From 3f5e885e82953d55cb808624800f302886a11777 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期五, 21 一月 2022 14:10:49 +0800 Subject: [PATCH] 目录默认节点被删除时,重置默认节点为根节点 --- web_src/src/components/dialog/chooseChannelForCatalog.vue | 31 ++++++++++++++++--------------- 1 files changed, 16 insertions(+), 15 deletions(-) diff --git a/web_src/src/components/dialog/chooseChannelForCatalog.vue b/web_src/src/components/dialog/chooseChannelForCatalog.vue index 89fa32b..4e4339f 100644 --- a/web_src/src/components/dialog/chooseChannelForCatalog.vue +++ b/web_src/src/components/dialog/chooseChannelForCatalog.vue @@ -121,25 +121,23 @@ node.loaded = false node.expand(); }, - refreshCatalogById: function (id, nodeIds) { + refreshCatalogById: function (id) { if (id) { - console.log("refreshCatalogById: " + id) let node = this.$refs.tree.getNode(id); - console.log(node) this.refreshCatalog(node); } - if (nodeIds !== null) { - let refreshNode = {} - for (let i = 0; i < nodeIds.length; i++) { - let node = this.$refs.tree.getNode(nodeIds[i]); - refreshNode[node.parent.data.id] = node.parent - } - if (Object.values(refreshNode).length > 0) { - for (let j = 0; j < Object.values(refreshNode).length; j++) { - this.refreshCatalog(Object.values(refreshNode)[j]); - } - } - } + // if (nodeIds !== null) { + // let refreshNode = {} + // for (let i = 0; i < nodeIds.length; i++) { + // let node = this.$refs.tree.getNode(nodeIds[i]); + // refreshNode[node.parent.data.id] = node.parent + // } + // if (Object.values(refreshNode).length > 0) { + // for (let j = 0; j < Object.values(refreshNode).length; j++) { + // this.refreshCatalog(Object.values(refreshNode)[j]); + // } + // } + // } }, editCatalog: function (data, node){ let that = this; @@ -163,6 +161,9 @@ console.log("绉婚櫎鎴愬姛") node.parent.loaded = false node.parent.expand(); + if(this.defaultCatalogId === id) { + this.defaultCatalogId = this.platformId; + } } }) .catch(function (error) { -- Gitblit v1.8.0