|
@@ -49,7 +49,7 @@
|
|
|
|
|
|
<body>
|
|
<body>
|
|
<div id="app" v-cloak>
|
|
<div id="app" v-cloak>
|
|
- <el-container>
|
|
|
|
|
|
+ <el-container v-cloak>
|
|
<el-header>
|
|
<el-header>
|
|
<div class="logo" contenteditable="false">知识图谱系统</div>
|
|
<div class="logo" contenteditable="false">知识图谱系统</div>
|
|
<div class="time">{{nowDate}}</div>
|
|
<div class="time">{{nowDate}}</div>
|
|
@@ -285,10 +285,20 @@
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
<span style="margin-left: 10px;">实体名称:</span>
|
|
<span style="margin-left: 10px;">实体名称:</span>
|
|
- <el-autocomplete v-model.trim="addPropertyDropdown.name"
|
|
|
|
|
|
+ <!-- <el-autocomplete v-model.trim="addPropertyDropdown.name"
|
|
:fetch-suggestions="((queryString,cb)=>{querySearchAsync(queryString,cb,addPropertyDropdown.label)})"
|
|
:fetch-suggestions="((queryString,cb)=>{querySearchAsync(queryString,cb,addPropertyDropdown.label)})"
|
|
@select="handleSelect($event,addPropertyDropdown,'addProperty-dropdown')"
|
|
@select="handleSelect($event,addPropertyDropdown,'addProperty-dropdown')"
|
|
- placeholder=" 请输入实体名称"></el-autocomplete>
|
|
|
|
|
|
+ placeholder="请输入实体名称"></el-autocomplete> -->
|
|
|
|
+
|
|
|
|
+ <el-select class="select-entity-name" v-model.trim="addPropertyDropdown.nodeId" filterable remote
|
|
|
|
+ placeholder="请输入实体名称" @change="addPropertyDropdownValueChange"
|
|
|
|
+ :remote-method="((query)=>addPropertyDropdownRemoteMethod(query,addPropertyDropdown.label))"
|
|
|
|
+ :loading="false">
|
|
|
|
+ <el-option v-for="item in addPropertyDropdownOptions" :key="item.nodeId" :label="item.name"
|
|
|
|
+ :value="item.nodeId">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
<div class="right">
|
|
<div class="right">
|
|
<span class="blue">导出模板</span>
|
|
<span class="blue">导出模板</span>
|
|
@@ -600,10 +610,11 @@
|
|
],
|
|
],
|
|
addPropertyDropdown: {
|
|
addPropertyDropdown: {
|
|
"label": "疾病",
|
|
"label": "疾病",
|
|
- "nodeId": 0,
|
|
|
|
|
|
+ "nodeId": null,
|
|
"name": "",
|
|
"name": "",
|
|
"property": [{ key: "", value: "" }]
|
|
"property": [{ key: "", value: "" }]
|
|
},
|
|
},
|
|
|
|
+ addPropertyDropdownOptions: [],
|
|
addProperty: { //右键属性新增的数据
|
|
addProperty: { //右键属性新增的数据
|
|
"label": "",
|
|
"label": "",
|
|
"nodeId": -1,
|
|
"nodeId": -1,
|
|
@@ -714,6 +725,7 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+
|
|
menuSelect: function (item) {
|
|
menuSelect: function (item) {
|
|
this.currentPage = { ...item }
|
|
this.currentPage = { ...item }
|
|
const { id, title, url } = item
|
|
const { id, title, url } = item
|
|
@@ -1060,7 +1072,33 @@
|
|
this.dialogVisible = false
|
|
this.dialogVisible = false
|
|
this.sendChildWindowMessage("update-graph", "")
|
|
this.sendChildWindowMessage("update-graph", "")
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ },
|
|
|
|
+ addPropertyDropdownValueChange(value) {
|
|
|
|
+ for (let i = 0; i < this.addPropertyDropdownOptions.length; i++) {
|
|
|
|
+ const option = this.addPropertyDropdownOptions[i]
|
|
|
|
+ if (option.nodeId === value) {
|
|
|
|
+ this.addPropertyDropdown.name = option.name
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // this.addPropertyDropdownOptions
|
|
|
|
+ },
|
|
|
|
+ addPropertyDropdownRemoteMethod(name, label) {
|
|
|
|
+ axios.post("/api" + api.getNode, {
|
|
|
|
+ "inputStr": name,
|
|
|
|
+ "labelName": label
|
|
|
|
+ }).then(res => {
|
|
|
|
+ const { msg, code, data } = res.data
|
|
|
|
+ if (code == '0') {
|
|
|
|
+ this.addPropertyDropdownOptions = data
|
|
|
|
+ // data.forEach((el, index) => {
|
|
|
|
+ // this.addPropertyDropdownOptions.push(
|
|
|
|
+ // { oldName: el.name, name: "", nodeId: el.nodeId, type: el.label })
|
|
|
|
+ // })
|
|
|
|
+ }
|
|
|
|
+ }).catch(err => {
|
|
|
|
+ console.log("addPropertyDropdownRemoteMethod的getNode接口出错了", err)
|
|
|
|
+ })
|
|
},
|
|
},
|
|
getNode() {
|
|
getNode() {
|
|
axios.post("/api" + api.getNode, {
|
|
axios.post("/api" + api.getNode, {
|