From ba0395075da59d9b9e20163c6649845d0ccc684f Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 3 Jan 2023 18:53:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E5=85=B3=E8=81=94=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E5=88=97=E8=A1=A8=E6=94=AF=E6=8C=81=E8=AE=B0=E4=BD=8F?= =?UTF-8?q?=E8=B7=A8=E9=A1=B5=E9=80=89=E6=8B=A9=E7=9A=84=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --story=1010820 --user=郭雨琦 https://www.tapd.cn/55049933/prong/stories/view/1155049933001010820=worktable_title --- .../environment/snippet/ext/ApiTableList.vue | 19 +++++++++++--- .../frontend/src/components/table/MsTable.vue | 25 ++++++++++++++++--- .../comonents/api/RelevanceScenarioList.vue | 13 +++++++--- .../functional/FunctionalRelevance.vue | 14 ++++++++--- .../comonents/load/TestCaseLoadRelevance.vue | 14 +++++++---- .../comonents/ui/RelevanceUiScenarioList.vue | 11 ++++++-- 6 files changed, 77 insertions(+), 19 deletions(-) diff --git a/framework/sdk-parent/frontend/src/components/environment/snippet/ext/ApiTableList.vue b/framework/sdk-parent/frontend/src/components/environment/snippet/ext/ApiTableList.vue index 986c26218c..79bf57d604 100644 --- a/framework/sdk-parent/frontend/src/components/environment/snippet/ext/ApiTableList.vue +++ b/framework/sdk-parent/frontend/src/components/environment/snippet/ext/ApiTableList.vue @@ -9,6 +9,9 @@ - @@ -165,6 +168,7 @@ export default { currentPage: 1, pageSize: 10, versionEnable: false, + pageRefresh: false, }; }, props: { @@ -190,12 +194,17 @@ export default { }, watch: { currentProtocol() { + this.pageRefresh = false; this.getProtocolFilter(); }, projectId() { + this.pageRefresh = false; this.checkVersionEnable(); this.getUserFilter(); - } + }, + selectNodeIds() { + this.pageRefresh = false; + }, }, mounted() { if (this.$refs.apitable) { @@ -235,7 +244,11 @@ export default { this.currentPage = 1; this.initTable(); }, - initTable() { + pageChange() { + this.initTable("page"); + }, + initTable(data) { + this.pageRefresh = data === "page"; this.$emit('refreshTable'); }, clear() { diff --git a/framework/sdk-parent/frontend/src/components/table/MsTable.vue b/framework/sdk-parent/frontend/src/components/table/MsTable.vue index 72fb82efa3..ecce2f303e 100644 --- a/framework/sdk-parent/frontend/src/components/table/MsTable.vue +++ b/framework/sdk-parent/frontend/src/components/table/MsTable.vue @@ -27,7 +27,9 @@ @row-click="handleRowClick" ref="table" > - + + + { this.setDefaultOrders(); - this.clear(); + if (!this.pageRefresh) { + this.clear(); + } this.doLayout(); this.checkTableRowIsSelect(); this.listenRowDrop(); diff --git a/test-track/frontend/src/business/plan/view/comonents/api/RelevanceScenarioList.vue b/test-track/frontend/src/business/plan/view/comonents/api/RelevanceScenarioList.vue index 5b671ab2bf..3f1910d230 100644 --- a/test-track/frontend/src/business/plan/view/comonents/api/RelevanceScenarioList.vue +++ b/test-track/frontend/src/business/plan/view/comonents/api/RelevanceScenarioList.vue @@ -39,6 +39,8 @@ :total="total" :remember-order="true" row-key="id" + :reserve-option="true" + :page-refresh="pageRefresh" :row-order-group-id="projectId" @order="search" @filter="filterSearch" @@ -145,7 +147,7 @@ /> diff --git a/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalRelevance.vue b/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalRelevance.vue index d661d83f6a..ca04eab059 100644 --- a/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalRelevance.vue +++ b/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalRelevance.vue @@ -32,6 +32,9 @@ :total="page.total" :page-size.sync="page.pageSize" :screen-height="screenHeight" + row-key="id" + :reserve-option="true" + :page-refresh="pageRefresh" @handlePageChange="getTestCases" @selectCountChange="setSelectCounts" @order="getTestCases" @@ -94,7 +97,7 @@ - @@ -172,6 +175,7 @@ export default { ], versionFilters: null, testCaseTemplate: {}, + pageRefresh: false }; }, props: { @@ -253,7 +257,8 @@ export default { this.getTestCases(); this.getProjectNode(this.projectId, this.page.condition); }, - getTestCases() { + getTestCases(data) { + this.pageRefresh = data === "page"; let condition = this.page.condition; if (this.selectNodeIds && this.selectNodeIds.length > 0) { condition.nodeIds = this.selectNodeIds; @@ -265,6 +270,9 @@ export default { this.getTableData(); } }, + pageChange() { + this.getTestCases("page") + }, saveCaseRelevance(item) { this.isSaving = true; let param = {}; @@ -311,7 +319,7 @@ export default { this.testCaseTemplate = data; this.page.condition.components = initTestCaseConditionComponents(this.page.condition, this.testCaseTemplate.customFields); }); - }, + } } }; diff --git a/test-track/frontend/src/business/plan/view/comonents/load/TestCaseLoadRelevance.vue b/test-track/frontend/src/business/plan/view/comonents/load/TestCaseLoadRelevance.vue index cd4de5ecd4..d986bbacb8 100644 --- a/test-track/frontend/src/business/plan/view/comonents/load/TestCaseLoadRelevance.vue +++ b/test-track/frontend/src/business/plan/view/comonents/load/TestCaseLoadRelevance.vue @@ -23,6 +23,8 @@ :total="total" :remember-order="true" row-key="id" + :reserve-option="true" + :page-refresh="pageRefresh" :row-order-group-id="projectId" @order="getTestCases" @filter="search" @@ -81,7 +83,7 @@ - @@ -147,6 +149,7 @@ export default { {text: 'Error', value: 'Error'} ], versionFilters: null, + pageRefresh: false }; }, props: { @@ -218,7 +221,11 @@ export default { this.testCases = []; this.getTestCases(true); }, - getTestCases() { + pageChange() { + this.getTestCases("page"); + }, + getTestCases(data) { + this.pageRefresh = data === "page"; if (this.planId) { this.condition.testPlanId = this.planId; this.condition.projectId = this.projectId; @@ -231,9 +238,6 @@ export default { this.testCases = data.listObject; this.selectIds.clear(); - if (this.$refs.table) { - this.$refs.table.clearSelection(); - } }); } }, diff --git a/test-track/frontend/src/business/plan/view/comonents/ui/RelevanceUiScenarioList.vue b/test-track/frontend/src/business/plan/view/comonents/ui/RelevanceUiScenarioList.vue index 38d9c31e72..3ab3769385 100644 --- a/test-track/frontend/src/business/plan/view/comonents/ui/RelevanceUiScenarioList.vue +++ b/test-track/frontend/src/business/plan/view/comonents/ui/RelevanceUiScenarioList.vue @@ -16,6 +16,8 @@ :total="total" :remember-order="true" row-key="id" + :reserve-option="true" + :page-refresh="pageRefresh" :row-order-group-id="projectId" @order="search" @filter="filterSearch" @@ -76,7 +78,7 @@ - @@ -147,6 +149,7 @@ export default { envGroupId: "", versionFilters: [], fieldsWidth: getCustomTableWidth('TEST_PLAN_UI_SCENARIO_CASE'), + pageRefresh: false }; }, computed: { @@ -176,7 +179,11 @@ export default { this.currentPage = 1; this.search(); }, - search() { + pageChange() { + this.search("page"); + }, + search(data) { + this.pageRefresh = data === "page"; this.projectEnvMap.clear(); if (!this.projectId) { return;