|
|
@ -3,14 +3,17 @@ |
|
|
<div style="width: 100%;height: 4vw;background-color: #42b983;"> |
|
|
<div style="width: 100%;height: 4vw;background-color: #42b983;"> |
|
|
<div style="background-color: silver;width: 3vw;height: 2vw;line-height: 2vw;text-align: center;" @click="goBook">跳转1</div> |
|
|
<div style="background-color: silver;width: 3vw;height: 2vw;line-height: 2vw;text-align: center;" @click="goBook">跳转1</div> |
|
|
</div> |
|
|
</div> |
|
|
<div style="width: 100%;height: 100%;"> |
|
|
<div style="width: 100%;height: 80%;"> |
|
|
<div class="gContainer"> |
|
|
<div class="gContainer"> |
|
|
<div id="graph-panel" style="width: 100%;height: 100%;"></div> |
|
|
<div id="graph-panel" style="width: 100%;height: 100%;"></div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 弹窗 --> |
|
|
<!-- 弹窗 --> |
|
|
<div v-if="isModalVisible" class="modal-overlay" @click.self="closeModal"> |
|
|
<div v-if="isModalVisible" style="height: 5vw;width: 100%;" class="modal-overlay" @click.self="closeModal"> |
|
|
<div class="modal-content"> |
|
|
<div class="modal-content"> |
|
|
<h3>请输入分支内容</h3> |
|
|
<h3>请输入分支内容</h3> |
|
|
<label for="fileId">fileId:</label> |
|
|
<label for="fileId">fileId:</label> |
|
|
@ -120,9 +123,11 @@ export default { |
|
|
this.visGraph = new VisGraph(document.getElementById('graph-panel'), configWithEvents); |
|
|
this.visGraph = new VisGraph(document.getElementById('graph-panel'), configWithEvents); |
|
|
}, |
|
|
}, |
|
|
showPopup(node) { |
|
|
showPopup(node) { |
|
|
|
|
|
console.log("o----------") |
|
|
|
|
|
console.log(node) |
|
|
this.selectedNode = node; |
|
|
this.selectedNode = node; |
|
|
this.newBranchParentId = node.properties.docId; |
|
|
this.newBranchParentId = node.properties.docId; |
|
|
this.newBranchLevel = node.properties.level - 1; |
|
|
this.newBranchLevel = parseInt(node.properties.level) + 1; |
|
|
this.isModalVisible = true; // 显示模态框 |
|
|
this.isModalVisible = true; // 显示模态框 |
|
|
}, |
|
|
}, |
|
|
closeModal() { |
|
|
closeModal() { |
|
|
@ -226,8 +231,11 @@ export default { |
|
|
|
|
|
|
|
|
var nodeList = data.nodes; |
|
|
var nodeList = data.nodes; |
|
|
var lineList = data.links; |
|
|
var lineList = data.links; |
|
|
|
|
|
var allOne = "" |
|
|
|
|
|
|
|
|
var allOne = nodeList[0].docId |
|
|
console.log(nodeList) |
|
|
|
|
|
if(nodeList!=undefined){ |
|
|
|
|
|
allOne = nodeList[0].docId |
|
|
for (let a = 0; a < nodeList.length; a++) { |
|
|
for (let a = 0; a < nodeList.length; a++) { |
|
|
const group = parseInt(nodeList[a].group, 10); |
|
|
const group = parseInt(nodeList[a].group, 10); |
|
|
const style = this.getNodeStyle(group); |
|
|
const style = this.getNodeStyle(group); |
|
|
@ -235,12 +243,16 @@ export default { |
|
|
nodes.push({ |
|
|
nodes.push({ |
|
|
id: nodeList[a].id, |
|
|
id: nodeList[a].id, |
|
|
label: nodeList[a].name, |
|
|
label: nodeList[a].name, |
|
|
properties: { name: nodeList[a].name, docId: nodeList[a].docId, parent: allOne }, |
|
|
properties: { name: nodeList[a].name, docId: nodeList[a].docId, parent: allOne, leve: nodeList[a].group }, |
|
|
...style // 展开 style 对象以应用样式属性 |
|
|
...style // 展开 style 对象以应用样式属性 |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// var allOne = nodeList[0].docId |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(lineList!=undefined){ |
|
|
for (let b = 0; b < lineList.length; b++) { |
|
|
for (let b = 0; b < lineList.length; b++) { |
|
|
|
|
|
|
|
|
var bbb = {name: lineList[b].relate} |
|
|
var bbb = {name: lineList[b].relate} |
|
|
@ -253,6 +265,8 @@ export default { |
|
|
lineWidth: 3, |
|
|
lineWidth: 3, |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.demoData = { |
|
|
this.demoData = { |
|
|
"nodes": nodes, |
|
|
"nodes": nodes, |
|
|
|