fix(项目设置): 修复环境管理里的批量操作

--bug=1028301 --user=宋天阳 【项目设置】github#25967,环境配置下的通用配置 批量添加、 编辑、分页和搜索功能
问题 https://www.tapd.cn/55049933/s/1401799
This commit is contained in:
song-tianyang 2023-08-08 18:28:03 +08:00 committed by 建国
parent a00f87bcdd
commit 113d10d23d
1 changed files with 65 additions and 47 deletions

View File

@ -207,6 +207,7 @@ export default {
pageSize: 10,
total: 0,
loading: false,
refreshOver: true,
screenHeight: '460px',
batchButtons: [
{
@ -369,6 +370,19 @@ export default {
},
handleDeleteBatch() {
operationConfirm(this, this.$t('api_test.environment.variables_delete_info') + ' ', () => {
if (this.condition.selectAll) {
let deleteIndex = 0;
let deleteRows = this.items.filter((item) => {
return this.condition.unSelectIds.indexOf(item.id) < 0;
});
deleteRows.forEach(deleteRow => {
const index = this.items.findIndex((d) => d.id === deleteRow.id);
this.items.splice(index, 1);
})
this.allData = this.items;
this.currentPage = 1;
this.queryPage();
} else {
let ids = this.$refs.variableTable.selectRows;
ids.forEach((row) => {
if (row.id) {
@ -382,12 +396,14 @@ export default {
}
}
});
}
this.sortParameters();
this.$refs.variableTable.cancelCurrentRow();
this.$refs.variableTable.clear();
this.pageData.forEach((item) => {
item.showMore = false;
});
});
},
filter() {
@ -498,7 +514,9 @@ export default {
keyValue
);
}
this.allData = this.items;
});
this.queryPage();
}
this.currentPage = Math.ceil(this.items.length / this.pageSize);
},