|
@@ -61,6 +61,11 @@ export default {
|
|
this.fetching = false
|
|
this.fetching = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ getRow (cur) {
|
|
|
|
+ const _this = this
|
|
|
|
+ const ind = _this.data.findIndex(item => item.productSn == cur.key)
|
|
|
|
+ cur.row = ind != -1 ? _this.data[ind] : undefined
|
|
|
|
+ },
|
|
handleChange (value) {
|
|
handleChange (value) {
|
|
const _this = this
|
|
const _this = this
|
|
if (this.mode == 'default') { // 单选
|
|
if (this.mode == 'default') { // 单选
|
|
@@ -69,13 +74,18 @@ export default {
|
|
value.row = ind != -1 ? _this.data[ind] : undefined
|
|
value.row = ind != -1 ? _this.data[ind] : undefined
|
|
}
|
|
}
|
|
} else if (this.mode == 'multiple') { // 多选
|
|
} else if (this.mode == 'multiple') { // 多选
|
|
- if (value.length > 0) {
|
|
|
|
- const ind = _this.data.findIndex(item => item.productSn == value[value.length - 1].key)
|
|
|
|
- value[value.length - 1].row = ind != -1 ? _this.data[ind] : undefined
|
|
|
|
- }
|
|
|
|
- if (this.lastData && this.lastData.length > 0) {
|
|
|
|
- this.lastData = this.lastData.concat(value[value.length - 1])
|
|
|
|
- value = this.lastData
|
|
|
|
|
|
+ console.log('===========')
|
|
|
|
+ console.log(this.lastData)
|
|
|
|
+ console.log(value)
|
|
|
|
+ console.log('===========')
|
|
|
|
+ // 新增
|
|
|
|
+ if (_this.lastData.length < value.length) {
|
|
|
|
+ _this.getRow(value[value.length - 1])
|
|
|
|
+ value = this.lastData.concat(value[value.length - 1])
|
|
|
|
+ } else {
|
|
|
|
+ // 删除
|
|
|
|
+ const delItem = this.lastData.filter(item => !value.find(a => a.key == item.key))
|
|
|
|
+ console.log(delItem)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Object.assign(this, {
|
|
Object.assign(this, {
|