fix: 测试跟踪-测试用例-选择所有数据批量编辑-面板只显示当前页面数据

修复测试跟踪-测试用例-选择所有数据批量编辑-面板只显示当前页面数据的问题
This commit is contained in:
song.tianyang 2021-01-28 11:13:52 +08:00
parent 267dd14a93
commit 5eec3db477
3 changed files with 11 additions and 19 deletions

View File

@ -15,23 +15,6 @@
props: ['total', 'pageSize'], props: ['total', 'pageSize'],
data() { data() {
return { return {
gridData: [{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}]
}; };
} }
} }

View File

@ -81,7 +81,8 @@
if (size) { if (size) {
this.size = size; this.size = size;
} else { } else {
this.size = this.$parent.selectRows.size; // this.size = this.$parent.selectRows.size;
this.size = this.$parent.selectDataCounts;
} }
listenGoBack(this.handleClose); listenGoBack(this.handleClose);
}, },

View File

@ -46,7 +46,7 @@
<el-table-column width="40" :resizable="false" align="center"> <el-table-column width="40" :resizable="false" align="center">
<template v-slot:default="scope"> <template v-slot:default="scope">
<show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectRows.size"/> <show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectDataCounts"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -292,6 +292,7 @@ export default {
}, },
currentCaseId: null, currentCaseId: null,
projectId: "", projectId: "",
selectDataCounts: 0,
} }
}, },
props: { props: {
@ -328,6 +329,7 @@ export default {
this.condition.nodeIds = []; this.condition.nodeIds = [];
this.condition.selectAll = false; this.condition.selectAll = false;
this.condition.unSelectIds = []; this.condition.unSelectIds = [];
this.selectDataCounts = 0;
if (this.planId) { if (this.planId) {
// param.planId = this.planId; // param.planId = this.planId;
this.condition.planId = this.planId; this.condition.planId = this.planId;
@ -435,6 +437,7 @@ export default {
_handleSelect(this, selection, row, this.selectRows); _handleSelect(this, selection, row, this.selectRows);
this.setUnSelectIds(); this.setUnSelectIds();
}, },
importTestCase() { importTestCase() {
if (!getCurrentProjectID()) { if (!getCurrentProjectID()) {
this.$warning(this.$t('commons.check_project_tip')); this.$warning(this.$t('commons.check_project_tip'));
@ -553,6 +556,11 @@ export default {
this.condition.unSelectIds = allIDs.filter(function (val) { this.condition.unSelectIds = allIDs.filter(function (val) {
return ids.indexOf(val) === -1 return ids.indexOf(val) === -1
}); });
if (this.condition.selectAll) {
this.selectDataCounts = this.total - this.condition.unSelectIds.length;
} else {
this.selectDataCounts = this.selectRows.size;
}
}, },
moveSave(param) { moveSave(param) {
param.condition = this.condition; param.condition = this.condition;