添加资产展示

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({
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',
})
}

View File

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

View File

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

View File

@ -62,7 +62,7 @@
</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="types"></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>
@ -98,6 +98,7 @@ export default {
//"
return {
tableMapping:[],
data:[],
defaultProps: {
children: 'tableNames',
@ -123,21 +124,34 @@ export default {
})
},
handleNodeClick(data){
sessionStorage.setItem("key",data.name)
console.log(data)
// console.log(data)
this.tableBasic=data
this.dataNum=data.tableFie.length
this.tableStructure=data.tableFie
// console.log(this.tableStructure)
findTableValue(data.dataId,data.name).then(res=>{
let tableMapping=res.data
// console.log(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
})
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
}
}
}
}
})
},