[update 标准解读流程] 表格回显
This commit is contained in:
@@ -123,10 +123,18 @@ export default {
|
||||
val = e
|
||||
}
|
||||
console.log(val)
|
||||
if (this.$listeners.nameChange) {
|
||||
this.$emit('nameChange', this.getDictLabelByValue(val))
|
||||
}
|
||||
this.$emit('change', val)
|
||||
// 解决数据规则,选择自定义SQL 规则值无法输入空格
|
||||
this.$emit('input', val)
|
||||
},
|
||||
// 通过val获取字典项
|
||||
getDictLabelByValue (val) {
|
||||
const dictItem = this.dictOptions.find(item => item.value === val)
|
||||
return dictItem.text || dictItem.label
|
||||
},
|
||||
setCurrentDictOptions (dictOptions) {
|
||||
this.dictOptions = dictOptions
|
||||
},
|
||||
|
||||
@@ -139,15 +139,27 @@ export default {
|
||||
selectedValue = this.dictOptions.map(item => item.value)
|
||||
}
|
||||
}
|
||||
|
||||
this.arrayValue = selectedValue
|
||||
// 开启全选时,不把全选的value进行返回
|
||||
if (this.openSelectedAll) {
|
||||
this.$emit('change', selectedValue.filter(item => item !== selectedAllValue).join(this.spliter))
|
||||
const list = selectedValue.filter(item => item !== selectedAllValue)
|
||||
if (this.$listeners.nameChange) {
|
||||
const labelList = list.map(val => this.getDictLabelByValue(val))
|
||||
this.$emit('nameChange', labelList.join(this.spliter))
|
||||
}
|
||||
this.$emit('change', list.join(this.spliter))
|
||||
} else {
|
||||
if (this.$listeners.nameChange) {
|
||||
this.$emit('nameChange', selectedValue.map(val => this.getDictLabelByValue(val)).join(this.spliter))
|
||||
}
|
||||
this.$emit('change', selectedValue.join(this.spliter))
|
||||
}
|
||||
},
|
||||
// 通过val获取字典项
|
||||
getDictLabelByValue (val) {
|
||||
const dictItem = this.dictOptions.find(item => item.value === val)
|
||||
return dictItem.text || dictItem.label
|
||||
},
|
||||
// 选中的回调
|
||||
onSelect (value) {
|
||||
// 没有开启全选就直接退出
|
||||
|
||||
Reference in New Issue
Block a user