From 2788d3b1376fd6d74471fbe74ae1eeb293763786 Mon Sep 17 00:00:00 2001 From: yzw <2431960323@qq.com> Date: Wed, 15 Feb 2023 20:16:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BA=8B=E4=BB=B6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=9A=84=E6=9F=A5=E8=AF=A2=E3=80=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E3=80=81=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../D3Visualization/GraphEventHandler.js | 2 +- src/store/modules/kg.js | 27 ++- src/views/Test/test2.vue | 81 +++++-- src/views/manage/event/basic/index.vue | 225 +++++++++++++++++- 4 files changed, 303 insertions(+), 32 deletions(-) diff --git a/src/components/D3Visualization/GraphEventHandler.js b/src/components/D3Visualization/GraphEventHandler.js index 9cdf7f1..c00b3e2 100644 --- a/src/components/D3Visualization/GraphEventHandler.js +++ b/src/components/D3Visualization/GraphEventHandler.js @@ -108,7 +108,7 @@ export class GraphEventHandler { this.selectItem(relationship) this.onItemSelected({type: 'relationship', item: {id: relationship.id, type: relationship.type, properties: relationship.propertyList}}) // 存储关系数据到vuex中,其他模块可使用 - store.commit('kg/SET_KG', {type: 'relation', item: {id: relationship.id, labels: relationship.type, properties: relationship.propertyList}}) + store.commit('kg/SET_KG', {type: 'relation', item: {id: relationship.id, labels: [relationship.type], properties: relationship.propertyList}}) } else { this.deselectItem() } diff --git a/src/store/modules/kg.js b/src/store/modules/kg.js index 44e0d76..85b8290 100644 --- a/src/store/modules/kg.js +++ b/src/store/modules/kg.js @@ -12,12 +12,37 @@ const state = getDefaultState() const mutations = { RESET_KG: (state) => { - state = getDefaultState() + state.type = 'node' + state.data = {} + // state = getDefaultState() + // console.log('mutation', state) }, SET_KG: (state, obj) => { state.type = obj.type state.data = obj.item }, + SET_VALUE: (state, obj) => { + for(let i=0; i { + let properties = state.data.properties + let index = -1 + for(let i=0; i -
- -
+ + + + + + + + + + - - - - + \ No newline at end of file diff --git a/src/views/manage/event/basic/index.vue b/src/views/manage/event/basic/index.vue index f5c8dce..337d786 100644 --- a/src/views/manage/event/basic/index.vue +++ b/src/views/manage/event/basic/index.vue @@ -52,15 +52,79 @@
-
{{curType}}
+
+ {{ curType }}: {{ curTypeName }} +
+
+ ID {{ curId }} +
+ + + + + + + + + + + 删除整个{{ this.curType }}
+ + + + + + 取 消 + 确 定 + +