From 1a858c619d269b080284e7b47e218df931818dd4 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Tue, 30 Mar 2021 19:20:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E5=9B=BA=E5=AE=9A=E5=88=97=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=E9=94=99=E4=B9=B1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../automation/scenario/ApiScenarioList.vue | 8 +- .../components/list/ApiCaseSimpleList.vue | 22 +- .../definition/components/list/ApiList.vue | 1162 +++++++++-------- .../track/case/components/TestCaseList.vue | 256 ++-- .../functional/FunctionalTestCaseList.vue | 4 +- 5 files changed, 734 insertions(+), 718 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue index efbc66655d..f30bf7315c 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue @@ -446,7 +446,9 @@ export default { } this.$nextTick(function () { - this.$refs.scenarioTable.doLayout(); + if (this.$refs.scenarioTable) { + this.$refs.scenarioTable.doLayout(); + } this.checkTableRowIsSelect(); }) }); @@ -726,8 +728,8 @@ export default { // let ids = [row.id]; let param = {}; this.buildBatchParam(param); - if(param.ids && param.ids.length <=0){ - param.ids =[row.id]; + if (param.ids && param.ids.length <= 0) { + param.ids = [row.id]; } this.$post('/api/automation/removeToGcByBatch/', param, () => { // this.$post('/api/automation/removeToGc/', ids, () => { diff --git a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue index f71771bd1a..7b4c2e1894 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue @@ -313,7 +313,7 @@ export default { this.condition.status = "Trash"; this.condition.moduleIds = []; } - if(!this.selectAll){ + if (!this.selectAll) { this.selectAll = false; this.unSelection = []; this.selectDataCounts = 0; @@ -342,7 +342,7 @@ export default { this.total = response.data.itemCount; this.tableData = response.data.listObject; - if(!this.selectAll){ + if (!this.selectAll) { this.unSelection = response.data.listObject.map(s => s.id); } @@ -352,8 +352,10 @@ export default { } }) - this.$nextTick(function(){ - this.$refs.caseTable.doLayout(); + this.$nextTick(function () { + if (this.$refs.caseTable) { + this.$refs.caseTable.doLayout(); + } this.checkTableRowIsSelect(); }) }); @@ -361,20 +363,20 @@ export default { getLabel(this, API_CASE_LIST); }, - checkTableRowIsSelect(){ + checkTableRowIsSelect() { //如果默认全选的话,则选中应该选中的行 - if(this.selectAll){ + if (this.selectAll) { let unSelectIds = this.unSelection; - this.tableData.forEach(row=>{ - if(unSelectIds.indexOf(row.id)<0){ - this.$refs.caseTable.toggleRowSelection(row,true); + this.tableData.forEach(row => { + if (unSelectIds.indexOf(row.id) < 0) { + this.$refs.caseTable.toggleRowSelection(row, true); //默认全选,需要把选中对行添加到selectRows中。不然会影响到勾选函数统计 if (!this.selectRows.has(row)) { this.$set(row, "showMore", true); this.selectRows.add(row); } - }else{ + } else { //不勾选的行,也要判断是否被加入了selectRow中。加入了的话就去除。 if (this.selectRows.has(row)) { this.$set(row, "showMore", false); diff --git a/frontend/src/business/components/api/definition/components/list/ApiList.vue b/frontend/src/business/components/api/definition/components/list/ApiList.vue index 3a03be7ba8..71c3e4b7b2 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiList.vue @@ -116,7 +116,8 @@ min-width="120px" :key="index"> @@ -211,101 +212,315 @@ diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index 141bd7a9b7..eca9805b0d 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -2,128 +2,128 @@
- - + + + + + + + + + +