feat(): 点击树形列表的表出现表详情
parent
37b6a43c62
commit
0c308623db
|
@ -21,6 +21,9 @@
|
||||||
<OverallAssets v-if="showAssets == null" :assetStructureDataCount="assetStructureDataCount"/>
|
<OverallAssets v-if="showAssets == null" :assetStructureDataCount="assetStructureDataCount"/>
|
||||||
<overall-specific-assets v-if="showAssets === 'dataSource'" :title="title"
|
<overall-specific-assets v-if="showAssets === 'dataSource'" :title="title"
|
||||||
:structureTableDataCount="structureTableDataCount"/>
|
:structureTableDataCount="structureTableDataCount"/>
|
||||||
|
<overall-asset-structure v-if="showAssets === 'dataTable'" :assetTableDetailsList="assetTableDetailsList" :tableName="tableName"
|
||||||
|
:tableNameAnnotation="tableNameAnnotation"
|
||||||
|
:tableDataCount="tableDataCount" :title="title"/>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
@ -29,10 +32,11 @@
|
||||||
import {listAssetStructure, selectAssetSouructureTableList} from "@/api/data/structure";
|
import {listAssetStructure, selectAssetSouructureTableList} from "@/api/data/structure";
|
||||||
import OverallAssets from "@/views/data/structure/dashlboard/OverallAssets.vue";
|
import OverallAssets from "@/views/data/structure/dashlboard/OverallAssets.vue";
|
||||||
import OverallSpecificAssets from "@/views/data/structure/dashlboard/OverallSpecificAssets.vue";
|
import OverallSpecificAssets from "@/views/data/structure/dashlboard/OverallSpecificAssets.vue";
|
||||||
|
import OverallAssetStructure from "@/views/data/structure/dashlboard/OverallAssetStructure.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'assetStructure',
|
name: 'assetStructure',
|
||||||
components: {OverallSpecificAssets, OverallAssets},
|
components: {OverallAssetStructure, OverallSpecificAssets, OverallAssets},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
mainHeight: window.innerHeight - 85,
|
mainHeight: window.innerHeight - 85,
|
||||||
|
@ -47,6 +51,10 @@ export default {
|
||||||
|
|
||||||
showAssets: null,
|
showAssets: null,
|
||||||
title: null,
|
title: null,
|
||||||
|
tableName: null,
|
||||||
|
tableNameAnnotation: null,
|
||||||
|
tableDataCount: null,
|
||||||
|
assetTableDetailsList: null,
|
||||||
// 数据接入数量
|
// 数据接入数量
|
||||||
assetStructureDataCount: {
|
assetStructureDataCount: {
|
||||||
dataCount: null,
|
dataCount: null,
|
||||||
|
@ -98,31 +106,40 @@ export default {
|
||||||
|
|
||||||
// 从节点信息对象中解构出 data 属性
|
// 从节点信息对象中解构出 data 属性
|
||||||
const {data} = node;
|
const {data} = node;
|
||||||
/*
|
/*
|
||||||
// 异步调用 selectAssetSouructureTableList API 函数,传入当前节点的 id 作为参数
|
// 异步调用 selectAssetSouructureTableList API 函数,传入当前节点的 id 作为参数
|
||||||
selectAssetSouructureTableList(data.id).then((response) => {
|
selectAssetSouructureTableList(data.id).then((response) => {
|
||||||
// 打印 API 返回的响应数据
|
// 打印 API 返回的响应数据
|
||||||
// console.log(response);
|
// console.log(response);
|
||||||
|
|
||||||
// 将 API 返回的 data 属性赋值给 this.childrenList
|
// 将 API 返回的 data 属性赋值给 this.childrenList
|
||||||
this.childrenList = response.data.assetStructureList;
|
this.childrenList = response.data.assetStructureList;
|
||||||
|
|
||||||
// 遍历 this.childrenList,为每个元素添加 type 属性,值为 "dataTable"
|
// 遍历 this.childrenList,为每个元素添加 type 属性,值为 "dataTable"
|
||||||
this.childrenList.forEach((item) => {
|
this.childrenList.forEach((item) => {
|
||||||
item.type = "dataTable";
|
item.type = "dataTable";
|
||||||
});
|
});
|
||||||
|
|
||||||
this.structureTableDataCount.tableCount = response.data.tableCount
|
this.structureTableDataCount.tableCount = response.data.tableCount
|
||||||
this.structureTableDataCount.tableDataCount = response.data.tableDataCount
|
this.structureTableDataCount.tableDataCount = response.data.tableDataCount
|
||||||
this.structureTableDataCount.childrenList = this.childrenList
|
this.structureTableDataCount.childrenList = this.childrenList
|
||||||
|
|
||||||
// 调用 resolve 函数,传递处理后的 this.childrenList 作为子节点数据
|
// 调用 resolve 函数,传递处理后的 this.childrenList 作为子节点数据
|
||||||
resolve(this.childrenList);
|
resolve(this.childrenList);
|
||||||
});*/
|
});*/
|
||||||
|
|
||||||
// 如果当前节点的数据类型为 "dataTable",返回空数组,不加载任何子节点
|
// 如果当前节点的数据类型为 "dataTable",返回空数组,不加载任何子节点
|
||||||
if (data.type === 'dataTable') {
|
if (data.type === 'dataTable') {
|
||||||
return resolve([]);
|
this.tableName = data.tableName,
|
||||||
|
this.tableNameAnnotation = data.tableNameAnnotation,
|
||||||
|
this.tableDataCount = data.tableDataCount
|
||||||
|
this.childrenList.forEach(item => {
|
||||||
|
if (item.tableName === this.tableName){
|
||||||
|
this.assetTableDetailsList = item.assetTableDetailsList
|
||||||
|
}
|
||||||
|
return
|
||||||
|
})
|
||||||
|
return resolve([])
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果当前节点级别大于 1,返回空数组,不加载任何子节点
|
// 如果当前节点级别大于 1,返回空数组,不加载任何子节点
|
||||||
|
@ -159,6 +176,12 @@ export default {
|
||||||
this.structureTableDataCount.childrenList = this.childrenList
|
this.structureTableDataCount.childrenList = this.childrenList
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (data.type === "dataTable") {
|
||||||
|
this.tableParams = {
|
||||||
|
tableName: data.name,
|
||||||
|
tableAsName: data.as
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue