feat:数据展示

master_fei
Yunfei Du 2024-05-14 22:12:10 +08:00
parent 2045889bb1
commit 5a40ef2005
4 changed files with 78 additions and 74 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<el-container :style="{height: mainHeight + 'px'}"> <el-container :style="{height: mainHeight + 'px'}">
<el-aside> <el-aside>
<el-tree style="background-color: white" :data="sourceList" :props="defaultProps" @node-click="handleNodeClick"></el-tree> <el-tree lazy :load="expandTable" style="background-color: white" :data="sourceList" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</el-aside> </el-aside>
<el-container> <el-container>
<el-main> <el-main>
@ -54,9 +54,11 @@
<script> <script>
import {dataAssetList, listSource, structureList} from "@/api/dataSource/source";
import DataSourceShow from "@/views/dataSource/assetShow/modules/dataSourceShow.vue";
import DataAssetShow from "@/views/dataSource/assetShow/modules/dataAssetShow.vue"; import DataAssetShow from "@/views/dataSource/assetShow/modules/dataAssetShow.vue";
import DataSourceShow from "@/views/dataSource/assetShow/modules/dataSourceShow.vue";
import {dataAssetList, listSource} from "@/api/dataSource/source";
export default { export default {
name: "AssetShow", name: "AssetShow",
@ -81,27 +83,39 @@ export default {
{key: "测试.sys_user.sex", type: "String", value: "Y"}, {key: "测试.sys_user.sex", type: "String", value: "Y"},
], ],
kvtList: [], kvtList: [],
structure: [] structure: [],
childrenList: []
} }
}, },
created() { created() {
this.getList() this.getList()
}, },
methods: { methods: {
expandTable( node, resolve){
if (node.level === 0) return resolve(this.sourceList);
const {data} = node;
this.showAssets = data.dataType;
if (data.dataType === 'dataTable') {
return resolve([])
}
setTimeout(() => {
resolve(this.childrenList)
}, 500);
},
getList() { getList() {
listSource({}).then(response => { listSource({}).then(response => {
this.sourceList = response.data.rows; this.sourceList = response.data.rows;
this.sourceList.forEach(source => { this.sourceList.forEach(source => {
if (source.type=='PostGreSql'){ if (source.type=='PostGreSql'){
source.label=source.dataSourceName+'('+source.databaseName+'-'+source.modeName+'-'+source.systemName+')' source.label=source.name+'('+source.databaseName+'-'+source.modeName+'-'+source.systemName+')'
}else{ }else{
source.label=source.dataSourceName+'('+source.databaseName+'-'+source.systemName+')' source.label=source.name+'('+source.databaseName+'-'+source.systemName+')'
} }
source.dataType = 'dataSource' source.dataType = 'dataSource'
if (source.tableList!=null){ if (source.tableList!=null){
source.tableList.forEach(table => { source.tableList.forEach(table => {
table.label = table.tableName+'-'+table.tableComment+'('+table.tableCount+'条)' table.label= table.name+'-'+table.nameAs+"("+table.dataTotal+"条)"
table.dataType = 'dataTable' table.dataType = 'dataTable'
}) })
} }
@ -118,15 +132,16 @@ export default {
// }, // },
handleNodeClick(data) { handleNodeClick(data) {
if (data.dataType === 'dataSource') { if (data.dataType === 'dataSource') {
this.source = data
dataAssetList(data).then(res => { dataAssetList(data).then(res => {
res.data.forEach(table => { res.data.forEach(table => {
table.dataType = "dataTable" table.dataType = "dataTable"
table.label=table.tableName+"-"+table.tableComment+"("+table.tableCount+"条)" table.label = table.name + "-" + table.nameAs + "(" + table.dataTotal + "条)"
}) })
data.tableList = res.data data.tableList = res.data
this.sourceList[this.sourceList.indexOf(data)].tableList = res.data this.sourceList[this.sourceList.indexOf(data)].tableList = res.data
this.childrenList = res.data
this.title = data this.title = data
this.source = data
}) })
} else { } else {
@ -147,18 +162,7 @@ export default {
// }, 50); // }, 50);
} }
this.showAssets = data.dataType
}, },
expandTable( node, resolve){
if (node.level === 0) return resolve(this.assetStructureList);
const {data} = node;
if (data.type === 'dataTable') {
return resolve([])
}
setTimeout(() => {
resolve(this.childrenList)
}, 500);
}
} }
} }
</script> </script>
@ -170,12 +174,15 @@ export default {
width: 400px; width: 400px;
background-color: white; background-color: white;
} }
.el-main { .el-main {
background-color: #f1f1f1; background-color: #f1f1f1;
} }
.custom-tree-node { .custom-tree-node {
height: 30px; height: 30px;
} }
.el-descriptions-row > th { .el-descriptions-row > th {
width: 200px; width: 200px;
} }

View File

@ -5,9 +5,9 @@
<span>资产模型基本信息</span> <span>资产模型基本信息</span>
</div> </div>
<el-descriptions border :column="2"> <el-descriptions border :column="2">
<el-descriptions-item label="表名称">{{asset.tableName}}</el-descriptions-item> <el-descriptions-item label="表名称">{{asset.name}}</el-descriptions-item>
<el-descriptions-item label="表备注">{{asset.tableComment}}</el-descriptions-item> <el-descriptions-item label="表备注">{{asset.nameAs}}</el-descriptions-item>
<el-descriptions-item label="数据量">{{asset.tableCount}}</el-descriptions-item> <el-descriptions-item label="数据量">{{asset.dataTotal}}</el-descriptions-item>
<el-descriptions-item label="是否核心"> <el-descriptions-item label="是否核心">
<el-tag size="small"></el-tag> <el-tag size="small"></el-tag>
</el-descriptions-item> </el-descriptions-item>

View File

@ -3,7 +3,7 @@
<el-row :gutter="40" class="panel-group"> <el-row :gutter="40" class="panel-group">
<el-col :span="24"> <el-col :span="24">
<el-tabs v-model="activeName" type="border-card"> <el-tabs v-model="activeName" type="border-card">
<el-tab-pane v-for="tableAsset in source.tableList" :label="tableAsset.tableName+'('+tableAsset.tableComment+')'" :name="tableAsset.tableName"> <el-tab-pane v-for="tableAsset in source.tableList" :label="tableAsset.name+'('+tableAsset.nameAs+')'" :name="tableAsset.name">
<data-asset-show v-if="activeName == tableAsset.tableName" :asset="tableAsset" :source="source"/> <data-asset-show v-if="activeName == tableAsset.tableName" :asset="tableAsset" :source="source"/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>

View File

@ -6,11 +6,8 @@
更多操作 更多操作
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="add">版本添加</el-dropdown-item> <el-dropdown-item command="add">版本添加</el-dropdown-item>
<el-dropdown-item command="activate"> <el-dropdown-item command="activate">{{ (ruleEngineInfo.isActivate === 'no-activate' ? "激活" : "禁用") + '引擎' }}</el-dropdown-item>
{{ (ruleEngineInfo.isActivate === 'no-activate' ? "激活" : "禁用") + '引擎' }} <el-dropdown-item command="status">{{ (ruleEngineInfo.status === '0' ? "关闭" : "开启") + '引擎' }}</el-dropdown-item>
</el-dropdown-item>
<el-dropdown-item command="status">{{ (ruleEngineInfo.status === '0' ? "关闭" : "开启") + '引擎' }}
</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>