fix(接口测试): 修复由保存前一页而引起的全选相关问题
--bug=1021777 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001021777 --bug=1021772 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001021772
This commit is contained in:
parent
27f34b3e18
commit
49e8c8a276
|
@ -341,6 +341,9 @@ export default {
|
|||
});
|
||||
}
|
||||
},
|
||||
pageSize() {
|
||||
this.clear();
|
||||
},
|
||||
selectDataCounts(value) {
|
||||
this.$emit("selectCountChange", value);
|
||||
},
|
||||
|
@ -417,7 +420,7 @@ export default {
|
|||
this.selectRows,
|
||||
this.condition
|
||||
);
|
||||
setUnSelectIds(this.data, this.condition, this.selectRows);
|
||||
setUnSelectIds(selection, this.condition, this.selectRows);
|
||||
this.selectDataCounts = getSelectDataCounts(
|
||||
this.condition,
|
||||
this.total,
|
||||
|
@ -447,8 +450,6 @@ export default {
|
|||
},
|
||||
isSelectDataAll(data) {
|
||||
this.condition.selectAll = data;
|
||||
//设置勾选
|
||||
toggleAllSelection(this.$refs.table, this.data, this.selectRows);
|
||||
//显示隐藏菜单
|
||||
_handleSelectAll(this, this.data, this.data, this.selectRows);
|
||||
//设置未选择ID(更新)
|
||||
|
|
|
@ -10,18 +10,20 @@ import {CUSTOM_FIELD_TYPE_OPTION, SYSTEM_FIELD_NAME_MAP} from "./table-constants
|
|||
import {generateColumnKey} from "../components/search/custom-component";
|
||||
|
||||
export function _handleSelectAll(component, selection, tableData, selectRows, condition) {
|
||||
selectRows.clear();
|
||||
if (selection.length > 0) {
|
||||
selection.forEach((item) => {
|
||||
selectRows.add(item);
|
||||
});
|
||||
if (selection.length === 1) {
|
||||
selection.hashTree = [];
|
||||
tableData.forEach((item) => {
|
||||
component.$set(item, "showMore", true);
|
||||
selectRows.add(item);
|
||||
});
|
||||
} else {
|
||||
tableData.forEach((item) => {
|
||||
item.hashTree = [];
|
||||
component.$set(item, "showMore", true);
|
||||
selectRows.add(item);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
@ -83,8 +85,8 @@ export function getSelectDataCounts(condition, total, selectRows) {
|
|||
// 全选操作
|
||||
export function toggleAllSelection(table, tableData, selectRows) {
|
||||
//如果已经全选,不需要再操作了
|
||||
if (selectRows.size != tableData.length) {
|
||||
table.toggleAllSelection(true);
|
||||
if (selectRows.size !== tableData.length) {
|
||||
table.toggleAllSelection();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue