From 02d8b51ebb8e6194608c6b9bb64ec30121b55313 Mon Sep 17 00:00:00 2001 From: likexuan Date: Mon, 5 Sep 2022 10:07:34 +0800 Subject: [PATCH] =?UTF-8?q?fix=20:=20issue=20recordRule=20=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=90=9C=E7=B4=A2=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/mixin/dataList.js | 68 ++++++++++++------- .../src/components/common/searchInput.vue | 7 +- 2 files changed, 51 insertions(+), 24 deletions(-) diff --git a/nezha-fronted/src/components/common/mixin/dataList.js b/nezha-fronted/src/components/common/mixin/dataList.js index 0e29e5500..ed43a7372 100644 --- a/nezha-fronted/src/components/common/mixin/dataList.js +++ b/nezha-fronted/src/components/common/mixin/dataList.js @@ -1045,9 +1045,11 @@ export default { name: 'State', readonly: true, type: 'select', - val: '' + val: '', + valnum: '', + listStr: 'issue' }, - jsonKey: 'val' + jsonKey: 'valnum' }, name: { target: this.searchLabel, @@ -1075,9 +1077,11 @@ export default { name: 'Type', readonly: true, type: 'select', - val: '' + val: '', + valnum: '', + listStr: 'issue' }, - jsonKey: 'val' + jsonKey: 'valnum' }, expr: { target: this.searchLabel, @@ -1103,9 +1107,11 @@ export default { label: 'starrd', name: 'Starrd', type: 'select', - val: '' + val: '', + valnum: '', + listStr: 'issue' }, - jsonKey: 'val' + jsonKey: 'valnum' }, buildIn: { target: this.searchLabel, @@ -1117,9 +1123,11 @@ export default { label: 'buildIn', name: 'buildIn', type: 'select', - val: '' + val: '', + valnum: '', + listStr: 'issue' }, - jsonKey: 'val' + jsonKey: 'valnum' } } } else if (path === 'issue') { @@ -1177,16 +1185,18 @@ export default { target: this.searchLabel, isSearchInput: true, propertyName: 'state', - type: 'Number', + type: 'number', defaultJson: { disabled: false, label: 'issueState', name: 'State', readonly: true, type: 'select', - val: '' + val: '', + valnum: '', + listStr: 'issue' }, - jsonKey: 'val' + jsonKey: 'valnum' }, priority: { target: this.searchLabel, @@ -1198,9 +1208,11 @@ export default { label: 'priority', name: 'Priority', type: 'select', - val: '' + val: '', + valnum: '', + listStr: 'issue' }, - jsonKey: 'val' + jsonKey: 'valnum' }, assetsId: { target: this.searchLabel, @@ -1240,9 +1252,11 @@ export default { label: 'cid', name: 'Create user', type: 'issue', - val: '' + val: '', + valnum: '', + listStr: 'issue' }, - jsonKey: 'val' + jsonKey: 'valnum' }, uid: { target: this.searchLabel, @@ -1254,9 +1268,11 @@ export default { label: 'uid', name: 'Update user', type: 'issue', - val: '' + val: '', + valnum: '', + listStr: 'issue' }, - jsonKey: 'val' + jsonKey: 'valnum' }, rid: { target: this.searchLabel, @@ -1268,9 +1284,11 @@ export default { label: 'rid', name: 'Reporter', type: 'issue', - val: '' + val: '', + valnum: '', + listStr: 'issue' }, - jsonKey: 'val' + jsonKey: 'valnum' }, aid: { target: this.searchLabel, @@ -1282,9 +1300,11 @@ export default { label: 'aid', name: 'Assignee', type: 'issue', - val: '' + val: '', + valnum: '', + listStr: 'issue' }, - jsonKey: 'val' + jsonKey: 'valnum' }, starrd: { target: this.searchLabel, @@ -1296,9 +1316,11 @@ export default { label: 'starrd', name: 'Starrd', type: 'select', - val: '' + val: '', + valnum: '', + listStr: 'issue' }, - jsonKey: 'val' + jsonKey: 'valnum' } } } diff --git a/nezha-fronted/src/components/common/searchInput.vue b/nezha-fronted/src/components/common/searchInput.vue index 4e4a58e50..57e56ad47 100644 --- a/nezha-fronted/src/components/common/searchInput.vue +++ b/nezha-fronted/src/components/common/searchInput.vue @@ -1612,7 +1612,12 @@ export default { setTimeout(() => { this.select_list.forEach(item => { if (item.listStr) { - item.val = this[item.listStr].find(r => r.id == item.valnum).name + if (item.listStr == 'issue') { + item.valnum = item.val + item.val = JSON.parse(localStorage.getItem('nz-history-' + this.where))[0][0].val + } else { + item.val = this[item.listStr].find(r => r.id == item.valnum).name + } } }) }, 300)