资产结构测试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> <template>
<div> <div>
<el-container> <el-container style="height: 1000px">
<el-aside>
<el-aside> <el-tree :data="assetStructureList"
<el-tree :data="assetStructureList" :props="defaultProps"
:expand-on-click-node="false" @node-click="handleNodeClick"></el-tree>
:load="expandTable" </el-aside>
lazy <el-main>
@node-click="" <AssetsBasic :infoOpen="infoOpen" :fundDataNum="fundDataNum"></AssetsBasic>
:props="defaultProps"> <AssetsModel v-if="infoOpen" :info="tableInfoForm" :list="tableInfoList"></AssetsModel>
<!-- <div class="custom-tree-node" slot-scope="{ node, data }">--> </el-main>
<!-- <div v-if="data.info.type !== null">{{ data.info.dataResourceName + '('+data.info.databaseName + '-' + data.info.dataSourcesSystemName+')' }}</div>--> </el-container>
<!-- <div v-if="data.info.type === null">{{ data.tableName + '-'+data.tableRemark + '(' + data.dataNum+')' }}</div>--> </div>
<!-- </div>-->
</el-tree>
</el-aside>
<el-main>
<h1>整体数据资产结构概述</h1>
</el-main>
</el-container>
</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,
//
childrenList: [], infoOpen: false,
assetStructureList: [], //
tableInfoForm:{},
//
defaultProps: { tableInfoList:[],
children: 'children', //
label: 'tableName' 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() { created() {
this.getList() this.getList()
}, },
// - 访DOM", methods: {
mounted() { //
}, getList(){
beforeCreate() { this.fundDataNum ={
}, // - ", basicNum: 0,
beforeMount() { tableNum: 0,
}, // - ", structureNum: 0,
beforeUpdate() { },
}, // - ", //
updated() { getTableTree().then(response => {
}, // - ", this.data = []
beforeDestroy() { response.data.forEach(data => {
}, // - ", //
destroyed() { this.fundDataNum.basicNum+=1
}, // - ", let child = [];
activated() { let info = data.basicConfigInfo;
} //keep-alive", 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> </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%;
} }
body > .el-container { 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>