修改一直问题

This commit is contained in:
qq787203167
2022-03-24 18:36:45 +08:00
parent 920190e305
commit 7b691a7378
4 changed files with 57 additions and 5 deletions
@@ -27,6 +27,7 @@
placeholder: String,
triggerChange: Boolean,
disabled: Boolean,
db_field_name:String,
value: [String, Number],
type: String,
getPopupContainer:{
@@ -94,11 +95,17 @@
}else{
val = e
}
console.log(val)
let content = ''
this.dictOptions.forEach(res=>{
if (res.value == e){
content = res.text || res.label
}
})
if(this.triggerChange){
this.$emit('change', val);
}else{
this.$emit('input', val);
this.$emit('changeQuery', content,this.db_field_name);
}
},
setCurrentDictOptions(dictOptions){
@@ -36,6 +36,7 @@
placeholder: String,
disabled: Boolean,
value: String,
db_field_name:String,
type: String,
options:Array,
spliter:{
@@ -104,7 +105,16 @@
},
onChange (selectedValue) {
let content = []
this.dictOptions.forEach(res=>{
selectedValue.forEach(val=>{
if (res.value == val){
content.push(res.text || res.label)
}
})
})
this.$emit('change', selectedValue.join(this.spliter));
this.$emit('changeQuery', content.join(this.spliter),this.db_field_name);
},
setCurrentDictOptions(dictOptions){
this.dictOptions = dictOptions