|
@@ -75,6 +75,7 @@
|
|
|
<script type="text/javascript">
|
|
|
import api from '@api/icss.js';
|
|
|
import apis from '@api/medicalTerm.js';
|
|
|
+import config from '@api/config.js';
|
|
|
export default {
|
|
|
name:'AddAssistCheckMultRelation',
|
|
|
data(){
|
|
@@ -135,7 +136,8 @@ import apis from '@api/medicalTerm.js';
|
|
|
level: 0, //层级(修改时只能显示三级)
|
|
|
saveDisable: false, //保存按钮禁止点击
|
|
|
showSearch: false,
|
|
|
- defaultExpandedArr: []
|
|
|
+ defaultExpandedArr: [],
|
|
|
+ timer: undefined
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
@@ -157,13 +159,20 @@ import apis from '@api/medicalTerm.js';
|
|
|
this.conceptList = []
|
|
|
}
|
|
|
if(nextVal.trim() &&nextVal != prevVal) {
|
|
|
- this.searchConcept()
|
|
|
+ clearTimeout(this.timer)
|
|
|
+ let timer = setTimeout(()=>{
|
|
|
+ clearTimeout(this.timer);
|
|
|
+ this.searchConcept()
|
|
|
+ }, config.delayTime)
|
|
|
+ this.timer = timer
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
allowDrop(draggingNode, dropNode, type) {
|
|
|
- if(draggingNode.level !== dropNode.level){
|
|
|
+ if(draggingNode.parent.data.conceptName !== dropNode.parent.data.conceptName){
|
|
|
return false
|
|
|
}else{
|
|
|
return type !== 'inner'
|
|
@@ -241,12 +250,14 @@ import apis from '@api/medicalTerm.js';
|
|
|
return nodeListResult
|
|
|
},
|
|
|
searchConcept() {
|
|
|
+ if(!this.conceptText.trim()) {
|
|
|
+ return
|
|
|
+ }
|
|
|
let excludedConceptIds = [];
|
|
|
if(this.list[0]) {
|
|
|
excludedConceptIds.push(this.list[0].conceptId)
|
|
|
this.excludedConceptIds = this.IteraNodeList(this.list[0].nodeList,excludedConceptIds, 2)
|
|
|
}
|
|
|
-
|
|
|
const param = {
|
|
|
"name": this.conceptText,
|
|
|
"excludedConceptIds": this.excludedConceptIds,
|
|
@@ -256,15 +267,18 @@ import apis from '@api/medicalTerm.js';
|
|
|
}
|
|
|
if(this.addLevel === 0) {
|
|
|
param.relationTypeId = 16
|
|
|
- }
|
|
|
+ }
|
|
|
if(this.addLevel > 0) {
|
|
|
param.relationPosition = 0
|
|
|
+ param.relationTypeIdSupplement = [16,71]
|
|
|
}
|
|
|
|
|
|
api.getConceptInfoAssay(param).then((res) => {
|
|
|
const { data } = res
|
|
|
if(data.code == '0') {
|
|
|
- this.conceptList = data.data
|
|
|
+ if(this.conceptText.trim()) {
|
|
|
+ this.conceptList = data.data
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -294,6 +308,11 @@ import apis from '@api/medicalTerm.js';
|
|
|
this.showSearch = false
|
|
|
},
|
|
|
append(data, e) {
|
|
|
+ e.stopPropagation()
|
|
|
+ if(!data.isExpanded) {
|
|
|
+ data.isExpanded = true
|
|
|
+ this.defaultExpandedArr.push(data.conceptId)
|
|
|
+ }
|
|
|
this.addLevel = data.level+1;
|
|
|
this.relationConceptId = data.conceptId
|
|
|
this.operaList = data;
|