Browse Source

add all entity graph

allen 2 years ago
parent
commit
11abd0d1ba
2 changed files with 34 additions and 2 deletions
  1. 8 0
      src/api/graph/entity.js
  2. 26 2
      src/views/knowledge/statistical/statisticalMap_v1.vue

+ 8 - 0
src/api/graph/entity.js

@@ -528,6 +528,13 @@ function getChart(data) {
 	})
 }
 
+function getAllChart() {
+	return request({
+		method: 'get',
+		url: `/knowledge/statisticalMap/show/allGraph`,
+	})
+}
+
 /**
  * 根据实体类,获取关系类
  * @param id, degree, delEntIds, direction, isModel
@@ -686,4 +693,5 @@ export {
 	exportUnionid,
 	exportOmsUpload,
 	getChart,
+	getAllChart,
 }

+ 26 - 2
src/views/knowledge/statistical/statisticalMap_v1.vue

@@ -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>