资产结构测试3

etl-xin
xiaohuang 2024-04-25 09:07:32 +08:00
parent 7e007403c9
commit 61b5b344eb
1 changed files with 116 additions and 129 deletions

View File

@ -1,131 +1,130 @@
<template> <template>
<div> <div>
<el-container> <el-container style="height: 1000px">
<el-aside> <el-aside>
<el-tree :data="assetStructureList" <el-tree :data="assetStructureList"
:expand-on-click-node="false" :props="defaultProps"
:load="expandTable" @node-click="handleNodeClick"></el-tree>
lazy
@node-click=""
:props="defaultProps">
<!-- <div class="custom-tree-node" slot-scope="{ node, data }">-->
<!-- <div v-if="data.info.type !== null">{{ data.info.dataResourceName + '('+data.info.databaseName + '-' + data.info.dataSourcesSystemName+')' }}</div>-->
<!-- <div v-if="data.info.type === null">{{ data.tableName + '-'+data.tableRemark + '(' + data.dataNum+')' }}</div>-->
<!-- </div>-->
</el-tree>
</el-aside> </el-aside>
<el-main> <el-main>
<h1>整体数据资产结构概述</h1> <AssetsBasic :infoOpen="infoOpen" :fundDataNum="fundDataNum"></AssetsBasic>
<AssetsModel v-if="infoOpen" :info="tableInfoForm" :list="tableInfoList"></AssetsModel>
</el-main> </el-main>
</el-container> </el-container>
</div> </div>
</template> </template>
<script> <script>
//jsjsjson,
//import from ', import {getTableTree} from "@/api/etl/etl";
import {getTableTree} from "@/api/etl/etl"; import AssetsBasic from "@/views/etl/construction/AssetsBasic.vue";
import data from "@/views/system/dict/data.vue"; import AssetsModel from "@/views/etl/construction/AssetsModel.vue";
export default { export default {
//import使"
name:'construction', name:'construction',
components:{AssetsModel, AssetsBasic },
data() { data() {
//"
return { return {
//
title: null,
//
infoOpen: false,
//
tableInfoForm:{},
//
tableInfoList:[],
//
fundDataNum:{
basicNum: null,
tableNum: null,
structureNum: null,
},
childrenList: [], childrenList: [],
assetStructureList: [], assetStructureList: [],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'tableName' label: 'tableName'
} },
}; };
}, },
// data",
computed: {
data() {
return data
}
},
//data",
watch: {},
//",
methods: {
getList(){
getTableTree().then(response =>{
this.data = []
response.data.forEach(data => {
let info = data.basicConfigInfo
this.assetStructureList.push({
'info':info,
'table': info.dataResourceName+"("+info.dataSourcesSystemName+")",
'children':data.children
})
})
console.log(this.assetStructureList)
})
},
expandTable(node,resolve){
if (node.level === 0) return resolve(this.assetStructureList);
const {data} = node;
this.showAssets = data.type;
if (data.type === null){
return resolve([])
}
setTimeout(() => {
resolve(this.childrenList)
},500);
}
},
// - 访this",
created() { created() {
this.getList() this.getList()
}, },
// - 访DOM", methods: {
mounted() { //
getList(){
this.fundDataNum ={
basicNum: 0,
tableNum: 0,
structureNum: 0,
}, },
beforeCreate() { //
}, // - ", getTableTree().then(response => {
beforeMount() { this.data = []
}, // - ", response.data.forEach(data => {
beforeUpdate() { //
}, // - ", this.fundDataNum.basicNum+=1
updated() { let child = [];
}, // - ", let info = data.basicConfigInfo;
beforeDestroy() { data.children.forEach(tableInfo => {
}, // - ", //
destroyed() { this.fundDataNum.tableNum +=1
}, // - ", //
activated() { this.fundDataNum.structureNum+=tableInfo.structureList.length
} //keep-alive", child.push({
}; 'tableName':tableInfo.tableName,
'info':tableInfo
})
})
//
this.assetStructureList.push({
'info':info,
'tableName': info.dataResourceName+'('+info.databaseName+'-'+info.dataSourcesSystemName+')',
'children':child,
})
})
})
console.log(this.assetStructureList)
},
//
handleNodeClick(data) {
//assetStructureList
let info = this.assetStructureList.find(assent =>
assent.info.id === data.info.id
)
this.infoOpen = true
//infoForm
this.tableInfoForm = data
//form list
if (info !== undefined){
this.tableInfoList = data.children
this.tableInfoForm = data.children[0]
}else {
info = this.assetStructureList.find(assent =>
assent.info.id === this.tableInfoForm.info.basicId
)
this.tableInfoList = info.children
}
// console.log('tableList')
// console.log(this.tableInfoList)
// console.log('tableForm')
// console.log(this.tableInfoForm)
},
}
};
</script> </script>
<style scoped> <style>
.el-aside{ .el-aside {
background-color: #ccb1ea; background-color: #ffffff;
color: #f4516c; color: #333;
text-align: center; text-align: center;
line-height: 100%; line-height: 100%;
} }
.el-main{ .el-main {
background-color: #ccb1ea; background-color: #E9EEF3;
color: #f4516c; color: #333;
text-align: center; text-align: center;
line-height: 100%; line-height: 100%;
} }
@ -134,16 +133,4 @@ body > .el-container {
margin-bottom: 40px; margin-bottom: 40px;
} }
.el-container:nth-child(5).el-aside,
.el-container:nth-child(6).el-aside{
line-height: 260px;
}
.el-container:nth-child(7).el-aside{
line-height: 320px;
}
</style> </style>