|  |  | @ -1,47 +1,56 @@ | 
			
		
	
		
			
				
					|  |  |  | <template> | 
			
		
	
		
			
				
					|  |  |  |   <div class="collection"> | 
			
		
	
		
			
				
					|  |  |  |     <el-tree | 
			
		
	
		
			
				
					|  |  |  |       :data="tableData" | 
			
		
	
		
			
				
					|  |  |  |       :props="collectProps" | 
			
		
	
		
			
				
					|  |  |  |       node-key="id" | 
			
		
	
		
			
				
					|  |  |  |       default-expand-all | 
			
		
	
		
			
				
					|  |  |  |       :expand-on-click-node="false" | 
			
		
	
		
			
				
					|  |  |  |     > | 
			
		
	
		
			
				
					|  |  |  |       <span slot-scope="{ node, data }" class="custom-tree-node" :name="node.id"> | 
			
		
	
		
			
				
					|  |  |  |         <span style="display: inline-block;min-width: 100px">{{ node.label }}</span> | 
			
		
	
		
			
				
					|  |  |  |         <span :class="[currentNumber == node.id ? 'active' : 'dis']"> | 
			
		
	
		
			
				
					|  |  |  |           <span class="ml15" @click="delMenu(data)"> | 
			
		
	
		
			
				
					|  |  |  |             <!--            <a-icon type="minus-circle" />--> | 
			
		
	
		
			
				
					|  |  |  |           </span> | 
			
		
	
		
			
				
					|  |  |  |           <span class="mr30" @click="addMenu(1,data)"> | 
			
		
	
		
			
				
					|  |  |  |             <!--            <a-icon type="plus-circle" />--> | 
			
		
	
		
			
				
					|  |  |  |     <div class="collection_title">个人收藏</div> | 
			
		
	
		
			
				
					|  |  |  |     <div style="flex: 1"> | 
			
		
	
		
			
				
					|  |  |  |       <el-button v-if="!tableData.length" size="mini" @click="dialogFormVisible = true">新增节点</el-button> | 
			
		
	
		
			
				
					|  |  |  |       <el-tree | 
			
		
	
		
			
				
					|  |  |  |         v-else | 
			
		
	
		
			
				
					|  |  |  |         :data="tableData" | 
			
		
	
		
			
				
					|  |  |  |         :props="collectProps" | 
			
		
	
		
			
				
					|  |  |  |         node-key="id" | 
			
		
	
		
			
				
					|  |  |  |         default-expand-all | 
			
		
	
		
			
				
					|  |  |  |         :expand-on-click-node="false" | 
			
		
	
		
			
				
					|  |  |  |       > | 
			
		
	
		
			
				
					|  |  |  |         <span slot-scope="{ node, data }" class="custom-tree-node" :name="node.id"> | 
			
		
	
		
			
				
					|  |  |  |           <span style="display: inline-block;min-width: 100px"> | 
			
		
	
		
			
				
					|  |  |  |             <span>{{ node.label }}</span> | 
			
		
	
		
			
				
					|  |  |  |           <!--          <el-input v-else v-model="editName" :autofocus="true" @blur="" @change="getRename" />--> | 
			
		
	
		
			
				
					|  |  |  |           </span> | 
			
		
	
		
			
				
					|  |  |  |           <span> | 
			
		
	
		
			
				
					|  |  |  |             <el-button | 
			
		
	
		
			
				
					|  |  |  |               type="text" | 
			
		
	
		
			
				
					|  |  |  |               size="mini" | 
			
		
	
		
			
				
					|  |  |  |               @click="() => addMenu(2,data)" | 
			
		
	
		
			
				
					|  |  |  |             > | 
			
		
	
		
			
				
					|  |  |  |               新增子级 | 
			
		
	
		
			
				
					|  |  |  |             </el-button> | 
			
		
	
		
			
				
					|  |  |  |             <el-button | 
			
		
	
		
			
				
					|  |  |  |               type="text" | 
			
		
	
		
			
				
					|  |  |  |               size="mini" | 
			
		
	
		
			
				
					|  |  |  |               @click="() => editMenu(node, data)" | 
			
		
	
		
			
				
					|  |  |  |             > | 
			
		
	
		
			
				
					|  |  |  |               配置 | 
			
		
	
		
			
				
					|  |  |  |             </el-button> | 
			
		
	
		
			
				
					|  |  |  |             <el-dropdown trigger="click" @command="(command)=>addNode(command,node,data)"> | 
			
		
	
		
			
				
					|  |  |  |               <span> | 
			
		
	
		
			
				
					|  |  |  |                 <i class="el-icon-plus" /> | 
			
		
	
		
			
				
					|  |  |  |               </span> | 
			
		
	
		
			
				
					|  |  |  |               <el-dropdown-menu slot="dropdown"> | 
			
		
	
		
			
				
					|  |  |  |                 <el-dropdown-item command="same">新增同级节点</el-dropdown-item> | 
			
		
	
		
			
				
					|  |  |  |                 <el-dropdown-item command="child">新增子级节点</el-dropdown-item> | 
			
		
	
		
			
				
					|  |  |  |               </el-dropdown-menu> | 
			
		
	
		
			
				
					|  |  |  |             </el-dropdown> | 
			
		
	
		
			
				
					|  |  |  |             <el-dropdown trigger="click" style="margin-left: 10px" @command="(command)=>handleNode(command,node,data)"> | 
			
		
	
		
			
				
					|  |  |  |               <span>···</span> | 
			
		
	
		
			
				
					|  |  |  |               <el-dropdown-menu slot="dropdown"> | 
			
		
	
		
			
				
					|  |  |  |                 <el-dropdown-item command="rename">重命名</el-dropdown-item> | 
			
		
	
		
			
				
					|  |  |  |                 <el-dropdown-item command="delete">删除</el-dropdown-item> | 
			
		
	
		
			
				
					|  |  |  |               </el-dropdown-menu> | 
			
		
	
		
			
				
					|  |  |  |             </el-dropdown> | 
			
		
	
		
			
				
					|  |  |  |           </span> | 
			
		
	
		
			
				
					|  |  |  |         </span> | 
			
		
	
		
			
				
					|  |  |  |       </span> | 
			
		
	
		
			
				
					|  |  |  |     </el-tree> | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     <div v-if="collectData.length"> | 
			
		
	
		
			
				
					|  |  |  |       <div style="text-align: center;padding-top: 32px"> | 
			
		
	
		
			
				
					|  |  |  |         <el-input v-model="remark" type="textarea" style="width: 180px;" size="small" clearable placeholder="请输入备注" /> | 
			
		
	
		
			
				
					|  |  |  |       </el-tree> | 
			
		
	
		
			
				
					|  |  |  |       <el-dialog width="30%" :modal="false" title="节点名称" :visible.sync="dialogFormVisible"> | 
			
		
	
		
			
				
					|  |  |  |         <el-input v-model="editName" /> | 
			
		
	
		
			
				
					|  |  |  |         <div slot="footer" class="dialog-footer"> | 
			
		
	
		
			
				
					|  |  |  |           <el-button @click="dialogFormVisible = false">取 消</el-button> | 
			
		
	
		
			
				
					|  |  |  |           <el-button type="primary" @click="confirmNode()">确 定</el-button> | 
			
		
	
		
			
				
					|  |  |  |         </div> | 
			
		
	
		
			
				
					|  |  |  |       </el-dialog> | 
			
		
	
		
			
				
					|  |  |  |     </div> | 
			
		
	
		
			
				
					|  |  |  |     <div> | 
			
		
	
		
			
				
					|  |  |  |       <div style="display:flex;text-align: center;padding: 16px"> | 
			
		
	
		
			
				
					|  |  |  |         <span>备注:</span> | 
			
		
	
		
			
				
					|  |  |  |         <el-input v-model="remark" style="flex: 1" type="textarea" resize="none" clearable placeholder="请输入备注" /> | 
			
		
	
		
			
				
					|  |  |  |       </div> | 
			
		
	
		
			
				
					|  |  |  |       <div style="text-align: center;padding-top: 16px"> | 
			
		
	
		
			
				
					|  |  |  |         <el-button style="width: 180px" type="primary" size="small" @click="handleAddPatient">保存</el-button> | 
			
		
	
		
			
				
					|  |  |  |       <div style="text-align: right;padding:0 16px 16px"> | 
			
		
	
		
			
				
					|  |  |  |         <el-button style="width: 180px" type="primary" size="small" @click="handleAddPatient">收藏当前患者</el-button> | 
			
		
	
		
			
				
					|  |  |  |       </div> | 
			
		
	
		
			
				
					|  |  |  |     </div> | 
			
		
	
		
			
				
					|  |  |  |   </div> | 
			
		
	
	
		
			
				
					|  |  | @ -60,20 +69,36 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |     patientIdNumber: { | 
			
		
	
		
			
				
					|  |  |  |       type: String, | 
			
		
	
		
			
				
					|  |  |  |       default: '' | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     platform: { | 
			
		
	
		
			
				
					|  |  |  |       type: String, | 
			
		
	
		
			
				
					|  |  |  |       default: '' | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     patientId: { | 
			
		
	
		
			
				
					|  |  |  |       type: String, | 
			
		
	
		
			
				
					|  |  |  |       default: '' | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |   }, | 
			
		
	
		
			
				
					|  |  |  |   data() { | 
			
		
	
		
			
				
					|  |  |  |     return { | 
			
		
	
		
			
				
					|  |  |  |       dialogFormVisible: false, | 
			
		
	
		
			
				
					|  |  |  |       remark: '', | 
			
		
	
		
			
				
					|  |  |  |       currentNumber: '', | 
			
		
	
		
			
				
					|  |  |  |       editName: '', | 
			
		
	
		
			
				
					|  |  |  |       collectProps: { | 
			
		
	
		
			
				
					|  |  |  |         // children: 'childs', | 
			
		
	
		
			
				
					|  |  |  |         // label: 'name' | 
			
		
	
		
			
				
					|  |  |  |       }, | 
			
		
	
		
			
				
					|  |  |  |       addParam: { | 
			
		
	
		
			
				
					|  |  |  |         id: 0, | 
			
		
	
		
			
				
					|  |  |  |         parentId: 0 | 
			
		
	
		
			
				
					|  |  |  |       }, | 
			
		
	
		
			
				
					|  |  |  |       doctorId: JSON.parse(window.localStorage.getItem('qg-userData')).id, | 
			
		
	
		
			
				
					|  |  |  |       collectData: [], | 
			
		
	
		
			
				
					|  |  |  |       tableData: [{ | 
			
		
	
		
			
				
					|  |  |  |         id: 1, | 
			
		
	
		
			
				
					|  |  |  |         label: '一级 1', | 
			
		
	
		
			
				
					|  |  |  |         isEdit: false, | 
			
		
	
		
			
				
					|  |  |  |         children: [{ | 
			
		
	
		
			
				
					|  |  |  |           id: 4, | 
			
		
	
		
			
				
					|  |  |  |           label: '二级 1-1', | 
			
		
	
	
		
			
				
					|  |  | @ -87,6 +112,7 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |         }] | 
			
		
	
		
			
				
					|  |  |  |       }, { | 
			
		
	
		
			
				
					|  |  |  |         id: 2, | 
			
		
	
		
			
				
					|  |  |  |         isEdit: false, | 
			
		
	
		
			
				
					|  |  |  |         label: '一级 2', | 
			
		
	
		
			
				
					|  |  |  |         children: [{ | 
			
		
	
		
			
				
					|  |  |  |           id: 5, | 
			
		
	
	
		
			
				
					|  |  | @ -97,6 +123,7 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |         }] | 
			
		
	
		
			
				
					|  |  |  |       }, { | 
			
		
	
		
			
				
					|  |  |  |         id: 3, | 
			
		
	
		
			
				
					|  |  |  |         isEdit: false, | 
			
		
	
		
			
				
					|  |  |  |         label: '一级 3', | 
			
		
	
		
			
				
					|  |  |  |         children: [{ | 
			
		
	
		
			
				
					|  |  |  |           id: 7, | 
			
		
	
	
		
			
				
					|  |  | @ -115,20 +142,123 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |   watch: { | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |   }, | 
			
		
	
		
			
				
					|  |  |  |   created() { | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |   async created() { | 
			
		
	
		
			
				
					|  |  |  |     this.initPatient() | 
			
		
	
		
			
				
					|  |  |  |   }, | 
			
		
	
		
			
				
					|  |  |  |   mounted() { | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |   }, | 
			
		
	
		
			
				
					|  |  |  |   methods: { | 
			
		
	
		
			
				
					|  |  |  |     // 初始化获取或者相关信息 | 
			
		
	
		
			
				
					|  |  |  |     initPatient() { | 
			
		
	
		
			
				
					|  |  |  |       this.findTree() | 
			
		
	
		
			
				
					|  |  |  |       this.queryPatientRemarks() | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     // 获取当前或者最新备注 | 
			
		
	
		
			
				
					|  |  |  |     async queryPatientRemarks() { | 
			
		
	
		
			
				
					|  |  |  |       const { data } = await this.$http.get('/tree/findTreeIsExistPatient', { | 
			
		
	
		
			
				
					|  |  |  |         params: { | 
			
		
	
		
			
				
					|  |  |  |           doctorId: this.doctorId, | 
			
		
	
		
			
				
					|  |  |  |           patientId: this.patientId, | 
			
		
	
		
			
				
					|  |  |  |           platform: this.platform | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |       }) | 
			
		
	
		
			
				
					|  |  |  |       console.log('备注', data) | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     // 查询树结构 | 
			
		
	
		
			
				
					|  |  |  |     async findTree() { | 
			
		
	
		
			
				
					|  |  |  |       const { data } = await this.$http.get(`/tree/findTree`, { | 
			
		
	
		
			
				
					|  |  |  |         params: { | 
			
		
	
		
			
				
					|  |  |  |           doctorId: JSON.parse(window.localStorage.getItem('qg-userData')).id, | 
			
		
	
		
			
				
					|  |  |  |           platform: this.platform | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |       }) | 
			
		
	
		
			
				
					|  |  |  |       console.log('树结构', data) | 
			
		
	
		
			
				
					|  |  |  |       // this.tableData = data | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     // 或者详情目录结构包含或者备注信息 | 
			
		
	
		
			
				
					|  |  |  |     // async patientTrees() { | 
			
		
	
		
			
				
					|  |  |  |     //   const { data } = await this.$http.get('/tree/findTreeIsExistPatient', { | 
			
		
	
		
			
				
					|  |  |  |     //     params: { | 
			
		
	
		
			
				
					|  |  |  |     //       doctorId: this.doctorId, | 
			
		
	
		
			
				
					|  |  |  |     //       patientId: this.patientId, | 
			
		
	
		
			
				
					|  |  |  |     //       platform: this.platform | 
			
		
	
		
			
				
					|  |  |  |     //     } | 
			
		
	
		
			
				
					|  |  |  |     //   }) | 
			
		
	
		
			
				
					|  |  |  |     //   console.log('详情目录', data) | 
			
		
	
		
			
				
					|  |  |  |     // }, | 
			
		
	
		
			
				
					|  |  |  |     searchRemark(data) { | 
			
		
	
		
			
				
					|  |  |  |       // this.treeId = data.id | 
			
		
	
		
			
				
					|  |  |  |       // this.remark = data.hisManagePatientEntity ? data.hisManagePatientEntity.remark : '' | 
			
		
	
		
			
				
					|  |  |  |       // this.remarkId = data.hisManagePatientEntity ? data.hisManagePatientEntity.id : '' | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     async handleAddPatient() { | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     handleAddPatient() { | 
			
		
	
		
			
				
					|  |  |  |       this.$http.post('/tree/addPatientTree', {}) | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     // 新增节点 | 
			
		
	
		
			
				
					|  |  |  |     addNode(command, node) { | 
			
		
	
		
			
				
					|  |  |  |       switch (command) { | 
			
		
	
		
			
				
					|  |  |  |         case 'same': | 
			
		
	
		
			
				
					|  |  |  |           this.dialogFormVisible = true | 
			
		
	
		
			
				
					|  |  |  |           this.addParam.id = node.id | 
			
		
	
		
			
				
					|  |  |  |           this.addParam.parentId = node.parent.id | 
			
		
	
		
			
				
					|  |  |  |           this.editName = node.name | 
			
		
	
		
			
				
					|  |  |  |           break | 
			
		
	
		
			
				
					|  |  |  |         case 'child': | 
			
		
	
		
			
				
					|  |  |  |           this.addParam.id = node.id | 
			
		
	
		
			
				
					|  |  |  |           this.addParam.parentId = node.parent.id | 
			
		
	
		
			
				
					|  |  |  |           this.editName = node.name | 
			
		
	
		
			
				
					|  |  |  |           break | 
			
		
	
		
			
				
					|  |  |  |         default: | 
			
		
	
		
			
				
					|  |  |  |           this.addParam.id = 0 | 
			
		
	
		
			
				
					|  |  |  |           this.addParam.parentId = 0 | 
			
		
	
		
			
				
					|  |  |  |           this.editName = '' | 
			
		
	
		
			
				
					|  |  |  |           break | 
			
		
	
		
			
				
					|  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     // 确定新增节点 | 
			
		
	
		
			
				
					|  |  |  |     async confirmNode() { | 
			
		
	
		
			
				
					|  |  |  |       const params = { | 
			
		
	
		
			
				
					|  |  |  |         createDate: new Date().getDate(), | 
			
		
	
		
			
				
					|  |  |  |         doctorId: this.doctorId, | 
			
		
	
		
			
				
					|  |  |  |         flag: '1', | 
			
		
	
		
			
				
					|  |  |  |         name: this.editName, | 
			
		
	
		
			
				
					|  |  |  |         platform: this.platform, | 
			
		
	
		
			
				
					|  |  |  |         weight: 1, | 
			
		
	
		
			
				
					|  |  |  |         ...this.addParam | 
			
		
	
		
			
				
					|  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |       await this.$http.post('/tree/addTree', params) | 
			
		
	
		
			
				
					|  |  |  |       await this.findTree() | 
			
		
	
		
			
				
					|  |  |  |       this.dialogFormVisible = false | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     handleNode(command, node, data) { | 
			
		
	
		
			
				
					|  |  |  |       if (command === 'delete') { | 
			
		
	
		
			
				
					|  |  |  |         this.deleteNode(node, data) | 
			
		
	
		
			
				
					|  |  |  |       } else { | 
			
		
	
		
			
				
					|  |  |  |         this.editNode(node, data) | 
			
		
	
		
			
				
					|  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     // 删除树节点 | 
			
		
	
		
			
				
					|  |  |  |     deleteNode(node, data) { | 
			
		
	
		
			
				
					|  |  |  |       this.addParam.id = node.id | 
			
		
	
		
			
				
					|  |  |  |       this.addParam.parentId = node.parent.id | 
			
		
	
		
			
				
					|  |  |  |       const params = { | 
			
		
	
		
			
				
					|  |  |  |         createDate: new Date().getDate(), | 
			
		
	
		
			
				
					|  |  |  |         doctorId: this.doctorId, | 
			
		
	
		
			
				
					|  |  |  |         flag: '1', | 
			
		
	
		
			
				
					|  |  |  |         name: data.label, | 
			
		
	
		
			
				
					|  |  |  |         platform: this.platform, | 
			
		
	
		
			
				
					|  |  |  |         weight: 1, | 
			
		
	
		
			
				
					|  |  |  |         ...this.addParam | 
			
		
	
		
			
				
					|  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |       this.$http.post('/tree/deleteTree', params) | 
			
		
	
		
			
				
					|  |  |  |       this.findTree() | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     // 重命名 | 
			
		
	
		
			
				
					|  |  |  |     editNode(node, data) { | 
			
		
	
		
			
				
					|  |  |  |       this.dialogFormVisible = true | 
			
		
	
		
			
				
					|  |  |  |       this.editName = node.label | 
			
		
	
		
			
				
					|  |  |  |       this.findTree() | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
	
		
			
				
					|  |  | @ -137,6 +267,14 @@ export default { | 
			
		
	
		
			
				
					|  |  |  | <style lang="scss" scoped> | 
			
		
	
		
			
				
					|  |  |  | .collection { | 
			
		
	
		
			
				
					|  |  |  |   width: 600px; | 
			
		
	
		
			
				
					|  |  |  |   display: flex; | 
			
		
	
		
			
				
					|  |  |  |   flex-direction: column; | 
			
		
	
		
			
				
					|  |  |  |   justify-content: space-between; | 
			
		
	
		
			
				
					|  |  |  |   .collection_title{ | 
			
		
	
		
			
				
					|  |  |  |     font-size: 16px; | 
			
		
	
		
			
				
					|  |  |  |     font-weight: bold; | 
			
		
	
		
			
				
					|  |  |  |     padding: 18px; | 
			
		
	
		
			
				
					|  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  |   .cell-cursor { | 
			
		
	
		
			
				
					|  |  |  |     cursor: pointer; | 
			
		
	
		
			
				
					|  |  |  |     color: #1e79ff; | 
			
		
	
	
		
			
				
					|  |  | @ -144,5 +282,8 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |   .table-column-disable { | 
			
		
	
		
			
				
					|  |  |  |     color: #dddd; | 
			
		
	
		
			
				
					|  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  |   ::v-deep .el-textarea__inner{ | 
			
		
	
		
			
				
					|  |  |  |     height: 164px; | 
			
		
	
		
			
				
					|  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
		
			
				
					|  |  |  | </style> | 
			
		
	
	
		
			
				
					|  |  | 
 |