Browse Source

业务关系,修改调整页面展示

master
xueyinfei 2 weeks ago
parent
commit
5909b5e750
  1. 20
      vue-fastapi-frontend/src/views/meta/metaInfo/businssRelation.vue

20
vue-fastapi-frontend/src/views/meta/metaInfo/businssRelation.vue

@ -97,8 +97,6 @@ function initG6(){
// 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 // 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()) edgesToUpdate.forEach(edge => edge.refresh())
} }
}, },
click(e) { click(e) {
const { const {
@ -109,7 +107,6 @@ function initG6(){
if (!item) { if (!item) {
return; return;
} }
if (shape.get("name") === "collapse") { if (shape.get("name") === "collapse") {
graph.updateItem(item, { graph.updateItem(item, {
collapsed: true, collapsed: true,
@ -131,8 +128,9 @@ function initG6(){
} }
}) })
edges.forEach(edg => { edges.forEach(edg => {
if((edg.getModel().sourceKey === columnName && edg.getModel().source === item.getModel().id) if (edg.getModel().sourceKey === columnName && edg.getModel().source === item.getModel().id) {
|| (edg.getModel().targetKey === columnName && edg.getModel().target === item.getModel().id)){ edg.show()
} else if(edg.getModel().targetKey === columnName && edg.getModel().target === item.getModel().id){
edg.show() edg.show()
} else{ } else{
edg.hide() edg.hide()
@ -244,7 +242,7 @@ function initG6(){
// must be assigned in G6 3.3 and later versions. it can be any string you want, but should be unique in a custom item type // must be assigned in G6 3.3 and later versions. it can be any string you want, but should be unique in a custom item type
name: "path-shape", name: "path-shape",
}); });
} else if (!sourceNode.collapsed) { } else {
let gap = Math.abs((startPoint.y - endPoint.y) / 3); let gap = Math.abs((startPoint.y - endPoint.y) / 3);
if (startPoint["index"] === 1) { if (startPoint["index"] === 1) {
gap = -gap; gap = -gap;
@ -270,7 +268,6 @@ function initG6(){
name: "path-shape", name: "path-shape",
}); });
} }
return shape; return shape;
}, },
afterDraw(cfg, group) { afterDraw(cfg, group) {
@ -311,14 +308,14 @@ function initG6(){
icon, icon,
} = cfg; } = cfg;
const list = attrs; const list = attrs;
const itemCount = list.length + 1; const itemCount = list.length;
const boxStyle = { const boxStyle = {
stroke: "#096DD9", stroke: "#096DD9",
radius: 4, radius: 4,
}; };
const afterList = list.slice( const afterList = list.slice(
Math.floor(startIndex), Math.floor(startIndex),
Math.floor(startIndex + itemCount - 1) Math.floor(startIndex + itemCount)
); );
const offsetY = (0.5 - (startIndex % 1)) * itemHeight + 30; const offsetY = (0.5 - (startIndex % 1)) * itemHeight + 30;
// //
@ -541,7 +538,6 @@ function initG6(){
} }
return keyshape; return keyshape;
}, },
getAnchorPoints() { getAnchorPoints() {
@ -554,8 +550,7 @@ function initG6(){
const dataTransform = (data) => { const dataTransform = (data) => {
const nodes = []; const nodes = [];
const edges = []; let edges = [];
data.map((node) => { data.map((node) => {
nodes.push({ nodes.push({
...node ...node
@ -578,7 +573,6 @@ function initG6(){
}); });
} }
}); });
return { return {
nodes, nodes,
edges, edges,

Loading…
Cancel
Save