fix():修改配置
parent
c3563651ff
commit
7c6949cef7
|
@ -2,7 +2,7 @@
|
|||
<el-container :style="{height: mainHeight + 'px'}">
|
||||
<el-aside>
|
||||
<el-menu :default-openeds="['1', '3']">
|
||||
<el-tree :data="sourceList" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
||||
<el-tree lazy :load="expandTable" :data="sourceList" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
||||
</el-menu>
|
||||
</el-aside>
|
||||
<el-container>
|
||||
|
@ -25,16 +25,33 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
title: {},
|
||||
sourceList: [],
|
||||
sourceList: [{
|
||||
label: '测试',
|
||||
tableList: [
|
||||
{label: '测试1'}
|
||||
]
|
||||
}],
|
||||
mainHeight: window.innerHeight - 85,
|
||||
defaultProps: {
|
||||
children: 'tableList',
|
||||
label: 'label'
|
||||
},
|
||||
showAuth: null
|
||||
showAuth: null,
|
||||
childrenList: []
|
||||
}
|
||||
},
|
||||
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);
|
||||
},
|
||||
handleNodeClick(data) {
|
||||
if (data.dataType === 'dataSource'){
|
||||
dataAssetList(data).then(res => {
|
||||
|
@ -44,9 +61,9 @@ export default {
|
|||
})
|
||||
data.tableList = res.data
|
||||
this.sourceList[this.sourceList.indexOf(data)].tableList = res.data
|
||||
this.childrenList = res.data
|
||||
this.title = data
|
||||
})
|
||||
|
||||
}else{
|
||||
this.sourceList.forEach(source => {
|
||||
if (source.tableList!=null){
|
||||
|
@ -63,23 +80,13 @@ export default {
|
|||
}
|
||||
this.showAuth = 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);
|
||||
},
|
||||
getList() {
|
||||
this.assetsCompute={
|
||||
assetsModuleSum: 0,
|
||||
dataModuleSum: 0,
|
||||
dataSourceSum: 0
|
||||
}
|
||||
listSource(this.queryParams).then(response => {
|
||||
listSource({}).then(response => {
|
||||
this.sourceList = response.data.rows;
|
||||
this.sourceList.forEach(source => {
|
||||
source.label=source.dataSourceName+'('+source.databaseName+'-'+source.systemName+')'
|
||||
|
|
|
@ -1,52 +1,12 @@
|
|||
<template>
|
||||
<el-container :style="{height: mainHeight + 'px'}">
|
||||
<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-container>
|
||||
<el-main>
|
||||
<data-source-show v-if="showAssets === 'dataSource'" :source="source"></data-source-show>
|
||||
<data-asset-show v-if="showAssets === 'dataTable'" :asset="asset" :source="source"></data-asset-show>
|
||||
<!-- <el-card>-->
|
||||
<!-- <div slot="header" class="clearfix">-->
|
||||
<!-- <span>资产模型基本信息</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- <el-descriptions border :column="2">-->
|
||||
<!-- <el-descriptions-item label="表名称">{{asset.tableName}}</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="表备注">{{asset.tableComment}}</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="数据量">{{asset.tableCount}}</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="是否核心">-->
|
||||
<!-- <el-tag size="small">是</el-tag>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- </el-descriptions>-->
|
||||
<!-- </el-card>-->
|
||||
|
||||
<!-- <el-card class="box-card" style="margin-top: 20px">-->
|
||||
<!-- <div slot="header" class="clearfix">-->
|
||||
<!-- <span>模型数据</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- <el-row v-if="kvtList.length > 0" :gutter="20">-->
|
||||
<!-- <el-col :span="6" v-for="(kvt,index) in kvtList[0]" style="margin-top: 20px">-->
|
||||
<!-- <el-descriptions :title="source.dataSourceName+'.'+asset.tableName+'.'+index" direction="vertical" border :column="1">-->
|
||||
<!-- <el-descriptions-item label="Type">-->
|
||||
<!-- <el-tag size="small">{{kvt.type}}</el-tag>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="Value">{{kvt.value=='' ? 'null':kvt.value}}</el-descriptions-item>-->
|
||||
<!-- </el-descriptions>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
<!-- <el-row v-if="kvtList.length == 0" :gutter="20">-->
|
||||
<!-- <el-col :span="6" v-for="(value,index) in structure" style="margin-top: 20px">-->
|
||||
<!-- <el-descriptions :title="source.dataSourceName+'.'+asset.tableName+'.'+index" direction="vertical" border :column="1">-->
|
||||
<!-- <el-descriptions-item label="Type">-->
|
||||
<!-- <el-tag size="small">{{value}}</el-tag>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="Value">null</el-descriptions-item>-->
|
||||
<!-- </el-descriptions>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
|
||||
<!-- </el-card>-->
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
|
@ -81,13 +41,25 @@ export default {
|
|||
{key: "测试.sys_user.sex", type: "String", value: "Y"},
|
||||
],
|
||||
kvtList: [],
|
||||
structure: []
|
||||
structure: [],
|
||||
childrenList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
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() {
|
||||
listSource({}).then(response => {
|
||||
this.sourceList = response.data.rows;
|
||||
|
@ -109,16 +81,8 @@ export default {
|
|||
this.total = response.data.total;
|
||||
});
|
||||
},
|
||||
// structureList(){
|
||||
// structureList(this.source).then(res => {
|
||||
// console.log(res)
|
||||
// this.kvtList = res.data.kvtList
|
||||
// this.structure = res.data.structure
|
||||
// })
|
||||
// },
|
||||
handleNodeClick(data) {
|
||||
if (data.dataType === 'dataSource'){
|
||||
this.source = data
|
||||
dataAssetList(data).then(res => {
|
||||
res.data.forEach(table => {
|
||||
table.dataType = "dataTable"
|
||||
|
@ -126,7 +90,9 @@ export default {
|
|||
})
|
||||
data.tableList = res.data
|
||||
this.sourceList[this.sourceList.indexOf(data)].tableList = res.data
|
||||
this.childrenList = res.data
|
||||
this.title = data
|
||||
this.source = data
|
||||
})
|
||||
|
||||
}else{
|
||||
|
@ -140,25 +106,8 @@ export default {
|
|||
})
|
||||
}
|
||||
})
|
||||
// console.log(this.source)
|
||||
// this.source.sql = 'select * from '+(data.modeName == null ? '' : data.modeName+'.')+data.tableName +' limit 1'
|
||||
// setTimeout(() => {
|
||||
// this.structureList()
|
||||
// }, 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>
|
||||
|
|
|
@ -50,12 +50,12 @@ export default {
|
|||
watch:{
|
||||
'asset':{
|
||||
handler(val){
|
||||
this.structureList()
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
'source':{
|
||||
handler(val){
|
||||
this.structureList()
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
|
|
|
@ -209,6 +209,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
assetModelList(){
|
||||
console.log(this.title)
|
||||
assetModelList(this.title).then(res => {
|
||||
this.tableData = res.data
|
||||
this.formStatus = false
|
||||
|
@ -226,7 +227,6 @@ export default {
|
|||
getDictionaryList() {
|
||||
getDictionaryList(this.title.dataSourceId).then(res => {
|
||||
this.dictMap = res.data
|
||||
console.log(this.dictMap)
|
||||
})
|
||||
},
|
||||
async update(row) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div>
|
||||
<el-container :style="{height: mainHeight + 'px'}">
|
||||
<el-aside width="400px" style="background-color: rgb(238, 241, 246);height: 80%">
|
||||
<el-tree style="background-color: white" :data="sourceList" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
||||
<el-tree lazy :load="expandTable" :data="sourceList" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
||||
</el-aside>
|
||||
|
||||
<el-container>
|
||||
|
@ -104,7 +104,8 @@ export default {
|
|||
source: {
|
||||
sql: ''
|
||||
},
|
||||
statisticsInfo:{}
|
||||
statisticsInfo:{},
|
||||
childrenList: []
|
||||
};
|
||||
},
|
||||
//计算属性 类似于data概念",
|
||||
|
@ -113,6 +114,17 @@ export default {
|
|||
watch: {},
|
||||
//方法集合",
|
||||
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);
|
||||
},
|
||||
test(data){
|
||||
this.sourceData = data
|
||||
},
|
||||
|
@ -126,17 +138,16 @@ export default {
|
|||
})
|
||||
data.tableList = res.data
|
||||
this.sourceList[this.sourceList.indexOf(data)].tableList = res.data
|
||||
this.childrenList = res.data
|
||||
this.title = data
|
||||
})
|
||||
|
||||
}else{
|
||||
this.title= data
|
||||
}
|
||||
this.showAssets = data.dataType
|
||||
},
|
||||
sql(){
|
||||
structureList(this.source).then(res => {
|
||||
console.log(res)
|
||||
this.structureList = res.data.kvtList
|
||||
})
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue