Compare commits

...

12 Commits

Author SHA1 Message Date
xiaohuang 88359ed9e6 资产结构测试7 2024-04-28 09:57:20 +08:00
xiaohuang 0f8c27aeca 资产结构测试6 2024-04-27 19:54:39 +08:00
xiaohuang 774cc447d4 资产结构测试5 2024-04-27 16:56:23 +08:00
xiaohuang 518216279d 资产结构测试4 2024-04-26 22:25:31 +08:00
xiaohuang 97fbf8b1ce 资产结构测试3 2024-04-26 17:01:13 +08:00
xiaohuang 95db638abb 资产结构测试2 2024-04-26 14:03:46 +08:00
xiaohuang 180fd905fc 资产结构测试5 信息统计组件 2024-04-25 22:25:39 +08:00
xiaohuang 6daac51b9c 资产结构测试4 左边目录已经和接口对接成功 2024-04-25 14:17:26 +08:00
xiaohuang 61b5b344eb 资产结构测试3 2024-04-25 09:07:32 +08:00
xiaohuang 7e007403c9 资产结构测试2 2024-04-25 09:07:02 +08:00
xiaohuang f9b086e019 资产结构测试1 2024-04-24 22:03:00 +08:00
xiaohuang a9dd6cb370 数据库接入 2024-04-22 09:59:03 +08:00
12 changed files with 1781 additions and 5 deletions

View File

@ -36,6 +36,7 @@
"url": "https://gitee.com/y_project/MuYu-Cloud.git"
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"@riophae/vue-treeselect": "0.4.0",
"axios": "0.24.0",
"clipboard": "2.0.8",

99
src/api/etl/etl.js 100644
View File

