From df2f4bb8a67f1014fbf661fafcc6da1e57214a73 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Fri, 7 Jul 2023 11:04:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3CASE=E6=89=B9=E9=87=8F=E6=89=A7=E8=A1=8C=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=BC=B9=E7=AA=97=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1027073 --user=宋昌昌 【工作台】我的待办-接口用例-待完成/待更新-批量执行-未显示环境 https://www.tapd.cn/55049933/s/1390207 --- workstation/frontend/src/api/api.js | 4 + workstation/frontend/src/api/project.js | 6 +- .../business/component/ApiCaseTableList.vue | 9 +- .../module/api/ApiCaseRunModeWithEnv.vue | 49 +- .../module/environment/EnvSelectPopover.vue | 297 ++++++++++++ .../common/EditEnvironmentGroup.vue | 119 +++++ .../environment/common/EnvGroupWithOption.vue | 148 ++++++ .../common/EnvironmentGroupList.vue | 206 ++++++++ .../common/EnvironmentGroupRow.vue | 453 ++++++++++++++++++ 9 files changed, 1271 insertions(+), 20 deletions(-) create mode 100644 workstation/frontend/src/business/module/environment/EnvSelectPopover.vue create mode 100644 workstation/frontend/src/business/module/environment/common/EditEnvironmentGroup.vue create mode 100644 workstation/frontend/src/business/module/environment/common/EnvGroupWithOption.vue create mode 100644 workstation/frontend/src/business/module/environment/common/EnvironmentGroupList.vue create mode 100644 workstation/frontend/src/business/module/environment/common/EnvironmentGroupRow.vue diff --git a/workstation/frontend/src/api/api.js b/workstation/frontend/src/api/api.js index 9c617b03da..1a69cd70df 100644 --- a/workstation/frontend/src/api/api.js +++ b/workstation/frontend/src/api/api.js @@ -50,6 +50,10 @@ export function testCaseBatchRun(params) { return post(CASE_URL+'batch/run', params); } +export function getApiCaseEnvironments(param) { + return post(CASE_URL + '/get/env', param); +} + /*sync*/ diff --git a/workstation/frontend/src/api/project.js b/workstation/frontend/src/api/project.js index a31170b897..6cdcf38bdb 100644 --- a/workstation/frontend/src/api/project.js +++ b/workstation/frontend/src/api/project.js @@ -1,5 +1,5 @@ import {get, post} from "metersphere-frontend/src/plugins/request" -import {getCurrentProjectID} from "metersphere-frontend/src/utils/token"; +import {getCurrentProjectID, getCurrentWorkspaceId} from "metersphere-frontend/src/utils/token"; export function listAllProject() { return get("/project/listAll") @@ -38,3 +38,7 @@ export function getProjectConfig(projectId) { let url = '/project_application/get/config/' + projectId; return get(url); } + +export function getAll() { + return get('/project/listAll/' + getCurrentWorkspaceId()); +} diff --git a/workstation/frontend/src/business/component/ApiCaseTableList.vue b/workstation/frontend/src/business/component/ApiCaseTableList.vue index 5ce2449580..5e8a8cc8f7 100644 --- a/workstation/frontend/src/business/component/ApiCaseTableList.vue +++ b/workstation/frontend/src/business/component/ApiCaseTableList.vue @@ -207,6 +207,7 @@ @@ -472,7 +473,8 @@ export default { hasEditPermission: false, store: {}, openUpdateRule: true, - showColum: false + showColum: false, + runCaseIds: [] }; }, props: { @@ -941,7 +943,10 @@ export default { }); }, handleRunBatch() { - this.$refs.batchRun.open(); + this.runCaseIds = Array.from(this.selectRows).map((row) => row.id); + this.$nextTick(() => { + this.$refs.batchRun.open(); + }); }, runBatch(config) { let obj = {}; diff --git a/workstation/frontend/src/business/module/api/ApiCaseRunModeWithEnv.vue b/workstation/frontend/src/business/module/api/ApiCaseRunModeWithEnv.vue index 7d292afb58..f5cda55154 100644 --- a/workstation/frontend/src/business/module/api/ApiCaseRunModeWithEnv.vue +++ b/workstation/frontend/src/business/module/api/ApiCaseRunModeWithEnv.vue @@ -7,18 +7,20 @@ :visible.sync="runModeVisible" >
- {{ $t("commons.environment") }}: - +
{{ $t('commons.environment') }}:
+
{{ $t("run_mode.title") }}: @@ -78,7 +80,7 @@ + + + diff --git a/workstation/frontend/src/business/module/environment/common/EditEnvironmentGroup.vue b/workstation/frontend/src/business/module/environment/common/EditEnvironmentGroup.vue new file mode 100644 index 0000000000..5edf044a3f --- /dev/null +++ b/workstation/frontend/src/business/module/environment/common/EditEnvironmentGroup.vue @@ -0,0 +1,119 @@ + + + + + diff --git a/workstation/frontend/src/business/module/environment/common/EnvGroupWithOption.vue b/workstation/frontend/src/business/module/environment/common/EnvGroupWithOption.vue new file mode 100644 index 0000000000..d114a4c091 --- /dev/null +++ b/workstation/frontend/src/business/module/environment/common/EnvGroupWithOption.vue @@ -0,0 +1,148 @@ + + + + + diff --git a/workstation/frontend/src/business/module/environment/common/EnvironmentGroupList.vue b/workstation/frontend/src/business/module/environment/common/EnvironmentGroupList.vue new file mode 100644 index 0000000000..2fee45b241 --- /dev/null +++ b/workstation/frontend/src/business/module/environment/common/EnvironmentGroupList.vue @@ -0,0 +1,206 @@ + + + + + diff --git a/workstation/frontend/src/business/module/environment/common/EnvironmentGroupRow.vue b/workstation/frontend/src/business/module/environment/common/EnvironmentGroupRow.vue new file mode 100644 index 0000000000..2677c1e5d6 --- /dev/null +++ b/workstation/frontend/src/business/module/environment/common/EnvironmentGroupRow.vue @@ -0,0 +1,453 @@ + + + + +