feat:searchInput的回显

This commit is contained in:
zhangyu
2021-12-23 19:31:00 +08:00
parent 59d35b2ea5
commit c322dcf445
3 changed files with 17 additions and 11 deletions

View File

@@ -37,9 +37,10 @@ export default {
setTimeout(() => { setTimeout(() => {
const obj = lodash.cloneDeep(val.defaultJson) const obj = lodash.cloneDeep(val.defaultJson)
obj[val.jsonKey] = qv obj[val.jsonKey] = qv
console.log(obj[val.jsonKey]) if (obj[val.jsonKey]) {
this.$refs[dataList].$refs.searchInput.select_list.push(obj) this.$refs[dataList].$refs.searchInput.select_list.push(obj)
this.$refs[dataList].$refs.searchInput.sreach_num++ this.$refs[dataList].$refs.searchInput.sreach_num++
}
// this.$refs[dataList].$refs.searchInput.searchLabelList = this.$refs[dataList].$refs.searchInput.searchLabelList.filter(item => item.label !== 'projectIds') // this.$refs[dataList].$refs.searchInput.searchLabelList = this.$refs[dataList].$refs.searchInput.searchLabelList.filter(item => item.label !== 'projectIds')
}, 500) }, 500)
} }

View File

@@ -1480,8 +1480,15 @@ export default {
if (this.$route.path === '/exprTemp') { if (this.$route.path === '/exprTemp') {
this.getGnameList() this.getGnameList()
} }
console.log(this.select_list, this.searchLabelList) this.searchLabelList = this.searchLabelList.filter(item => !this.select_list.find(select => select.label === item.label))
}, 100) setTimeout(() => {
this.select_list.forEach(item => {
if (item.listStr) {
item.val = this[item.listStr].find(r => r.id == item.valnum).name
}
})
}, 300)
}, 1000)
JSON.parse(JSON.stringify(this.searchMsg.searchLabelList)).forEach(val => { JSON.parse(JSON.stringify(this.searchMsg.searchLabelList)).forEach(val => {
if (val.prop == 'common_action') { if (val.prop == 'common_action') {
this.actionSelect = val.doc.data this.actionSelect = val.doc.data

View File

@@ -345,7 +345,7 @@ export default {
ids: { ids: {
target: this.searchLabel, target: this.searchLabel,
propertyName: 'ids', propertyName: 'ids',
isSearchInput: true,
type: 'string', type: 'string',
defaultJson: { defaultJson: {
disabled: false, disabled: false,
@@ -371,11 +371,10 @@ export default {
type: 'severity', type: 'severity',
val: '', val: '',
valnum: '', valnum: '',
valString: '' valString: '',
listStr: 'severitySelect'
}, },
jsonKey: 'valnum', jsonKey: 'valnum',
strKey: 'val',
listStr: 'severitySelect'
}, },
type: { type: {
target: this.searchLabel, target: this.searchLabel,
@@ -394,11 +393,10 @@ export default {
valString: '' valString: ''
}, },
jsonKey: 'valnum', jsonKey: 'valnum',
strKey: 'val',
listStr: 'alertTypesSelect'
}, },
name: { name: {
target: this.searchLabel, target: this.searchLabel,
isSearchInput: true,
propertyName: 'name', propertyName: 'name',
type: 'string', type: 'string',
defaultJson: { defaultJson: {