From 531b6d25d21474f8df88bd484b901111e048837d Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期一, 06 二月 2023 18:40:41 +0800 Subject: [PATCH] 接口请求时间判断 --- src/views/datamanage/catalogueManage.vue | 23 ++++++++++++++++------- 1 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/views/datamanage/catalogueManage.vue b/src/views/datamanage/catalogueManage.vue index 2dc5485..1a79c33 100644 --- a/src/views/datamanage/catalogueManage.vue +++ b/src/views/datamanage/catalogueManage.vue @@ -237,6 +237,7 @@ old_dirDat: [], //el鏍戞暟鎹�(鎷栧姩鍓�) newData: [], //鎷栧姩鍚庡師濮嬫暟鎹� itemdetail: {}, + itemaName: null, backUpData: '', formLabelWidth: '150px', delChildID: '', @@ -271,13 +272,18 @@ this.oriData = res.result; this.newData = res.result; this.dirList = this.treeData(res.result); + // this.$nextTick(() => { - if (this.itemdetail.id != null) { + // this.expandData=[15] + // this.$refs.tree.setCurrentKey(15); + + // }); + if (this.itemaName != null) { this.$nextTick(() => { - // this.expandData=[1] - // this.$refs.tree.setCurrentKey(this.itemdetail.id); - // document.getElementById(this.itemdetail.id).click(); + this.expandData = [this.itemaName] + this.$refs.tree.setCurrentKey(this.itemaName); + }); } @@ -378,12 +384,10 @@ if (res == 1) {//鏂板鍚岀骇 id = this.itemdetail.pid; orderNum = this.getMaxOrderNum(this.newNode.parent.childNodes) - lever = this.itemdetail.level; } else if (res == 2) {//鏂板瀛愮骇 id = this.itemdetail.id; orderNum = this.getMaxOrderNum(this.newNode.childNodes) - lever = this.itemdetail.level + 1; } @@ -428,12 +432,13 @@ .then((res) => { setTimeout(() => { this.fullscreenLoading = false; + if (res.code == 200) { this.$message({ message: '娣诲姞鎴愬姛', type: 'success', }); - + this.itemaName = res.result; this.itemdetail = {}; this.ruleForm = {}; this.dialogFormVisible = false; @@ -456,6 +461,8 @@ }); }, remove(node, data) { + this.itemaName =node.parent.data.id; + this.$confirm('姝ゆ搷浣滃皢鍒犻櫎璇ヨ妭鐐�, 鏄惁缁х画?', '鎻愮ず', { confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', @@ -484,6 +491,7 @@ message: '鍒犻櫎鎴愬姛!', }); this.itemdetail = {}; + this.getDirTree(); } else if (res[0].code == 200) { this.$message.error('鍒犻櫎鎴愬姛锛屼綅缃皟鏁村け璐�'); @@ -601,6 +609,7 @@ }, handleNodeClick(data, node) { // console.log(data); + this.newNode = node; this.backUpData = JSON.stringify(data); this.itemdetail = JSON.parse(JSON.stringify(data)); -- Gitblit v1.9.3