From ec618b68db00f3296abfa4b1d278513e563f0047 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 14 Jul 2022 12:50:02 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E6=89=B9=E9=87=8F=E7=94=9F=E6=88=90?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=85=B3=E7=B3=BB=E6=95=B0=E6=8D=AE=E9=87=8F?= =?UTF-8?q?=E5=A4=A7=E6=97=B6=E7=9A=84=E5=8F=8B=E5=A5=BD=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1014704 --user=王孝刚 【接口测试】github#15559,接口自动化批量生成依赖关系图时,当选择所有数据时,生成失败并报错 https://www.tapd.cn/55049933/s/1201691 --- .../api/automation/scenario/ApiScenarioList.vue | 7 ++++++- .../api/definition/components/list/ApiList.vue | 5 +++++ .../components/track/case/components/TestCaseList.vue | 10 ++++++++-- frontend/src/i18n/en-US.js | 1 + frontend/src/i18n/zh-CN.js | 1 + frontend/src/i18n/zh-TW.js | 1 + 6 files changed, 22 insertions(+), 3 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue index f554f6be13..05c6d84e11 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue @@ -326,7 +326,8 @@ import { buildBatchParam, getCustomTableHeader, getCustomTableWidth, - getLastTableSortField + getLastTableSortField, + getSelectDataCounts } from "@/common/js/tableUtils"; import {API_SCENARIO_FILTERS} from "@/common/js/table-constants"; import MsTable from "@/business/components/common/components/table/MsTable"; @@ -688,6 +689,10 @@ export default { }, methods: { generateGraph() { + if (getSelectDataCounts(this.condition, this.total, this.selectRows) > 100) { + this.$warning(this.$t('test_track.case.generate_dependencies_warning')); + return; + } getGraphByCondition('API_SCENARIO', buildBatchParam(this, this.$refs.scenarioTable.selectIds), (data) => { this.graphData = data; this.$refs.relationshipGraph.open(); 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 1cb3e6b0db..5009c54e33 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiList.vue @@ -249,6 +249,7 @@ import { getCustomTableHeader, getCustomTableWidth, getLastTableSortField, + getSelectDataCounts, initCondition } from "@/common/js/tableUtils"; import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate"; @@ -581,6 +582,10 @@ export default { }); }, generateGraph() { + if (getSelectDataCounts(this.condition, this.total, this.selectRows) > 100) { + this.$warning(this.$t('test_track.case.generate_dependencies_warning')); + return; + } getGraphByCondition('API', buildBatchParam(this, this.$refs.table.selectIds), (data) => { this.graphData = data; this.$refs.relationshipGraph.open(); diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index 68304ae78b..e4dd1c2cbb 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -180,7 +180,7 @@ :value="getCustomFieldValue(scope.row, field, scope.row.priority)"/> - {{ getCustomFieldValue(scope.row, field, scope.row.status)}} + {{ getCustomFieldValue(scope.row, field, scope.row.status) }} {{ getCustomFieldValue(scope.row, field) }} @@ -238,12 +238,14 @@ import ApiStatus from "@/business/components/api/definition/components/list/ApiS import { buildBatchParam, deepClone, - getCustomFieldBatchEditOption, getCustomFieldFilter, + getCustomFieldBatchEditOption, + getCustomFieldFilter, getCustomFieldValue, getCustomTableHeader, getCustomTableWidth, getLastTableSortField, getPageInfo, + getSelectDataCounts, getTableHeaderWithCustomFields, initCondition, parseCustomFilesForList, @@ -967,6 +969,10 @@ export default { }); }, generateGraph() { + if (getSelectDataCounts(this.condition, this.total, this.selectRows) > 100) { + this.$warning(this.$t('test_track.case.generate_dependencies_warning')); + return; + } getGraphByCondition('TEST_CASE', buildBatchParam(this, this.$refs.table.selectIds), (data) => { this.graphData = data; this.$refs.relationshipGraph.open(); diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 9db07437ef..e07d66297a 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -2133,6 +2133,7 @@ export default { batch_add_public: 'Batch add public', public_warning: 'The public library configuration is not enabled', generate_dependencies: 'Generate dependencies', + generate_dependencies_warning: 'For a better experience, it is recommended to check the data below 100', batch_delete_case: 'Batch delete', batch_unlink: 'Batch Unlink', unlink: 'Unlink', diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 2535351995..114c50e76e 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -2133,6 +2133,7 @@ export default { batch_add_public: '批量添加到公共用例库', public_warning: '未开启公共库用例配置', generate_dependencies: '生成依赖关系', + generate_dependencies_warning: '为了更好的体验,建议勾选一百条以下的数据', batch_unlink: '批量取消关联', unlink: '取消关联', project_name: '所属项目', diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index e5e30aa5da..4d4725ffcc 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -2128,6 +2128,7 @@ export default { batch_add_public: '批量添加到公共用例庫', public_warning: '未開啟公共庫用例配置', generate_dependencies: '生成依賴關系', + generate_dependencies_warning: '為了更好的體驗,建議勾選一百條以下的數據', batch_unlink: '批量取消關聯', unlink: '取消關聯', project_name: '所屬項目',