|
@@ -133,16 +133,16 @@ function initGraph(width: number, height: number) {
|
|
|
},
|
|
},
|
|
|
nodeStateStyles: {
|
|
nodeStateStyles: {
|
|
|
selected: {
|
|
selected: {
|
|
|
- stroke: '#FF8000',
|
|
|
|
|
- fill: '#FF8000',
|
|
|
|
|
|
|
+ stroke: '#00FA9A',
|
|
|
|
|
+ fill: '#00FA9A',
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
defaultNode: {
|
|
defaultNode: {
|
|
|
size: 64,
|
|
size: 64,
|
|
|
type: 'circle',
|
|
type: 'circle',
|
|
|
style: {
|
|
style: {
|
|
|
- stroke: '#FF8000',
|
|
|
|
|
- fill: '#FF8000',
|
|
|
|
|
|
|
+ stroke: '#90EE90',
|
|
|
|
|
+ fill: '#90EE90',
|
|
|
},
|
|
},
|
|
|
// 选中颜色为 #FBEECD
|
|
// 选中颜色为 #FBEECD
|
|
|
labelCfg: {
|
|
labelCfg: {
|
|
@@ -192,6 +192,27 @@ onMounted(() => {
|
|
|
const rect = document.getElementById("graph")?.getBoundingClientRect()
|
|
const rect = document.getElementById("graph")?.getBoundingClientRect()
|
|
|
if (rect) {
|
|
if (rect) {
|
|
|
graph = initGraph(rect.width, rect.height)
|
|
graph = initGraph(rect.width, rect.height)
|
|
|
|
|
+ graph.node((node) => {
|
|
|
|
|
+ console.log(node,"node")
|
|
|
|
|
+ if (node.label === "建筑工程" || node.label === "工程设计") {
|
|
|
|
|
+ return {
|
|
|
|
|
+ style: {
|
|
|
|
|
+ fill: "#FF8000",
|
|
|
|
|
+ stroke: "#FF8000",
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ return {
|
|
|
|
|
+ style: {
|
|
|
|
|
+ fill: "#00FA9A",
|
|
|
|
|
+ stroke: "#00FA9A",
|
|
|
|
|
+ },
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ console.log(graph,"graph")
|
|
|
findName(keyword.value)
|
|
findName(keyword.value)
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|