@ -0,0 +1,99 @@
import request from '@/utils/request'
// 查询列表
export function listInfo(query) {
return request({
url: '/etl/info/list',
method: 'get',
params: query
})
}
// 查询详细
export function getInfo(id) {
return request({
url: '/etl/info/' + id,
method: 'get'
})
}
// 新增
export function addInfo(data) {
return request({
url: '/etl/info',
method: 'post',
data: data
})
}
// 新增
export function connectionTest(data) {
return request({
url: '/etl/info/connectionTest',
method: 'post',
data: data
})
}
// 修改
export function updateInfo(data) {
return request({
url: '/etl/info',
method: 'put',
data: data
})
}
// 删除
export function delInfo(id) {
return request({
url: '/etl/info/' + id,
method: 'delete'
})
}
//获取
export function getTableTree(){
return request({
url: 'etl/info/getTableTree',
method: 'get'
})
}
// 修改资产数据结构
export function updateStructureInfo(data) {
return request({
url: '/etl/info/updateStructureInfo',
method: 'put',
data
})
}
//获取字典
export function getDict(id){
return request({
url: '/etl/info/getDict'+id,
method: 'get'
})
}
//添加字典内容
export function insertDictInfo(data){
return request({
url: '/etl/info/insertDictInfo',
method: 'post',
data
})
}
//添加字典内容
export function insertDict(data){
return request({
url: '/etl/info/insertDict',
method: 'post',
data
})
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询数据资产列表
export function listBasic(query) {
return request({
url: '/system/basic/list',
method: 'get',
params: query
})
}
// 查询数据资产详细
export function getBasic(id) {
return request({
url: '/system/basic/' + id,
method: 'get'
})
}
// 新增数据资产
export function addBasic(data) {
return request({
url: '/system/basic',
method: 'post',
data: data
})
}
// 修改数据资产
export function updateBasic(data) {
return request({
url: '/system/basic',
method: 'put',
data: data
})
}
// 删除数据资产
export function delBasic(id) {
return request({
url: '/system/basic/' + id,
method: 'delete'
})
}

View File

@ -73,7 +73,7 @@ service.interceptors.request.use(config => {
// 响应拦截器
service.interceptors.response.use(res => {
debugger
// 未设置状态码则默认成功状态
const code = res.data.code || 200;
// 获取错误信息

View File

@ -0,0 +1,193 @@
<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" v-if="!infoOpen">
<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="fundDataNum.basicNum" :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="fundDataNum.tableNum" :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="fundDataNum.structureNum" :start-val="0" class="card-panel-num"/>
</div>
</div>
</el-col>
</el-row>
</template>
<script>
import CountTo from 'vue-count-to'
export default {
props:{
infoOpen:false,
fundDataNum: {
basicNum: null,
tableNum: null,
structureNum: null,
}
},
watch: {
infoOpen(newName, oldName) {
console.log(newName)
console.log(oldName)
}
},
name: 'AssetsBasic',
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: 0;
.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>

View File

@ -0,0 +1,562 @@
<template>
<div>
<el-row :gutter="40" class="panel-group">
<div class="title-header">
{{ this.name }}
</div>
<el-col :lg="12" :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="this.tableInfoList.length" :start-val="0" class="card-panel-num"/>
</div>
</div>
</el-col>
<el-col :lg="12" :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="this.structureNum" :start-val="0" class="card-panel-num"/>
</div>
</div>
</el-col>
</el-row>
<el-row :gutter="40" class="panel-group">
<el-card>
<el-tabs type="border-card" @tab-click="handleClick">
<el-tab-pane
v-for="tableInfo in tableInfoList"
:label="tableInfo.tableName+'('+tableInfo.info.tableRemark+')'">
<el-card>
<div slot="header" class="clearfix">
<span>基础字典</span>
<!--新增字典表-->
<el-button type="text" style="float: right" @click="insertDictOpen = true">新增字典</el-button>
</div>
<el-row>
<el-card style="width: 300px; float: left;margin:10px" v-for="dictInfo in dictList">
<div slot="header" class="clearfix">
<span>{{ dictInfo.dictName }}({{ dictInfo.dictType }})</span>
<!--新增字典具体信息-->
<el-button style="float: right; padding: 3px 0" type="text" @click="insertDictList(dictInfo)">
</el-button>
</div>
<el-table :data="dictInfo.dictInfoList" height="216">
<el-table-column label="标签">
<template slot-scope="scope">
<span v-if="!scope.row.isEdit">{{ scope.row.infoName }}</span>
<el-input :value="scope.row.infoName"
v-model="scope.row.infoName"
v-if="scope.row.isEdit"></el-input>
</template>
</el-table-column>
<el-table-column label="值">
<template slot-scope="scope">
<span v-if="!scope.row.isEdit">{{ scope.row.infoValue }}</span>
<el-input :value="scope.row.infoValue"
v-model="scope.row.infoValue"
v-if="scope.row.isEdit"></el-input>
</template>
</el-table-column>
<el-table-column>
<template slot-scope="scope">
<el-button type="text" v-if="!scope.row.isEdit" @click="scope.row.isEdit = true">
</el-button>
<el-button type="text" v-if="scope.row.isEdit" @click="insertDictInfo(dictInfo.id,scope.row)">
确认
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-row>
</el-card>
<!--资产模型基本信息-->
<el-card>
<div slot="header" class="clearfix">
<span>资产模型基本信息</span>
</div>
<el-descriptions
class="margin-top"
:column="2"
border>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
表名称
</template>
{{ tableInfo.info.tableName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-mobile-phone"></i>
表备注
</template>
{{ tableInfo.info.tableRemark }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-location-outline"></i>
数据量
</template>
{{ tableInfo.info.dataNum }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-tickets"></i>
备注
</template>
<el-tag size="small">学校</el-tag>
</el-descriptions-item>
</el-descriptions>
</el-card>
<!--数据模型-->
<el-card>
<div slot="header" class="clearfix">
<span>数据模型</span>
</div>
<el-table
:data="tableInfo.info.structureList"
style="width: 100%"
>
<el-table-column fixed prop="columnName" label="字段名称" width="200px"/>
<el-table-column fixed prop="columnRemark" label="字段注释"/>
<el-table-column fixed prop="isPrimary" label="是否主键">
<template slot-scope="scope">
<el-tag :type="scope.row.isPrimary==='Y'?'success':'danger'">
{{ scope.row.isPrimary }}
</el-tag>
</template>
</el-table-column>
<el-table-column fixed prop="columnType" label="数据类型"/>
<el-table-column fixed prop="javaType" label="映射类型"/>
<el-table-column fixed prop="columnLength" label="字段长度"/>
<el-table-column fixed prop="columnDecimals" label="小数位数"/>
<el-table-column fixed prop="isNull" label="是否为空">
<template slot-scope="scope">
<el-tag :type="scope.row.isNull==='Y'?'success':'danger'">
{{ scope.row.isNull }}
</el-tag>
</template>
</el-table-column>
<el-table-column fixed prop="defaultValue" label="默认值"/>
<el-table-column fixed prop="isDictionary" label="是否字典">
<template slot-scope="scope">
<el-tag v-if="scope.row.isDictionary!==null"
:type="scope.row.isDictionary==='Y'?'success':'danger'">
{{ scope.row.isDictionary }}
</el-tag>
{{ scope.row.isDictionary }}
</template>
</el-table-column>
<el-table-column fixed label="映射字典">
<template slot-scope="scope">
<el-popover trigger="hover" placement="left"
@mouseover.native="findDictList(scope.row.dictionaryTable)"
v-if="scope.row.dictionaryTable !== null">
<el-table
:data="findedDictList"
border
style="width: 100%">
<el-table-column prop="infoName" label="标签" width="180"></el-table-column>
<el-table-column prop="infoValue" label="值" width="180"></el-table-column>
</el-table>
<div slot="reference" class="name-wrapper">
<el-tag >
{{ scope.row.dictionaryTable }}
</el-tag>
</div>
</el-popover>
</template>
</el-table-column>
<el-table-column fixed prop="dictionaryTable" label="操作">
<template slot-scope="scope">
<el-button
type="text"
@click="editDictInfo(scope.row)">
编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-tab-pane>
</el-tabs>
</el-card>
</el-row>
<!-- 添加新字典表对话框-->
<el-dialog title="字典表基础信息" style="float:left; margin:20px" :visible.sync="insertDictOpen">
<el-form :model="assetDictFormInfo">
<el-form-item label="字典表名" label-width="120px">
<el-input v-model="assetDictFormInfo.dictName" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="字典类型" label-width="120px">
<el-input v-model="assetDictFormInfo.dictType" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="insertDictOpen = false"> </el-button>
<el-button type="primary" @click="insertDict(tableInfo.info)"> </el-button>
</div>
</el-dialog>
<!-- 编辑字典详细信息 -->
<el-dialog title="数据详情修改" :visible.sync="structureInfoFormOpen">
{{ this.structureInfoForm }}
<el-form :model="structureInfoForm" :inline="true" label-width="150px">
<el-row>
<el-col :span="12">
<el-form-item label="字段名">
<el-input v-model="structureInfoForm.columnName" disabled autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="是否主键">
<el-tag :type="structureInfoForm.isPrimary==='Y'?'success':'danger'" v-model="structureInfoForm.isNull">
{{ structureInfoForm.isPrimary }}
</el-tag>
</el-form-item>
<el-form-item label="数据类型">
<el-input v-model="structureInfoForm.columnType" disabled autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="长度">
<el-input v-model="structureInfoForm.columnLength" disabled autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="是否字典">
<el-switch
v-model="structureInfoForm.isDictionary"
active-value="Y"
inactive-value="N"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注名">
<el-input v-model="structureInfoForm.columnRemark" disabled autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="是否非空">
<el-tag :type="structureInfoForm.isNull==='Y'?'success':'danger'" v-model="structureInfoForm.isNull">
{{ structureInfoForm.isNull }}
</el-tag>
</el-form-item>
<el-form-item label="java类型">
<el-input v-model="structureInfoForm.javaType" disabled autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="小数点位数">
<el-input v-model="structureInfoForm.columnDecimals" disabled autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="选择字典" v-if="structureInfoForm.isDictionary==='Y'">
<el-select v-model="structureInfoForm.dictionaryTable" placeholder="选择系统中的字典"
@change="checkDictList">
<el-option v-for="dictInfo in dictList" :label="dictInfo.dictName"
:value="dictInfo.dictType"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<!-- 显示所选字典内容-->
<el-row :gutter="20">
<el-col :span="12" :offset="6">
<div class="grid-content bg-purple">
<el-table :data="selectDictList">
<el-table-column label="标签" prop="infoName"></el-table-column>
<el-table-column label="值" prop="infoValue"></el-table-column>
</el-table>
</div>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="outEdit"> </el-button>
<el-button type="primary" @click="updateStructureInfo"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import CountTo from 'vue-count-to'
import {insertDict, insertDictInfo, updateStructureInfo} from "@/api/etl/etl";
export default {
props: {
name: null,
tableInfoList: Array,
dictList: Array
},
watch: {
//
tableInfoList: {
handler(newValue) {
this.structureNum = 0
newValue.forEach(asset => {
this.structureNum += asset.info.structureList.length
})
},
immediate: true,
deep: true
},
'structureInfoForm.isDictionary': {
handler(newValue) {
// if (newValue === "") {
//
// } else {
// console.log('' + newValue)
// if (!newValue) {
// this.structureInfoForm.dictionaryTable = null
// this.structureInfoForm.isDictTionary = null
// this.selectDictList = []
// }
// }
//
},
// immediate: true,
// deep: true
}
},
name: 'AssetsModel',
components: {
CountTo
},
data() {
return {
//
findedDictList: [],
//
selectDictList: [],
//
structureInfoFormOpen: false,
//
structureInfoForm: {
isDirectory: false,
dictionaryTable: null,
},
structureNum: null,
//
tableInfoList: this.tableInfoList,
dictList: this.dictList,
//
insertDictOpen: false,
//
dictFormInfoOpen: false,
//
assetDictFormInfo: {
dictName: null,
dictType: null,
},
}
},
methods: {
//
findDictList(dictName) {
console.log(11111111)
this.findedDictList = this.dictList.find(item => item.dictType === dictName).dictInfoList
//this.$set
console.log(this.findedDictList)
},
//
updateStructureInfo() {
console.log(this.structureInfoForm)
updateStructureInfo(this.structureInfoForm).then(res => {
this.$message.success(res.msg)
})
this.structureInfoFormOpen = false
this.structureInfoForm.isDictionary = 'N'
this.structureInfoForm.dictionaryTable = null
this.reset()
},
//
checkDictList(data) {
//data === dictType
this.selectDictList = this.dictList.find(item => item.dictType === data).dictInfoList
},
//
outEdit() {
this.structureInfoFormOpen = false
this.structureInfoForm.isDictionary = 'N'
this.structureInfoForm.dictionaryTable = null
},
//
editDictInfo(data) {
this.structureInfoFormOpen = true
let info = data
this.structureInfoForm = info
this.structureInfoForm.isDictionary = info.isDictionary === 'Y'
},
//
insertDictList(data) {
console.log(data)
data.dictInfoList.push({
'id': data.id,
'infoName': null,
'infoValue': null,
'isEdit': true,
})
},
//
insertDict(data) {
console.log(data)
//
this.insertDictOpen = false
this.assetDictFormInfo.basicId = data.basicId
console.log(this.assetDictFormInfo)
insertDict(this.assetDictFormInfo)
this.reset()
},
//
insertDictInfo(id, row) {
console.log(row)
console.log(id)
row.dictId = id
row.id = null
if (row.infoValue === null || row.infoName === null) {
this.$message.error("字典标签或者值不能为空")
} else {
insertDictInfo(row)
this.$message.success("添加成功")
this.reset()
row.isEdit = false
}
},
handleSetLineChartData(type) {
this.$emit('handleSetLineChartData', type)
},
handleClick(val, event) {
console.log(val)
console.log(event)
},
//
reset() {
// this.$emit('watchChild'); //$emitwatchChild
}
}
}
</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: 0;
.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>

View File

@ -0,0 +1,225 @@
<template>
<el-row :gutter="40" class="panel-group">
<el-card>
<el-tabs type="border-card" @tab-click="handleClick">
<el-tab-pane
:v-model="tableInfo"
:label="tableInfo.tableName+'('+tableInfo.info.tableRemark+')'">
<!-- 资产模型基本信息-->
<el-card>
<div slot="header" class="clearfix">
<span>资产模型基本信息</span>
</div>
<el-descriptions
class="margin-top"
:column="2" :size="size"
border>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
表名称
</template>
{{ tableInfo.info.tableName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-mobile-phone"></i>
表备注
</template>
{{ tableInfo.info.tableRemark }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-location-outline"></i>
数据量
</template>
{{ tableInfo.info.dataNum }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-tickets"></i>
备注
</template>
<el-tag size="small">学校</el-tag>
</el-descriptions-item>
</el-descriptions>
</el-card>
<!-- 数据模型-->
<el-card>
<div slot="header" class="clearfix">
<span>数据模型</span>
</div>
<el-table
:data="tableInfo.info.structureList"
style="width: 100%"
>
<el-table-column fixed prop="columnName" label="字段名称" width="200px" />
<el-table-column fixed prop="columnRemark" label="字段注释" />
<el-table-column fixed prop="isPrimary" label="是否主键" />
<el-table-column fixed prop="columnType" label="数据类型" />
<el-table-column fixed prop="javaType" label="映射类型" />
<el-table-column fixed prop="columnLength" label="字段长度" />
<el-table-column fixed prop="columnDecimals" label="小数位数" />
<el-table-column fixed prop="isNull" label="是否为空" />
<el-table-column fixed prop="defaultValue" label="默认值" />
<el-table-column fixed prop="isDictionary" label="是否字典" />
<el-table-column fixed prop="dictionaryTable" label="映射字典" />
<el-table-column fixed prop="dictionaryTable" label="映射字典">
<template slot-scope="scope">
操作
</template>
</el-table-column>
</el-table>
</el-card>
</el-tab-pane>
</el-tabs>
</el-card>
</el-row>
</template>
<script>
import CountTo from 'vue-count-to'
export default {
props:{
tableInfo:Array,
},
name: 'TableInfoModel',
components: {
CountTo
},
data() {
return{
tableInfo:this.tableInfo
}
},
methods: {
handleSetLineChartData(type) {
this.$emit('handleSetLineChartData', type)
},
handleClick(val,event){
console.log(val)
console.log(event)
}
}
}
</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: 0;
.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>

View File

@ -0,0 +1,142 @@
<template>
<div>
<el-container style="height: 1000px">
<el-aside>
<el-tree :data="assetStructureList"
:props="defaultProps"
@node-click="handleNodeClick"></el-tree>
</el-aside>
<el-main>
<AssetsBasic v-if="!infoOpen" :infoOpen="infoOpen" :fundDataNum="fundDataNum"></AssetsBasic>
<AssetsModel v-if="this.tableInfoList.length!==0" @watchChild="handleNodeClick" :name="vueName" :dictList="dictList" :tableInfoList="tableInfoList"></AssetsModel>
<TableInfoModel v-if="this.tableInfoList.length===0" :table-info="tableInfoForm"></TableInfoModel>
</el-main>
</el-container>
</div>
</template>
<script>
import {getDict, getTableTree} from "@/api/etl/etl";
import AssetsBasic from "@/views/etl/construction/AssetsBasic.vue";
import AssetsModel from "@/views/etl/construction/AssetsModel.vue";
import TableInfoModel from "@/views/etl/construction/TableInfoModel.vue";
export default {
name: 'construction',
components: { TableInfoModel, AssetsModel, AssetsBasic},
data() {
return {
vueName:null,
//
tableInfoOpen: false,
//
title: null,
//
infoOpen: false,
//
tableInfoForm: {},
//
tableInfoList: [],
//
fundDataNum: {
basicNum: null,
tableNum: null,
structureNum: null,
},
childrenList: [],
//
assetStructureList: [],
//
defaultProps: {
children: 'children',
label: 'tableName'
},
//
dictList: [],
}
},
created() {
this.getList()
},
methods: {
//
getList() {
this.fundDataNum = {
basicNum: 0,
tableNum: 0,
structureNum: 0,
}
//
getTableTree().then(response => {
this.data = []
response.data.forEach(data => {
//
this.fundDataNum.basicNum += 1
let child = [];
let info = data.basicConfigInfo;
data.children.forEach(tableInfo => {
//
this.fundDataNum.tableNum += 1
//
this.fundDataNum.structureNum += tableInfo.structureList.length
child.push({
'tableName': tableInfo.tableName,
'info': tableInfo
})
})
//
this.assetStructureList.push({
'info': info,
'tableName': info.dataResourceName + '(' + info.databaseName + '-' + info.dataSourcesSystemName + ')',
'children': child,
})
})
})
console.log(this.assetStructureList)
},
//
handleNodeClick(data) {
console.log(data)
if (data===undefined){
data = sessionStorage.getItem('handleNodeClickData')
}
sessionStorage.setItem('handleNodeClickData',data)
//undefined
// console.log(data.children)
this.infoOpen = true
//infoForm
this.tableInfoForm = data
//form list
if (data.children !== undefined) {
this.vueName = data.tableName
this.tableInfoList = data.children
this.tableInfoForm = data.children[0]
console.log(data.info.id)
getDict(data.info.id).then(response => {
console.log(response)
this.dictList = response.data
})
} else {
// this.tableInfoList = this.assetStructureList.find(assent =>
// assent.info.id === this.tableInfoForm.info.basicId
// ).children
this.tableInfoList = []
}
console.log('tableList')
console.log(this.tableInfoList)
console.log('tableForm')
console.log(this.tableInfoForm)
},
}
};
</script>
<style>
body > {
margin-bottom: 40px;
}
</style>

View File

@ -0,0 +1,510 @@
<template>
<div class="app-container">
<!-- 三种查询-->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="接入源名称" prop="paramsName">
<el-input
v-model="queryParams.paramsName"
placeholder="请输入接入源名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数据来源系统名称" prop="dataSourcesSystemName">
<el-input
v-model="queryParams.dataSourcesSystemName"
placeholder="请输入数据来源系统名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数据库名称" prop="databaseName">
<el-input
v-model="queryParams.databaseName"
placeholder="请输入数据库名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<!-- 系统操作-->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['etl:info:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['etl:info:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['etl:info:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['etl:info:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!--列表-->
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="接入源名称" align="center" prop="dataResourceName" />
<el-table-column label="数据来源系统名称" align="center" prop="dataSourcesSystemName" />
<el-table-column label="主机ip" align="center" prop="host" />
<el-table-column label="主机端口" align="center" prop="port" />
<el-table-column label="数据接入类型" align="center" prop="databaseType" />
<el-table-column label="数据库名称" align="center" prop="databaseName" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-s-help" @click="connectionTest(scope.row)" v-hasPermi="['etl:info:edit']"
>测试链接</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['etl:info:edit']"
>修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['etl:info:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<!--分页-->
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-card>
<div slot="header" class="clearfix">
<span>基础配置信息</span>
</div>
<el-row>
<el-col :span="12">
<el-form-item label="接入源名称" prop="dataResourceName">
<el-input v-model="form.dataResourceName" placeholder="请输入接入源名称" />
</el-form-item>
<el-form-item label="主机ip地址" prop="host">
<el-input v-model="form.host" placeholder="请输入主机ip地址" />
</el-form-item>
<el-form-item label="接入数据库类型" prop="databaseType">
<el-select v-model="form.databaseType" placeholder="请选择">
<el-option
v-for="type in databaseTypeList"
:key="type.value"
:label="type.label"
:value="type.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="用户名" prop="host">
<el-input v-model="form.username" placeholder="请输入用户名" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数据来源系统名称" prop="dataSourcesSystemName">
<el-input v-model="form.dataSourcesSystemName" placeholder="请输入数据来源系统名称" />
</el-form-item>
<el-form-item label="端口" prop="port">
<el-input v-model="form.port" placeholder="请输入端口" />
</el-form-item>
<el-form-item label="数据库名称" prop="databaseName">
<el-input v-model="form.databaseName" placeholder="请输入数据库名称" />
</el-form-item>
<el-form-item label="密码" prop="databaseName">
<el-input v-model="form.password" placeholder="请输入密码" />
</el-form-item>
</el-col>
</el-row>
<el-card>
<div slot="header" class="clearfix">
<span>数据连接参数</span>
</div>
<el-col :sm="24">
<el-form-item label="数据连接参数" prop="connectionParams">
<el-input v-model="form.connectionParams" placeholder="请输入内容" />
</el-form-item>
</el-col>
<el-row :gutter="10" style="margin: 10px 0">
<el-col :span="2">
<el-button type="primary" @click="addParam()"></el-button>
</el-col>
<el-col :span="2">
<el-button type="danger" @click="deleteParam(null)"></el-button>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :md="8" :xs="12" style="margin: 10px 0" v-for="(basicParam, basicParamIndex) in basicParamList">
<el-col :span="10">
<el-input v-model="basicParam.paramsName" placeholder="请输入参数键" @keyup.native="processParam"/>
</el-col>
<el-col :span="1"><span style="font-size: 28px; margin: 0 3px 0 0;">:</span></el-col>
<el-col :span="10">
<el-input v-model="basicParam.paramsValue" placeholder="请输入参数值" @keyup.native="processParam"/>
</el-col>
<el-col :span="3">
<el-button type="danger" @click="deleteParam(basicParamIndex)"></el-button>
</el-col>
</el-col>
</el-row>
</el-card>
</el-card>
<el-card>
<div slot="header" class="clearfix">
<span>连接池配置</span>
</div>
<el-row>
<el-col :span="12">
<el-form-item label="初始化连接数量" prop="initLinkNum">
<el-input v-model="form.initLinkNum" placeholder="请输入初始化连接数量" />
</el-form-item>
<el-form-item label="最大等待时间" prop="maxWaitTime">
<el-input v-model="form.maxWaitTime" placeholder="请输入最大等待时间" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="最大连接数量" prop="maxLinkNum">
<el-input v-model="form.maxLinkNum" placeholder="请输入最大连接数量" />
</el-form-item>
<el-form-item label="最大等待次数" prop="maxWaitTimes">
<el-input v-model="form.maxWaitTimes" placeholder="请输入最大等待次数" />
</el-form-item>
</el-col>
</el-row>
</el-card>
<el-card >
<div slot="header" class="clearfix">
<span>卡片名称</span>
</div>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-card>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {addInfo, connectionTest, delInfo, getInfo, listInfo, updateInfo} from "@/api/etl/etl";
export default {
name: "info",
data() {
return {
basicParamList:[
{
paramsName: null,
paramsValue: null
}
],
databaseTypeList:[{
value:'MySql',
label:'MySql'
},{
value:'PostSql',
label:'PostSql'
},{
value:'Oracle',
label:'Oracle'
}],
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
infoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
paramsName: null,
dataSourcesSystemName: null,
databaseTypeList: null,
databaseName: null,
initLinkNum :null,
maxWaitTime :null,
maxLinkNum :null,
maxWaitTimes :null,
},
//
form: {},
//
rules: {
paramsName: [
{required: true, message: "接入源名称不能为空", trigger: "blur"}
],
host: [ {required: true, message: "主机ip地址不能为空", trigger: "blur"}
],
databaseType: [ {required: true, message: "接入数据库类型不能为空", trigger: "blur"}
],
dataSourcesSystemName: [
{required: true, message: "数据来源系统名称不能为空", trigger: "blur"}
],
port: [
{required: true, message: "端口不能为空", trigger: "blur"}
],
databaseName: [
{required: true, message: "数据库名称不能为空", trigger: "blur"}
],
initLinkNum: [
{required: true, message: "初始化连接池数量不能为空", trigger: "blur"}
],
maxWaitTime: [
{required: true, message: "最大等待连接时长不能为空", trigger: "blur"}
],
maxLinkNum: [
{required: true, message: "最大连接池数量为空", trigger: "blur"}
],
maxWaitTimes: [
{required: true, message: "最大连接次数不能为空", trigger: "blur"}
],
connectionParams: [
{required: true, message: "数据连接参数不能为空", trigger: "blur"}
],
}
};
},
created() {
this.getList();
},
methods: {
//
addParam(){
this.basicParamList.push({
paramsName: null,
paramsValue: null
})
},
//
deleteParam(index){
if (index != null){
this.basicParamList.splice(index, 1);
}else {
this.basicParamList = []
}
this.processParam();
},
//
processParam(){
this.form.connectionParams = this.basicParamList
.filter(item => item.paramsName != null || item.paramsValue != null)
.map(item => {
return item.paramsName + "=" + item.paramsValue;
}).join("&")
console.log(this.form.connectionParams)
},
/** 查询列表 */
getList() {
this.loading = true;
// let response = {
// "code": 200,
// "msg": "",
// "data": {
// "total": 1,
// "rows": [
// {
// id: null,
// paramsName: "",
// databaseType: "MySql",
// dataSourcesSystemName: "",
// host: "125.36.25.36",
// port: 6536,
// databaseName: "yunjisuan-server",
// connectionParams: "useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8",
// initLinkNum: 5,
// maxLinkNum: 20,
// maxWaitTime: 3000,
// maxWaitTimes: 3,
// remark: ""
// }
// ]
// }
// };
listInfo(this.queryParams).then(response =>{
console.log(response)
this.infoList = response.data.rows;
this.total = response.data.total;
this.loading = false;
})
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
paramsName: null,
dataSourcesSystemName: null,
host: null,
port: null,
username: null,
password: null,
databaseTypeList: null,
databaseName: null,
connectionParams: null,
initLinkNum: 5,
maxLinkNum: 20,
maxWaitTime: 3000,
maxWaitTimes: 3,
remark: null
};
this.basicParamList= [
{
paramsName: null,
paramsValue: null
}
],
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加数据接入";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.form = row;
this.basicParamList = [];
this.form.connectionParams.split("&").forEach(param => {
let paramArr = param.split("=");
this.basicParamList.push({
paramsName: paramArr[0],
paramsValue: paramArr[1]
})
console.log(this.basicParamList)
})
this.open = true;
this.title = "修改数据接入";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 测试连接 */
connectionTest(basicConfigInfo){
connectionTest(basicConfigInfo).then( response => {
if (response.code === 200){
this.$message.success("连接成功")
}else {
this.$message.error("连接失败")
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(function() {
return delInfo(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('etl/info/export', {
...this.queryParams
}, `info_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -264,7 +264,7 @@ export default {
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.noticeId)
this.single = selection.length != 1
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
@ -287,7 +287,7 @@ export default {
submitForm: function () {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.noticeId != undefined) {
if (this.form.noticeId !== undefined) {
updateNotice(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;

View File

@ -194,7 +194,7 @@ export default {
parentMenuId: genTable.parentMenuId
};
updateGenTable(genTable).then(res => {
this.$modal.msgSuccess(res.data.msg);
this.$modal.msgSuccess(res.msg);
if (res.code === 200) {
this.close();
}

View File

@ -108,7 +108,7 @@ export default {
return;
}
importTable({tables: tableNames}).then(res => {
this.$modal.msgSuccess(res.data.msg);
this.$modal.msgSuccess(res.msg);
this.visible = false;
this.$emit("ok");
});