+
-
@@ -21,13 +52,42 @@ import { setting } from "@/config";
const neo4j = require("neo4j-driver");
export default {
components: {
- Visualization
+ Visualization,
},
data() {
return {
- query: "match (s:School) return s limit 2",
+ query: "",
records: [],
- clearAll: false
+ clearAll: false,
+
+ domainOptions: [
+ {
+ value: "Department",
+ label: "部门",
+ },
+ {
+ value: "Job",
+ label: "岗位",
+ },
+ {
+ value: "Person",
+ label: "人员",
+ },
+ {
+ value: "Event",
+ label: "事件",
+ },
+ {
+ value: "School",
+ label: "学校",
+ },
+ {
+ value: "不限",
+ label: "不限",
+ },
+ ],
+ domain: "Event",
+ nodeNum: 10,
};
},
mounted() {
@@ -38,36 +98,42 @@ export default {
this.executeQuery();
},
methods: {
- handleClickNode(item) {},
+ handleClickNode(item) {
+ // console.log(item);
+ },
executeQuery() {
- let me = this;
- me.records = [];
+ this.records = [];
this.clearAll = true;
- const session = this.driver.session();
-
- let query = this.query;
- if (query == "") return;
+ let session = this.driver.session();
+ // if (this.query == "") return;
+ // todo: 限制query不能出现关键字,如limit
+ let domain = this.domain;
+ if (domain != "不限") {
+ domain = ":" + domain;
+ } else {
+ domain = "";
+ }
+ let query = `match (n${domain}) where n.name=~'.*${this.query}.*' return n limit ${this.nodeNum}`;
session
.run(query, {})
- .then(function(result) {
- me.clearAll = false;
- me.records = result.records;
- console.log("neo4j 结果", result);
+ .then((result) => {
+ this.clearAll = false;
+ this.records = result.records;
session.close();
})
- .catch(function(error) {
+ .catch((error) => {
console.log(error);
this.driver.close();
});
- }
+ },
},
watch: {
records: {
- handler: function(val, oldVal) {},
- deep: true
- }
- }
+ handler: function (val, oldVal) {},
+ deep: true,
+ },
+ },
};
@@ -78,10 +144,12 @@ export default {
-ms-user-select: none;
user-select: none;
position: absolute;
- top: 0;
+ height: 100%;
+ width: 100%;
+ /* top: 0;
left: 0;
right: 0;
- bottom: 0;
+ bottom: 0; */
}
.kgWidget div,
@@ -612,5 +680,5 @@ export default {
.cBHfln.contracted {
max-height: 100px;
}
+
-
\ 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 fdcf877..f5c8dce 100644
--- a/src/views/manage/event/basic/index.vue
+++ b/src/views/manage/event/basic/index.vue
@@ -1,3 +1,769 @@
- 管理 事件基本信息
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+