zhangxiaomeng 1 year ago
parent
commit
6e8e782169
  1. 49
      kcui/src/view/Graph.vue

49
kcui/src/view/Graph.vue

@ -1,10 +1,12 @@
<template>
<div style="width: 100%;height: 100%;">
<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 class="stText">关键字:</div>
<input class="stInput" placeholder="请输入关键字" v-model="keywords"/>
<div @click="getInfo"
<div @click="getInfo1"
style="width: 4vw;height: 2vw;margin-left:0.2vw;background-color: #0AB7FD;float: right;font-size: 1vw;line-height: 2vw;text-align: center;border-radius:2vw;margin-top: 0.1vw;">
查询
</div>
@ -102,16 +104,10 @@ export default {
onCreated(editor) {
this.editor = Object.seal(editor) // Object.seal()
},
// getInfo(){
// var data = {}
// getgraphInfo(data).then((res)=>{
// this.zhengl(res.data);
//
// })
// },
getInfo() {
this.graphData = undefined;
this.demoData = {}
this.data = undefined;
if (this.keywords != '' && this.keywords != undefined) {
this.visGraph.clearAll();
let params = {
@ -123,7 +119,28 @@ export default {
} else {
let params = {};
getgraphInfo(params).then((res) => {
this.zhengl(res.data);
})
}
},
getInfo1() {
this.graphData = undefined;
this.demoData = {}
if (this.keywords != '' && this.keywords != undefined) {
this.visGraph.clearAll();
let params = {
nodename: this.keywords,
};
getgraphInfo(params).then((res) => {
this.zhengl(res.data);
})
} else {
this.visGraph.clearAll();
let params = {};
getgraphInfo(params).then((res) => {
this.zhengl(res.data);
})
@ -131,24 +148,20 @@ export default {
},
async drawGraphData() {
this.graphData = this.demoData;
if (this.visGraph === null) {
this.createGraph();
// this.genrateGraphData();
this.visGraph.drawData(this.graphData);
// this.refreshGraphData();
this.visGraph.incremaNodesCodinate(this.graphData.nodes);
this.reLayout();
// this.goCenter();
} else {
this.createGraph();
this.visGraph.drawData(this.graphData);
// this.refreshGraphData();
this.visGraph.incremaNodesCodinate(this.graphData.nodes);
this.reLayout();
// this.goCenter();
}
this.loading = false;
@ -167,8 +180,6 @@ export default {
this.visGraph = new VisGraph(document.getElementById('graph-panel'), configWithEvents);
},
async showPopup(node) {
console.log("o----------")
console.log(node)
this.selectedNode = node;
this.newBranchParentId = node.properties.docId;
this.newBranchLevel = parseInt(node.properties.level) + 1;
@ -344,8 +355,8 @@ export default {
return styles[group] || {};
},
testInfo(){
test().then((res)=>{
testInfo() {
test().then((res) => {
console.log(res);
})
}

Loading…
Cancel
Save