添加资产展示

pull/7/head^2
Yueng 2024-09-01 18:57:24 +08:00
parent f427e262ce
commit 8ae1b76ddc
4 changed files with 181 additions and 130 deletions

View File

@ -7,9 +7,16 @@ export function getExtractDataTableNameList() {
}) })
} }
export function findTableValue(id,dataName) { export function findTableValue(dataId,name) {
return request({ return request({
url: '/property/dataRunName/findTableValue?basicId='+id +"&dataName="+dataName, url: '/property/dataRunName/findTableValue?dataId='+dataId+"&tableName="+name,
method: 'post',
})
}
export function selectBasicList() {
return request({
url: '/property/dataRunName/selectBasicList',
method: 'post', method: 'post',
}) })
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<h1>数据资产结构</h1> <h1>测试4()- 资产展示</h1>
<el-container> <el-container>
<el-aside width="400px"> <el-aside width="400px">
@ -14,12 +14,19 @@
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span style="font-size: xx-large"></span> <span style="font-size: xx-large"></span>
<!-- <table>-->
<!-- a <tr><td>表名称:</td><td>{{ tableBasic.tableName }}</td></tr>-->
<!-- <tr><td>表备注:</td><td>{{ tableBasic.tableRemark }}</td></tr>-->
<!-- <tr><td>数据量:</td><td>{{ tableBasic.dataNum }}</td></tr>-->
<!-- <tr><td>是否核心:</td><td><dict-tag :options="dict.type.sys_yes_no" :value="tableBasic.isCenter"/></td></tr>-->
<!-- </table>-->
<template> <template>
<el-descriptions class="margin-top" title="资产模型基本信息" :column="2" border> <el-descriptions class="margin-top" title="资产模型基本信息" :column="2" border>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">表名称</template> <template slot="label">表名称</template>
{{ tableBasic.name }} {{ tableBasic.tableName }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">表备注</template> <template slot="label">表备注</template>
@ -27,7 +34,7 @@
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">数据量</template> <template slot="label">数据量</template>
{{ dataNum }} {{ tableBasic.dataNum }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">是否核心</template> <template slot="label">是否核心</template>
@ -35,59 +42,64 @@
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</template> </template>
</div> </div>
</el-card> </el-card>
<!-- v-if="dataType === 'dataTable'-->
<el-card class="box-card" title="资产模型基本信息" :column="2" > <el-card class="box-card" style="margin-top: 20px">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>资产模型详细信息</span> <span>模型数据</span>
</div> </div>
<el-table <el-row :gutter="20">
:data="tableStructure" style="width: 100%"> <!-- -->
<el-table-column label="名称" prop="field"></el-table-column> <el-col :span="6" v-for="DataValue in assetShowList" style="margin-top: 20px">
<el-table-column label="注释" prop="annotation"></el-table-column> <el-descriptions :title="tableBasic.tableRemark+'.'+tableBasic.tableName+'.'+DataValue.key" direction="vertical"
<el-table-column label="是否主键" prop="primarys"> border :column="1">
<template slot-scope="scope"> <el-descriptions-item label="Type">
<span v-if="scope.row.primarys==='PRI'"> <el-tag size="small">{{ DataValue.type }}</el-tag>
<el-tag type="success">{{scope.row.primarys }}</el-tag> </el-descriptions-item>
</span> <el-descriptions-item label="Value">{{ DataValue.value }}</el-descriptions-item>
<span v-if="scope.row.primarys===''"> </el-descriptions>
<el-tag type="danger">NO</el-tag>
</span>
</template> </el-col>
</el-table-column> </el-row>
<el-table-column label="类型" prop="type"></el-table-column>
<el-table-column label="映射类型" prop="javaType">{{this.javaType.type}}</el-table-column>
<el-table-column label="是否为空" prop="nullable"></el-table-column>
<el-table-column label="是否字典" prop="isDictionary"></el-table-column>
<el-table-column label="映射字典" prop="dictionaryTable"></el-table-column>
</el-table>
</el-card> </el-card>
<el-table
:data="DataValue"
style="width: 100%">
<el-table-column
prop="key"
label="key"
width="180">
</el-table-column>
<el-table-column
prop="label"
label="label"
width="180">
</el-table-column>
<el-table-column
prop="type"
label="type">
</el-table-column>
<el-table-column
prop="value"
label="value">
</el-table-column>
</el-table>
</el-main> </el-main>
</el-container> </el-container>
</div> </div>
</template> </template>
<style>
.el-main {
background-color: #ececec;
color: #000000;
line-height: 147px;
}
</style>
<script> <script>
//jsjsjson, //jsjsjson,
//import from ', //import from ',
import { findByTableName, findStructureByTableId, findTableValueList } from '@/api/etl/property'
import { findTableValue, getExtractDataTableNameList } from '@/api/property/astr'
export default { export default {
//import使" //import使"
@ -100,15 +112,21 @@ export default {
return { return {
data:[], data:[],
defaultProps: { defaultProps: {
children: 'tableNames', children: 'children',
label: 'name' label: 'tableName'
},
dataNum:0,
tableBasic:{
}, },
tableBasic:{},
tableStructure:[], tableStructure:[],
javaType:[], assetShowList: [
// {key: ".sys_user.id", type: "String", value: 1},
// {key: ".sys_user.name", type: "String", value: ""},
// {key: ".sys_user.age", type: "Integer", value: 18},
// {key: ".sys_user.email", type: "String", value: "123@136.com"},
// {key: ".sys_user.sex", type: "String", value: "Y"},
],
kvtList: [],
DataValue:[],
}; };
}, },
// data", // data",
@ -117,33 +135,34 @@ export default {
watch: {}, watch: {},
//", //",
methods: { methods: {
getSelectList(){ findByTableName(){
getExtractDataTableNameList().then((res)=>{ findByTableName().then((res)=>{
this.data = res.data this.data = res.data
}) })
}, },
handleNodeClick(data){ handleNodeClick(data){
console.log(data) console.log("...."+data)
this.tableBasic=data this.tableBasic=data
this.dataNum=data.tableFie.length
this.tableStructure=data.tableFie
var id = 0; // findStructureByTableId(data.id).then((res)=>{
data.tableFie.forEach(res => { // this.tableStructure=res.data
id=res.tableId // })
}) if (data.children==null){
console.log(id) findTableValueList(data.basicId,data.tableName).then(res=>{
findTableValue(id,data.name).then(res=>{ this.assetShowList=res.data;
// console.log(res) this.DataValue=res.data;
this.javaType=res.data
}) })
}
console.log("-----"+this.DataValue);
console.log("...."+data.basicId)
}, },
}, },
// - 访this", // - 访this",
created() { created() {
this.getSelectList(); this.findByTableName();
}, },
// - 访DOM", // - 访DOM",

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<h1>数据资产结构</h1> <h1>数据资产授权</h1>
<el-container> <el-container>
<el-aside width="400px"> <el-aside width="400px">
@ -18,21 +18,29 @@
<el-descriptions class="margin-top" title="资产模型基本信息" :column="2" border> <el-descriptions class="margin-top" title="资产模型基本信息" :column="2" border>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">名称</template> <template slot="label">数据接入名称</template>
{{ tableBasic.name }} {{ tableBasics.accSourName }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">表备注</template> <template slot="label">系统名称</template>
{{ tableBasic.tableRemark }} {{ tableBasics.dataSourSystemName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">数据库名称</template>
{{ tableBasics }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">表名称</template>
{{ this.tableBasics.name }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">表中文名</template>
{{ this.tableBasics.name }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label">数据量</template> <template slot="label">数据量</template>
{{ dataNum}} {{ dataNum}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item>
<template slot="label">是否核心</template>
<dict-tag :options="dict.type.sys_no" :value="tableBasic.isCenter"/>
</el-descriptions-item>
</el-descriptions> </el-descriptions>
</template> </template>
@ -43,31 +51,27 @@
</el-card> </el-card>
<el-tabs type="border-card">
<el-tab-pane label="用户管理">
<el-card class="box-card" title="资产模型基本信息" :column="2" > <el-card class="box-card" title="资产模型基本信息" :column="2" >
<div slot="header" class="clearfix">
<span>资产模型详细信息</span>
</div>
<el-table <el-table
:data="tableStructure" style="width: 100%"> :data="tableBasic" style="width: 100%">
<el-table-column label="名称" prop="field"></el-table-column> <el-table-column label="部门名称" prop="field"></el-table-column>
<el-table-column label="注释" prop="annotation"></el-table-column> <el-table-column label="部门负责人" prop="annotation"></el-table-column>
<el-table-column label="是否主键" prop="primarys"> <el-table-column label="邮箱" prop="primarys"></el-table-column>
<template slot-scope="scope"> <el-table-column label="创建时间" prop="type"></el-table-column>
<span v-if="scope.row.primarys==='PRI'"> <el-table-column label="操作" prop="types"></el-table-column>
<el-tag type="success">{{scope.row.primarys }}</el-tag>
</span>
<span v-if="scope.row.primarys===''">
<el-tag type="danger">NO</el-tag>
</span>
</template>
</el-table-column>
<el-table-column label="类型" prop="type"></el-table-column>
<el-table-column label="映射类型" prop="javaType">{{this.javaType.type}}</el-table-column>
<el-table-column label="是否为空" prop="nullable"></el-table-column>
<el-table-column label="是否字典" prop="isDictionary"></el-table-column>
<el-table-column label="映射字典" prop="dictionaryTable"></el-table-column>
</el-table> </el-table>
</el-card> </el-card>
</el-tab-pane>
<el-tab-pane label="配置管理">
</el-tab-pane>
</el-tabs>
</el-main> </el-main>
</el-container> </el-container>
@ -98,16 +102,16 @@ export default {
//" //"
return { return {
tableMapping:[],
data:[], data:[],
defaultProps: { defaultProps: {
children: 'tableNames', children: 'tableNames',
label: 'name' label: 'name'
}, },
dataNum:0, dataNum:0,
tableBasic:{ tableBasic:{},
},
tableStructure:[], tableStructure:[],
tableBasics:{},
javaType:[], javaType:[],
}; };
}, },
@ -122,21 +126,28 @@ export default {
this.data = res.data this.data = res.data
}) })
}, },
handleNodeClick(data){ handleNodeClick(data){
debugger;
console.log(data) console.log(data)
this.tableBasic=data if (this.tableBasic.name===data.name){
this.tableBasic={}
}
console.log(this.tableBasic.length)
if (this.tableBasic.length === undefined){
selectBasicList().then(ress=>{
this.tableBasic.ress.data
this.tableBasics.data
})
this.dataNum=data.tableFie.length this.dataNum=data.tableFie.length
this.tableStructure=data.tableFie this.tableStructure=data.tableFie
findTableValue(data.dataId,data.name).then(res=>{
let tableMapping=res.data
var id = 0;
data.tableFie.forEach(res => {
id=res.tableId
})
console.log(id)
findTableValue(id,data.name).then(res=>{
// console.log(res)
this.javaType=res.data
}) })
}
}, },

View File

@ -62,7 +62,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="类型" prop="type"></el-table-column> <el-table-column label="类型" prop="type"></el-table-column>
<el-table-column label="映射类型" prop="javaType">{{this.javaType.type}}</el-table-column> <el-table-column label="映射类型" prop="types"></el-table-column>
<el-table-column label="是否为空" prop="nullable"></el-table-column> <el-table-column label="是否为空" prop="nullable"></el-table-column>
<el-table-column label="是否字典" prop="isDictionary"></el-table-column> <el-table-column label="是否字典" prop="isDictionary"></el-table-column>
<el-table-column label="映射字典" prop="dictionaryTable"></el-table-column> <el-table-column label="映射字典" prop="dictionaryTable"></el-table-column>
@ -98,6 +98,7 @@ export default {
//" //"
return { return {
tableMapping:[],
data:[], data:[],
defaultProps: { defaultProps: {
children: 'tableNames', children: 'tableNames',
@ -123,20 +124,33 @@ export default {
}) })
}, },
handleNodeClick(data){ handleNodeClick(data){
sessionStorage.setItem("key",data.name) // console.log(data)
console.log(data)
this.tableBasic=data this.tableBasic=data
this.dataNum=data.tableFie.length this.dataNum=data.tableFie.length
this.tableStructure=data.tableFie this.tableStructure=data.tableFie
// console.log(this.tableStructure)
findTableValue(data.dataId,data.name).then(res=>{
let tableMapping=res.data
// console.log(res.data)
for (const index in tableMapping) {
for (const i in this.tableStructure) {
if (tableMapping[index].key === this.tableStructure[i].field) {
this.tableStructure[i].types.push(tableMapping[index].type)
console.log(this.tableStructure[i].types)
if (i!== 0&& this.tableStructure[i].types==this.tableStructure[0].types){
alert("dawdwadad")
return
}
}
}
}
var id = 0;
data.tableFie.forEach(res => {
id=res.tableId
})
console.log(id)
findTableValue(id,data.name).then(res=>{
// console.log(res)
this.javaType=res.data
}) })
}, },