|
@@ -1,37 +1,15 @@
|
|
<template>
|
|
<template>
|
|
<div class="addMedicalMultRelationWrapper">
|
|
<div class="addMedicalMultRelationWrapper">
|
|
<crumbs :title="minTitle" fix="fixed" linkTo="MedicalMultRelation"></crumbs>
|
|
<crumbs :title="minTitle" fix="fixed" linkTo="MedicalMultRelation"></crumbs>
|
|
- <div class="tabList">
|
|
|
|
- <ul class="clearfix">
|
|
|
|
- <li :class="{'curTab':curId==item.id}"
|
|
|
|
- @click="()=>handleTabClick(item.id)"
|
|
|
|
- v-for="item in tab" :key="item.id"
|
|
|
|
- >{{item.name}}<span v-if="curId==item.id"></span></li>
|
|
|
|
- </ul>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <TreeTab @getTreeList="getTreeList" />
|
|
<div class="contents">
|
|
<div class="contents">
|
|
<div class="content">
|
|
<div class="content">
|
|
<div class="addBtn" v-if="list.length == 0">
|
|
<div class="addBtn" v-if="list.length == 0">
|
|
- <el-button
|
|
|
|
|
|
+ <!-- <el-button
|
|
@click="addConcept"
|
|
@click="addConcept"
|
|
- >+ 新 增</el-button>
|
|
|
|
|
|
+ >+ 新 增</el-button> -->
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div class="conceptSearch" ref="conceptSearch">
|
|
|
|
- <h4 class="conceptTitle">术语(概念ID)搜索</h4>
|
|
|
|
- <img class="closeSearch" src="../../images/close-icon.png" @click="closeSearch" alt="">
|
|
|
|
- <input v-model="conceptText" type="text" ref="conceptInput" class="searchText" placeholder="请输入关键词搜索">
|
|
|
|
- <ul class="conceptList" ref="conceptList">
|
|
|
|
- <li
|
|
|
|
- v-for="item in conceptList"
|
|
|
|
- class="conceptItem ellipsis"
|
|
|
|
- :title="item.conceptNameType"
|
|
|
|
- @click="selectConcept(item)"
|
|
|
|
- :key="item.conceptId">
|
|
|
|
- {{item.conceptNameType}}
|
|
|
|
- </li>
|
|
|
|
- </ul>
|
|
|
|
- </div>
|
|
|
|
<div class="tree">
|
|
<div class="tree">
|
|
<el-tree
|
|
<el-tree
|
|
:data="list"
|
|
:data="list"
|
|
@@ -41,6 +19,8 @@
|
|
:allow-drag="allowDrag"
|
|
:allow-drag="allowDrag"
|
|
:allow-drop="allowDrop"
|
|
:allow-drop="allowDrop"
|
|
:expand-on-click-node="true"
|
|
:expand-on-click-node="true"
|
|
|
|
+ :render-after-expand="true"
|
|
|
|
+ :highlight-current="true"
|
|
:default-expanded-keys="defaultExpandedArr"
|
|
:default-expanded-keys="defaultExpandedArr"
|
|
@node-click = "handleNodeClick"
|
|
@node-click = "handleNodeClick"
|
|
>
|
|
>
|
|
@@ -67,7 +47,6 @@
|
|
</span>
|
|
</span>
|
|
</el-tree>
|
|
</el-tree>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
<div class="btn">
|
|
<div class="btn">
|
|
<el-button
|
|
<el-button
|
|
type="primary"
|
|
type="primary"
|
|
@@ -77,12 +56,25 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <SearchList
|
|
|
|
+ v-if="showSearch"
|
|
|
|
+ :conceptList="conceptList"
|
|
|
|
+ :addLevel="addLevel"
|
|
|
|
+ @closeSearch="closeSearch"
|
|
|
|
+ @selectConcept="selectConcept"
|
|
|
|
+ @searchConcept="searchConcept" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
import api from '@api/knowledgeTree.js';
|
|
import api from '@api/knowledgeTree.js';
|
|
- export default {
|
|
|
|
|
|
+import SearchList from '../basicKnow/SearchList.vue';
|
|
|
|
+import TreeTab from '../basicKnow/TreeTab.vue';
|
|
|
|
+
|
|
|
|
+export default {
|
|
name:'KnowledgeAll',
|
|
name:'KnowledgeAll',
|
|
|
|
+ components:{
|
|
|
|
+ SearchList,TreeTab
|
|
|
|
+ },
|
|
data(){
|
|
data(){
|
|
return{
|
|
return{
|
|
minTitle:'分诊人体图数据维护-添加',
|
|
minTitle:'分诊人体图数据维护-添加',
|
|
@@ -99,42 +91,36 @@ import api from '@api/knowledgeTree.js';
|
|
list: [],
|
|
list: [],
|
|
defaultProps: {
|
|
defaultProps: {
|
|
children: 'nodeList',
|
|
children: 'nodeList',
|
|
- label: 'conceptNameType'
|
|
|
|
|
|
+ label: 'conceptName'
|
|
},
|
|
},
|
|
- conceptText: '',
|
|
|
|
conceptList: [], //概念列表
|
|
conceptList: [], //概念列表
|
|
|
|
+ showSearch: false,
|
|
addLevel: 0, //添加级别
|
|
addLevel: 0, //添加级别
|
|
excludedConceptIds:[],
|
|
excludedConceptIds:[],
|
|
operaList: [],
|
|
operaList: [],
|
|
relationConceptId: '', //关联父类ID
|
|
relationConceptId: '', //关联父类ID
|
|
level: 0, //层级(修改时只能显示三级)
|
|
level: 0, //层级(修改时只能显示三级)
|
|
saveDisable: false, //保存按钮禁止点击
|
|
saveDisable: false, //保存按钮禁止点击
|
|
- defaultExpandedArr: []
|
|
|
|
|
|
+ defaultExpandedArr: [],
|
|
|
|
+ relationTypes:[]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
- this.getTreeList()
|
|
|
|
- },
|
|
|
|
- watch:{
|
|
|
|
- conceptText(nextVal, prevVal) {
|
|
|
|
- if(!nextVal.trim()) {
|
|
|
|
- this.conceptList = []
|
|
|
|
- }
|
|
|
|
- if(nextVal.trim() &&nextVal != prevVal) {
|
|
|
|
- this.searchConcept()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ this.getTreeList(1)
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
- handleTabClick(id){
|
|
|
|
- this.curId = id
|
|
|
|
- },
|
|
|
|
- getTreeList(){
|
|
|
|
- api.getlistTree({}).then((res) => {
|
|
|
|
|
|
+ getTreeList(id){
|
|
|
|
+ const params = {
|
|
|
|
+ "type": id,
|
|
|
|
+ }
|
|
|
|
+ api.getlistTree(params).then((res) => {
|
|
const { data } = res
|
|
const { data } = res
|
|
if(data.code == '0') {
|
|
if(data.code == '0') {
|
|
- let result = data.data
|
|
|
|
- const item = JSON.parse(JSON.stringify(result))
|
|
|
|
|
|
+ let result = data.data.treeDTO||{}
|
|
|
|
+ this.relationTypes = data.data.types||[]
|
|
|
|
+ const itemStr = JSON.stringify(result)
|
|
|
|
+ let tmp = itemStr.replace(/nextTree/g,'nodeList').replace(/id/g,'conceptId').replace(/name/g,'conceptName')
|
|
|
|
+ let item = JSON.parse(tmp)
|
|
item.level = 0
|
|
item.level = 0
|
|
item.isExpanded = false
|
|
item.isExpanded = false
|
|
item.nodeList = this.IteraNodeList(item.nodeList, [], 1)
|
|
item.nodeList = this.IteraNodeList(item.nodeList, [], 1)
|
|
@@ -168,10 +154,11 @@ import api from '@api/knowledgeTree.js';
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
- addConcept(e) {
|
|
|
|
- this.addLevel = 0;
|
|
|
|
- this.openSearch(e);
|
|
|
|
- },
|
|
|
|
|
|
+ // addConcept(e) {
|
|
|
|
+ // console.log(e)
|
|
|
|
+ // this.addLevel = 0;
|
|
|
|
+ // this.openSearch(e);
|
|
|
|
+ // },
|
|
confirm() {
|
|
confirm() {
|
|
if(!this.list[0] || this.list[0].nodeList.length == 0) {
|
|
if(!this.list[0] || this.list[0].nodeList.length == 0) {
|
|
this.message('请输入数据信息');
|
|
this.message('请输入数据信息');
|
|
@@ -186,14 +173,10 @@ import api from '@api/knowledgeTree.js';
|
|
this.IteraNodeList(this.list[0].nodeList, nodeListResult, 0)
|
|
this.IteraNodeList(this.list[0].nodeList, nodeListResult, 0)
|
|
param.nodeList = nodeListResult
|
|
param.nodeList = nodeListResult
|
|
this.saveDisable = true //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
|
|
this.saveDisable = true //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
|
|
- api.addMultRelation(param).then((res) => {
|
|
|
|
|
|
+ api.addTreeRelation(this.reparams(param)).then((res) => {
|
|
const { data } = res
|
|
const { data } = res
|
|
if(data.code == '0') {
|
|
if(data.code == '0') {
|
|
this.message(res.data.msg||'术语关系建立成功','success');
|
|
this.message(res.data.msg||'术语关系建立成功','success');
|
|
- setTimeout(() => {
|
|
|
|
- //返回带搜索条件的首页
|
|
|
|
- this.$router.push({name:'MedicalMultRelation',params:Object.assign({},this.$route.params,{currentPage:1})});
|
|
|
|
- }, 2000);
|
|
|
|
} else {
|
|
} else {
|
|
this.message(data.msg);
|
|
this.message(data.msg);
|
|
}
|
|
}
|
|
@@ -225,26 +208,20 @@ import api from '@api/knowledgeTree.js';
|
|
}
|
|
}
|
|
return nodeListResult
|
|
return nodeListResult
|
|
},
|
|
},
|
|
- searchConcept() {
|
|
|
|
|
|
+ searchConcept(txt) {
|
|
let excludedConceptIds = [];
|
|
let excludedConceptIds = [];
|
|
if(this.list[0]) {
|
|
if(this.list[0]) {
|
|
excludedConceptIds.push(this.list[0].conceptId)
|
|
excludedConceptIds.push(this.list[0].conceptId)
|
|
this.excludedConceptIds = this.IteraNodeList(this.list[0].nodeList,excludedConceptIds, 2)
|
|
this.excludedConceptIds = this.IteraNodeList(this.list[0].nodeList,excludedConceptIds, 2)
|
|
}
|
|
}
|
|
-
|
|
|
|
- const param = {
|
|
|
|
- "name": this.conceptText,
|
|
|
|
|
|
+ const params = {
|
|
|
|
+ "typeId": this.addLevel === 1 ? this.relationTypes[2] : this.addLevel === 2 ? this.relationTypes[4] : 1,
|
|
|
|
+ "name": txt,
|
|
"excludedConceptIds": this.excludedConceptIds,
|
|
"excludedConceptIds": this.excludedConceptIds,
|
|
- "relationId": 17,
|
|
|
|
- "relationPosition": 1,
|
|
|
|
- "typeId": this.addLevel === 0 ? 52 : this.addLevel === 1 ? 3 : 1
|
|
|
|
|
|
+ "relationId": this.addLevel === 1 ? this.relationTypes[1] : this.addLevel === 2 ? this.relationTypes[3] : 1,
|
|
|
|
+ "relationConceptId": this.relationConceptId,
|
|
}
|
|
}
|
|
- if(this.addLevel > 0) {
|
|
|
|
- param.relationPosition = 2
|
|
|
|
- param.relationConceptId = this.relationConceptId
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- api.getTreeSearchList({}).then((res) => {
|
|
|
|
|
|
+ api.getTreeSearchList(params).then((res) => {
|
|
const { data } = res
|
|
const { data } = res
|
|
if(data.code == '0') {
|
|
if(data.code == '0') {
|
|
this.conceptList = data.data
|
|
this.conceptList = data.data
|
|
@@ -253,11 +230,11 @@ import api from '@api/knowledgeTree.js';
|
|
},
|
|
},
|
|
selectConcept(item) {
|
|
selectConcept(item) {
|
|
if(this.addLevel == 0) {
|
|
if(this.addLevel == 0) {
|
|
- this.list.push(Object.assign({}, item, {nodeList: [], level: 0, conceptId: item.conceptId, conceptNameType: item.conceptNameType, sonRelationId: 17}))
|
|
|
|
|
|
+ this.list.push(Object.assign({}, item, {nodeList: [], level: 0, conceptId: item.conceptId, sonRelationId: 17}))
|
|
this.list = JSON.parse(JSON.stringify(this.list))
|
|
this.list = JSON.parse(JSON.stringify(this.list))
|
|
}else {
|
|
}else {
|
|
const data = this.operaList
|
|
const data = this.operaList
|
|
- const newChild = Object.assign({}, item, {nodeList: [], level: data.level+1, conceptId: item.conceptId, conceptNameType: item.conceptNameType, relationId: 17,sonRelationId: 17});
|
|
|
|
|
|
+ const newChild = Object.assign({}, item, {nodeList: [], level: data.level+1, conceptId: item.conceptId, relationId: 17,sonRelationId: 17});
|
|
// const newChild = { id: id++, label: 'nodeList', level: data.level+1, children: [] };
|
|
// const newChild = { id: id++, label: 'nodeList', level: data.level+1, children: [] };
|
|
if (!data.nodeList) {
|
|
if (!data.nodeList) {
|
|
this.$set(data, 'nodeList', []);
|
|
this.$set(data, 'nodeList', []);
|
|
@@ -268,19 +245,18 @@ import api from '@api/knowledgeTree.js';
|
|
this.closeSearch();
|
|
this.closeSearch();
|
|
},
|
|
},
|
|
openSearch(e) {
|
|
openSearch(e) {
|
|
- this.$refs['conceptSearch'].style.top= e.pageY - 120 + 'px';
|
|
|
|
- this.$refs['conceptSearch'].style.display= 'block'
|
|
|
|
- this.$refs['conceptInput'].focus();
|
|
|
|
|
|
+ this.showSearch = true
|
|
},
|
|
},
|
|
closeSearch() {
|
|
closeSearch() {
|
|
this.conceptText = ''
|
|
this.conceptText = ''
|
|
- this.$refs['conceptSearch'].style.display = "none";
|
|
|
|
|
|
+ this.conceptList = []
|
|
|
|
+ this.showSearch = false
|
|
},
|
|
},
|
|
append(data, e) {
|
|
append(data, e) {
|
|
this.addLevel = data.level+1;
|
|
this.addLevel = data.level+1;
|
|
this.relationConceptId = data.conceptId
|
|
this.relationConceptId = data.conceptId
|
|
this.operaList = data;
|
|
this.operaList = data;
|
|
- this.openSearch(e);
|
|
|
|
|
|
+ this.openSearch(data);
|
|
|
|
|
|
// const newChild = { id: id++, label: 'testtest', level: data.level+1, nodeList: [] };
|
|
// const newChild = { id: id++, label: 'testtest', level: data.level+1, nodeList: [] };
|
|
// if (!data.nodeList) {
|
|
// if (!data.nodeList) {
|
|
@@ -295,6 +271,27 @@ import api from '@api/knowledgeTree.js';
|
|
const index = nodeList.findIndex(d => d.conceptId === data.conceptId);
|
|
const index = nodeList.findIndex(d => d.conceptId === data.conceptId);
|
|
nodeList.splice(index, 1);
|
|
nodeList.splice(index, 1);
|
|
},
|
|
},
|
|
|
|
+ reparams(param){
|
|
|
|
+ let params = []
|
|
|
|
+ const tmplis = param.nodeList||[];
|
|
|
|
+ for(let i = 0;i < tmplis.length;i++){
|
|
|
|
+ let item = tmplis[i],sonIds=[]
|
|
|
|
+ if(item.nodeList&&item.nodeList.length>0){
|
|
|
|
+ for(let j = 0;j < item.nodeList.length;j++){
|
|
|
|
+ sonIds.push(item.nodeList[j].conceptId)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ let obj = {
|
|
|
|
+ "eid": item.conceptId,
|
|
|
|
+ "eids": sonIds,
|
|
|
|
+ "rid": this.relationTypes[1],
|
|
|
|
+ "sid": param.conceptId,
|
|
|
|
+ "srid": this.relationTypes[3]
|
|
|
|
+ }
|
|
|
|
+ params.push(obj)
|
|
|
|
+ }
|
|
|
|
+ return params
|
|
|
|
+ },
|
|
message(msg,type){
|
|
message(msg,type){
|
|
this.$message({
|
|
this.$message({
|
|
showClose: true,
|
|
showClose: true,
|
|
@@ -304,7 +301,7 @@ import api from '@api/knowledgeTree.js';
|
|
},
|
|
},
|
|
|
|
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
@import "../../less/admin.less";
|
|
@import "../../less/admin.less";
|
|
@@ -316,40 +313,7 @@ import api from '@api/knowledgeTree.js';
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
}
|
|
-.tabList {
|
|
|
|
- position: fixed;
|
|
|
|
- top: 100px;
|
|
|
|
- right: 20px;
|
|
|
|
- left: 270px;
|
|
|
|
- z-index: 10;
|
|
|
|
- border-top: 10px solid #dee2ea;
|
|
|
|
- border-bottom: 10px solid #dee2ea;
|
|
|
|
- box-sizing: border-box;
|
|
|
|
- ul {
|
|
|
|
- margin: 0 0 0 20px;
|
|
|
|
- background-color: #fff;
|
|
|
|
- li {
|
|
|
|
- float: left;
|
|
|
|
- height: 60px;
|
|
|
|
- line-height: 60px;
|
|
|
|
- margin: 0 15px;
|
|
|
|
- box-sizing: border-box;
|
|
|
|
- cursor: pointer;
|
|
|
|
- position: relative;
|
|
|
|
- span {
|
|
|
|
- position: absolute;
|
|
|
|
- bottom: 10px;
|
|
|
|
- left: 0;
|
|
|
|
- width: 100%;
|
|
|
|
- height: 2px;
|
|
|
|
- background-color: #21CBC7;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .curTab {
|
|
|
|
- color: #21CBC7;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
+
|
|
.addMedicalMultRelationWrapper {
|
|
.addMedicalMultRelationWrapper {
|
|
height: calc(100% - 70px);
|
|
height: calc(100% - 70px);
|
|
}
|
|
}
|
|
@@ -366,6 +330,7 @@ import api from '@api/knowledgeTree.js';
|
|
}
|
|
}
|
|
.btn-del {
|
|
.btn-del {
|
|
color: #8F8F8F;
|
|
color: #8F8F8F;
|
|
|
|
+ padding-left: 28px;
|
|
}
|
|
}
|
|
.addBtn {
|
|
.addBtn {
|
|
width: 66px;
|
|
width: 66px;
|
|
@@ -373,49 +338,61 @@ import api from '@api/knowledgeTree.js';
|
|
border-radius: 2px;
|
|
border-radius: 2px;
|
|
}
|
|
}
|
|
.conceptSearch {
|
|
.conceptSearch {
|
|
- position: absolute;
|
|
|
|
- left: 560px;
|
|
|
|
- width: 301px;
|
|
|
|
- height: 300px;
|
|
|
|
- display: none;
|
|
|
|
|
|
+ position: fixed;
|
|
|
|
+ right: 20px;
|
|
|
|
+ top: 180px;
|
|
|
|
+ bottom: 10px;
|
|
|
|
+ width: 300px;
|
|
background: #fff;
|
|
background: #fff;
|
|
- border: 1px solid #ccc;
|
|
|
|
|
|
+ border: 1px solid #C9C9C9;
|
|
text-align: center;
|
|
text-align: center;
|
|
z-index: 2;
|
|
z-index: 2;
|
|
-}
|
|
|
|
-.conceptTitle {
|
|
|
|
- width: 100%;
|
|
|
|
- text-align: center;
|
|
|
|
- padding: 20px 0;
|
|
|
|
-}
|
|
|
|
-.searchText {
|
|
|
|
- padding: 0 15px;
|
|
|
|
- width: 191px;
|
|
|
|
- height: 34px;
|
|
|
|
-}
|
|
|
|
-.conceptList {
|
|
|
|
- width: 221px;
|
|
|
|
- height: 170px;
|
|
|
|
- margin: -2px auto 0;
|
|
|
|
- border: 2px solid #E1DFDF;
|
|
|
|
- overflow: hidden;
|
|
|
|
- overflow-y: auto;
|
|
|
|
-}
|
|
|
|
-.conceptItem {
|
|
|
|
- height: 34px;
|
|
|
|
- line-height: 34px;
|
|
|
|
- text-align: left;
|
|
|
|
- padding: 0 15px;
|
|
|
|
- cursor: pointer;
|
|
|
|
-}
|
|
|
|
-.conceptItem:hover {
|
|
|
|
- background: #f5f7fa;
|
|
|
|
-}
|
|
|
|
-.closeSearch {
|
|
|
|
- position: absolute;
|
|
|
|
- width: 30px;
|
|
|
|
- right: 0;
|
|
|
|
- top: 0;
|
|
|
|
|
|
+ padding: 30px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ .conceptTitle {
|
|
|
|
+ width: 100%;
|
|
|
|
+ text-align: center;
|
|
|
|
+ padding: 20px 0;
|
|
|
|
+ }
|
|
|
|
+ .searchText {
|
|
|
|
+ padding: 0 35px 0 15px;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 34px;
|
|
|
|
+ border: 1px solid #C9C9C9;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ }
|
|
|
|
+ .conceptList {
|
|
|
|
+ min-height: 200px;
|
|
|
|
+ max-height:300px;
|
|
|
|
+ margin: -2px auto 0;
|
|
|
|
+ border: 1px solid #E1DFDF;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ }
|
|
|
|
+ .conceptItem {
|
|
|
|
+ height: 34px;
|
|
|
|
+ line-height: 34px;
|
|
|
|
+ text-align: left;
|
|
|
|
+ padding: 0 15px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+ .conceptItem:hover {
|
|
|
|
+ background: #f5f7fa;
|
|
|
|
+ }
|
|
|
|
+ .closeSearch {
|
|
|
|
+ position: absolute;
|
|
|
|
+ width: 30px;
|
|
|
|
+ right: 0;
|
|
|
|
+ top: 0;
|
|
|
|
+ }
|
|
|
|
+ .searchWrap {
|
|
|
|
+ position: relative;
|
|
|
|
+ .search {
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 7px;
|
|
|
|
+ top:8px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.delete {
|
|
.delete {
|
|
cursor: pointer;
|
|
cursor: pointer;
|