From e8c2bcc5baa4c77a4450e5eaf88f28e7dc8fc476 Mon Sep 17 00:00:00 2001 From: junhong Date: Fri, 21 Jan 2022 11:39:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E5=9C=BA=E6=99=AF=E5=8F=98=E9=87=8F=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --story=1005318 --user=周骏弘 场景变量交互优化 https://www.tapd.cn/55049933/s/1095248 --- .../scenario/variable/VariableList.vue | 684 ++++++++++-------- .../common/components/table/MsTable.vue | 12 +- .../src/common/js/default-table-header.js | 8 + frontend/src/i18n/en-US.js | 1 + frontend/src/i18n/zh-CN.js | 1 + frontend/src/i18n/zh-TW.js | 1 + 6 files changed, 422 insertions(+), 285 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/variable/VariableList.vue b/frontend/src/business/components/api/automation/scenario/variable/VariableList.vue index da7d4afd83..b05fe590f0 100644 --- a/frontend/src/business/components/api/automation/scenario/variable/VariableList.vue +++ b/frontend/src/business/components/api/automation/scenario/variable/VariableList.vue @@ -15,6 +15,7 @@ @keyup.enter="filter"> + @@ -23,24 +24,17 @@ -
- - {{ $t('commons.add') }} - - {{ $t('api_test.automation.constant') }} - {{ $t('test_track.case.list') }} - CSV - {{ $t('api_test.automation.counter') }} - {{ $t('api_test.automation.random') }} - - - {{ $t('commons.delete') }} - -
-
- +
+ + + + + + + + {{ $t('commons.add') }} + {{ $t("commons.batch_add") }}
@@ -48,23 +42,56 @@
- - - - - - - - - + + + + + + + + + + + + +
@@ -74,11 +101,14 @@ +
+ {{ $t('commons.confirm') }} + {{ $t('commons.cancel') }} + {{ $t('commons.delete') }} +
- - @@ -112,278 +142,364 @@ diff --git a/frontend/src/business/components/common/components/table/MsTable.vue b/frontend/src/business/components/common/components/table/MsTable.vue index 8ade46a0f7..33194ff136 100644 --- a/frontend/src/business/components/common/components/table/MsTable.vue +++ b/frontend/src/business/components/common/components/table/MsTable.vue @@ -15,6 +15,7 @@ :height="screenHeight" v-loading="tableIsLoading" :row-key="rowKey" + :row-class-name="tableRowClassName" :cell-class-name="addPaddingColClass" :highlight-current-row="highlightCurrentRow" ref="table" @row-click="handleRowClick"> @@ -400,6 +401,9 @@ export default { handlePageChange() { this.$emit('pageChange'); }, + cancelCurrentRow() { + this.$refs.table.setCurrentRow(-1); + }, clear() { this.clearSelectRows(); }, @@ -446,7 +450,13 @@ export default { || column.columnKey ==='batchBtnCol') { return 'padding-col'; } - } + }, + tableRowClassName(row) { + if (row.row.hidden) { + return 'ms-variable-hidden-row'; + } + return ''; + }, } }; diff --git a/frontend/src/common/js/default-table-header.js b/frontend/src/common/js/default-table-header.js index 74c7f9f5a2..dccf02c4b0 100644 --- a/frontend/src/common/js/default-table-header.js +++ b/frontend/src/common/js/default-table-header.js @@ -213,6 +213,14 @@ export let CUSTOM_TABLE_HEADER = { {id: 'passRate', key: '8', label: 'test_track.report.list.pass_rate'}, ], + // 场景变量 + VARIABLE_LIST_TABLE: [ + {id: 'num', key: '1', label: "ID"}, + {id: 'name', key: '2', label: 'api_test.variable_name'}, + {id: 'type', key: '3', label: 'test_track.case.type'}, + {id: 'value', key: '4', label: 'api_test.value'}, + ], + //缺陷列表 ISSUE_LIST: [ {id: 'num', key: '1', label: 'test_track.issue.id'}, diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 9c454ad302..4ce1954a88 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -1283,6 +1283,7 @@ export default { automation: { open_expansion: "One-click expansion", close_expansion: "One-click storage", + all: "all", constant: "constant", counter: "counter", random: "random", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 1968bd7303..0c0e828ade 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -1288,6 +1288,7 @@ export default { automation: { open_expansion: "一键展开", close_expansion: "一键收起", + all: "全部", constant: "常量", counter: "计数器", random: "随机数", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index b09e1472fb..f489c4788a 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -1288,6 +1288,7 @@ export default { automation: { open_expansion: "一鍵展開", close_expansion: "一鍵收起", + all: "全部", constant: "常量", counter: "計數器", random: "隨機數",