158 lines
4.8 KiB
Vue
158 lines
4.8 KiB
Vue
<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>
|
||
|
||
<table>
|
||
<tr><td>表名称:</td><td>{{ tableBasic.tableName }}</td></tr>
|
||
<tr><td>表备注:</td><td>{{ tableBasic.tableRemark }}</td></tr>
|
||
<tr><td>数据量:</td><td>{{ tableBasic.dataNum }}</td></tr>
|
||
<tr><td>是否核心:</td><td><dict-tag :options="dict.type.yes_no" :value="tableBasic.isCenter"/></td></tr>
|
||
</table>
|
||
|
||
<!-- <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>
|
||
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||
//例如: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>
|
||
|