From e5fe34356d67c3474a0181f9c922cb16b9260596 Mon Sep 17 00:00:00 2001 From: jinlin <jinlin> Date: 星期六, 14 九月 2024 19:22:54 +0800 Subject: [PATCH] 修改 --- web/src/views/modules/taskReliability/RBD-edit-img.vue | 160 +++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 131 insertions(+), 29 deletions(-) diff --git a/web/src/views/modules/taskReliability/RBD-edit-img.vue b/web/src/views/modules/taskReliability/RBD-edit-img.vue index c7f5609..67c368e 100644 --- a/web/src/views/modules/taskReliability/RBD-edit-img.vue +++ b/web/src/views/modules/taskReliability/RBD-edit-img.vue @@ -43,7 +43,7 @@ <el-button @click="redo()">閲嶅仛</el-button> </el-form-item> <el-form-item> - <zt-button type="delete" @click="deleteCompment()" /> + <zt-button type="delete" @click="deleteCompment()"/> </el-form-item> </el-form> <div id="containerImg" style="border: 1px solid #EAEBEE;border-radius: 6px; @@ -468,7 +468,11 @@ "shape": "edge", "id": "66c81c68-0827-4a3c-8343-e2c453d3e9e7", "router": { - "name": "manhattan" + "name": "manhattan", + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, }, "connector": { "name": "rounded" @@ -487,7 +491,11 @@ "shape": "edge", "id": "a0f3cf90-6d37-4ee0-a254-90b4ec2b6a7f", "router": { - "name": "manhattan" + "name": "manhattan", + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, }, "connector": { "name": "rounded" @@ -510,8 +518,8 @@ }, data() { return { - nodeX:'', - nodeY:'', + nodeX: '', + nodeY: '', isFirstLoad: true, hasMoveNode: false, hasMoveSingleNode: null, @@ -617,7 +625,13 @@ stroke: '#5F95FF', strokeWidth: 1, connector: 'rounded', - router: 'manhattan', + router: { + name: 'manhattan', + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, + }, label: '', nodeStroke: '#5F95FF', nodeStrokeWidth: 1, @@ -820,6 +834,10 @@ connecting: { router: { name: 'manhattan', + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, }, connector: { name: 'rounded', @@ -830,7 +848,7 @@ anchor: 'center', connectionPoint: 'anchor', allowBlank: false, - allowLoop:false, // 鏄惁鍏佽鍒涘缓寰幆杩炵嚎锛屽嵆杈圭殑璧峰鑺傜偣鍜岀粓姝㈣妭鐐逛负鍚屼竴鑺傜偣锛岄粯璁や负 true + allowLoop: false, // 鏄惁鍏佽鍒涘缓寰幆杩炵嚎锛屽嵆杈圭殑璧峰鑺傜偣鍜岀粓姝㈣妭鐐逛负鍚屼竴鑺傜偣锛岄粯璁や负 true snap: { radius: 20, }, @@ -1017,7 +1035,7 @@ repairMttcr: item.repairMttcr, repairMttcrOther2: item.repairMttcrOtherParams2, repairMttcrOther3: item.repairMttcrOtherParams3, - successRate:item.successRate, + successRate: item.successRate, imgHeight: item.imgHeight, imgWidth: item.imgWidth, @@ -1403,7 +1421,7 @@ }) return false }) - }else if (this.isMultipleBrach(node)) { + } else if (this.isMultipleBrach(node)) { //鎻愮ず鏄惁瑕佸垹闄� this.$confirm('鏄惁鍒犻櫎璇ヨ妭鐐�?', '鎻愮ず', { confirmButtonText: '纭畾', @@ -1431,7 +1449,7 @@ }) return false }) - }else { + } else { //鎻愮ず涓嶈兘鍒犻櫎 this.$message({message: '璇ユ潯绾胯矾涓婂彧鏈夎鑺傜偣锛屾棤娉曞垹闄�', type: 'warning'}) return false; // 鍙栨秷鎿嶄綔 @@ -1462,13 +1480,13 @@ } }) }, - getNodeArr(){ + getNodeArr() { const nodes = this.graph.getNodes() let nodeArr2 = [] // 妫�鏌ラ櫎褰撳墠鑺傜偣涔嬪鐨勬墍鏈夎妭鐐圭殑鍖呭洿妗嗘槸鍚︾浉浜� for (const node of nodes) { console.log(node, 'saveDiagram node') - if (node.getData().nodeType == 'node' && node.getData().dataId) { + if (node.getData().nodeType == 'node' && node.getData().dataId) { nodeArr2.push(node.getData().dataId) } } @@ -1481,13 +1499,13 @@ this.getNodeArr() const nodes = this.graph.getNodes() for (const node of nodes) { - if(node.getData().nodeType === 'dashedBox'){ + if (node.getData().nodeType === 'dashedBox') { this.$message({message: '璇ユā鍨嬩腑瀛樺湪铏氭锛屾棤娉曚繚瀛�', type: 'warning'}) return false; // 鍙栨秷娣诲姞鑺傜偣鎿嶄綔 } - if(node.getData().nodeType === 'vote'){ + if (node.getData().nodeType === 'vote') { const edges = this.graph.getConnectedEdges(node); - if(node.getData().voteNum>=edges.length){ + if (node.getData().voteNum >= edges.length) { this.$message({message: '琛ㄥ喅鏁伴噺涓嶈兘楂樹簬璇ヨ妭鐐圭殑杩涚嚎鏁伴噺', type: 'warning'}) return false; // 鍙栨秷娣诲姞鑺傜偣鎿嶄綔 } @@ -1738,13 +1756,25 @@ this.graph.addEdge({ source: {cell: graphNodeStartNode, port: 'right1'}, target: {cell: result.newStartNode, port: 'left1'}, - router: {name: 'manhattan'}, + router: { + name: 'manhattan', + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, + }, connector: {name: 'rounded'} }) this.graph.addEdge({ source: {cell: result.newEndNode, port: 'right1'}, target: {cell: graphNode, port: 'left1'}, - router: {name: 'manhattan'}, + router: { + name: 'manhattan', + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, + }, connector: {name: 'rounded'} }) } @@ -1840,14 +1870,26 @@ this.graph.addEdge({ source: {cell: result.newEndNode, port: startPort}, target: {cell: endNode, port: endPort}, - router: {name: 'manhattan'}, + router: { + name: 'manhattan', + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, + }, connector: {name: 'rounded'} }) } else { this.graph.addEdge({ source: {cell: startNode, port: startPort}, target: {cell: result.newStartNode, port: endPort}, - router: {name: 'manhattan'}, + router: { + name: 'manhattan', + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, + }, connector: {name: 'rounded'} }) graphEdge.source = {cell: result.newEndNode.id, port: startPort} @@ -1888,13 +1930,25 @@ this.graph.addEdge({ source: {cell: connectNode, port: 'right1'}, target: {cell: dashedBox, port: 'left1'}, - router: {name: 'manhattan'}, + router: { + name: 'manhattan', + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, + }, connector: {name: 'rounded'} }) this.graph.addEdge({ source: {cell: dashedBox, port: 'right1'}, target: {cell: dragNode, port: 'left1'}, - router: {name: 'manhattan'}, + router: { + name: 'manhattan', + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, + }, connector: {name: 'rounded'} }) return {newStartNode: connectNode, newEndNode: dragNode} @@ -1940,52 +1994,100 @@ this.graph.addEdge({ source: {cell: leftConnectNode, port: 'right1'}, target: {cell: leftTopDashedBox, port: 'left1'}, - router: {name: 'manhattan'}, + router: { + name: 'manhattan', + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, + }, connector: {name: 'rounded'}, }) this.graph.addEdge({ source: {cell: leftConnectNode, port: 'right1'}, target: {cell: leftBottomDashedBox, port: 'left1'}, - router: {name: 'manhattan'}, + router: { + name: 'manhattan', + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, + }, connector: {name: 'rounded'}, }) let edgeTop = this.graph.addEdge({ source: {cell: leftTopDashedBox, port: 'right1'}, target: {cell: rightTopDashedBox, port: 'left1'}, - router: {name: 'manhattan'}, + router: { + name: 'manhattan', + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, + }, connector: {name: 'rounded'}, }) let edgeBottom = this.graph.addEdge({ source: {cell: leftBottomDashedBox, port: 'right1'}, target: {cell: rightBottomDashedBox, port: 'left1'}, - router: {name: 'manhattan'}, + router: { + name: 'manhattan', + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, + }, connector: {name: 'rounded'}, }) this.graph.addEdge({ source: {cell: rightTopDashedBox, port: 'right1'}, target: {cell: rightConnectNode, port: 'left1'}, - router: {name: 'manhattan'}, + router: { + name: 'manhattan', + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, + }, connector: {name: 'rounded'}, }) this.graph.addEdge({ source: {cell: rightBottomDashedBox, port: 'right1'}, target: {cell: rightConnectNode, port: 'left1'}, - router: {name: 'manhattan'}, + router: { + name: 'manhattan', + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, + }, connector: {name: 'rounded'}, }) this.graph.addEdge({ source: {cell: edgeTop}, target: {cell: alignCenterDashedBox, port: 'top1'}, - router: {name: 'manhattan'}, + router: { + name: 'manhattan', + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, + }, connector: {name: 'rounded'}, }) this.graph.addEdge({ source: {cell: alignCenterDashedBox, port: 'bottom1'}, target: {cell: edgeBottom}, - router: {name: 'manhattan'}, + router: { + name: 'manhattan', + args: { + startDirections: ['top','bottom'], // 浠庝笅鏂瑰紑濮� + endDirections: ['left'], // 鍚戝乏鏂圭粨鏉� + }, + }, connector: {name: 'rounded'}, }) dragNode.remove() -- Gitblit v1.9.1