|
@@ -166,7 +166,7 @@ export default {
|
|
this.$refs.searchForm.resetFields();
|
|
this.$refs.searchForm.resetFields();
|
|
this.search();
|
|
this.search();
|
|
},
|
|
},
|
|
- onFormatSelectData(arr) {
|
|
|
|
|
|
+ onFormatSelectData(arr, row) {
|
|
try {
|
|
try {
|
|
let currentPageList = [];
|
|
let currentPageList = [];
|
|
const otherPageList = [];
|
|
const otherPageList = [];
|
|
@@ -179,18 +179,28 @@ export default {
|
|
});
|
|
});
|
|
|
|
|
|
const lastPage = [];
|
|
const lastPage = [];
|
|
- if (arr.length > 0) {
|
|
|
|
- arr.forEach(item => {
|
|
|
|
- const index = currentPageList.findIndex(
|
|
|
|
- child => child.id === item.id
|
|
|
|
- );
|
|
|
|
- if (index === -1) {
|
|
|
|
- lastPage.push(item);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ if (row?.id) {
|
|
|
|
+ const index = currentPageList.findIndex(child => child.id === row.id);
|
|
|
|
+ if (index === -1) {
|
|
|
|
+ lastPage.push(row);
|
|
|
|
+ } else {
|
|
|
|
+ currentPageList.splice(index, 1);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- currentPageList = [];
|
|
|
|
|
|
+ if (arr.length > 0) {
|
|
|
|
+ arr.forEach(item => {
|
|
|
|
+ const index = currentPageList.findIndex(
|
|
|
|
+ child => child.id === item.id
|
|
|
|
+ );
|
|
|
|
+ if (index === -1) {
|
|
|
|
+ lastPage.push(item);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ currentPageList = [];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
this.activeChiose = [
|
|
this.activeChiose = [
|
|
...lastPage,
|
|
...lastPage,
|
|
...otherPageList,
|
|
...otherPageList,
|
|
@@ -198,12 +208,12 @@ export default {
|
|
].sort((a, b) => a.id - b.id);
|
|
].sort((a, b) => a.id - b.id);
|
|
} catch (e) {}
|
|
} catch (e) {}
|
|
},
|
|
},
|
|
- onTableSelect(arr) {
|
|
|
|
- // console.log(arr, "onTableSelect");
|
|
|
|
- this.onFormatSelectData(arr);
|
|
|
|
|
|
+ onTableSelect(arr, row) {
|
|
|
|
+ console.log(arr, "onTableSelect", row);
|
|
|
|
+ this.onFormatSelectData(arr, row);
|
|
},
|
|
},
|
|
handleSelectionChange(arr) {
|
|
handleSelectionChange(arr) {
|
|
- // console.log(arr, "val");
|
|
|
|
|
|
+ console.log(arr, "val");
|
|
this.onFormatSelectData(arr);
|
|
this.onFormatSelectData(arr);
|
|
},
|
|
},
|
|
async getList() {
|
|
async getList() {
|