From a9b7d706e0db37c2f23602744c70a19c5bf3cef4 Mon Sep 17 00:00:00 2001 From: chao <3072464591@QQ.com> Date: Wed, 24 Apr 2024 19:15:21 +0800 Subject: [PATCH] =?UTF-8?q?fix():=20=E8=B5=84=E4=BA=A7=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E6=A6=82=E8=BF=B0=E7=BB=9F=E8=AE=A1=E6=95=B0=E9=87=8F=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=85=B6=E4=BB=96=E6=95=B0=E9=87=8F=E4=B8=8D=E6=94=B9?= =?UTF-8?q?=E5=8F=98BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/data/structure/index.vue | 45 +++++++++++++++--------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/src/views/data/structure/index.vue b/src/views/data/structure/index.vue index 13c2046..5dc5068 100644 --- a/src/views/data/structure/index.vue +++ b/src/views/data/structure/index.vue @@ -96,29 +96,6 @@ export default { // 从节点信息对象中解构出 data 属性 const {data} = node; - - // 异步调用 selectAssetSouructureTableList API 函数,传入当前节点的 id 作为参数 - selectAssetSouructureTableList(data.id).then((response) => { - // 打印 API 返回的响应数据 - // console.log(response); - - // 将 API 返回的 data 属性赋值给 this.childrenList - this.childrenList = response.data.assetStructureList; - - // 遍历 this.childrenList,为每个元素添加 type 属性,值为 "dataTable" - this.childrenList.forEach((item) => { - item.type = "dataTable"; - }); - - this.structureTableDataCount.tableCount = response.data.tableCount - this.structureTableDataCount.tableDataCount = response.data.tableDataCount - - console.log(this.structureTableDataCount) - - // 调用 resolve 函数,传递处理后的 this.childrenList 作为子节点数据 - resolve(this.childrenList); - }); - // 如果当前节点的数据类型为 "dataTable",返回空数组,不加载任何子节点 if (data.type === 'dataTable') { return resolve([]); @@ -139,6 +116,28 @@ export default { showAssetsFun(data){ this.title = data.dataSourceName + '('+data.dataSourceDatabaseName + '-' + data.dataSourceSystemName+')' this.showAssets = data.type; + // 异步调用 selectAssetSouructureTableList API 函数,传入当前节点的 id 作为参数 + selectAssetSouructureTableList(data.id).then((response) => { + // 打印 API 返回的响应数据 + // console.log(response); + + // 将 API 返回的 data 属性赋值给 this.childrenList + this.childrenList = response.data.assetStructureList; + + // 遍历 this.childrenList,为每个元素添加 type 属性,值为 "dataTable" + this.childrenList.forEach((item) => { + item.type = "dataTable"; + }); + + this.structureTableDataCount.tableCount = response.data.tableCount + this.structureTableDataCount.tableDataCount = response.data.tableDataCount + + + console.log(this.structureTableDataCount) + + // 调用 resolve 函数,传递处理后的 this.childrenList 作为子节点数据 + resolve(this.childrenList); + }); } } }