bug修复: 修复table-selector组件问题

pull/107/head
猿小天 2023-08-21 20:38:09 +08:00
parent d0cad5c939
commit 88a04980a8
1 changed files with 22 additions and 4 deletions

View File

@ -95,10 +95,10 @@ import util from '@/libs/util'
export default {
name: 'selector-table-input',
model: {
prop: 'value',
event: ['change', 'input']
},
// model: {
// prop: 'value',
// event: ['change', 'input']
// },
mixins: [d2CrudPlus.input, d2CrudPlus.inputDict],
props: {
//
@ -170,6 +170,17 @@ export default {
}
},
watch: {
// value (value) {
// // inputv-modelvalue
// // watchvaluechange
// // changevalueform-data-change
// this.$emit('change', value)
// // if (this.currentValue === value) {
// // return
// // }
// // currentValue
// // this.setCurrentValue(value)
// },
multipleSelection: {
handler (newValue, oldVal) {
const { tableConfig } = this._elProps
@ -215,6 +226,7 @@ export default {
this.pageConfig.limit = limit
this.pageConfig.total = total
if (data.data && data.data.length > 0) {
console.log(data.data)
this.currentValue = data.data
} else {
this.currentValue = []
@ -306,6 +318,9 @@ export default {
const result = val.map((item) => {
return item[this.dict.value]
})
if (this.dispatch) {
this.dispatch('ElFormItem', 'el.form.blur')
}
this.$emit('input', result)
this.$emit('change', result)
},
@ -318,6 +333,9 @@ export default {
if (!tableConfig.multiple) {
this.multipleSelection = val
this.$emit('radioChange', val)
if (this.dispatch) {
this.dispatch('ElFormItem', 'el.form.blur')
}
this.$emit('input', val[this.dict.value])
this.$emit('change', val[this.dict.value])
}