Commit 03d805a8 by liuyong

修改bug

1 parent 09d000c0
This diff could not be displayed because it is too large.
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<script type="text/javascript" src="./jsmind/jsmind.draggable-node.js"></script> <script type="text/javascript" src="./jsmind/jsmind.draggable-node.js"></script>
<script type="text/javascript" src="./jsmind/dom-to-image.js"></script> <script type="text/javascript" src="./jsmind/dom-to-image.js"></script>
<script type="text/javascript" src="./jsmind/jsmind.screenshot.js"></script> <script type="text/javascript" src="./jsmind/jsmind.screenshot.js"></script>
<script type="text/javascript" src="./echarts.min.js"></script>
</head> </head>
<body> <body>
<noscript> <noscript>
......
...@@ -13,7 +13,9 @@ ...@@ -13,7 +13,9 @@
ref="tree"> ref="tree">
</el-tree> </el-tree>
</div> </div>
<div class="right_container"></div> <div class="right_container">
<div id="main" style="width: 100%;height: 100%;"></div>
</div>
</div> </div>
</template> </template>
...@@ -33,8 +35,48 @@ export default { ...@@ -33,8 +35,48 @@ export default {
}, },
mounted(){ mounted(){
this.getTreeData(); this.getTreeData();
// this.echarts1();
}, },
methods: { methods: {
echarts1(seriesData, linkData) {
if(myChart) {
myChart.dispose();
}
var myChart = echarts.init(document.getElementById('main'));
var option = {
series: [
{
type: 'graph',
layout: 'force',
symbolSize: 120,
label: {
normal: {
show: true,
textStyle: {
fontSize: 12
},
}
},
lineStyle: {
normal: {
opacity: 0.9,
width: 5,
curveness: 0
}
},
force: {
repulsion: 6000
},
edgeSymbol: ['circle', 'arrow'],
data: seriesData,
links: linkData
}
]
};
myChart.setOption(option);
},
getTreeData() {//查询左侧树 getTreeData() {//查询左侧树
const params = { const params = {
"assetName": null, "assetName": null,
...@@ -47,8 +89,53 @@ export default { ...@@ -47,8 +89,53 @@ export default {
}); });
}, },
treeCheckChange(data, tree) {//左侧树勾选 treeCheckChange(data, tree) {//左侧树勾选
console.log(data) // console.log(data)
console.log(tree) // console.log(tree.checkedNodes);
let seriesData = [], linkData = [];
if(tree.checkedNodes.length > 0) {
tree.checkedNodes.forEach(item => {
seriesData.push({
name: item.assetName,
// symbol: item.icon,
draggable: true,
itemStyle: {
color: 'green',
normal: {
borderColor: "#04f2a7",
borderWidth: 4,
shadowBlur: 10,
shadowColor: "#04f2a7",
color: "#001c43",
},
}
});
if(item.targetList.length > 0) {
item.targetList.forEach(item2 => {
seriesData.push({
name: item2.assetName,
// symbol: item.icon,
draggable: true,
itemStyle: {
color: 'green',
normal: {
borderColor: "#04f2a7",
borderWidth: 4,
shadowBlur: 10,
shadowColor: "#04f2a7",
color: "#001c43",
},
}
})
linkData.push({
source: item.assetName,
target: item2.assetName,
})
})
}
})
}
this.echarts1(seriesData, linkData);
}, },
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!