fix : issue recordRule 页面搜索回显

This commit is contained in:
likexuan
2022-09-05 10:07:34 +08:00
parent d83416be64
commit 02d8b51ebb
2 changed files with 51 additions and 24 deletions

View File

@@ -1045,9 +1045,11 @@ export default {
name: 'State', name: 'State',
readonly: true, readonly: true,
type: 'select', type: 'select',
val: '' val: '',
valnum: '',
listStr: 'issue'
}, },
jsonKey: 'val' jsonKey: 'valnum'
}, },
name: { name: {
target: this.searchLabel, target: this.searchLabel,
@@ -1075,9 +1077,11 @@ export default {
name: 'Type', name: 'Type',
readonly: true, readonly: true,
type: 'select', type: 'select',
val: '' val: '',
valnum: '',
listStr: 'issue'
}, },
jsonKey: 'val' jsonKey: 'valnum'
}, },
expr: { expr: {
target: this.searchLabel, target: this.searchLabel,
@@ -1103,9 +1107,11 @@ export default {
label: 'starrd', label: 'starrd',
name: 'Starrd', name: 'Starrd',
type: 'select', type: 'select',
val: '' val: '',
valnum: '',
listStr: 'issue'
}, },
jsonKey: 'val' jsonKey: 'valnum'
}, },
buildIn: { buildIn: {
target: this.searchLabel, target: this.searchLabel,
@@ -1117,9 +1123,11 @@ export default {
label: 'buildIn', label: 'buildIn',
name: 'buildIn', name: 'buildIn',
type: 'select', type: 'select',
val: '' val: '',
valnum: '',
listStr: 'issue'
}, },
jsonKey: 'val' jsonKey: 'valnum'
} }
} }
} else if (path === 'issue') { } else if (path === 'issue') {
@@ -1177,16 +1185,18 @@ export default {
target: this.searchLabel, target: this.searchLabel,
isSearchInput: true, isSearchInput: true,
propertyName: 'state', propertyName: 'state',
type: 'Number', type: 'number',
defaultJson: { defaultJson: {
disabled: false, disabled: false,
label: 'issueState', label: 'issueState',
name: 'State', name: 'State',
readonly: true, readonly: true,
type: 'select', type: 'select',
val: '' val: '',
valnum: '',
listStr: 'issue'
}, },
jsonKey: 'val' jsonKey: 'valnum'
}, },
priority: { priority: {
target: this.searchLabel, target: this.searchLabel,
@@ -1198,9 +1208,11 @@ export default {
label: 'priority', label: 'priority',
name: 'Priority', name: 'Priority',
type: 'select', type: 'select',
val: '' val: '',
valnum: '',
listStr: 'issue'
}, },
jsonKey: 'val' jsonKey: 'valnum'
}, },
assetsId: { assetsId: {
target: this.searchLabel, target: this.searchLabel,
@@ -1240,9 +1252,11 @@ export default {
label: 'cid', label: 'cid',
name: 'Create user', name: 'Create user',
type: 'issue', type: 'issue',
val: '' val: '',
valnum: '',
listStr: 'issue'
}, },
jsonKey: 'val' jsonKey: 'valnum'
}, },
uid: { uid: {
target: this.searchLabel, target: this.searchLabel,
@@ -1254,9 +1268,11 @@ export default {
label: 'uid', label: 'uid',
name: 'Update user', name: 'Update user',
type: 'issue', type: 'issue',
val: '' val: '',
valnum: '',
listStr: 'issue'
}, },
jsonKey: 'val' jsonKey: 'valnum'
}, },
rid: { rid: {
target: this.searchLabel, target: this.searchLabel,
@@ -1268,9 +1284,11 @@ export default {
label: 'rid', label: 'rid',
name: 'Reporter', name: 'Reporter',
type: 'issue', type: 'issue',
val: '' val: '',
valnum: '',
listStr: 'issue'
}, },
jsonKey: 'val' jsonKey: 'valnum'
}, },
aid: { aid: {
target: this.searchLabel, target: this.searchLabel,
@@ -1282,9 +1300,11 @@ export default {
label: 'aid', label: 'aid',
name: 'Assignee', name: 'Assignee',
type: 'issue', type: 'issue',
val: '' val: '',
valnum: '',
listStr: 'issue'
}, },
jsonKey: 'val' jsonKey: 'valnum'
}, },
starrd: { starrd: {
target: this.searchLabel, target: this.searchLabel,
@@ -1296,9 +1316,11 @@ export default {
label: 'starrd', label: 'starrd',
name: 'Starrd', name: 'Starrd',
type: 'select', type: 'select',
val: '' val: '',
valnum: '',
listStr: 'issue'
}, },
jsonKey: 'val' jsonKey: 'valnum'
} }
} }
} }

View File

@@ -1612,8 +1612,13 @@ export default {
setTimeout(() => { setTimeout(() => {
this.select_list.forEach(item => { this.select_list.forEach(item => {
if (item.listStr) { if (item.listStr) {
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 item.val = this[item.listStr].find(r => r.id == item.valnum).name
} }
}
}) })
}, 300) }, 300)
}, 1000) }, 1000)