bug修复: 修复table-selector组件问题
parent
d0cad5c939
commit
88a04980a8
|
@ -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) {
|
||||
// // 父组件收到input事件后会通过v-model改变value参数的值
|
||||
// // 然后此处会watch到value的改变,发出change事件
|
||||
// // change事件放在此处发射的好处是,当外部修改value值时,也能够触发form-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])
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue