Qin Dong Ming 2024-08-27 11:51:07 +08:00
commit 8dbc2216d5
4 changed files with 234 additions and 43 deletions

View File

@ -75,3 +75,27 @@ export function update(data){
}
//查询数据库名称 表名称 字段名称 类型等
export function findTableInfo(){
return request({
url: "/source/tableInfo/findTableInfo",
method: "get",
})
}
export function findTableInfoList(){
return request({
url: "/source/tableInfo/findTableInfoList",
method: "get",
})
}
export function findStructureByTableId(id){
return request({
url: "/source/tableInfo/findStruceure/"+id,
method: "get",
})
}

View File

@ -0,0 +1,151 @@
<template>
<div>
<el-container>
<el-aside width="30%">
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</el-aside>
<el-main>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>资产模型基本信息</span>
</div>
<el-descriptions class="margin-top" title="带边框列表" :column="2" border>
<el-descriptions-item>
<template slot="label">表名称</template>
{{ tableBasic.tableName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">表备注</template>
{{ tableBasic.tableRemark }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">数据量</template>
{{ tableBasic.dataNum }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">是否核心</template>
<dict-tag :options="dict.type.yes_no" :value="tableBasic.isCenter"/>
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>资产模型详细信息</span>
</div>
<el-table
:data="tableData" style="width: 100%">
<el-table-column label="名称" prop="columnName"></el-table-column>
<el-table-column label="注释" prop="columnRemark"></el-table-column>
<el-table-column label="是否主键" prop="isPrimary">
<template slot-scope="scope">
<dict-tag :options="dict.type.yes_no" :value="scope.row.isPrimary"/>
</template>
</el-table-column>
<el-table-column label="类型" prop="columnType"></el-table-column>
<el-table-column label="映射类型" prop="javaType"></el-table-column>
<el-table-column label="长度" prop="columnLength"></el-table-column>
<el-table-column label="小数位" prop="columnDecimals"></el-table-column>
<el-table-column label="是否为空" prop="isNull">
<template slot-scope="scope">
<dict-tag :options="dict.type.yes_no" :value="scope.row.isNull"/>
</template>
</el-table-column>
</el-table>
</el-card>
</el-main>
</el-container>
</div>
</template>
<script>
//jsjsjson,
//import from ',
import {findTableInfoList} from "@/api/etl/switch";
import {findStructureByTableId} from "@/api/etl/switch";
export default {
dicts: ['yes_no'],
//import使"
components: {},
props: {},
data() {
//"
return {
tableData:[],
tableBasic:{
},
form:{
},
data:[],
defaultProps:{
children:"children",
label:'tableName'
},
};
},
// data",
computed: {},
//data",
watch: {},
//",
methods: {
findTAbleInfoList(){
findTableInfoList().then(res=>{
this.data=res.data;
})
},
handleNodeClick(data) {
this.tableBasic=data
findStructureByTableId(data.id).then((res)=>{
this.tableData=res.data;
})
console.log(data);
},
},
// - 访this",
created() {
this.findTAbleInfoList();
},
// - 访DOM",
mounted() {
},
beforeCreate() {
}, // - ",
beforeMount() {
}, // - ",
beforeUpdate() {
}, // - ",
updated() {
}, // - ",
beforeDestroy() {
}, // - ",
destroyed() {
}, // - ",
activated() {
} //keep-alive",
};
</script>
<style scoped>
</style>

View File

@ -48,7 +48,7 @@
<el-dialog title="title" :visible.sync="dialogFormVisible" append-to-body width="60%">
<el-form ref="form" :model="sourceAddReq" :rules="rules" label-width="140px" :inline="true" class="demo-form-inline">
<el-form ref="sourceAddReq" :model="sourceAddReq" :rules="rules" label-width="140px" :inline="true" class="demo-form-inline">
<el-form-item label="接入源名称">
<el-input v-model="sourceAddReq.dataResourceName"></el-input>
</el-form-item>
@ -83,9 +83,9 @@
<div slot="header" class="clearfix">
<span>连接池配置</span>
</div>
<el-form ref="form" :model="sourceAddReq" label-width="120px" :inline="true" class="demo-form-inline">
<el-form :model="sourceAddReq" label-width="120px" :inline="true" class="demo-form-inline">
<el-form-item label="初始连接数量:" prop="initCount">
<el-input v-model="sourceAddReq.initCount" placeholder="初始连接数量"/>
<el-input v-model="sourceAddReq.initLinkNum" placeholder="初始连接数量"/>
</el-form-item>
<el-form-item label="最大连接数量:" prop="maxCount">
<el-input v-model="sourceAddReq.maxLinkNum" placeholder="最大连接数量"/>
@ -94,7 +94,7 @@
<el-input v-model="sourceAddReq.maxWaitTime" placeholder="最大等待时间"/>
</el-form-item>
<el-form-item label="最大等待次数:" prop="maxFrequency">
<el-input v-model="sourceAddReq.remark" placeholder="最大等待次数"/>
<el-input v-model="sourceAddReq.maxWaitTimes" placeholder="最大等待次数"/>
</el-form-item>
@ -106,11 +106,11 @@
<div slot="header" class="clearfix">
<span>其他信息</span>
</div>
<el-form ref="form" :model="sourceAddReq" label-width="140px" :inline="true" class="demo-form-inline">
<el-form :model="sourceAddReq" label-width="140px" :inline="true" class="demo-form-inline">
<el-form-item label="是否初始化:" prop="status">
<el-radio-group v-model="sourceAddReq.status">
<el-radio
v-for="dict in dict.type.ys_yes_no"
v-for="dict in dict.type.yes_no"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
@ -125,11 +125,13 @@
</el-card>
<div slot="footer" class="dialog-footer">
<el-button @click="textP()"></el-button>
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="addSource()"> </el-button>
</div>
</el-dialog>
@ -179,14 +181,20 @@
prop="databaseName">
</el-table-column>
<el-table-column
label="是否初始化"
prop="status">
<el-table-column align="status" label="是否初始化" prop="status">
<template slot-scope="scope">
<dict-tag :options="dicts.type.ys_yes_no" :value="scope.row.status"/>
<dict-tag :options="dict.type.yes_no" :value="scope.row.status"/>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- label="是否初始化"-->
<!-- prop="status">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.yes_no" :value="scope.row.status"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
label="备注"
prop="remark">
@ -237,43 +245,43 @@
//jsjsjson,
//import from ',
import {selectSourceList, update} from "@/api/etl/switch";
import {selectSourceExport} from "@/api/etl/switch";
import {connectionTest} from "@/api/etl/switch";
import {insertAdd} from "@/api/etl/switch";
import {deleteSource} from "@/api/etl/switch";
import {getInfo} from "@/api/etl/switch";
import {structure} from "@/api/etl/switch";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
dicts: ['sys_normal_disable','ys_yes_no'],
dicts: ['yes_no', 'sys_normal_disable'],
//import使"
components: {},
components: {
},
props: {},
data() {
//"
return {
dicts: ['sys_normal_disable','ys_yes_no'],
sourceAddReq:{
},
rules: {
dataResourceName: [
{required: true, message: "接入源名称不能为空", trigger: "blur"}
],
dataSourcesSystemName: [
{required: true, message: "数据来源系统名称不能为空", trigger: "blur"}
],
host: [
{required: true, message: "主机地址不能为空", trigger: "blur"}
]
dataResourceName: [{required: true, message: "接入源名称不能为空", trigger: "blur"}],
dataSourcesSystemName: [{required: true, message: "数据来源系统名称不能为空", trigger: "blur"}],
host: [{required: true, message: "主机地址不能为空", trigger: "blur"}]
},
ids:[],
dialogFormVisible:false,
SourceReq:{
},
sourceAddReq:{
},
source:[],
};
},
@ -299,8 +307,8 @@ export default {
},
struceure(row){
structure(row).then(res=>{
if (res ===200){
alert("同步资产成功")
if (res.code ===200){
alert("同步资产成功,请查询数据库")
}
})
},
@ -311,6 +319,7 @@ export default {
}
})
},
handleDelete(row){
deleteSource(row.id).then(res=>{
if (res.code===200){
@ -327,7 +336,9 @@ export default {
}
})
},
addSource(){
addSource: function (){
this.$refs["sourceAddReq"].validate(valid=> {
if (valid){
if (this.sourceAddReq.id!=undefined){
update(this.sourceAddReq).then(res=>{
if (res.code===200){
@ -343,6 +354,9 @@ export default {
}
})
}
}
});
},
//
textConnect(row){

View File

@ -429,6 +429,7 @@ export default {
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.menuId != undefined) {
updateMenu(this.form).then(response => {
@ -444,6 +445,7 @@ export default {
});
}
}
});
},
/** 删除按钮操作 */