资产结构测试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,149 +1,136 @@
<template>
<div>
<el-container>
<el-aside>
<el-tree :data="assetStructureList"
:expand-on-click-node="false"
:load="expandTable"
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-main>
<h1>整体数据资产结构概述</h1>
</el-main>
</el-container>
</div>
<div>
<el-container style="height: 1000px">
<el-aside>
<el-tree :data="assetStructureList"
:props="defaultProps"
@node-click="handleNodeClick"></el-tree>
</el-aside>
<el-main>
<AssetsBasic :infoOpen="infoOpen" :fundDataNum="fundDataNum"></AssetsBasic>
<AssetsModel v-if="infoOpen" :info="tableInfoForm" :list="tableInfoList"></AssetsModel>
</el-main>
</el-container>
</div>
</template>
<script>
//jsjsjson,
//import from ',
import {getTableTree} from "@/api/etl/etl";
import data from "@/views/system/dict/data.vue";
import {getTableTree} from "@/api/etl/etl";
import AssetsBasic from "@/views/etl/construction/AssetsBasic.vue";
import AssetsModel from "@/views/etl/construction/AssetsModel.vue";
export default {
//import使"
name:'construction',
name:'construction',
components:{AssetsModel, AssetsBasic },
data() {
//"
return {
childrenList: [],
assetStructureList: [],
defaultProps: {
children: 'children',
label: 'tableName'
}
};
return {
//
title: null,
//
infoOpen: false,
//
tableInfoForm:{},
//
tableInfoList:[],
//
fundDataNum:{
basicNum: null,
tableNum: null,
structureNum: null,
},
childrenList: [],
assetStructureList: [],
defaultProps: {
children: 'children',
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() {
this.getList()
this.getList()
},
// - 访DOM",
mounted() {
},
beforeCreate() {
}, // - ",
beforeMount() {
}, // - ",
beforeUpdate() {
}, // - ",
updated() {
}, // - ",
beforeDestroy() {
}, // - ",
destroyed() {
}, // - ",
activated() {
} //keep-alive",
};
methods: {
//
getList(){
this.fundDataNum ={
basicNum: 0,
tableNum: 0,
structureNum: 0,
},
//
getTableTree().then(response => {
this.data = []
response.data.forEach(data => {
//
this.fundDataNum.basicNum+=1
let child = [];
let info = data.basicConfigInfo;
data.children.forEach(tableInfo => {
//
this.fundDataNum.tableNum +=1
//
this.fundDataNum.structureNum+=tableInfo.structureList.length
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>
<style scoped>
<style>
.el-aside{
background-color: #ccb1ea;
color: #f4516c;
text-align: center;
line-height: 100%;
.el-aside {
background-color: #ffffff;
color: #333;
text-align: center;
line-height: 100%;
}
.el-main{
background-color: #ccb1ea;
color: #f4516c;
text-align: center;
line-height: 100%;
.el-main {
background-color: #E9EEF3;
color: #333;
text-align: center;
line-height: 100%;
}
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>