数据资产

master
yaoxin 2024-04-21 11:04:34 +08:00
parent 8052d22ee6
commit 9e1df6e75a
3 changed files with 93 additions and 21 deletions

View File

@ -9,6 +9,22 @@ export function listSource(query) {
}) })
} }
export function assetsList(data) {
return request({
url: '/etl/source/AssetsList',
method: 'post',
data
})
}
export function structureList(data) {
return request({
url: '/etl/source/StructureList',
method: 'post',
data
})
}
// 查询【请填写功能名称】详细 // 查询【请填写功能名称】详细
export function getSource(id) { export function getSource(id) {
return request({ return request({

View File

@ -1,19 +1,58 @@
<template> <template>
<div></div> <div>
<el-container style="height: 80%; border: 1px solid #eee">
<el-aside width="300px" style="background-color: rgb(238, 241, 246)">
<el-menu :default-openeds="['1', '3']">
<el-submenu :index="source.id" v-for="source in sourceList">
<template slot="title"><i class="el-icon-message"></i>{{source.dataSourceName}}</template>
<el-menu-item-group>
<template v-if="source.tableList==null" slot="title"></template>
<el-menu-item v-for="(tableName,index) in source.tableList" :index="source.id-index" @click="selectAssets(source,tableName)">{{tableName}}</el-menu-item>
</el-menu-item-group>
</el-submenu>
</el-menu>
</el-aside>
<el-container>
<el-main>
<el-card style="height: 280px">
<div slot="header" class="clearfix">
<span>查询语句</span>
</div>
<el-input type="textarea" v-model="source.sql" style="width: 1080px;" :rows="6"></el-input>
<el-button style="float: right;margin-top: 20px" @click="sql()"></el-button>
</el-card>
<br>
<el-card>
<div slot="header" class="clearfix">
<span>数据资产</span>
</div>
<el-table :data="structureList">
<el-table-column v-for="(assets,index) in assetsList" :label="index+' ('+assets+')'" width="140">
<template slot-scope="scope">
{{scope.row[index].value}}
</template>
</el-table-column>
</el-table>
</el-card>
</el-main>
</el-container>
</el-container>
</div>
</template> </template>
<script> <script>
//jsjsjson, //jsjsjson,
//import from ', //import from ',
import {listSource} from "@/api/etl/source"; import {assetsList, listSource, structureList} from "@/api/etl/source";
export default { export default {
//import使" //import使"
components: {}, components: {},
props: {}, props: {},
data() { data() {
//"
return { return {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -25,6 +64,11 @@ export default {
total: 0, total: 0,
// //
sourceList: [], sourceList: [],
assetsList:[],
structureList:[],
source: {
sql: ''
}
}; };
}, },
// data", // data",
@ -33,37 +77,49 @@ export default {
watch: {}, watch: {},
//", //",
methods: { methods: {
sql(){
structureList(this.source).then(res => {
console.log(res)
this.structureList = res.data.kvtList
})
},
selectAssets(source,tableName) {
this.structureList = []
this.assetsList = []
this.source.sql=''
source.tableName = tableName
this.source = source
assetsList(source).then(res => {
console.log(res)
this.assetsList = res.data.structure
})
},
getList() { getList() {
this.loading = true; this.loading = true;
listSource(this.queryParams).then(response => { listSource(this.queryParams).then(response => {
this.sourceList = response.data.rows; this.sourceList = response.data.rows;
this.total = response.data.total; this.total = response.data.total;
this.loading = false; console.log(this.sourceList)
}); });
} }
}, },
// - 访this", // - 访this",
created() { created() {
this.getList()
}, },
// - 访DOM", // - 访DOM",
mounted() { mounted() {
}, }
beforeCreate() {
}, // - ",
beforeMount() {
}, // - ",
beforeUpdate() {
}, // - ",
updated() {
}, // - ",
beforeDestroy() {
}, // - ",
destroyed() {
}, // - ",
activated() {
} //keep-alive",
}; };
</script> </script>
<style scoped> <style scoped>
.el-header {
background-color: #B3C0D1;
color: #333;
line-height: 60px;
}
.el-aside {
color: #333;
}
</style> </style>

View File

@ -378,7 +378,7 @@ export default {
} }
}) })
}, },
/** 查询【请填写功能名称】列表 */ /** 查询数据源列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listSource(this.queryParams).then(response => { listSource(this.queryParams).then(response => {