|
@@ -76,16 +76,14 @@ export default {
|
|
|
checkedList: {
|
|
|
handler (nv, ov) {
|
|
|
// 特别注意,不能用箭头函数,箭头函数,this指向全局
|
|
|
- let arr = []
|
|
|
nv.forEach((item1) => {
|
|
|
this.dataList.forEach((item2) => {
|
|
|
if (item1.TacId == item2.TacId && item1.IsSelected == 1) {
|
|
|
item2.checked = true;
|
|
|
- arr.push(item1)
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
- this.listArray = JSON.parse(JSON.stringify(arr));
|
|
|
+ this.listArray = JSON.parse(JSON.stringify(nv));
|
|
|
},
|
|
|
deep: true, // 可以深度检测到 obj 对象的属性值的变化
|
|
|
},
|
|
@@ -139,7 +137,12 @@ export default {
|
|
|
const { returnData } = response;
|
|
|
const datas = returnData.records;
|
|
|
datas.forEach((element) => {
|
|
|
- element["checked"] = false;
|
|
|
+ // element["checked"] = false;
|
|
|
+ if (this.checkedList.findIndex(element1 => element.TacId === element1.TacId) !== -1) {
|
|
|
+ element['checked'] = true
|
|
|
+ } else {
|
|
|
+ element['checked'] = false
|
|
|
+ }
|
|
|
});
|
|
|
this.total = returnData.pages;
|
|
|
this.arrList.push(datas);
|
|
@@ -157,7 +160,6 @@ export default {
|
|
|
},
|
|
|
checkedChange (data) {
|
|
|
if (data.checked == true) {
|
|
|
- // this.listArray = [];
|
|
|
this.listArray.push(data);
|
|
|
this.$emit("getCheckedList", this.listArray);
|
|
|
} else {
|