Compare commits
2 Commits
158664de5e
...
61d5f4b1e3
Author | SHA1 | Date |
---|---|---|
|
61d5f4b1e3 | |
|
6e34b1e2d0 |
|
@ -0,0 +1,16 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
export function getAssetsModelListByTableIds(ids) {
|
||||
return request({
|
||||
url: '/data/assets/getAssetsModelList',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function getAssetsModelByDataTableId(id) {
|
||||
return request({
|
||||
url: '/data/assets/getAssetsModelByDataTableId?id='+id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
|
@ -5,9 +5,9 @@
|
|||
<span>资产模型基本信息</span>
|
||||
</div>
|
||||
<el-descriptions border :column="2">
|
||||
<el-descriptions-item label="表名称">sys_user</el-descriptions-item>
|
||||
<el-descriptions-item label="表备注">用户表</el-descriptions-item>
|
||||
<el-descriptions-item label="数据量">12536</el-descriptions-item>
|
||||
<el-descriptions-item label="表名称">{{ tableInfo.tableName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="表备注">{{tableInfo.tableAnnotation}}</el-descriptions-item>
|
||||
<el-descriptions-item label="数据量">{{ tableInfo.recordCount }}</el-descriptions-item>
|
||||
<el-descriptions-item label="是否核心">
|
||||
<el-tag size="small">是</el-tag>
|
||||
</el-descriptions-item>
|
||||
|
@ -18,40 +18,40 @@
|
|||
<span>资产模型详细信息</span>
|
||||
</div>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:data="assetsModelList"
|
||||
style="width: 100%;">
|
||||
<el-table-column prop="name" label="名称" />
|
||||
<el-table-column prop="comment" label="注释" />
|
||||
<el-table-column prop="isPrimaryKey" label="是否主键" >
|
||||
<el-table-column prop="fieldsName" label="名称" />
|
||||
<el-table-column prop="fieldsAnnotation" label="注释" />
|
||||
<el-table-column prop="isDictionary" label="是否主键" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" :type="scope.row.isPrimaryKey === 'Y' ? 'success' : ''">
|
||||
{{scope.row.isPrimaryKey}}
|
||||
<el-tag size="small" :type="scope.row.isDictionary === 1 ? 'success' : ''">
|
||||
{{scope.row.isDictionary}}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="type" label="类型" />
|
||||
<el-table-column prop="mappingType" label="映射类型" />
|
||||
<el-table-column prop="length" label="长度" />
|
||||
<el-table-column prop="decimalPlaces" label="小数位" />
|
||||
<el-table-column prop="isNull" label="是否为空" >
|
||||
<el-table-column prop="baseType" label="类型" />
|
||||
<el-table-column prop="javaType" label="映射类型" />
|
||||
<el-table-column prop="fieldsLength" label="长度" />
|
||||
<el-table-column prop="decimalPlace" label="小数位" />
|
||||
<el-table-column prop="isEmpty" label="是否为空" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" :type="scope.row.isNull === 'Y' ? 'success' : 'danger'">
|
||||
{{scope.row.isNull}}
|
||||
<el-tag size="small" :type="scope.row.isNull === 1 ? 'success' : 'danger'">
|
||||
{{scope.row.isEmpty}}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="defaultValue" label="默认值" />
|
||||
<el-table-column prop="isDict" label="是否字典" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.isDict === 'Y'" size="small" type="success">
|
||||
{{scope.row.isDict}}
|
||||
<el-tag v-if="scope.row.isDictionary === 1" size="small" type="success">
|
||||
{{scope.row.isDictionary}}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dictKey" label="映射字典" >
|
||||
<el-table-column prop="reflectionDictionary" label="映射字典" >
|
||||
<template slot-scope="scope">
|
||||
<el-popover
|
||||
v-if="scope.row.isDict === 'Y'"
|
||||
v-if="scope.row.isDictionary === 1"
|
||||
placement="left"
|
||||
width="200"
|
||||
trigger="hover">
|
||||
|
@ -80,8 +80,11 @@
|
|||
export default {
|
||||
name: 'OverallAssetStructure',
|
||||
props: {
|
||||
tableData: {
|
||||
assetsModelList: {
|
||||
type: Array
|
||||
},
|
||||
tableInfo: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<div class="card-panel-text">
|
||||
数据接入
|
||||
</div>
|
||||
<count-to :duration="2600" :end-val="4" :start-val="0" class="card-panel-num"/>
|
||||
<count-to :duration="2600" :end-val="dataSourceCount" :start-val="0" class="card-panel-num"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
|
@ -25,7 +25,7 @@
|
|||
<div class="card-panel-text">
|
||||
资产模型
|
||||
</div>
|
||||
<count-to :duration="3000" :end-val="96" :start-val="0" class="card-panel-num"/>
|
||||
<count-to :duration="3000" :end-val="allTableCount" :start-val="0" class="card-panel-num"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
|
@ -38,7 +38,7 @@
|
|||
<div class="card-panel-text">
|
||||
数据模型
|
||||
</div>
|
||||
<count-to :duration="3200" :end-val="560" :start-val="0" class="card-panel-num"/>
|
||||
<count-to :duration="3200" :end-val="allDataModelCount" :start-val="0" class="card-panel-num"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
|
@ -49,6 +49,17 @@
|
|||
import CountTo from 'vue-count-to'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
dataSourceCount: {
|
||||
type :Number
|
||||
},
|
||||
allTableCount: {
|
||||
type :Number
|
||||
},
|
||||
allDataModelCount: {
|
||||
type :Number
|
||||
}
|
||||
},
|
||||
components: {
|
||||
CountTo
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<el-row :gutter="40" class="panel-group">
|
||||
<div class="title-header">
|
||||
{{title}} - 资产结构概述
|
||||
{{dataSourceObj.dataSource.fromSystem}} - 资产结构概述
|
||||
</div>
|
||||
<el-col :sm="12" :xs="12" class="card-panel-col">
|
||||
<div class="card-panel" @click="handleSetLineChartData('messages')">
|
||||
|
@ -12,7 +12,7 @@
|
|||
<div class="card-panel-text">
|
||||
资产模型
|
||||
</div>
|
||||
<count-to :duration="3000" :end-val="15" :start-val="0" class="card-panel-num"/>
|
||||
<count-to :duration="3000" :end-val="dataSourceObj.dataSource.tableCount" :start-val="0" class="card-panel-num"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
|
@ -25,16 +25,90 @@
|
|||
<div class="card-panel-text">
|
||||
数据模型
|
||||
</div>
|
||||
<count-to :duration="3200" :end-val="230" :start-val="0" class="card-panel-num"/>
|
||||
<count-to :duration="3200" :end-val="dataSourceObj.dataSource.dataModelCount" :start-val="0" class="card-panel-num"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activeName" type="border-card">
|
||||
<el-tab-pane label="sys_user(用户表)" name="first">
|
||||
<overall-asset-structure/>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>基础字典</span>
|
||||
<el-popover
|
||||
placement="top-start"
|
||||
title="基础字典"
|
||||
width="200"
|
||||
trigger="hover"
|
||||
content="这个字典是数据资产项目当中的字典内容,而不是本项目当中的字典内容。主要作用为数据清洗过程中数据字典映射作用">
|
||||
<i class="el-icon-question" slot="reference"></i>
|
||||
</el-popover>
|
||||
<el-popover
|
||||
placement="right"
|
||||
width="400"
|
||||
trigger="click">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="18">
|
||||
<el-input v-model="dictAddName"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button @click="addDict">确定</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" slot="reference">新增字典</el-button>
|
||||
</el-popover>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col v-for="(val,key) in dictMap" :md="8" :sm="24" :xs="12">
|
||||
<el-card class="box-card" style="height: 300px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{key}}</span>
|
||||
<el-button style="float: right; padding: 3px 0"
|
||||
type="text"
|
||||
@click="val.push({ label: null, val: null, isEdit: true })"
|
||||
>新增</el-button>
|
||||
</div>
|
||||
<el-table :data="val" style="width: 100%" height="280px">
|
||||
<el-table-column prop="label" label="标签">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.isEdit">{{scope.row.label}}</span>
|
||||
<el-input v-if="scope.row.isEdit" v-model="scope.row.label" size="mini"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="val" label="值">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.isEdit">{{scope.row.val}}</span>
|
||||
<el-input v-if="scope.row.isEdit" v-model="scope.row.val" size="mini"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="val" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="!scope.row.isEdit"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="scope.row.isEdit = true"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.isEdit"
|
||||
@click="editConfirm(scope.row)"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-finished"
|
||||
>确定</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activeName" type="border-card" >
|
||||
<el-tab-pane :label="assetsModelResp.dataTable.tableName" :key="assetsModelResp.dataTable.id" v-for="assetsModelResp in assetsModelRespArrayList">
|
||||
<overall-asset-structure :tableInfo="assetsModelResp.dataTable" :assetsModelList="assetsModelResp.assetsModelList" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="sys_dept(部门表)" name="second">sys_dept(部门表)</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -47,13 +121,27 @@ import OverallAssetStructure from './OverallAssetStructure.vue'
|
|||
|
||||
export default {
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: "-"
|
||||
dataSourceObj: {
|
||||
type: Object
|
||||
},
|
||||
assetsModelRespArrayList: {
|
||||
type: Array
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dictAddName: null,
|
||||
dictMap: {
|
||||
"性别(system_sex)": [
|
||||
{ label: '男', val: '1', isEdit: false },
|
||||
{ label: '女', val: '2', isEdit: false },
|
||||
{ label: '未知', val: '0', isEdit: false },
|
||||
],
|
||||
"开关(system_y_n)": [
|
||||
{ label: '是', val: '1', isEdit: false },
|
||||
{ label: '否', val: '0', isEdit: false }
|
||||
],
|
||||
},
|
||||
activeName: 'first',
|
||||
}
|
||||
},
|
||||
|
@ -64,7 +152,15 @@ export default {
|
|||
methods: {
|
||||
handleSetLineChartData(type) {
|
||||
this.$emit('handleSetLineChartData', type)
|
||||
}
|
||||
},
|
||||
addDict(){
|
||||
if (!this.dictAddName){
|
||||
this.$message.error('数据字典,不可为空');
|
||||
return;
|
||||
}
|
||||
this.dictMap[this.dictAddName] = []
|
||||
this.dictAddName = null
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -8,16 +8,16 @@
|
|||
@node-click="(data) => showAssets=data.type"
|
||||
:props="defaultProps">
|
||||
<div class="custom-tree-node" slot-scope="{ node, data }">
|
||||
<div v-if="data.type === 'dataSource'">{{ data.name + '('+data.dataSourceDatabaseName + '-' + data.fromSystem+')' }}</div>
|
||||
<div @click="getTableStructure(data)" v-if="data.type === 'dataTable'">{{ data.tableName + '-'+data.dataAnnotation + '(' + data.dataCount+'条)' }}</div>
|
||||
<div @click="getNowDataSource(data)" v-if="data.type === 'dataSource'">{{ data.dataSource.name + '('+data.dataSource.dataSourceDatabaseName + '-' + data.dataSource.fromSystem+')' }}</div>
|
||||
<div @click="getTableStructure(data)" v-if="data.type === 'dataTable'">{{ data.dataTable.tableName + '-'+data.dataTable.tableAnnotation + '(' + data.dataTable.recordCount+'条)' }}</div>
|
||||
</div>
|
||||
</el-tree>
|
||||
</el-aside>
|
||||
<el-container>
|
||||
<el-main>
|
||||
<OverallAssets v-if="showAssets == null"/>
|
||||
<overall-specific-assets v-if="showAssets === 'dataSource'" :title="title"/>
|
||||
<overall-asset-structure :tableData="tableData" v-if="showAssets === 'dataTable'" :title="title"/>
|
||||
<OverallAssets :dataSourceCount="dataSourceCount" :allTableCount="allTableCount" :allDataModelCount="allDataModelCount" v-if="showAssets == null"/>
|
||||
<overall-specific-assets :dataSourceObj="dataSourceObj" :assetsModelRespArrayList="assetsModelRespArrayList" v-if="showAssets === 'dataSource'" :title="title"/>
|
||||
<overall-asset-structure :tableInfo="tableInfo" :assetsModelList="assetsModelList" v-if="showAssets === 'dataTable'" :title="title"/>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
|
@ -27,80 +27,23 @@ import OverallAssets from './dashboard/OverallAssets.vue'
|
|||
import OverallSpecificAssets from './dashboard/OverallSpecificAssets.vue'
|
||||
import OverallAssetStructure from './dashboard/OverallAssetStructure.vue'
|
||||
import {queryBigStructure, queryTableStructure} from "@/api/data";
|
||||
import {getAssetsModelByDataTableId, getAssetsModelListByTableIds} from "@/api/assets";
|
||||
|
||||
export default {
|
||||
name: 'assetStructure',
|
||||
components: { OverallAssetStructure, OverallSpecificAssets, OverallAssets },
|
||||
data() {
|
||||
return {
|
||||
tableInfo: {},
|
||||
assetsModelList: [],
|
||||
dataSourceObj: null,
|
||||
tableCount:0,
|
||||
dataModelCount:0,
|
||||
dataSourceCount: 0,
|
||||
allTableCount: 0,
|
||||
allDataModelCount: 0,
|
||||
dataBaseConnectObj: {},
|
||||
tableData: [
|
||||
{
|
||||
id: 1,
|
||||
name: "id",
|
||||
comment: "主键",
|
||||
isPrimaryKey: "Y",
|
||||
type: "bigint",
|
||||
mappingType: "Long",
|
||||
length: "-",
|
||||
decimalPlaces: "-",
|
||||
isNull: "N",
|
||||
defaultValue: "-",
|
||||
isDict: "N",
|
||||
dictKey: "-",
|
||||
}, {
|
||||
id: 2,
|
||||
name: "name",
|
||||
comment: "姓名",
|
||||
isPrimaryKey: "N",
|
||||
type: "varchar",
|
||||
mappingType: "String",
|
||||
length: "64",
|
||||
decimalPlaces: "-",
|
||||
isNull: "N",
|
||||
defaultValue: "-",
|
||||
isDict: "N",
|
||||
dictKey: "-",
|
||||
}, {
|
||||
id: 3,
|
||||
name: "sex",
|
||||
comment: "性别",
|
||||
isPrimaryKey: "N",
|
||||
type: "char",
|
||||
mappingType: "String",
|
||||
length: "1",
|
||||
decimalPlaces: "-",
|
||||
isNull: "N",
|
||||
defaultValue: "-",
|
||||
isDict: "Y",
|
||||
dictKey: "system_sex",
|
||||
}, {
|
||||
id: 4,
|
||||
name: "price",
|
||||
comment: "金额",
|
||||
isPrimaryKey: "N",
|
||||
type: "double",
|
||||
mappingType: "BigDecimal",
|
||||
length: "10",
|
||||
decimalPlaces: "2",
|
||||
isNull: "N",
|
||||
defaultValue: "0.00",
|
||||
isDict: "N",
|
||||
dictKey: "-",
|
||||
}, {
|
||||
id: 5,
|
||||
name: "create_time",
|
||||
comment: "创建时间",
|
||||
isPrimaryKey: "N",
|
||||
type: "datetime",
|
||||
mappingType: "Date",
|
||||
length: "-",
|
||||
decimalPlaces: "-",
|
||||
isNull: "Y",
|
||||
defaultValue: "-",
|
||||
isDict: "N",
|
||||
dictKey: "-",
|
||||
}, ],
|
||||
tableData: [],
|
||||
mainHeight: window.innerHeight - 85,
|
||||
defaultProps: {
|
||||
children: 'childrenList',
|
||||
|
@ -109,31 +52,44 @@ export default {
|
|||
assetStructureList: [],
|
||||
childrenList: [],
|
||||
showAssets: null,
|
||||
title: null
|
||||
title: null,
|
||||
tableIds: [],
|
||||
assetsModelRespArrayList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getTableStructure(data) {
|
||||
this.assetStructureList.forEach(asset => {
|
||||
asset.tableInfoList.forEach(tableInfo => {
|
||||
if (tableInfo == data){
|
||||
this.dataBaseConnectObj = asset
|
||||
}
|
||||
})
|
||||
})
|
||||
this.dataBaseConnectObj.tableName = data.tableName
|
||||
console.log("数据库连接对象:",this.dataBaseConnectObj)
|
||||
queryTableStructure(this.dataBaseConnectObj).then(
|
||||
getNowDataSource(data) {
|
||||
console.log(data)
|
||||
this.tableIds = data.dataTableList.map(dataTable => dataTable.dataTable.id);
|
||||
console.log("idList",this.tableIds)
|
||||
getAssetsModelListByTableIds(this.tableIds).then(
|
||||
res => {
|
||||
console.log(res)
|
||||
this.assetsModelRespArrayList = res.data
|
||||
console.log("this.assetsModelRespArrayList",this.assetsModelRespArrayList)
|
||||
}
|
||||
)
|
||||
this.dataSourceObj = data
|
||||
},
|
||||
getTableStructure(data) {
|
||||
console.log(data.dataTable.id)
|
||||
getAssetsModelByDataTableId(data.dataTable.id).then(
|
||||
res => {
|
||||
console.log("根据表ID",res.data)
|
||||
this.assetsModelList = res.data.assetsModelList
|
||||
this.tableInfo = res.data.dataTable
|
||||
console.log(this.tableInfo)
|
||||
}
|
||||
)
|
||||
},
|
||||
getBigStructure() {
|
||||
queryBigStructure().then(
|
||||
res => {
|
||||
this.assetStructureList = res.data
|
||||
console.log("BigStructure",res.data)
|
||||
this.assetStructureList = res.data.dataSourceDecorationList
|
||||
this.dataSourceCount = this.assetStructureList.length
|
||||
this.allTableCount = res.data.allTableCount
|
||||
this.allDataModelCount = res.data.allDataModelCount
|
||||
console.log("BigStructure",this.assetStructureList)
|
||||
this.assetsModelList = this.assetStructureList
|
||||
}
|
||||
)
|
||||
},
|
||||
|
@ -142,13 +98,13 @@ export default {
|
|||
if (node.level > 1) return resolve([]);
|
||||
const {data} = node;
|
||||
if (data.type === 'dataSource') {
|
||||
this.title = data.name + '('+data.dataSourceDatabaseName + '-' + data.fromSystem+')'
|
||||
this.title = data.name + '('+data.dataSource.dataSourceDatabaseName + '-' + data.dataSource.fromSystem+')'
|
||||
}
|
||||
if (data.type === 'dataTable') {
|
||||
this.title = data.tableName + '('+data.dataAnnotation + '-' + data.dataCount+')'
|
||||
this.title = data.tableName + '('+data.dataTable.tableAnnotation + '-' + data.dataTable.recordCount+')'
|
||||
}
|
||||
setTimeout(() => {
|
||||
resolve(data.tableInfoList)
|
||||
resolve(data.dataTableList)
|
||||
this.showAuth = data.type;
|
||||
}, 500);
|
||||
}
|
||||
|
|
|
@ -540,7 +540,6 @@ export default {
|
|||
}else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
console.log("test:",row)
|
||||
|
|
Loading…
Reference in New Issue