资产结构测试5

etl-xin
xiaohuang 2024-04-27 16:56:23 +08:00
parent 518216279d
commit 774cc447d4
2 changed files with 202 additions and 181 deletions

View File

@ -1,6 +1,7 @@
<template> <template>
<el-row :gutter="40" class="panel-group"> <div>
<el-row :gutter="40" class="panel-group">
<!-- insertDictOpen {{ this.insertDictOpen }}--> <!-- insertDictOpen {{ this.insertDictOpen }}-->
<!-- <p></p>--> <!-- <p></p>-->
<!-- assetDictFormInfo {{ this.assetDictFormInfo }}--> <!-- assetDictFormInfo {{ this.assetDictFormInfo }}-->
@ -16,25 +17,14 @@
:label="tableInfo.tableName+'('+tableInfo.info.tableRemark+')'"> :label="tableInfo.tableName+'('+tableInfo.info.tableRemark+')'">
<el-card> <el-card>
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>基础字典</span> <span>基础字典</span>
<!--新增字典表--> <!--新增字典表-->
<el-button type="text" style="float: right" @click="insertDictOpen = true">新增字典</el-button> <el-button type="text" style="float: right" @click="insertDictOpen = true">新增字典</el-button>
<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> </div>
</el-dialog> <el-row gutter="20">
</div> <el-col v-for="dictInfo in dictList" :span="8">
<el-card v-for="dictInfo in dictList" style="width: 300px;"> <el-card style="width: 300px;">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ dictInfo.dictName }}({{ dictInfo.dictType }})</span> <span>{{ dictInfo.dictName }}({{ dictInfo.dictType }})</span>
<!--新增字典具体信息--> <!--新增字典具体信息-->
@ -60,23 +50,28 @@
</el-table-column> </el-table-column>
<el-table-column> <el-table-column>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" v-if="!scope.row.isEdit" @click="updateDictInfo(scope.row)"></el-button> <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(scope.row)"></el-button> <el-button type="text" v-if="scope.row.isEdit" @click="insertDictInfo(dictInfo.id,scope.row)"></el-button>
{{ scope.row.isEdit }} {{ scope.row.isEdit }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-card> </el-card>
</el-col>
</el-row>
</el-card> </el-card>
<!--资产模型基本信息--> <!--资产模型基本信息-->
<el-card> <el-card>
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>资产模型基本信息</span> <span>资产模型基本信息</span>
</div> </div>
<el-descriptions <el-descriptions
class="margin-top" class="margin-top"
:column="2" :column="2"
border> border>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
<i class="el-icon-user"></i> <i class="el-icon-user"></i>
@ -84,6 +79,7 @@
</template> </template>
{{tableInfo.info.tableName}} {{tableInfo.info.tableName}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
<i class="el-icon-mobile-phone"></i> <i class="el-icon-mobile-phone"></i>
@ -91,6 +87,7 @@
</template> </template>
{{tableInfo.info.tableRemark}} {{tableInfo.info.tableRemark}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
<i class="el-icon-location-outline"></i> <i class="el-icon-location-outline"></i>
@ -98,24 +95,31 @@
</template> </template>
{{tableInfo.info.dataNum}} {{tableInfo.info.dataNum}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
<i class="el-icon-tickets"></i> <i class="el-icon-tickets"></i>
备注 备注
</template> </template>
<el-tag size="small">学校</el-tag> <el-tag size="small">小黄</el-tag>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<!--数据模型--> <!--数据模型-->
<el-card> <el-card>
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>数据模型</span> <span>数据模型</span>
</div> </div>
<el-table <el-table
:data="tableInfo.info.structureList" :data="tableInfo.info.structureList"
style="width: 100%" style="width: 100%">
>
<el-table-column fixed prop="columnName" label="字段名称" width="200px"/> <el-table-column fixed prop="columnName" label="字段名称" width="200px"/>
<el-table-column fixed prop="columnRemark" label="字段注释" /> <el-table-column fixed prop="columnRemark" label="字段注释" />
<el-table-column fixed prop="isPrimary" label="是否主键" /> <el-table-column fixed prop="isPrimary" label="是否主键" />
@ -132,44 +136,45 @@
操作 操作
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-card> </el-card>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-card> </el-card>
</el-row> </el-row>
</template>
<!--添加新字典表对话框-->
<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>
</div>
</template>
<script> <script>
import CountTo from 'vue-count-to' import CountTo from "vue-count-to";
import {insertDict,insertDictInfo} from "@/api/etl/etl"; import {insertDict,insertDictInfo} from "@/api/etl/etl";
export default { export default {
props: { props: {
tableInfoList: Array, tableInfoList: Array,
dictList: Array dictList: Array
}, },
watch:{
dictList: {
handler(newValue, oldValue) {
console.log(newValue)
console.log(oldValue)
this.$forceUpdate()
},
immediate: true,
deep: true
}
},
name: 'AssetsModel', name: 'AssetsModel',
components:{ components:{
CountTo CountTo
@ -192,11 +197,11 @@ export default {
}, },
methods: { methods: {
// //
updateDictInfo(row) { updateDictInfo(row) {
row.isEdit = true row.isEdit = true
}, },
// //
insertDictList(data) { insertDictList(data) {
console.log(data) console.log(data)
@ -207,37 +212,41 @@ export default {
'isEdit': true, 'isEdit': true,
}) })
}, },
// //
insertDict(data) { insertDict(data) {
console.log(data) console.log(data)
// //
this.insertDictOpen = false this.insertDictOpen = false
this.assetDictFormInfo.basicId = data.basicId this.assetDictFormInfo.basicId = data.basicId
console.log(this.assetDictFormInfo) console.log(this.assetDictFormInfo)
insertDict(this.assetDictFormInfo) insertDict(this.insertDictOpen)
this.reset() this.reset()
}, },
// //
insertDictInfo(row) { insertDictInfo(id,row){
console.log(row)
console.log(id)
row.dictId = id
row.id = null
if (row.infoValue === null || row.infoName === null) { if (row.infoValue === null || row.infoName === null) {
this.$message.error("字典标签或者值不能为空") this.$message.error("字典标签或者值不能为空")
}else { }else {
insertDictInfo(row) insertDictInfo(row)
this.$message.success("添加成功") this.$message.success("添加成功")
this.reset() this.reset()
row.isEdit = false
} }
}, },
handleSetLineChartData(type) { handleSetLineChartData(type) {
this.$emit('handleSetLineChartData', type) this.$emit('handleSetLineChartData', type)
}, },
handleClick(val, event) { handleClick(val, event) {
console.log(val) console.log(val)
console.log(event) console.log(event)
}, },
// //
reset() { reset() {
@ -354,10 +363,17 @@ export default {
} }
} }
} }
.title-header { .title-header {
text-align: center; text-align: center;
width: 100%; width: 100%;
font-size: 46px; font-size: 46px;
ia font-weight: 600;
line-height: 100px;
} }
</style> </style>

View File

@ -2,18 +2,21 @@
<div> <div>
<el-container style="height: 1000px"> <el-container style="height: 1000px">
<el-aside> <el-aside>
<el-tree :data="assetStructureList" <el-tree :data="assetStructureList"
:props="defaultProps" :props="defaultProps"
@node-click="handleNodeClick"></el-tree> @node-click="handleNodeClick">
</el-tree>
</el-aside> </el-aside>
<el-main> <el-main>
<AssetsBasic v-if="!infoOpen" :info-open="infoOpen" :fund-data-num="fundDataNum"></AssetsBasic>
<AssetsModel v-if="this.tableInfoList.length!==0" :dict-list="dictList" :table-info-list="tableInfoList">
</AssetsModel>
<AssetsBasic v-if="!infoOpen" :infoOpen="infoOpen" :fundDataNum="fundDataNum"></AssetsBasic>
<AssetsModel v-if="this.tableInfoList.length!==0" :dictList="dictList" :tableInfoList="tableInfoList"></AssetsModel>
<TableInfoModel v-if="this.tableInfoList.length===0" :table-info="tableInfoForm"></TableInfoModel> <TableInfoModel v-if="this.tableInfoList.length===0" :table-info="tableInfoForm"></TableInfoModel>
</el-main> </el-main>
</el-container> </el-container>
</div> </div>
</template> </template>
@ -27,7 +30,9 @@ import TableInfoModel from "@/views/etl/construction/TableInfoModel.vue";
export default { export default {
name:'construction', name:'construction',
components:{TableInfoModel, AssetsModel, AssetsBasic }, components:{TableInfoModel, AssetsModel, AssetsBasic },
data() { data() {
return { return {
// //
@ -115,12 +120,12 @@ export default {
if (data.children !== undefined) { if (data.children !== undefined) {
this.tableInfoList = data.children this.tableInfoList = data.children
this.tableInfoForm = data.children[0] this.tableInfoForm = data.children[0]
}else {
console.log(data.info.id) console.log(data.info.id)
getDict(data.info.id).then(response => { getDict(data.info.id).then(response => {
console.log(response) console.log(response)
this.dictList = response.data this.dictList = response.data
}) })
}else {
// this.tableInfoList = this.assetStructureList.find(assent => // this.tableInfoList = this.assetStructureList.find(assent =>
// assent.info.id === this.tableInfoForm.info.basicId // assent.info.id === this.tableInfoForm.info.basicId