From 479b4e3a2577e1e79957714bafc0e11d111f717d Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 24 Dec 2020 18:21:43 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=A8=A1=E5=9D=97=F0=9F=8C=B2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8A=82=E7=82=B9=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/business/components/track/common/NodeTree.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/business/components/track/common/NodeTree.vue b/frontend/src/business/components/track/common/NodeTree.vue index fd90d244f9..780e71797a 100644 --- a/frontend/src/business/components/track/common/NodeTree.vue +++ b/frontend/src/business/components/track/common/NodeTree.vue @@ -22,7 +22,7 @@ - + @@ -164,8 +164,9 @@ export default { } data.children.push(newChild); this.edit(node, newChild); + node.expanded = true; this.$nextTick(() => { - this.$refs.tree.setCurrentKey(data.id); + this.$refs.nameInput.focus(); }); }, save(node, data) { @@ -187,6 +188,10 @@ export default { this.$set(data, 'isEdit', false); }, remove(node, data) { + if (data.label === undefined) { + this.$refs.tree.remove(node); + return; + } let tip = '确定删除节点 ' + data.label + ' 及其子节点下所有资源' + '?'; // let info = this.$t("test_track.module.delete_confirm") + data.label + "," + this.$t("test_track.module.delete_all_resource") + "?"; this.$alert(tip, "", {