From d43f867e9773f793c9cde3e32b18e62867f5d903 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 16 Mar 2021 13:16:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E6=9F=A5=E7=9C=8B=E5=BC=95=E7=94=A8=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/automation/ApiAutomation.vue | 2 +- .../automation/scenario/EditApiScenario.vue | 18 +- .../scenario/api/ScenarioRelevance.vue | 3 +- .../scenario/common/ApiBaseComponent.vue | 11 +- .../component/ApiScenarioComponent.vue | 12 +- .../scenario/component/ComponentConfig.vue | 5 +- .../scenario/component/StepExtendBtns.vue | 64 ++----- .../scenario/maximize/ScenarioHeader.vue | 78 ++++---- .../scenario/variable/VariableList.vue | 178 ++++++++++-------- frontend/src/business/components/xpack | 2 +- 10 files changed, 187 insertions(+), 186 deletions(-) diff --git a/frontend/src/business/components/api/automation/ApiAutomation.vue b/frontend/src/business/components/api/automation/ApiAutomation.vue index 921ab5f536..bba45cd049 100644 --- a/frontend/src/business/components/api/automation/ApiAutomation.vue +++ b/frontend/src/business/components/api/automation/ApiAutomation.vue @@ -39,7 +39,7 @@ :name="item.name" closable>
-
diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index 38aaf8c4bb..9f76c1edb4 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -137,7 +137,7 @@ + @remove="remove" @copyRow="copyRow" @suggestClick="suggestClick" @refReload="refReload" @openScenario="openScenario"/> @@ -198,7 +198,7 @@ @@ -222,7 +222,7 @@ import {parseEnvironment} from "../../definition/model/EnvironmentModel"; import {ELEMENT_TYPE, ELEMENTS} from "./Setting"; import MsApiCustomize from "./ApiCustomize"; - import {getCurrentProjectID, getUUID, objToStrMap, strMapToObj} from "@/common/js/utils"; + import {getCurrentProjectID, getUUID, objToStrMap, strMapToObj, handleCtrlSEvent} from "@/common/js/utils"; import ApiEnvironmentConfig from "../../definition/components/environment/ApiEnvironmentConfig"; import MsInputTag from "./MsInputTag"; import MsRun from "./DebugRun"; @@ -234,7 +234,6 @@ import ScenarioApiRelevance from "./api/ApiRelevance"; import ScenarioRelevance from "./api/ScenarioRelevance"; import MsComponentConfig from "./component/ComponentConfig"; - import {handleCtrlSEvent} from "../../../../../common/js/utils"; import EnvPopover from "@/business/components/api/automation/scenario/EnvPopover"; import MaximizeScenario from "./maximize/MaximizeScenario"; import ScenarioHeader from "./maximize/ScenarioHeader"; @@ -442,6 +441,10 @@ } }, methods: { + // 打开引用的场景 + openScenario(data) { + this.$emit('openScenario', data); + }, showAllBtn() { this.$refs.maximizeScenario.showAll(); }, @@ -465,7 +468,9 @@ // 直接更新场景防止编辑内容丢失 this.editScenario(); } - this.$refs.maximizeHeader.getVariableSize(); + if (this.$refs.maximizeHeader) { + this.$refs.maximizeHeader.getVariableSize(); + } this.reload(); }, showButton(...names) { @@ -727,6 +732,9 @@ this.loading = false }) }, + runDebugMax() { + this.$refs.maximizeScenario.runDebug(); + }, runDebug() { /*触发执行操作*/ let sign = this.$refs.envPopover.checkEnv(); diff --git a/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevance.vue b/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevance.vue index 5f089a65b7..e73d8b202a 100644 --- a/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevance.vue +++ b/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevance.vue @@ -90,7 +90,8 @@ response.data.forEach(item => { let scenarioDefinition = JSON.parse(item.scenarioDefinition); if (scenarioDefinition && scenarioDefinition.hashTree) { - let obj = {id: item.id, name: item.name, type: "scenario", referenced: 'Copy', resourceId: getUUID(), hashTree: scenarioDefinition.hashTree, projectId: item.projectId}; + let obj = {id: item.id, name: item.name, type: "scenario", headers: scenarioDefinition.headers, variables: scenarioDefinition.variables, environmentMap: scenarioDefinition.environmentMap, + referenced: 'Copy', resourceId: getUUID(), hashTree: scenarioDefinition.hashTree, projectId: item.projectId}; scenarios.push(obj); } }); diff --git a/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue b/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue index dbd1d4102b..ec877c34f5 100644 --- a/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue @@ -15,6 +15,7 @@ @click="active(data)" v-if="data.type!='scenario' && !isMax "/> + {{data.name}} @@ -34,13 +35,14 @@ - + +
- 6. +
@@ -130,6 +132,9 @@ remove() { this.$emit('remove'); }, + openScenario(data) { + this.$emit('openScenario', data); + }, editName() { this.isShowInput = true; this.$nextTick(() => { @@ -159,7 +164,7 @@ } .header-right { - margin-top: 5px; + margin-top: 0px; float: right; z-index: 1; } diff --git a/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue b/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue index 529f6909d9..b74f2da85a 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ApiScenarioComponent.vue @@ -4,6 +4,7 @@ @copy="copyRow" @remove="remove" @active="active" + @openScenario="openScenario" :data="scenario" :show-collapse="false" :is-show-name-input="!isDeletedOrRef" @@ -62,8 +63,10 @@ this.result = this.$get("/api/automation/getApiScenario/" + this.scenario.id, response => { if (response.data) { this.scenario.loaded = true; + let obj = {}; if (response.data.scenarioDefinition) { - this.scenario.hashTree = JSON.parse(response.data.scenarioDefinition).hashTree; + obj = JSON.parse(response.data.scenarioDefinition); + this.scenario.hashTree = obj.hashTree; } if (this.scenario.hashTree) { this.setDisabled(this.scenario.hashTree); @@ -73,7 +76,9 @@ if (!this.scenario.projectId) { this.scenario.projectId = response.data.projectId; } - + this.scenario.headers = obj.headers; + this.scenario.variables = obj.variables; + this.scenario.environmentMap = obj.environmentMap; this.$emit('refReload'); } else { this.scenario.referenced = "Deleted"; @@ -109,6 +114,9 @@ copyRow() { this.$emit('copyRow', this.scenario, this.node); }, + openScenario(data){ + this.$emit('openScenario', data); + }, reload() { this.loading = true this.$nextTick(() => { diff --git a/frontend/src/business/components/api/automation/scenario/component/ComponentConfig.vue b/frontend/src/business/components/api/automation/scenario/component/ComponentConfig.vue index 4061381817..0e20a0b68e 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ComponentConfig.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ComponentConfig.vue @@ -3,7 +3,7 @@ + @remove="remove" @copyRow="copyRow" @refReload="refReload" @openScenario="openScenario" :project-list="projectList" :env-map="envMap"/>
@@ -120,6 +120,9 @@ this.$emit('copyRow', row, node); }, + openScenario(data){ + this.$emit('openScenario', data); + }, suggestClick(node) { this.$emit('suggestClick', node); }, diff --git a/frontend/src/business/components/api/automation/scenario/component/StepExtendBtns.vue b/frontend/src/business/components/api/automation/scenario/component/StepExtendBtns.vue index 7b840ba742..7e692824e1 100644 --- a/frontend/src/business/components/api/automation/scenario/component/StepExtendBtns.vue +++ b/frontend/src/business/components/api/automation/scenario/component/StepExtendBtns.vue @@ -7,34 +7,31 @@ 复制步骤 删除步骤 - 查看场景变量 - 打开场景 - 另存为接口定义 - - - - - - - + 查看场景变量 + 打开场景 + 另存为接口定义 - - +
diff --git a/frontend/src/business/components/api/automation/scenario/maximize/ScenarioHeader.vue b/frontend/src/business/components/api/automation/scenario/maximize/ScenarioHeader.vue index d957231385..5fbad83245 100644 --- a/frontend/src/business/components/api/automation/scenario/maximize/ScenarioHeader.vue +++ b/frontend/src/business/components/api/automation/scenario/maximize/ScenarioHeader.vue @@ -1,31 +1,28 @@ @@ -43,11 +40,13 @@ envMap: new Map, loading: false, varSize: 0, + cookieShare: false, } }, mounted() { this.envMap = this.projectEnvMap; this.getVariableSize(); + this.cookieShare = this.enableCookieShare; }, methods: { handleExport() { @@ -92,6 +91,7 @@ }) }, setProjectEnvMap(projectEnvMap) { + this.$emit('setProjectEnvMap',projectEnvMap); this.envMap = projectEnvMap; } }, @@ -101,7 +101,7 @@ 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 47503cd137..5b00d2fc71 100644 --- a/frontend/src/business/components/api/automation/scenario/variable/VariableList.vue +++ b/frontend/src/business/components/api/automation/scenario/variable/VariableList.vue @@ -1,96 +1,101 @@ @@ -146,6 +151,7 @@ pageSize: 10, total: 0, headerSuggestions: REQUEST_HEADERS, + disabled: false, } }, methods: { @@ -212,12 +218,13 @@ isSelect(row) { return this.selection.includes(row.id) }, - open: function (variables, headers) { + open: function (variables, headers, disabled) { this.variables = variables; this.headers = headers; this.visible = true; this.editData = {type: "CONSTANT"}; this.addParameters(this.editData); + this.disabled = disabled; }, save() { this.visible = false; @@ -302,4 +309,11 @@ float: right; margin-right: 45px; } + fieldset { + padding: 0px; + margin: 0px; + min-width: 100%; + min-inline-size: 0px; + border: 0px; + } diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index b2571e06e8..4c33b9c3b1 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit b2571e06e8b211821409115cc2c4a7c52cbac1db +Subproject commit 4c33b9c3b12a83da6d9bd2740262c6c8baaab819