|  | @ -14,11 +14,15 @@ | 
		
	
		
			
				|  |  |         <el-button v-if="!collectData.length" size="mini" @click="dialogFormVisible = true">新增节点</el-button> |  |  |         <el-button v-if="!collectData.length" size="mini" @click="dialogFormVisible = true">新增节点</el-button> | 
		
	
		
			
				|  |  |         <el-tree |  |  |         <el-tree | 
		
	
		
			
				|  |  |           v-else |  |  |           v-else | 
		
	
		
			
				|  |  |  |  |  |           ref="collectTree" | 
		
	
		
			
				|  |  |           :data="collectData" |  |  |           :data="collectData" | 
		
	
		
			
				|  |  |           node-key="id" |  |  |           node-key="id" | 
		
	
		
			
				|  |  |           :props="defaultProps" |  |  |           :props="defaultProps" | 
		
	
		
			
				|  |  |  |  |  |           :default-expanded-keys="defaultExpandIds" | 
		
	
		
			
				|  |  |  |  |  |           @node-expand="handleNodeExpand" | 
		
	
		
			
				|  |  |  |  |  |           @node-collapse="handleNodeCollapse" | 
		
	
		
			
				|  |  |         > |  |  |         > | 
		
	
		
			
				|  |  |           <span slot-scope="{ node, data }" :class="[curNode.id===data.id?'active':'','custom-tree-node']" @click="levelClick(data)"> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |           <span slot-scope="{ node, data }" :class="[curNode.id===data.id?'active':'','custom-tree-node']" @click="levelClick(data,node)"> | 
		
	
		
			
				|  |  |             <span class="treeDefault"> |  |  |             <span class="treeDefault"> | 
		
	
		
			
				|  |  |               <span>{{ node.label }}</span> |  |  |               <span>{{ node.label }}</span> | 
		
	
		
			
				|  |  |             </span> |  |  |             </span> | 
		
	
	
		
			
				|  | @ -32,8 +36,7 @@ | 
		
	
		
			
				|  |  |                   <el-dropdown-item command="child">新增子级节点</el-dropdown-item> |  |  |                   <el-dropdown-item command="child">新增子级节点</el-dropdown-item> | 
		
	
		
			
				|  |  |                 </el-dropdown-menu> |  |  |                 </el-dropdown-menu> | 
		
	
		
			
				|  |  |               </el-dropdown> |  |  |               </el-dropdown> | 
		
	
		
			
				|  |  |               <i v-if="data.patientId" style="color: red" class="el-icon-delete" @click="deleteNode(node, data)" /> |  |  |  | 
		
	
		
			
				|  |  |               <el-dropdown v-else trigger="click" style="margin-left: 10px" @command="(command)=>handleNode(command,node,data)"> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |               <el-dropdown trigger="click" style="margin-left: 10px" @command="(command)=>handleNode(command,node,data)"> | 
		
	
		
			
				|  |  |                 <span :class="{'active':curNode.id===data.id}">···</span> |  |  |                 <span :class="{'active':curNode.id===data.id}">···</span> | 
		
	
		
			
				|  |  |                 <el-dropdown-menu slot="dropdown"> |  |  |                 <el-dropdown-menu slot="dropdown"> | 
		
	
		
			
				|  |  |                   <el-dropdown-item command="rename">编辑</el-dropdown-item> |  |  |                   <el-dropdown-item command="rename">编辑</el-dropdown-item> | 
		
	
	
		
			
				|  | @ -103,11 +106,13 @@ export default { | 
		
	
		
			
				|  |  |   }, |  |  |   }, | 
		
	
		
			
				|  |  |   data() { |  |  |   data() { | 
		
	
		
			
				|  |  |     return { |  |  |     return { | 
		
	
		
			
				|  |  |  |  |  |       defaultExpandIds: [], | 
		
	
		
			
				|  |  |       keyword: '', |  |  |       keyword: '', | 
		
	
		
			
				|  |  |       dialogFormVisible: false, |  |  |       dialogFormVisible: false, | 
		
	
		
			
				|  |  |       remarkDialog: false, |  |  |       remarkDialog: false, | 
		
	
		
			
				|  |  |       remark: '', |  |  |       remark: '', | 
		
	
		
			
				|  |  |       curNode: '', |  |  |       curNode: '', | 
		
	
		
			
				|  |  |  |  |  |       curExpand: '', | 
		
	
		
			
				|  |  |       editName: '', |  |  |       editName: '', | 
		
	
		
			
				|  |  |       editRemark: '', |  |  |       editRemark: '', | 
		
	
		
			
				|  |  |       editMessage: '新增成功', |  |  |       editMessage: '新增成功', | 
		
	
	
		
			
				|  | @ -180,7 +185,7 @@ export default { | 
		
	
		
			
				|  |  |     searchPatient() { |  |  |     searchPatient() { | 
		
	
		
			
				|  |  |       this.$http.get('/tree/findCollectPatient', { |  |  |       this.$http.get('/tree/findCollectPatient', { | 
		
	
		
			
				|  |  |         params: { |  |  |         params: { | 
		
	
		
			
				|  |  |           doctorld: this.doctorId, |  |  |  | 
		
	
		
			
				|  |  |  |  |  |           doctorId: this.doctorId, | 
		
	
		
			
				|  |  |           platform: this.platform, |  |  |           platform: this.platform, | 
		
	
		
			
				|  |  |           queryStr: this.keyword |  |  |           queryStr: this.keyword | 
		
	
		
			
				|  |  |         } |  |  |         } | 
		
	
	
		
			
				|  | @ -236,8 +241,9 @@ export default { | 
		
	
		
			
				|  |  |         } |  |  |         } | 
		
	
		
			
				|  |  |       }) |  |  |       }) | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     levelClick(data) { |  |  |  | 
		
	
		
			
				|  |  |  |  |  |     levelClick(data, node) { | 
		
	
		
			
				|  |  |       this.curNode = data |  |  |       this.curNode = data | 
		
	
		
			
				|  |  |  |  |  |       this.curExpand = node | 
		
	
		
			
				|  |  |       this.remark = data.remark || '' |  |  |       this.remark = data.remark || '' | 
		
	
		
			
				|  |  |       this.tableData = data.treePatientVoList |  |  |       this.tableData = data.treePatientVoList | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
	
		
			
				|  | @ -371,6 +377,21 @@ export default { | 
		
	
		
			
				|  |  |       this.editMessage = '重命名成功!' |  |  |       this.editMessage = '重命名成功!' | 
		
	
		
			
				|  |  |       this.addParam.id = data.id |  |  |       this.addParam.id = data.id | 
		
	
		
			
				|  |  |       this.addParam.parentId = data.parentId |  |  |       this.addParam.parentId = data.parentId | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     // 树节点展开 | 
		
	
		
			
				|  |  |  |  |  |     handleNodeExpand() { | 
		
	
		
			
				|  |  |  |  |  |       if (this.defaultExpandIds.indexOf(this.curNode.id) === -1) { | 
		
	
		
			
				|  |  |  |  |  |         this.defaultExpandIds.push(this.curNode.id) | 
		
	
		
			
				|  |  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     // 树节点关闭 | 
		
	
		
			
				|  |  |  |  |  |     handleNodeCollapse() { | 
		
	
		
			
				|  |  |  |  |  |       if (!this.defaultExpandIds.indexOf(this.curNode.id)) { | 
		
	
		
			
				|  |  |  |  |  |         const index = this.defaultExpandIds.findIndex(item => { | 
		
	
		
			
				|  |  |  |  |  |           return item === this.curNode.id | 
		
	
		
			
				|  |  |  |  |  |         }) | 
		
	
		
			
				|  |  |  |  |  |         this.defaultExpandIds.splice(index, 1) | 
		
	
		
			
				|  |  |  |  |  |       } | 
		
	
		
			
				|  |  |     } |  |  |     } | 
		
	
		
			
				|  |  |   } |  |  |   } | 
		
	
		
			
				|  |  | } |  |  | } | 
		
	
	
		
			
				|  | 
 |