refacto:修改了资产模型字典结构(为映射字典做准备)
parent
ad3f4bd2fc
commit
b8057ede4a
|
@ -1,98 +0,0 @@
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-card>
|
|
||||||
<div slot="header" class="clearfix">
|
|
||||||
<span>资产模型基本信息</span>
|
|
||||||
</div>
|
|
||||||
<el-descriptions border :column="2">
|
|
||||||
<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>
|
|
||||||
</el-descriptions>
|
|
||||||
</el-card>
|
|
||||||
<el-card style=" margin-top: 20px;">
|
|
||||||
<div slot="header" class="clearfix">
|
|
||||||
<span>资产模型详细信息</span>
|
|
||||||
</div>
|
|
||||||
<el-table
|
|
||||||
:data="assetsModelList"
|
|
||||||
style="width: 100%;">
|
|
||||||
<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.isDictionary === 1 ? 'success' : ''">
|
|
||||||
{{scope.row.isDictionary}}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<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 === 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.isDictionary === 1" size="small" type="success">
|
|
||||||
{{scope.row.isDictionary}}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="reflectionDictionary" label="映射字典" >
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-popover
|
|
||||||
v-if="scope.row.isDictionary === 1"
|
|
||||||
placement="left"
|
|
||||||
width="200"
|
|
||||||
trigger="hover">
|
|
||||||
<el-table :data="[
|
|
||||||
{ label: '男', value: '1' },
|
|
||||||
{ label: '女', value: '2' },
|
|
||||||
{ label: '未知', value: '0' },
|
|
||||||
]">
|
|
||||||
<el-table-column property="label" label="字典标签"/>
|
|
||||||
<el-table-column property="value" label="字典值"/>
|
|
||||||
</el-table>
|
|
||||||
<el-tag slot="reference">{{scope.row.dictKey}}</el-tag>
|
|
||||||
</el-popover>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="id" label="操作" >
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button type="text">编辑</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'OverallAssetStructure',
|
|
||||||
props: {
|
|
||||||
assetsModelList: {
|
|
||||||
type: Array
|
|
||||||
},
|
|
||||||
tableInfo: {
|
|
||||||
type: Object
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -1,189 +0,0 @@
|
||||||
<template>
|
|
||||||
<el-row :gutter="40" class="panel-group">
|
|
||||||
<div class="title-header">
|
|
||||||
整体数据资产结构概述
|
|
||||||
</div>
|
|
||||||
<el-col :lg="8" :sm="12" :xs="12" class="card-panel-col">
|
|
||||||
<div class="card-panel" @click="handleSetLineChartData('newVisitis')">
|
|
||||||
<div class="card-panel-icon-wrapper icon-people">
|
|
||||||
<svg-icon class-name="card-panel-icon" icon-class="database"/>
|
|
||||||
</div>
|
|
||||||
<div class="card-panel-description">
|
|
||||||
<div class="card-panel-text">
|
|
||||||
数据接入
|
|
||||||
</div>
|
|
||||||
<count-to :duration="2600" :end-val="dataSourceCount" :start-val="0" class="card-panel-num"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :lg="8" :sm="12" :xs="12" class="card-panel-col">
|
|
||||||
<div class="card-panel" @click="handleSetLineChartData('messages')">
|
|
||||||
<div class="card-panel-icon-wrapper icon-message">
|
|
||||||
<svg-icon class-name="card-panel-icon" icon-class="table"/>
|
|
||||||
</div>
|
|
||||||
<div class="card-panel-description">
|
|
||||||
<div class="card-panel-text">
|
|
||||||
资产模型
|
|
||||||
</div>
|
|
||||||
<count-to :duration="3000" :end-val="allTableCount" :start-val="0" class="card-panel-num"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :lg="8" :sm="12" :xs="12" class="card-panel-col">
|
|
||||||
<div class="card-panel" @click="handleSetLineChartData('purchases')">
|
|
||||||
<div class="card-panel-icon-wrapper icon-money">
|
|
||||||
<svg-icon class-name="card-panel-icon" icon-class="field"/>
|
|
||||||
</div>
|
|
||||||
<div class="card-panel-description">
|
|
||||||
<div class="card-panel-text">
|
|
||||||
数据模型
|
|
||||||
</div>
|
|
||||||
<count-to :duration="3200" :end-val="allDataModelCount" :start-val="0" class="card-panel-num"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import CountTo from 'vue-count-to'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
dataSourceCount: {
|
|
||||||
type :Number
|
|
||||||
},
|
|
||||||
allTableCount: {
|
|
||||||
type :Number
|
|
||||||
},
|
|
||||||
allDataModelCount: {
|
|
||||||
type :Number
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
CountTo
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleSetLineChartData(type) {
|
|
||||||
this.$emit('handleSetLineChartData', type)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.panel-group {
|
|
||||||
margin-top: 18px;
|
|
||||||
|
|
||||||
.card-panel-col {
|
|
||||||
margin-bottom: 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-panel {
|
|
||||||
height: 108px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 12px;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
color: #666;
|
|
||||||
background: #fff;
|
|
||||||
box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
|
|
||||||
border-color: rgba(0, 0, 0, .05);
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
.card-panel-icon-wrapper {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-people {
|
|
||||||
background: #40c9c6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-message {
|
|
||||||
background: #36a3f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-money {
|
|
||||||
background: #f4516c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-shopping {
|
|
||||||
background: #34bfa3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-people {
|
|
||||||
color: #40c9c6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-message {
|
|
||||||
color: #36a3f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-money {
|
|
||||||
color: #f4516c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-shopping {
|
|
||||||
color: #34bfa3
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-panel-icon-wrapper {
|
|
||||||
float: left;
|
|
||||||
margin: 14px 0 0 14px;
|
|
||||||
padding: 16px;
|
|
||||||
transition: all 0.38s ease-out;
|
|
||||||
border-radius: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-panel-icon {
|
|
||||||
float: left;
|
|
||||||
font-size: 48px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-panel-description {
|
|
||||||
float: right;
|
|
||||||
font-weight: bold;
|
|
||||||
margin: 26px;
|
|
||||||
margin-left: 0px;
|
|
||||||
|
|
||||||
.card-panel-text {
|
|
||||||
line-height: 18px;
|
|
||||||
color: rgba(0, 0, 0, 0.45);
|
|
||||||
font-size: 16px;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-panel-num {
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 550px) {
|
|
||||||
.card-panel-description {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-panel-icon-wrapper {
|
|
||||||
float: none !important;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
margin: 0 !important;
|
|
||||||
|
|
||||||
.svg-icon {
|
|
||||||
display: block;
|
|
||||||
margin: 14px auto !important;
|
|
||||||
float: none !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.title-header{
|
|
||||||
text-align: center;
|
|
||||||
width: 100%;
|
|
||||||
font-size: 46px;
|
|
||||||
font-weight: 600;
|
|
||||||
line-height: 100px;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,318 +0,0 @@
|
||||||
<template>
|
|
||||||
<el-row :gutter="40" class="panel-group">
|
|
||||||
<div class="title-header">
|
|
||||||
{{dataSourceObj.dataSource.fromSystem}} - 资产结构概述
|
|
||||||
</div>
|
|
||||||
<el-col :sm="12" :xs="12" class="card-panel-col">
|
|
||||||
<div class="card-panel" @click="handleSetLineChartData('messages')">
|
|
||||||
<div class="card-panel-icon-wrapper icon-message">
|
|
||||||
<svg-icon class-name="card-panel-icon" icon-class="table"/>
|
|
||||||
</div>
|
|
||||||
<div class="card-panel-description">
|
|
||||||
<div class="card-panel-text">
|
|
||||||
资产模型
|
|
||||||
</div>
|
|
||||||
<count-to :duration="3000" :end-val="dataSourceObj.dataSource.tableCount" :start-val="0" class="card-panel-num"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :sm="12" :xs="12" class="card-panel-col">
|
|
||||||
<div class="card-panel" @click="handleSetLineChartData('purchases')">
|
|
||||||
<div class="card-panel-icon-wrapper icon-money">
|
|
||||||
<svg-icon class-name="card-panel-icon" icon-class="field"/>
|
|
||||||
</div>
|
|
||||||
<div class="card-panel-description">
|
|
||||||
<div class="card-panel-text">
|
|
||||||
数据模型
|
|
||||||
</div>
|
|
||||||
<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-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="dictionary.dictionaryName"></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="dictionaryInfoResp in dictionaryInfoRespList" :md="8" :sm="24" :xs="12">
|
|
||||||
<el-card class="box-card" style="height: 300px">
|
|
||||||
<div slot="header" class="clearfix">
|
|
||||||
<span>{{dictionaryInfoResp.dictionary.dictionaryName}}</span>
|
|
||||||
<el-button style="float: right; padding: 3px 0"
|
|
||||||
type="text"
|
|
||||||
@click="dictionaryInfoResp.dictionaryInfoList.push({ dictionaryInfoTag: null, dictionaryInfoValue: null, isEdit: true })"
|
|
||||||
>新增</el-button>
|
|
||||||
</div>
|
|
||||||
<el-table :data="dictionaryInfoResp.dictionaryInfoList" style="width: 100%" height="280px">
|
|
||||||
<el-table-column label="标签">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span v-if="!scope.row.isEdit">{{scope.row.dictionaryInfoTag}}</span>
|
|
||||||
<el-input v-if="scope.row.isEdit" v-model="scope.row.dictionaryInfoTag" size="mini"></el-input>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="值">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span v-if="!scope.row.isEdit">{{scope.row.dictionaryInfoValue}}</span>
|
|
||||||
<el-input v-if="scope.row.isEdit" v-model="scope.row.dictionaryInfoValue" size="mini"></el-input>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
v-if="!scope.row.isEdit"
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="updateEdit(scope.row.id)"
|
|
||||||
:key="scope.row.id + this.nowTime"
|
|
||||||
>修改</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-tabs>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import CountTo from 'vue-count-to'
|
|
||||||
import OverallAssetStructure from './OverallAssetStructure.vue'
|
|
||||||
import {getDictionaryRespByDataSourceId} from "@/api/dataSource/dictionary";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
watch:{
|
|
||||||
// dataSourceId:{
|
|
||||||
// // 此处监听variable变量,当期有变化时执行
|
|
||||||
// handler(item1,item2){
|
|
||||||
// console.log("新值",item1)
|
|
||||||
// console.log("旧址",item2)
|
|
||||||
// getDictionaryRespByDataSourceId(item1).then(
|
|
||||||
// res => {
|
|
||||||
// console.log("字典表响应对象:",res.data)
|
|
||||||
// this.dictionaryInfoRespList = res.data
|
|
||||||
// this.dictionaryInfoRespList.forEach(dictionaryInfoResp => {
|
|
||||||
// dictionaryInfoResp.dictionaryInfoList.forEach(dictionaryInfo => {
|
|
||||||
// dictionaryInfo.isEdit = false;
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
assetsModelRespArrayList: {
|
|
||||||
type: Array
|
|
||||||
},
|
|
||||||
dataSourceObj: {
|
|
||||||
type: Object
|
|
||||||
},
|
|
||||||
dataSourceId: {
|
|
||||||
type: Number,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
nowTime: null,
|
|
||||||
dictionaryInfoRespList: [],
|
|
||||||
activeName: 'first',
|
|
||||||
dictionary: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
OverallAssetStructure,
|
|
||||||
CountTo
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
updateEdit(row) {
|
|
||||||
console.log("行对象:"+row)
|
|
||||||
this.dictionaryInfoRespList.forEach(dictionaryInfoResp => {
|
|
||||||
dictionaryInfoResp.dictionaryInfoList.forEach(dictionaryInfo => {
|
|
||||||
if (dictionaryInfo.id == row){
|
|
||||||
console.log("进来了",dictionaryInfo.isEdit)
|
|
||||||
dictionaryInfo.isEdit = true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
this.$forceUpdate()
|
|
||||||
this.nowTime = new Date()
|
|
||||||
},
|
|
||||||
editConfirm(row){
|
|
||||||
if (!row.dictionaryInfoTag || !row.dictionaryInfoValue) {
|
|
||||||
this.$message.error('字典标签或字典值,不可为空');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
row.isEdit = false;
|
|
||||||
},
|
|
||||||
handleSetLineChartData(type) {
|
|
||||||
this.$emit('handleSetLineChartData', type)
|
|
||||||
},
|
|
||||||
addDict(){
|
|
||||||
if (!this.dictionary.dictionaryName){
|
|
||||||
this.$message.error('数据字典,不可为空');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log(this.dictionary.dictionaryName)
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.panel-group {
|
|
||||||
margin-top: 18px;
|
|
||||||
|
|
||||||
.card-panel-col {
|
|
||||||
margin-bottom: 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-panel {
|
|
||||||
height: 108px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 12px;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
color: #666;
|
|
||||||
background: #fff;
|
|
||||||
box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
|
|
||||||
border-color: rgba(0, 0, 0, .05);
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
.card-panel-icon-wrapper {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-people {
|
|
||||||
background: #40c9c6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-message {
|
|
||||||
background: #36a3f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-money {
|
|
||||||
background: #f4516c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-shopping {
|
|
||||||
background: #34bfa3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-people {
|
|
||||||
color: #40c9c6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-message {
|
|
||||||
color: #36a3f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-money {
|
|
||||||
color: #f4516c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-shopping {
|
|
||||||
color: #34bfa3
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-panel-icon-wrapper {
|
|
||||||
float: left;
|
|
||||||
margin: 14px 0 0 14px;
|
|
||||||
padding: 16px;
|
|
||||||
transition: all 0.38s ease-out;
|
|
||||||
border-radius: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-panel-icon {
|
|
||||||
float: left;
|
|
||||||
font-size: 48px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-panel-description {
|
|
||||||
float: right;
|
|
||||||
font-weight: bold;
|
|
||||||
margin: 26px;
|
|
||||||
margin-left: 0px;
|
|
||||||
|
|
||||||
.card-panel-text {
|
|
||||||
line-height: 18px;
|
|
||||||
color: rgba(0, 0, 0, 0.45);
|
|
||||||
font-size: 16px;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-panel-num {
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 550px) {
|
|
||||||
.card-panel-description {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-panel-icon-wrapper {
|
|
||||||
float: none !important;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
margin: 0 !important;
|
|
||||||
|
|
||||||
.svg-icon {
|
|
||||||
display: block;
|
|
||||||
margin: 14px auto !important;
|
|
||||||
float: none !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.title-header{
|
|
||||||
text-align: center;
|
|
||||||
width: 100%;
|
|
||||||
font-size: 46px;
|
|
||||||
font-weight: 600;
|
|
||||||
line-height: 100px;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,133 +0,0 @@
|
||||||
<template>
|
|
||||||
<el-container :style="{height: mainHeight + 'px'}">
|
|
||||||
<el-aside>
|
|
||||||
<el-tree :data="assetStructureList"
|
|
||||||
:expand-on-click-node="false"
|
|
||||||
:load="expandTable"
|
|
||||||
lazy
|
|
||||||
@node-click="(data) => showAssets=data.type"
|
|
||||||
:props="defaultProps">
|
|
||||||
<div class="custom-tree-node" slot-scope="{ node, data }">
|
|
||||||
<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 :dataSourceCount="dataSourceCount" :allTableCount="allTableCount" :allDataModelCount="allDataModelCount" v-if="showAssets == null"/>
|
|
||||||
<overall-specific-assets :dataSourceId="dataSourceId" :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>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import OverallAssets from './dashboard/OverallAssets.vue'
|
|
||||||
import OverallSpecificAssets from './dashboard/OverallSpecificAssets.vue'
|
|
||||||
import OverallAssetStructure from './dashboard/OverallAssetStructure.vue'
|
|
||||||
import {getAssetsModelByDataTableId, getAssetsModelListByTableIds} from "@/api/dataSource/assets";
|
|
||||||
import {queryBigStructure} from "@/api/dataSource/data";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'assetStructure',
|
|
||||||
components: { OverallAssetStructure, OverallSpecificAssets, OverallAssets },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dataSourceId: null,
|
|
||||||
tableInfo: {},
|
|
||||||
assetsModelList: [],
|
|
||||||
dataSourceObj: null,
|
|
||||||
tableCount:0,
|
|
||||||
dataModelCount:0,
|
|
||||||
dataSourceCount: 0,
|
|
||||||
allTableCount: 0,
|
|
||||||
allDataModelCount: 0,
|
|
||||||
dataBaseConnectObj: {},
|
|
||||||
tableData: [],
|
|
||||||
mainHeight: window.innerHeight - 85,
|
|
||||||
defaultProps: {
|
|
||||||
children: 'childrenList',
|
|
||||||
label: 'name'
|
|
||||||
},
|
|
||||||
assetStructureList: [],
|
|
||||||
childrenList: [],
|
|
||||||
showAssets: null,
|
|
||||||
title: null,
|
|
||||||
tableIds: [],
|
|
||||||
assetsModelRespArrayList: [],
|
|
||||||
dictionaryInfoRespList: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getNowDataSource(data) {
|
|
||||||
console.log(data)
|
|
||||||
this.tableIds = data.dataTableList.map(dataTable => dataTable.dataTable.id);
|
|
||||||
console.log("idList",this.tableIds)
|
|
||||||
getAssetsModelListByTableIds(this.tableIds).then(
|
|
||||||
res => {
|
|
||||||
this.assetsModelRespArrayList = res.data
|
|
||||||
console.log("this.assetsModelRespArrayList",this.assetsModelRespArrayList)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
this.dataSourceId = data.dataSource.id
|
|
||||||
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.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
|
|
||||||
}
|
|
||||||
)
|
|
||||||
},
|
|
||||||
expandTable( node, resolve){
|
|
||||||
if (node.level === 0) return resolve(this.assetStructureList);
|
|
||||||
if (node.level > 1) return resolve([]);
|
|
||||||
const {data} = node;
|
|
||||||
if (data.type === 'dataSource') {
|
|
||||||
this.title = data.name + '('+data.dataSource.dataSourceDatabaseName + '-' + data.dataSource.fromSystem+')'
|
|
||||||
}
|
|
||||||
if (data.type === 'dataTable') {
|
|
||||||
this.title = data.tableName + '('+data.dataTable.tableAnnotation + '-' + data.dataTable.recordCount+')'
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
resolve(data.dataTableList)
|
|
||||||
this.showAuth = data.type;
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getBigStructure()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.el-aside {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
width: 400px;
|
|
||||||
background-color: white;
|
|
||||||
}
|
|
||||||
.el-main {
|
|
||||||
background-color: #f1f1f1;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -49,7 +49,7 @@
|
||||||
trigger="click">
|
trigger="click">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="18">
|
<el-col :span="18">
|
||||||
<el-input v-model="dictionaryNameAndVue"></el-input>
|
<el-input v-model="dictionary.dictionaryName"></el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-button @click="addDict">确定</el-button>
|
<el-button @click="addDict">确定</el-button>
|
||||||
|
@ -59,31 +59,28 @@
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
|
|
||||||
<el-col v-for="dictionaryInfoResp in dictionaryInfoRespList" :md="8" :sm="24" :xs="12">
|
<el-col v-for="dictionaryInfoResp in dictionaryInfoRespList" :md="8" :sm="24" :xs="12">
|
||||||
{{dictionaryInfoResp.dictionaryList}}
|
|
||||||
<el-card class="box-card" style="height: 300px">
|
<el-card class="box-card" style="height: 300px">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>{{dictionaryInfoResp.dictionaryNameAndValue}}</span>
|
<span>{{dictionaryInfoResp.dictionary.dictionaryName+'(+'+dictionaryInfoResp.dictionary.dictionaryValue+')'}}</span>
|
||||||
<el-button style="float: right; padding: 3px 0"
|
<el-button style="float: right; padding: 3px 0"
|
||||||
type="text"
|
type="text"
|
||||||
@click="dictionaryInfoResp.dictionaryList.push({ label: null, value: null, isEdit: true })"
|
@click="dictionaryInfoResp.dictionaryInfoList.push({ value: null, label: null, isEdit: true })"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="dictionaryInfoResp.dictionaryList" style="width: 100%" height="280px">
|
<el-table :data="dictionaryInfoResp.dictionaryInfoList" style="width: 100%" height="280px">
|
||||||
<el-table-column label="标签">
|
<el-table-column 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 label="值">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="!scope.row.isEdit">{{scope.row.value}}</span>
|
<span v-if="!scope.row.isEdit">{{scope.row.value}}</span>
|
||||||
<el-input v-if="scope.row.isEdit" v-model="scope.row.value" size="mini"></el-input>
|
<el-input v-if="scope.row.isEdit" v-model="scope.row.value" size="mini"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column 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 label="操作">
|
<el-table-column label="操作">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -91,12 +88,11 @@
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="updateEdit(scope.row.id)"
|
@click="$set(scope.row,'isEdit',true)"
|
||||||
:key="scope.row.id "
|
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.isEdit"
|
v-if="scope.row.isEdit"
|
||||||
@click="editConfirm(scope.row,dictionaryInfoResp.id)"
|
@click="editConfirm(scope.row,dictionaryInfoResp.dictionary.id)"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-finished"
|
icon="el-icon-finished"
|
||||||
|
@ -108,10 +104,11 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-tabs v-model="activeName" type="border-card" >
|
<el-tabs v-model="activeName" type="border-card" >
|
||||||
<el-tab-pane :label="assetsModelResp.dataTable.tableName" :key="assetsModelResp.dataTable.id" v-for="(assetsModelResp , index) in assetsModelRespArrayList" :name="index">
|
<el-tab-pane :name="assetsModelResp.dataTable.tableName" :label="assetsModelResp.dataTable.tableName" :key="assetsModelResp.dataTable.id" v-for="assetsModelResp in assetsModelRespArrayList">
|
||||||
<overall-asset-structure :tableInfo="assetsModelResp.dataTable" :assetsModelList="assetsModelResp.assetsModelList" />
|
<overall-asset-structure :tableInfo="assetsModelResp.dataTable" :assetsModelList="assetsModelResp.assetsModelList" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
@ -126,44 +123,54 @@ import OverallAssetStructure from './OverallAssetStructure.vue'
|
||||||
import {getDictionaryRespByDataSourceId, insertDictionary, insertDictionaryInfo} from "@/api/dataSource/dictionary";
|
import {getDictionaryRespByDataSourceId, insertDictionary, insertDictionaryInfo} from "@/api/dataSource/dictionary";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
watch:{
|
||||||
|
assetsModelRespArrayList:{
|
||||||
props: {
|
// 此处监听variable变量,当期有变化时执行
|
||||||
dictionaryInfoRespList:{
|
handler(item1,item2){
|
||||||
type:Array,
|
console.log("新值",item1)
|
||||||
// 设置默认值,如果父组件没有传递这个 prop,子组件将使用这个默认值
|
this.activeName=item1[0].dataTable.tableName
|
||||||
default:()=>[],
|
console.log("name:",this.activeName)
|
||||||
|
console.log("旧址",item2)
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
props: {
|
||||||
assetsModelRespArrayList: {
|
assetsModelRespArrayList: {
|
||||||
type: Array
|
type: Array
|
||||||
},
|
},
|
||||||
dataSourceObj: {
|
dataSourceObj: {
|
||||||
type: Object
|
type: Object
|
||||||
},
|
},
|
||||||
dataSourceId: {
|
dictionaryInfoRespList: {
|
||||||
type: Number,
|
type: Array
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
originalString: "性别(system_sex)",
|
nowTime: null,
|
||||||
dictionaryInfoRespList: [],
|
activeName: '',
|
||||||
activeName: '0',
|
|
||||||
// activeName: assetsModelRespArrayList[0].dataTableList.tableList.tableName,
|
|
||||||
dictionaryNameAndVue:"",
|
|
||||||
dictionary: {},
|
dictionary: {},
|
||||||
|
giveObj: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|
||||||
OverallAssetStructure,
|
OverallAssetStructure,
|
||||||
CountTo
|
CountTo
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// updateEdit(row) {
|
||||||
updateEdit(){
|
// this.$set(row,'isEdit',true)
|
||||||
|
// console.log("行对象:"+row)
|
||||||
},
|
// this.dictionaryInfoRespList.forEach(dictionaryInfoResp => {
|
||||||
|
// dictionaryInfoResp.dictionaryInfoList.forEach(dictionaryInfo => {
|
||||||
|
// if (dictionaryInfo.id == row){
|
||||||
|
// console.log("进来了",dictionaryInfo.isEdit)
|
||||||
|
// this.$set(dictionaryInfo,'isEdit',true)
|
||||||
|
// dictionaryInfo.isEdit = true
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// },
|
||||||
editConfirm(row,dictionaryId){
|
editConfirm(row,dictionaryId){
|
||||||
if (!row.label || !row.value) {
|
if (!row.label || !row.value) {
|
||||||
this.$message.error('字典标签或字典值,不可为空');
|
this.$message.error('字典标签或字典值,不可为空');
|
||||||
|
@ -176,16 +183,27 @@ export default {
|
||||||
console.log("插入字典",res)
|
console.log("插入字典",res)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
this.getDictionaryResp()
|
||||||
|
},
|
||||||
|
getDictionaryResp() {
|
||||||
|
getDictionaryRespByDataSourceId(this.dataSourceObj.dataSource.id).then(
|
||||||
|
res => {
|
||||||
|
console.log("字典表响应对象:",res.data)
|
||||||
|
this.giveObj = res.data
|
||||||
|
this.giveObj.forEach(dictionaryInfoResp => {
|
||||||
|
dictionaryInfoResp.dictionaryInfoList.forEach(dictionaryInfo => {
|
||||||
|
this.$set(dictionaryInfo,'isEdit',false)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.$emit('handleSetLineChartData', this.giveObj)
|
||||||
|
}
|
||||||
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
handleSetLineChartData(type) {
|
handleSetLineChartData(type) {
|
||||||
this.$emit('handleSetLineChartData', type)
|
this.$emit('handleSetLineChartData', type)
|
||||||
},
|
},
|
||||||
addDict(){
|
addDict(){
|
||||||
if (!this.dictionaryNameAndVue){
|
if (!this.dictionary.dictionaryName){
|
||||||
this.$message.error('数据字典,不可为空');
|
this.$message.error('数据字典,不可为空');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -197,7 +215,8 @@ export default {
|
||||||
res=>{
|
res=>{
|
||||||
console.log("插入字典",res)
|
console.log("插入字典",res)
|
||||||
this.$message.success("插入字典成功")
|
this.$message.success("插入字典成功")
|
||||||
this.getBigStructure()
|
this.dictionary = {}
|
||||||
|
this.getDictionaryResp()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
|
@ -35,7 +35,7 @@ export default {
|
||||||
components: { OverallAssetStructure, OverallSpecificAssets, OverallAssets },
|
components: { OverallAssetStructure, OverallSpecificAssets, OverallAssets },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dataSourceId: null,
|
dataSourceId: 0,
|
||||||
tableInfo: {},
|
tableInfo: {},
|
||||||
assetsModelList: [],
|
assetsModelList: [],
|
||||||
dataSourceObj: null,
|
dataSourceObj: null,
|
||||||
|
|
Loading…
Reference in New Issue