|
@@ -484,44 +484,28 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
handleSelectionChange(val, index) {
|
|
|
- // console.log(val, index);
|
|
|
let obj = this.newObj;
|
|
|
let numberIndex;
|
|
|
- // console.log(obj);
|
|
|
if (val.length === 0) {
|
|
|
- // console.log(index);
|
|
|
- // console.log(this.selected);
|
|
|
- // console.log(this.list[index].split);
|
|
|
-
|
|
|
let newArray = _.differenceWith(this.selected, this.list[index].split, _.isEqual);
|
|
|
this.$set(this, `selected`, newArray);
|
|
|
- // console.log('全部取消');
|
|
|
} else {
|
|
|
if (this.num === false) {
|
|
|
numberIndex = _.findIndex(this.selected, function(o) {
|
|
|
return o._id == obj._id;
|
|
|
});
|
|
|
- // console.log(numberIndex);
|
|
|
var newSelected = _.cloneDeep(this.selected);
|
|
|
newSelected.splice(numberIndex, 1);
|
|
|
this.$set(this, `selected`, newSelected);
|
|
|
- // console.log('取消');
|
|
|
} else if (this.num === true || this.num === 0) {
|
|
|
- // console.log(this.num);
|
|
|
let newArr = _.difference(val, this.selected);
|
|
|
let newData = newArr.concat(this.selected);
|
|
|
this.$set(this, `selected`, newData);
|
|
|
- // console.log('选中');
|
|
|
- // console.log(this.selected);
|
|
|
}
|
|
|
}
|
|
|
- // console.log(this.selected);
|
|
|
},
|
|
|
onTableSelect(selection, row) {
|
|
|
- // console.log(selection, row);
|
|
|
this.num = selection.length && selection.indexOf(row) !== -1;
|
|
|
- // console.log('哈哈哈');
|
|
|
- // console.log(this.num);
|
|
|
this.newObj = row;
|
|
|
},
|
|
|
},
|