From 86c7d1c7a983a12cad56fe85cbed6124150cdaa1 Mon Sep 17 00:00:00 2001 From: limengnan <420004014@qq.com> Date: Tue, 31 Mar 2026 14:22:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AE=97=E6=B3=95=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=88=A4=E6=96=AD=EF=BC=8C=E8=B0=83=E6=95=B4=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E6=A1=A9=E5=A4=A7=E5=B0=8F=EF=BC=8C=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=A7=BB=E5=8A=A8=E8=BF=9E=E6=8E=A5=E7=BA=BF?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business-css/frontend/src/assets/del.png | Bin 0 -> 1660 bytes .../src/components/antvg6/GraphCanvas.vue | 244 ----------- .../src/components/antvg6/LeftPanel.vue | 101 ----- .../frontend/src/components/antvg6/index.vue | 412 ------------------ .../frontend/src/components/antvx6/index.vue | 82 +++- .../frontend/src/components/antvx6/viewx6.vue | 2 +- .../views/component/scenario/condition.vue | 25 +- .../component/scenario/createscenario.vue | 38 +- .../src/views/component/scenario/index.vue | 45 +- 9 files changed, 145 insertions(+), 804 deletions(-) create mode 100644 business-css/frontend/src/assets/del.png delete mode 100644 business-css/frontend/src/components/antvg6/GraphCanvas.vue delete mode 100644 business-css/frontend/src/components/antvg6/LeftPanel.vue delete mode 100644 business-css/frontend/src/components/antvg6/index.vue diff --git a/business-css/frontend/src/assets/del.png b/business-css/frontend/src/assets/del.png new file mode 100644 index 0000000000000000000000000000000000000000..b902b42c81cab7371c3a427af0417f3f52917a9a GIT binary patch literal 1660 zcmbVNYiJx*6rL1P(!|6*M5H2)lN1ci>^ycen;Ei=>F%bxp_43|ElGr;H#2v4hwRQB zXC~QA0#!!WQ7b;ch{b4s6_KR1gr-)D-q{zaM2j7` z@9%!+anCt39_iXuTfMcKAc)#V?~bq^Cn z@Zjmg06qaVHaVZ+;D9XYsACarCgaMuUC2x@oG6M6%QHMrV+3uD=r+jGx>a9d2tZ3QHN)1BPCATW01eqb3Ts+0 zA#Idtb*tzm>@X$^42E;Dj!Ai-s+4iYkeSL0R}}`PU>fSSg|S>2Yb244tR(su>hkd& z05~lSrcu=MhwVAp@oJ_1qO$)n)Qw~hU7OPu#p) zNJ(YV?UKux8t5=3s4!UT6|4nL zNrr=dffEIR=3QJ~U0IgGx@7}hf#HCU!me>?nku=0&@8y!kanxUL$j<$q+7hg0L^*5 zKoM94#=V}>{Qy#ioB$}@SO4ezZd1bv2vYaV70Q=FwVG9N4w zP@E+2QHt~WP^F67+C6)qK$}TIO!^;jQGi(}ZfAfA+Y{JZcZoU%tIjydTCjror-Avi zRf%1K<7(kd%Vi2L%7qT_65YI5`8wE%%Xg->=->cg8!%TAMdKQFT_F_gp-{JqI2Nyp_u}%<&6j zd*1zZ@?bR;-J|R_UpRP(%SkWQQ0rdFX>I4ec>B?(PF76GuYEW%Z8tLg%fH{aersQA zTjut)ar z{vVpUk5q0N4^@HM#sehv(~+6)#4De7--N_xD_@F(i_7t)OC6s~HcUTzad_-%&2Nz( V-~6EC!TkRr9PA3bxAW=!e*?0aGJya9 literal 0 HcmV?d00001 diff --git a/business-css/frontend/src/components/antvg6/GraphCanvas.vue b/business-css/frontend/src/components/antvg6/GraphCanvas.vue deleted file mode 100644 index 200c4b9..0000000 --- a/business-css/frontend/src/components/antvg6/GraphCanvas.vue +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/business-css/frontend/src/components/antvg6/LeftPanel.vue b/business-css/frontend/src/components/antvg6/LeftPanel.vue deleted file mode 100644 index ea26b44..0000000 --- a/business-css/frontend/src/components/antvg6/LeftPanel.vue +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/business-css/frontend/src/components/antvg6/index.vue b/business-css/frontend/src/components/antvg6/index.vue deleted file mode 100644 index 3120d13..0000000 --- a/business-css/frontend/src/components/antvg6/index.vue +++ /dev/null @@ -1,412 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/business-css/frontend/src/components/antvx6/index.vue b/business-css/frontend/src/components/antvx6/index.vue index eb724ff..f2083cd 100644 --- a/business-css/frontend/src/components/antvx6/index.vue +++ b/business-css/frontend/src/components/antvx6/index.vue @@ -84,7 +84,7 @@ onMounted(() => { connector: { name: 'rounded', args: { - radius: 8, + radius: 1, }, }, anchor: 'center', @@ -109,6 +109,13 @@ onMounted(() => { }, }, zIndex: 0, + interactive: { + vertexMovable: true, + vertexAddable: true, + vertexDeletable: true, + arrowheadMovable: true, + edgeMovable: true, + }, }) }, validateConnection({ targetMagnet }) { @@ -126,7 +133,8 @@ onMounted(() => { }, }, }, - interacting: function (cellView) { + + interacting: function (cellView) { // 获取当前节点的模型 const cell = cellView.cell // 判断节点是否为 'rect' 形状 @@ -344,12 +352,12 @@ onMounted(() => { }else if(node.store.data.attrs.text.text == '扁平槽'){ deviceTypetype.value = 'FlatTank' - node.size(130, 80) + node.size(130, 60) const width = node.size().width node.attr('image/xlink:href', '/assets/22.png') node.attr('image/width', 130) - node.attr('image/height', 80) - node.attr('label/refY', 85) + node.attr('image/height', 60) + node.attr('label/refY', 65) node.attr('label/refX', width/2) node.attr('label/textAnchor', 'middle') @@ -357,10 +365,10 @@ onMounted(() => { }else if(node.store.data.attrs.text.text == '环形槽'){ deviceTypetype.value = 'AnnularTank' - node.size(110, 140) + node.size(90, 140) const width = node.size().width node.attr('image/xlink:href', '/assets/33.png') - node.attr('image/width', 105) + node.attr('image/width', 90) node.attr('image/height', 135) node.attr('label/refY', 140) node.attr('label/refX', width/2) @@ -369,10 +377,10 @@ onMounted(() => { }else if(node.store.data.attrs.text.text == '管束槽'){ deviceTypetype.value = 'TubeBundleTank' - node.size(110, 140) + node.size(80, 140) const width = node.size().width node.attr('image/xlink:href', '/assets/44.png') - node.attr('image/width', 105) + node.attr('image/width', 80) node.attr('image/height', 135) node.attr('label/refY', 140) node.attr('label/refX', width/2) @@ -392,20 +400,20 @@ onMounted(() => { }else if(node.store.data.attrs.text.text == '流化床'){ deviceTypetype.value = 'FluidizedBed' - node.size(80, 140) + node.size(60, 140) const width = node.size().width node.attr('image/xlink:href', '/assets/66.png') - node.attr('image/width', 80) + node.attr('image/width', 60) node.attr('image/height', 135) node.attr('label/refY', 140) node.attr('label/refX', width/2) node.attr('label/textAnchor', 'middle') }else if(node.store.data.attrs.text.text == '锥底环形槽'){ deviceTypetype.value = 'ACFTank' - node.size(80, 140) + node.size(40, 140) const width = node.size().width node.attr('image/xlink:href', '/assets/77.png') - node.attr('image/width', 80) + node.attr('image/width', 40) node.attr('image/height', 135) node.attr('label/refY', 140) node.attr('label/refX', width/2) @@ -424,7 +432,7 @@ onMounted(() => { }) graph.on('edge:selected', ({ edge }) => { - + let edgeTemp :any = edge edge.addTools({ name: 'button-remove', args: { @@ -433,8 +441,22 @@ onMounted(() => { offset: { x: 10, y: 10 }, }, }) - - + edge.addTools({ + name: 'vertices', // 指定使用 vertices 工具 + args: { + // 可选配置参数 + snapRadius: 20, // 移动时的吸附半径 + addable: true, // 是否允许单击边添加顶点 + removable: true, // 是否允许双击顶点删除 + attrs: { // 自定义顶点的样式(小圆点) + r: 6, + fill: edgeTemp.store.data.attrs.line.stroke, + }, + }, + }) + + + }); graph.on('edge:unselected', ({ edge }) => { edge.removeTools() @@ -525,6 +547,10 @@ graph.on('blank:mouseup', (e) => { console.log('鼠标松开事件', e) if (!startPoint) return + if(isBoundary.value == false){ + return + } + const endPoint = { x: e.x, y: e.y } if(Math.abs(endPoint.x - startPoint.x) <20 && Math.abs(endPoint.y - startPoint.y) <20){ @@ -601,7 +627,7 @@ graph.on('blank:mouseup', (e) => { position: 'top', attrs: { circle: { - r: 4, + r: 8, magnet: true, stroke: '#5F95FF', strokeWidth: 1, @@ -616,7 +642,7 @@ graph.on('blank:mouseup', (e) => { position: 'right', attrs: { circle: { - r: 4, + r: 8, magnet: true, stroke: '#5F95FF', strokeWidth: 1, @@ -631,7 +657,7 @@ graph.on('blank:mouseup', (e) => { position: 'bottom', attrs: { circle: { - r: 4, + r: 8, magnet: true, stroke: '#5F95FF', strokeWidth: 1, @@ -646,7 +672,7 @@ graph.on('blank:mouseup', (e) => { position: 'left', attrs: { circle: { - r: 4, + r: 8, magnet: true, stroke: '#5F95FF', strokeWidth: 1, @@ -1406,6 +1432,10 @@ function saveDesign() { // 保存设计 return null } } +const isBoundary = ref(false) +const boundaryClick = () => { + isBoundary.value = !isBoundary.value +}