From 0174dc8159b9f4bb28fc82c8da1bb2f5ee6430d4 Mon Sep 17 00:00:00 2001 From: bianyaqi Date: Tue, 15 Aug 2023 11:21:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=91=E7=BB=84=E4=BB=B6=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 4 ++-- src/components/360View/collection.vue | 31 ++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/public/index.html b/public/index.html index 13c0c29..24877b8 100644 --- a/public/index.html +++ b/public/index.html @@ -39,8 +39,8 @@ <% if (process.env.VUE_APP_NODE_ENV === 'dev') { %> <% } %> diff --git a/src/components/360View/collection.vue b/src/components/360View/collection.vue index aa09217..dfc6526 100644 --- a/src/components/360View/collection.vue +++ b/src/components/360View/collection.vue @@ -14,11 +14,15 @@ 新增节点 - + {{ node.label }} @@ -32,8 +36,7 @@ 新增子级节点 - - + ··· 编辑 @@ -103,11 +106,13 @@ export default { }, data() { return { + defaultExpandIds: [], keyword: '', dialogFormVisible: false, remarkDialog: false, remark: '', curNode: '', + curExpand: '', editName: '', editRemark: '', editMessage: '新增成功', @@ -180,7 +185,7 @@ export default { searchPatient() { this.$http.get('/tree/findCollectPatient', { params: { - doctorld: this.doctorId, + doctorId: this.doctorId, platform: this.platform, queryStr: this.keyword } @@ -236,8 +241,9 @@ export default { } }) }, - levelClick(data) { + levelClick(data, node) { this.curNode = data + this.curExpand = node this.remark = data.remark || '' this.tableData = data.treePatientVoList }, @@ -371,6 +377,21 @@ export default { this.editMessage = '重命名成功!' this.addParam.id = data.id 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) + } } } }