From aa0f3d2d26116fb12a2bc02a83d5f79be92a7b5c Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Thu, 13 Jan 2022 17:41:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=89=88=E6=9C=AC=E5=AF=B9=E6=AF=94):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8=E5=8C=96=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E5=AF=B9=E6=AF=94=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 接口自动化手动对比版本 --- .../scenario/common/ApiBaseComponent.vue | 6 +- .../api/automation/version/ScenarioDiff.vue | 84 +++++++------------ 2 files changed, 35 insertions(+), 55 deletions(-) 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 74266627b9..cc2a927451 100644 --- a/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/common/ApiBaseComponent.vue @@ -266,7 +266,7 @@ export default { font-size: 13px; margin: 0 5px; /*overflow-x: hidden;*/ - overflow-x: scroll; + overflow-x: auto; overflow-y: hidden; padding-bottom: 0; /*text-overflow: ellipsis;*/ @@ -274,6 +274,10 @@ export default { white-space: nowrap; width: calc(100% - 25rem); height: auto; + scrollbar-width: thin; + scrollbar-color: transparent transparent; + scrollbar-track-color: transparent; + -ms-scrollbar-track-color: transparent; } .scenario-name::-webkit-scrollbar { diff --git a/frontend/src/business/components/api/automation/version/ScenarioDiff.vue b/frontend/src/business/components/api/automation/version/ScenarioDiff.vue index 86cf10cbe2..871475c1d6 100644 --- a/frontend/src/business/components/api/automation/version/ScenarioDiff.vue +++ b/frontend/src/business/components/api/automation/version/ScenarioDiff.vue @@ -142,6 +142,7 @@ highlight-current @node-expand="nodeExpand(oldScenarioDefinition,null,'old')" @node-collapse="nodeCollapse(oldScenarioDefinition,null,'old')" + @node-click="oldNodeClick" draggable ref="stepTree"> @@ -298,13 +299,14 @@ - + @node-click="nodeClick" + draggable ref="stepTree" > 1) { - stepArray[i].countController.proceed = true; - } - if (!stepArray[i].clazzName) { - stepArray[i].clazzName = TYPE_TO_C.get(stepArray[i].type); - } - if (stepArray[i] && stepArray[i].authManager && !stepArray[i].authManager.clazzName) { - stepArray[i].authManager.clazzName = TYPE_TO_C.get(stepArray[i].authManager.type); - } - if (!stepArray[i].projectId) { - // 如果自身没有ID并且场景有ID则赋值场景ID,否则赋值当前项目ID - stepArray[i].projectId = scenarioProjectId ? scenarioProjectId : this.projectId; - } else { - const project = this.projectList.find(p => p.id === stepArray[i].projectId); - if (!project) { - stepArray[i].projectId = scenarioProjectId ? scenarioProjectId : this.projectId; - } - } - // 添加debug结果 - stepArray[i].parentIndex = fullPath ? fullPath + "_" + stepArray[i].index : stepArray[i].index; - if (stepArray[i].hashTree && stepArray[i].hashTree.length > 0) { - this.stepSize += stepArray[i].hashTree.length; - this.sort(stepArray[i].hashTree, stepArray[i].projectId, stepArray[i].parentIndex); - } - } - }, - allowDrag(draggingNode, dropNode, dropType,source) { - if (dropNode && draggingNode && dropType) { - this.sort(null,null,null,source); - } - }, nodeExpand(data, node,source) { if(source==="new"){ if (data && data.resourceId && this.newExpandedNode.indexOf(data.resourceId) === -1) { @@ -607,6 +560,26 @@ export default{ } } }, + nodeClick(data, node,source) { + this.$store.state.selectStep = data; + console.log(source) + this.currentRightChild = source; + if(this.currentLeftChild){ + diff(this.currentLeftChild,this.currentRightChild); + this.currentLeftChild = undefined; + this.currentRightChild = undefined; + } + }, + oldNodeClick(data, node,source) { + this.$store.state.selectStep = data; + console.log(source) + this.currentLeftChild = source; + if(this.currentRightChild){ + diff(this.currentLeftChild,this.currentRightChild); + this.currentLeftChild = undefined; + this.currentRightChild = undefined; + } + }, }, created() { @@ -625,4 +598,7 @@ export default{ display: flex; justify-content:space-between; } +.border-config{ + border: 1px solid red; +}