|
@@ -150,7 +150,7 @@ import chartComp from '@/views/knowledge/common/chart'
|
|
|
import fuzzySearch from '@/views/knowledge/common/fuzzySearch'
|
|
|
import eventBus from '@/plugins/knowledge/eventBus'
|
|
|
|
|
|
-import { getChart } from '@/api/graph/entity'
|
|
|
+import { getChart, getAllChart } from '@/api/graph/entity'
|
|
|
|
|
|
// 获取路径参数
|
|
|
function getQueryVariable(variable) {
|
|
@@ -207,6 +207,9 @@ export default {
|
|
|
entName: '',
|
|
|
ruleList: {}
|
|
|
}
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+
|
|
|
},
|
|
|
mounted() {
|
|
|
this.rootId = getQueryVariable('entId')
|
|
@@ -236,6 +239,8 @@ export default {
|
|
|
this.linkClassList = data.relClsListVO
|
|
|
this.spinning = false
|
|
|
})
|
|
|
+ } else {
|
|
|
+ this.getAllChart()
|
|
|
}
|
|
|
const vm = this
|
|
|
eventBus.eventBus.$on('graph:exportData', function() {
|
|
@@ -494,7 +499,6 @@ export default {
|
|
|
}
|
|
|
|
|
|
getChart(data).then(resp => {
|
|
|
- debugger
|
|
|
// this.getJson(__data)
|
|
|
this.tooltip.entityShow = false
|
|
|
this.tooltip.linkShow = false
|
|
@@ -708,6 +712,26 @@ export default {
|
|
|
exportDataToConsole() {
|
|
|
eventBus.eventBus.$emit('graph:exportData')
|
|
|
},
|
|
|
+ getAllChart(){
|
|
|
+ getAllChart().then(resp => {
|
|
|
+ // this.getJson(__data)
|
|
|
+ this.tooltip.entityShow = false
|
|
|
+ this.tooltip.linkShow = false
|
|
|
+ this.entityClassList = []
|
|
|
+ this.linkClassList = []
|
|
|
+ this.nodes = resp.data.entListVO
|
|
|
+ this.links = resp.data.relListVO
|
|
|
+ this.directionsList.forEach((v) => {
|
|
|
+ v.checked = true
|
|
|
+ })
|
|
|
+ this.$refs.chart.reDraw(
|
|
|
+ this.rootId,
|
|
|
+ resp.data.entListVO,
|
|
|
+ resp.data.relListVO
|
|
|
+ )
|
|
|
+ this.spinning = false
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
}
|
|
|
</script>
|