From ab3c42e2f0168228c28efe2c6485c83fa19a5e2b Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Sun, 26 Sep 2021 10:36:14 +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=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E6=AD=A5?= =?UTF-8?q?=E9=AA=A4=E6=94=B6=E8=B5=B7=E9=97=AE=E9=A2=98=20=E3=80=90?= =?UTF-8?q?=E3=80=90github#6454=E3=80=91=E5=9C=BA=E6=99=AF=E7=9A=84?= =?UTF-8?q?=E6=AD=A5=E9=AA=A4=E5=B1=95=E5=BC=80=E5=90=8E=EF=BC=8C=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E2=80=9C=E4=B8=80=E9=94=AE=E6=94=B6=E8=B5=B7=E2=80=9D?= =?UTF-8?q?=E3=80=91=20https://www.tapd.cn/55049933/bugtrace/bugs/view/115?= =?UTF-8?q?5049933001006910?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../automation/scenario/EditApiScenario.vue | 12 ++- .../scenario/component/ConstantTimer.vue | 94 +++++++------------ .../scenario/maximize/MaximizeScenario.vue | 58 ++++-------- 3 files changed, 61 insertions(+), 103 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index e2480e86bf..fe145701d0 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -196,7 +196,7 @@ highlight-current @node-expand="nodeExpand" @node-collapse="nodeCollapse" - :allow-drop="allowDrop" @node-drag-end="allowDrag" @node-click="nodeClick" draggable ref="stepTree"> + :allow-drop="allowDrop" @node-drag-end="allowDrag" @node-click="nodeClick" draggable ref="stepTree" v-if="showHideTree"> { + this.showHideTree = true + }); + }, runDebug() { if (this.scenarioDefinition.length < 1) { return; @@ -1221,7 +1228,6 @@ export default { allowDrag(draggingNode, dropNode, dropType) { if (dropNode && draggingNode && dropType) { this.sort(); - this.reload(); } }, nodeExpand(data, node) { @@ -1494,7 +1500,7 @@ export default { this.expandedStatus = false; this.expandedNode = []; this.changeNodeStatus(this.scenarioDefinition); - this.reload(); + this.showHide(); }, stepStatus(nodes) { for (let i in nodes) { diff --git a/frontend/src/business/components/api/automation/scenario/component/ConstantTimer.vue b/frontend/src/business/components/api/automation/scenario/component/ConstantTimer.vue index 2e765bcee9..d0f659471b 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ConstantTimer.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ConstantTimer.vue @@ -19,70 +19,48 @@ diff --git a/frontend/src/business/components/api/automation/scenario/maximize/MaximizeScenario.vue b/frontend/src/business/components/api/automation/scenario/maximize/MaximizeScenario.vue index d9df7bb286..9770a70ec9 100644 --- a/frontend/src/business/components/api/automation/scenario/maximize/MaximizeScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/maximize/MaximizeScenario.vue @@ -33,7 +33,7 @@ highlight-current @node-expand="nodeExpand" @node-collapse="nodeCollapse" - :allow-drop="allowDrop" @node-drag-end="allowDrag" @node-click="nodeClick" v-if="!loading" draggable> + :allow-drop="allowDrop" @node-drag-end="allowDrag" @node-click="nodeClick" draggable v-if="showHideTree"> { + this.showHideTree = true + }); + }, reload() { this.loading = true this.$nextTick(() => { @@ -585,7 +591,7 @@ export default { this.reportId = getUUID().substring(0, 8); } }); - }else{ + } else { this.errorRefresh(); } }) @@ -642,7 +648,6 @@ export default { allowDrag(draggingNode, dropNode, dropType) { if (dropNode && draggingNode && dropType) { this.sort(); - this.reload(); } }, nodeExpand(data) { @@ -764,7 +769,7 @@ export default { this.debugVisible = true; this.loading = false; }, - errorRefresh(){ + errorRefresh() { this.debugVisible = false; this.loading = false; }, @@ -818,30 +823,12 @@ export default { this.debugResult = result; this.sort() }, - shrinkTreeNode() { - //改变每个节点的状态 - for (let i in this.scenarioDefinition) { - if (i > 30 && this.expandedStatus) { - continue; - } - if (this.scenarioDefinition[i]) { - if (this.expandedStatus) { - this.expandedNode.push(this.scenarioDefinition[i].resourceId); - } - this.scenarioDefinition[i].active = this.expandedStatus; - if (this.scenarioDefinition[i].hashTree && this.scenarioDefinition[i].hashTree.length > 0) { - this.changeNodeStatus(this.scenarioDefinition[i].hashTree); - } - } - } - }, changeNodeStatus(nodes) { for (let i in nodes) { if (nodes[i]) { if (this.expandedStatus) { this.expandedNode.push(nodes[i].resourceId); } - nodes[i].active = this.expandedStatus; if (nodes[i].hashTree != undefined && nodes[i].hashTree.length > 0) { this.changeNodeStatus(nodes[i].hashTree); } @@ -849,28 +836,15 @@ export default { } }, openExpansion() { - if (this.scenarioDefinition && this.scenarioDefinition.length > 30) { - this.$alert(this.$t('api_test.definition.request.step_message'), '', { - confirmButtonText: this.$t('commons.confirm'), - callback: (action) => { - if (action === 'confirm') { - this.expandedNode = []; - this.expandedStatus = true; - this.shrinkTreeNode(); - } - } - }); - } else { - this.expandedNode = []; - this.expandedStatus = true; - this.shrinkTreeNode(); - } + this.expandedNode = []; + this.expandedStatus = true; + this.changeNodeStatus(this.scenarioDefinition); }, closeExpansion() { this.expandedStatus = false; this.expandedNode = []; - this.shrinkTreeNode(); - this.reload(); + this.changeNodeStatus(this.scenarioDefinition); + this.showHide(); }, stepNode() { //改变每个节点的状态