From 9685d988d07784347387eb37f2661e7fcd425811 Mon Sep 17 00:00:00 2001 From: junhong Date: Mon, 20 Dec 2021 10:05:33 +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=E5=86=85=E7=BD=AE=E5=87=BD=E6=95=B0=E6=9E=84?= =?UTF-8?q?=E9=80=A0=E5=99=A8=E4=BC=98=E5=8C=96=EF=BC=8C=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=8F=90?= =?UTF-8?q?=E5=8F=96=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --story=1004200 --user=周骏弘 内置函数构造器优化 https://www.tapd.cn/55049933/s/1082243 --- .../automation/scenario/EditApiScenario.vue | 24 +- .../scenario/common/ApiBaseComponent.vue | 8 +- .../scenario/component/ApiComponent.vue | 25 +- .../component/ApiScenarioComponent.vue | 11 +- .../scenario/component/ComponentConfig.vue | 21 +- .../scenario/component/IfController.vue | 7 +- .../scenario/component/Jsr233Processor.vue | 5 + .../scenario/component/LoopController.vue | 6 +- .../component/TransactionController.vue | 5 + .../scenario/maximize/MaximizeScenario.vue | 7 +- .../api/definition/components/ApiKeyValue.vue | 10 +- .../api/definition/components/ApiVariable.vue | 15 +- .../components/ApiVariableAdvance.vue | 375 ++++++++++++++++-- .../components/ApiVariableInput.vue | 17 +- .../components/extract/ApiExtract.vue | 14 +- .../components/extract/ApiExtractCommon.vue | 17 +- .../components/extract/ApiExtractEdit.vue | 19 +- .../request/http/ApiHttpRequestForm.vue | 16 +- frontend/src/i18n/en-US.js | 1 + frontend/src/i18n/zh-CN.js | 1 + frontend/src/i18n/zh-TW.js | 1 + 21 files changed, 517 insertions(+), 88 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index 73b9cc6ed7..56ec437b6c 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -196,9 +196,10 @@ @node-expand="nodeExpand" @node-collapse="nodeCollapse" :allow-drop="allowDrop" @node-drag-end="allowDrag" @node-click="nodeClick" draggable ref="stepTree" v-if="showHideTree"> - + + @openScenario="openScenario" + @editScenarioAdvance="editScenarioAdvance"/> @@ -244,6 +246,12 @@ + + + @@ -323,6 +331,7 @@ @openScenario="openScenario" @runScenario="runDebug" @stopScenario="stop" + @editScenarioAdvance="editScenarioAdvance" ref="maximizeScenario"/> @@ -388,7 +397,8 @@ export default { MsDrawer: () => import("../../../common/components/MsDrawer"), MsSelectTree: () => import("../../../common/select-tree/SelectTree"), MsChangeHistory: () => import("../../../history/ChangeHistory"), - MsTaskCenter: () => import("../../../task/TaskCenter") + MsTaskCenter: () => import("../../../task/TaskCenter"), + MsApiVariableAdvance: () => import("./../../definition/components/ApiVariableAdvance"), }, data() { return { @@ -477,6 +487,7 @@ export default { showFollow: false, envGroupId: "", environmentType: ENV_TYPE.JSON, + currentItem: {}, versionData: [] } }, @@ -1400,7 +1411,7 @@ export default { } this.$store.state.scenarioMap.set(this.currentScenario.id, 0); // 让接口自动化参数设置的地方,可以拿到场景变量 - this.$store.state.scenarioMap.set("currentScenarioId", this.currentScenario.variables); + this.$store.state.scenarioMap.set("currentScenarioVariables", this.currentScenario.variables); }) } }, @@ -1650,6 +1661,11 @@ export default { } } }, + editScenarioAdvance(data) { + // 打开编辑参数设置对话框,并且传递修改的蓝笔引用值参数 + this.currentItem = data; + this.$refs.scenarioVariableAdvance.open(); + }, getVersionHistory() { this.$get('/api/automation/versions/' + this.currentScenario.id, response => { this.versionData = response.data; 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 8e6943bbcf..9e8dc9ca97 100644 --- a/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue @@ -30,7 +30,7 @@ -
+
@@ -118,7 +118,11 @@ export default { return true } }, - title: String + title: String, + ifFromVariableAdvance: { + type: Boolean, + default: false, + } }, watch: { '$store.state.selectStep': function () { diff --git a/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue b/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue index 09e7e5fe0a..b5b5297159 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue @@ -11,7 +11,8 @@ :background-color="displayColor.backgroundColor" :is-max="isMax" :show-btn="showBtn" - :title="displayTitle"> + :title="displayTitle" + :if-from-variable-advance="ifFromVariableAdvance"> -