From 637b49c6e31459acb322a04be43eafea4d82d6d5 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 9 Aug 2021 18:03:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AF=BC=E5=85=A5=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/api.js | 3 --- src/views/data/Framework.vue | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/utils/api.js b/src/utils/api.js index 8a39b91..d632892 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -1,8 +1,5 @@ let host = 'http://39.108.250.202:9000' -if(process.env.NODE_ENV === 'development'){ - host = 'http://192.168.31.216:9000' -} let host1 = 'http://192.168.31.216:9000'//榕 let host2 = 'http://192.168.31.125:9000'//林 // let host = 'http://192.168.31.137:9000'// 陈赓 diff --git a/src/views/data/Framework.vue b/src/views/data/Framework.vue index 19a4ff8..d46a1c5 100644 --- a/src/views/data/Framework.vue +++ b/src/views/data/Framework.vue @@ -319,6 +319,18 @@ export default { } }) }, + renderChecked(){ + let result = [] + let list = this.$refs.typeTree.getCheckedNodes() + list.map((n,i) => { + if(n.tableLen && n.tableLen > n.children.length){ + result = [...result,...n.children.map(n => n.id)] + }else{ + result.push(n.id) + } + }) + this.$refs.typeTree.setCheckedKeys(result) + }, loadType(e){ clearTimeout(this.typeTimer) let typeTree = this.$refs.typeTreeWrap @@ -328,7 +340,7 @@ export default { this.getMoreTable(this.importTypeList,this.curExpand) setTimeout(() => { this.$nextTick(() => { - this.$refs.typeTree.setCheckedKeys(this.defaultTypeChecked) + this.renderChecked() }) },300) } @@ -431,7 +443,7 @@ export default { }, importTypeExpand(obj,node,com){ this.curExpand = obj.id - this.$refs.typeTree.setCheckedKeys(this.defaultTypeChecked) + this.renderChecked() }, closeImport(){ this.$refs.typeTree.setCheckedKeys([])