From 75573ff65a47d0236342010222d040fd7d3f2111 Mon Sep 17 00:00:00 2001 From: xueyinfei <1207092115@qq.com> Date: Fri, 16 Jan 2026 18:53:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=80=E7=BC=98=E5=9B=BE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module_admin/service/meta_service.py | 27 +- .../src/assets/aichat/101.svg | 7 + .../src/assets/aichat/101n.svg | 9 + vue-fastapi-frontend/src/assets/aichat/11.svg | 6 + .../src/assets/aichat/11n.svg | 8 + .../src/views/meta/metaInfo/bloodRelation.vue | 152 +----- .../views/meta/metaInfo/bloodRelationSql.vue | 153 +----- .../views/meta/metaInfo/businssRelation.vue | 456 ++++++++++-------- 8 files changed, 330 insertions(+), 488 deletions(-) create mode 100644 vue-fastapi-frontend/src/assets/aichat/101.svg create mode 100644 vue-fastapi-frontend/src/assets/aichat/101n.svg create mode 100644 vue-fastapi-frontend/src/assets/aichat/11.svg create mode 100644 vue-fastapi-frontend/src/assets/aichat/11n.svg diff --git a/vue-fastapi-backend/module_admin/service/meta_service.py b/vue-fastapi-backend/module_admin/service/meta_service.py index 0be0632..f14c0dc 100644 --- a/vue-fastapi-backend/module_admin/service/meta_service.py +++ b/vue-fastapi-backend/module_admin/service/meta_service.py @@ -271,6 +271,8 @@ class MetaService: "tab_eng_name": currentNode['a_tab_eng_name'], "fld_eng_name": currentNode['a_fld_eng_name']}, "endArrow": True} + if meta_query.type == 'er': + relation['relation_type'] = currentNode['relation_type'] relationList.append(relation) if meta_query.type == 'er': if currentNode['a_tab_eng_name'] == meta_query.tab_eng_name: @@ -292,7 +294,9 @@ class MetaService: 'mdl_name': nextNode['b_mdl_name'], 'tab_eng_name': nextNode['b_tab_eng_name'], 'fld_eng_name': nextNode['b_fld_eng_name']}, - "endArrow": True} if nextNode['father'] == 'A' else \ + "endArrow": True, + "relation_type": nextNode['relation_type'] + } if nextNode['father'] == 'A' else \ {"source": {'ssys_id': nextNode['b_ssys_id'], 'mdl_name': nextNode['b_mdl_name'], 'tab_eng_name': nextNode['b_tab_eng_name'], @@ -301,7 +305,8 @@ class MetaService: "mdl_name": nextNode['a_mdl_name'], "tab_eng_name": nextNode['a_tab_eng_name'], "fld_eng_name": nextNode['a_fld_eng_name']}, - "endArrow": True + "endArrow": True, + "relation_type": nextNode['relation_type'] } relationList.append(relation) if currentNode['father'] == 'B': @@ -322,7 +327,8 @@ class MetaService: 'mdl_name': preNode['b_mdl_name'], 'tab_eng_name': preNode['b_tab_eng_name'], 'fld_eng_name': preNode['b_fld_eng_name']}, - "endArrow": True} if preNode['father'] == 'A' else \ + "endArrow": True, + "relation_type": preNode['relation_type']} if preNode['father'] == 'A' else \ {"source": {'ssys_id': preNode['b_ssys_id'], 'mdl_name': preNode['b_mdl_name'], 'tab_eng_name': preNode['b_tab_eng_name'], @@ -330,7 +336,8 @@ class MetaService: "target": {"ssys_id": preNode['a_ssys_id'], "mdl_name": preNode['a_mdl_name'], "tab_eng_name": preNode['a_tab_eng_name'], "fld_eng_name": preNode['a_fld_eng_name']}, - "endArrow": True} + "endArrow": True, + "relation_type": preNode['relation_type']} relationList.append(relation) if currentNode['b_tab_eng_name'] == meta_query.tab_eng_name: if currentNode['father'] == 'A': @@ -351,7 +358,8 @@ class MetaService: 'mdl_name': preNode['b_mdl_name'], 'tab_eng_name': preNode['b_tab_eng_name'], 'fld_eng_name': preNode['b_fld_eng_name']}, - "endArrow": True} if \ + "endArrow": True, + "relation_type": preNode['relation_type']} if \ preNode['father'] == 'A' else { "source": {'ssys_id': preNode['b_ssys_id'], 'mdl_name': preNode['b_mdl_name'], @@ -360,7 +368,8 @@ class MetaService: "target": {"ssys_id": preNode['a_ssys_id'], "mdl_name": preNode['a_mdl_name'], "tab_eng_name": preNode['a_tab_eng_name'], "fld_eng_name": preNode['a_fld_eng_name']}, - "endArrow": True} + "endArrow": True, + "relation_type": preNode['relation_type']} relationList.append(relation) if currentNode['father'] == 'B': # a 为下游,取a字段的下下游 @@ -379,7 +388,8 @@ class MetaService: 'mdl_name': nextNode['b_mdl_name'], 'tab_eng_name': nextNode['b_tab_eng_name'], 'fld_eng_name': nextNode['b_fld_eng_name']}, - "endArrow": True} if \ + "endArrow": True, + "relation_type": nextNode['relation_type']} if \ nextNode['father'] == 'A' else { "source": {'ssys_id': nextNode['b_ssys_id'], 'mdl_name': nextNode['b_mdl_name'], @@ -388,7 +398,8 @@ class MetaService: "target": {"ssys_id": nextNode['a_ssys_id'], "mdl_name": nextNode['a_mdl_name'], "tab_eng_name": nextNode['a_tab_eng_name'], "fld_eng_name": nextNode['a_fld_eng_name']}, - "endArrow": True} + "endArrow": True, + "relation_type": nextNode['relation_type']} relationList.append(relation) tableList = [] if len(relationList) > 0: diff --git a/vue-fastapi-frontend/src/assets/aichat/101.svg b/vue-fastapi-frontend/src/assets/aichat/101.svg new file mode 100644 index 0000000..415a437 --- /dev/null +++ b/vue-fastapi-frontend/src/assets/aichat/101.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/vue-fastapi-frontend/src/assets/aichat/101n.svg b/vue-fastapi-frontend/src/assets/aichat/101n.svg new file mode 100644 index 0000000..2d8d850 --- /dev/null +++ b/vue-fastapi-frontend/src/assets/aichat/101n.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/vue-fastapi-frontend/src/assets/aichat/11.svg b/vue-fastapi-frontend/src/assets/aichat/11.svg new file mode 100644 index 0000000..446572f --- /dev/null +++ b/vue-fastapi-frontend/src/assets/aichat/11.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/vue-fastapi-frontend/src/assets/aichat/11n.svg b/vue-fastapi-frontend/src/assets/aichat/11n.svg new file mode 100644 index 0000000..29640b1 --- /dev/null +++ b/vue-fastapi-frontend/src/assets/aichat/11n.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/vue-fastapi-frontend/src/views/meta/metaInfo/bloodRelation.vue b/vue-fastapi-frontend/src/views/meta/metaInfo/bloodRelation.vue index 848331e..3cdd5a6 100644 --- a/vue-fastapi-frontend/src/views/meta/metaInfo/bloodRelation.vue +++ b/vue-fastapi-frontend/src/views/meta/metaInfo/bloodRelation.vue @@ -55,53 +55,7 @@ function initG6() { "node:mouseup": "mouseup" }; }, - scorll(e) { - // e.preventDefault(); - const { - graph - } = this; - const nodes = graph.getNodes().filter((n) => { - const bbox = n.getBBox(); - - return isInBBox(graph.getPointByClient(e.clientX, e.clientY), bbox); - }); - - const x = e.deltaX || e.movementX; - let y = e.deltaY || e.movementY; - if (!y && navigator.userAgent.indexOf('Firefox') > -1) y = (-e.wheelDelta * 125) / 3 - - if (nodes) { - const edgesToUpdate = new Set(); - nodes.forEach((node) => { - return; - const model = node.getModel(); - if (model.attrs.length < 2) { - return; - } - const idx = model.startIndex || 0; - let startX = model.startX || 0.5; - let startIndex = idx + y * 0.02; - startX -= x; - if (startIndex < 0) { - startIndex = 0; - } - if (startX > 0) { - startX = 0; - } - if (startIndex > model.attrs.length - 1) { - startIndex = model.attrs.length - 1; - } - graph.updateItem(node, { - startIndex, - startX, - }); - node.getEdges().forEach(edge => edgesToUpdate.add(edge)) - }); - // G6 update the related edges when graph.updateItem with a node according to the new properties - // here you need to update the related edges manualy since the new properties { startIndex, startX } for the nodes are custom, and cannot be recognized by G6 - edgesToUpdate.forEach(edge => edge.refresh()) - } - }, + scorll(e) {}, click(e) { const { graph @@ -160,27 +114,9 @@ function initG6() { }) } }, - mousedown(e) { - this.isMousedown = true; - }, - mouseup(e) { - this.isMousedown = false; - }, - move(e) { - if (this.isMousedown) return; - // const name = e.shape.get("name"); - // const item = e.item; - // - // if (name && name.startsWith("item")) { - // this.graph.updateItem(item, { - // selectedIndex: Number(name.split("-")[1]), - // }); - // } else { - // this.graph.updateItem(item, { - // selectedIndex: NaN, - // }); - // } - }, + mousedown(e) {}, + mouseup(e) {}, + move(e) {}, }); registerEdge("dice-er-edge", { @@ -433,45 +369,6 @@ function initG6() { draggable: true, }); - if (list.length + 1 > itemCount) { - const barStyle = { - width: 4, - padding: 0, - boxStyle: { - stroke: "#00000022", - }, - innerStyle: { - fill: "#00000022", - }, - }; - //滚动轴 - listContainer.addShape("rect", { - attrs: { - y: 30, - x: width - barStyle.padding - barStyle.width, - width: barStyle.width, - height: (list.length + 1) * itemHeight - 30, - ...barStyle.boxStyle, - }, - }); - - const indexHeight = - afterList.length > itemCount ? - (afterList.length / list.length + 1) * (list.length + 1) * itemHeight : - 10; - //滚动轴框 - listContainer.addShape("rect", { - attrs: { - y: 30 + - barStyle.padding + - (startIndex / list.length + 1) * ((list.length + 1) * itemHeight - 30), - x: width - barStyle.padding - barStyle.width, - width: barStyle.width, - height: Math.min((list.length + 1) * itemHeight, indexHeight), - ...barStyle.innerStyle, - }, - }); - } if (afterList) { afterList.forEach((e, i) => { const isSelected = @@ -498,35 +395,18 @@ function initG6() { name: `item-${Math.floor(startIndex) + i}-content`, draggable: true, }); - - if (!cfg.hideDot) { - //左边连接桩 - listContainer.addShape("circle", { - attrs: { - x: 0, - y: i * itemHeight + offsetY, - r: 3, - stroke: boxStyle.stroke, - fill: "white", - radius: 2, - lineWidth: 1, - cursor: "pointer", - }, - }); - //右边连接桩 - listContainer.addShape("circle", { - attrs: { - x: width, - y: i * itemHeight + offsetY, - r: 3, - stroke: boxStyle.stroke, - fill: "white", - radius: 2, - lineWidth: 1, - cursor: "pointer", - }, - }); - } + listContainer.addShape("line", { + attrs: { + x1: 0, + y1: i * itemHeight - itemHeight / 2 + offsetY, + x2: width, + y2: i * itemHeight - itemHeight / 2 + offsetY, + stroke: 'black', + lineWidth: 0.1, + cursor: "pointer", + }, + name: `item-${Math.floor(startIndex) + i}-top-border`, + }); //字段文字 listContainer.addShape("text", { attrs: { diff --git a/vue-fastapi-frontend/src/views/meta/metaInfo/bloodRelationSql.vue b/vue-fastapi-frontend/src/views/meta/metaInfo/bloodRelationSql.vue index 0bf5afb..cb64828 100644 --- a/vue-fastapi-frontend/src/views/meta/metaInfo/bloodRelationSql.vue +++ b/vue-fastapi-frontend/src/views/meta/metaInfo/bloodRelationSql.vue @@ -55,53 +55,7 @@ function initG6() { "node:mouseup": "mouseup" }; }, - scorll(e) { - // e.preventDefault(); - const { - graph - } = this; - const nodes = graph.getNodes().filter((n) => { - const bbox = n.getBBox(); - - return isInBBox(graph.getPointByClient(e.clientX, e.clientY), bbox); - }); - - const x = e.deltaX || e.movementX; - let y = e.deltaY || e.movementY; - if (!y && navigator.userAgent.indexOf('Firefox') > -1) y = (-e.wheelDelta * 125) / 3 - - if (nodes) { - const edgesToUpdate = new Set(); - nodes.forEach((node) => { - return; - const model = node.getModel(); - if (model.attrs.length < 2) { - return; - } - const idx = model.startIndex || 0; - let startX = model.startX || 0.5; - let startIndex = idx + y * 0.02; - startX -= x; - if (startIndex < 0) { - startIndex = 0; - } - if (startX > 0) { - startX = 0; - } - if (startIndex > model.attrs.length - 1) { - startIndex = model.attrs.length - 1; - } - graph.updateItem(node, { - startIndex, - startX, - }); - node.getEdges().forEach(edge => edgesToUpdate.add(edge)) - }); - // G6 update the related edges when graph.updateItem with a node according to the new properties - // here you need to update the related edges manualy since the new properties { startIndex, startX } for the nodes are custom, and cannot be recognized by G6 - edgesToUpdate.forEach(edge => edge.refresh()) - } - }, + scorll(e) {}, click(e) { const { graph @@ -166,27 +120,9 @@ else if (shape.get("name") && shape.get("name").startsWith("item")) { }) } }, - mousedown(e) { - this.isMousedown = true; - }, - mouseup(e) { - this.isMousedown = false; - }, - move(e) { - if (this.isMousedown) return; - // const name = e.shape.get("name"); - // const item = e.item; - // - // if (name && name.startsWith("item")) { - // this.graph.updateItem(item, { - // selectedIndex: Number(name.split("-")[1]), - // }); - // } else { - // this.graph.updateItem(item, { - // selectedIndex: NaN, - // }); - // } - }, + mousedown(e) {}, + mouseup(e) {}, + move(e) {}, }); registerEdge("dice-er-edge", { @@ -438,46 +374,6 @@ else if (shape.get("name") && shape.get("name").startsWith("item")) { }, draggable: true, }); - - if (list.length + 1 > itemCount) { - const barStyle = { - width: 4, - padding: 0, - boxStyle: { - stroke: "#00000022", - }, - innerStyle: { - fill: "#00000022", - }, - }; - //滚动轴 - listContainer.addShape("rect", { - attrs: { - y: 30, - x: width - barStyle.padding - barStyle.width, - width: barStyle.width, - height: (list.length + 1) * itemHeight - 30, - ...barStyle.boxStyle, - }, - }); - - const indexHeight = - afterList.length > itemCount ? - (afterList.length / list.length + 1) * (list.length + 1) * itemHeight : - 10; - //滚动轴框 - listContainer.addShape("rect", { - attrs: { - y: 30 + - barStyle.padding + - (startIndex / list.length + 1) * ((list.length + 1) * itemHeight - 30), - x: width - barStyle.padding - barStyle.width, - width: barStyle.width, - height: Math.min((list.length + 1) * itemHeight, indexHeight), - ...barStyle.innerStyle, - }, - }); - } if (afterList) { afterList.forEach((e, i) => { const isSelected = @@ -504,35 +400,18 @@ else if (shape.get("name") && shape.get("name").startsWith("item")) { name: `item-${Math.floor(startIndex) + i}-content`, draggable: true, }); - - if (!cfg.hideDot) { - //左边连接桩 - listContainer.addShape("circle", { - attrs: { - x: 0, - y: i * itemHeight + offsetY, - r: 3, - stroke: boxStyle.stroke, - fill: "white", - radius: 2, - lineWidth: 1, - cursor: "pointer", - }, - }); - //右边连接桩 - listContainer.addShape("circle", { - attrs: { - x: width, - y: i * itemHeight + offsetY, - r: 3, - stroke: boxStyle.stroke, - fill: "white", - radius: 2, - lineWidth: 1, - cursor: "pointer", - }, - }); - } + listContainer.addShape("line", { + attrs: { + x1: 0, + y1: i * itemHeight - itemHeight / 2 + offsetY, + x2: width, + y2: i * itemHeight - itemHeight / 2 + offsetY, + stroke: 'black', + lineWidth: 0.1, + cursor: "pointer", + }, + name: `item-${Math.floor(startIndex) + i}-top-border`, + }); //字段文字 listContainer.addShape("text", { attrs: { diff --git a/vue-fastapi-frontend/src/views/meta/metaInfo/businssRelation.vue b/vue-fastapi-frontend/src/views/meta/metaInfo/businssRelation.vue index b8c938e..1583ccd 100644 --- a/vue-fastapi-frontend/src/views/meta/metaInfo/businssRelation.vue +++ b/vue-fastapi-frontend/src/views/meta/metaInfo/businssRelation.vue @@ -4,7 +4,11 @@