From eb3219f4b61447739c38c447fe84f71b88b5925a Mon Sep 17 00:00:00 2001 From: bianyaqi Date: Tue, 15 Aug 2023 14:59:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=97=85=E5=8E=86=E6=94=B6=E9=9B=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/360View/collection.vue | 40 ++++++++++++--------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/src/components/360View/collection.vue b/src/components/360View/collection.vue index dfc6526..c1a6f48 100644 --- a/src/components/360View/collection.vue +++ b/src/components/360View/collection.vue @@ -14,7 +14,6 @@ 新增节点 - + {{ node.label }} @@ -57,6 +56,7 @@
关键词搜索:
+ @@ -112,7 +112,6 @@ export default { remarkDialog: false, remark: '', curNode: '', - curExpand: '', editName: '', editRemark: '', editMessage: '新增成功', @@ -156,7 +155,7 @@ export default { initPatient() { this.queryPatientRemarks() }, - // 获取当前或者最新备注 + // 初始化树 async queryPatientRemarks() { const { data } = await this.$http.get('/tree/findTreeIsExistPatient', { params: { @@ -166,20 +165,6 @@ export default { } }) this.collectData = data.data - this.findCurTableData(this.collectData) - }, - findCurTableData(collectData) { - collectData.forEach(item => { - if (!item.childs) { - item.childs = [] - } - if (this.curNode.id === item.id) { - this.curNode = item - this.tableData = item.treePatientVoList - } else { - this.findCurTableData(item.childs) - } - }) }, // 搜索患者 searchPatient() { @@ -202,7 +187,7 @@ export default { }).then(res => { if (res.data.code === 0) { this.$message.success('删除成功!') - this.queryPatientRemarks() + this.queryCurPatient() } else { this.$message.error(res.data.msg) } @@ -241,11 +226,20 @@ export default { } }) }, - levelClick(data, node) { + levelClick(data) { this.curNode = data - this.curExpand = node this.remark = data.remark || '' - this.tableData = data.treePatientVoList + this.queryCurPatient() + }, + queryCurPatient() { + this.$http.get('tree/findPatientTree', { + params: { + platform: this.platform, + treeId: this.curNode.id + } + }).then(res => { + this.tableData = res.data.data.list + }) }, // 收藏患者 handleAddPatient() { @@ -265,7 +259,7 @@ export default { message: this.editMessage, type: 'success' }) - this.queryPatientRemarks() + this.queryCurPatient() } else { this.$message.error(res.data.msg) }