bug修复: 修复table-selector组件问题
parent
8f55e5b9bb
commit
525e73e009
|
@ -40,7 +40,7 @@
|
||||||
<el-table-column fixed type="index" label="#" width="50"/>
|
<el-table-column fixed type="index" label="#" width="50"/>
|
||||||
<span v-for="(item,index) in _elProps.tableConfig.columns" :key="index" >
|
<span v-for="(item,index) in _elProps.tableConfig.columns" :key="index" >
|
||||||
<el-table-column :prop="item.prop" :label="item.label" :width="item.width"
|
<el-table-column :prop="item.prop" :label="item.label" :width="item.width"
|
||||||
v-if="item.show !== false">
|
v-if="item.show !== false">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="item.type === 'image'">
|
<span v-if="item.type === 'image'">
|
||||||
<el-image :src="baseURL + scope.row[item.prop]" style="height: 30px;width: 30px;">
|
<el-image :src="baseURL + scope.row[item.prop]" style="height: 30px;width: 30px;">
|
||||||
|
@ -203,25 +203,25 @@ export default {
|
||||||
deep: true,
|
deep: true,
|
||||||
immediate: true
|
immediate: true
|
||||||
},
|
},
|
||||||
currentValue (newValue, oldVal) {
|
// currentValue (newValue, oldVal) {
|
||||||
const { tableConfig } = this._elProps
|
// const { tableConfig } = this._elProps
|
||||||
const { value } = this.dict
|
// const { value } = this.dict
|
||||||
if (newValue) {
|
// if (newValue) {
|
||||||
if (!tableConfig.multiple) {
|
// if (!tableConfig.multiple) {
|
||||||
if (newValue[0]) {
|
// if (newValue[0]) {
|
||||||
this.$emit('input', newValue[0][value])
|
// this.$emit('input', newValue[0][value])
|
||||||
this.$emit('change', newValue[0][value])
|
// this.$emit('change', newValue[0][value])
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
console.log(newValue)
|
// console.log(newValue)
|
||||||
const result = newValue.map((item) => {
|
// const result = newValue.map((item) => {
|
||||||
return item[value]
|
// return item[value]
|
||||||
})
|
// })
|
||||||
this.$emit('input', result)
|
// this.$emit('input', result)
|
||||||
this.$emit('change', result)
|
// this.$emit('change', result)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
// 给currentValue设置初始值
|
// 给currentValue设置初始值
|
||||||
|
@ -256,11 +256,11 @@ export default {
|
||||||
if (data.data && data.data.length > 0) {
|
if (data.data && data.data.length > 0) {
|
||||||
this.currentValue = data.data
|
this.currentValue = data.data
|
||||||
} else {
|
} else {
|
||||||
this.currentValue = null
|
this.currentValue = []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.currentValue = null
|
this.currentValue = []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取数据
|
// 获取数据
|
||||||
|
|
Loading…
Reference in New Issue