fix:修复 资产模型基本信息

资产模型详细信息 之间的传值问题
master
031026 2024-04-27 20:07:30 +08:00
commit 781e290146
3 changed files with 126 additions and 82 deletions

View File

@ -1,5 +1,19 @@
<template>
<div>
<el-card v-if="tableMessage!=null" >
<div slot="header" class="clearfix">
<span>资产模型基本信息</span>
</div>
<el-descriptions border :column="2">
<el-descriptions-item label="表名称">{{tableMessage.name}}</el-descriptions-item>
<el-descriptions-item label="表备注">{{ tableMessage.as }}</el-descriptions-item>
<el-descriptions-item label="数据量">{{ tableMessage.dataTotal }}</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>
@ -16,8 +30,8 @@
</el-tag>
</template>
</el-table-column>
<el-table-column prop="type" label="类型" />
<el-table-column prop="mappingType" label="映射类型" />
<el-table-column prop="detailType" label="类型" />
<el-table-column prop="type" label="映射类型" />
<el-table-column prop="length" label="长度" />
<el-table-column prop="decimalPlaces" label="小数位" />
<el-table-column prop="isNull" label="是否为空" >
@ -27,7 +41,14 @@
</el-tag>
</template>
</el-table-column>
<el-table-column prop="defaultValue" label="默认值" />
<el-table-column label="默认值" width="180">
<template slot-scope="scope">
<span style="margin-left: 10px" v-if="scope.row.defaultValue==null">-</span>
<span style="margin-left: 10px" v-else>{{scope.row.defaultValue}}</span>
</template>
</el-table-column>
<el-table-column prop="isDict" label="是否字典" >
<template slot-scope="scope">
<el-tag v-if="scope.row.isDict === 'Y'" size="small" type="success">
@ -164,18 +185,17 @@
import bus from '@/views/dataSource/assets/dashboard/bus'
import { database, table } from '@/api/dataSource/source'
import { database, findDataBaseTable, table ,tableBasics} from '@/api/dataSource/source'
export default {
name: 'OverallAssetStructure',
props:{
'itemTest':{}
},
props:['itemTest','itemTable'],
data() {
return {
localEssential: null,
localTableMessage: null,
formStatus: false,
tableMessage:{},
form:{},
dictMap: {
"system_sex": [
@ -189,7 +209,8 @@ export default {
],
},
sendTest:[],
tableMessage:[],
databaseConnect:null,
tableList:[],
}
},
beforeDestroy() {
@ -199,20 +220,49 @@ export default {
watch:{
"itemTest": {
handler(val){
if (val && val.databaseName && val.name) {
const obj = {
databaseName: val.databaseName,
name: val.name
};
findDataBaseTable(obj).then(res => {
this.sendTest = res.data
})
}
if (val && val.name) {
database(val.name).then(
res => {
this.sendTest=res.data
}
)
}
},
immediate:true,
},
"itemTable":{
handler(val){
if (val.databaseName && val.name && val.type==null) {
table(val.databaseName).then(res => {
res.data.forEach(res=>{
if (res.name == val.name) {
this.tableMessage=res
}
})
})
}
if (val.databaseName && val.name && val.type===1){
this.tableMessage=val
}
},
immediate:true
},
},
created() {
},
methods: {
updEssential(row){
this.form=row
this.formStatus=true
},

View File

@ -31,7 +31,7 @@
</div>
</el-col>
<el-row :gutter="20">
<el-col :span="24" style="margin-top: 30px; margin-bottom: 20px;">
<el-col v-for="(val,key) in dictMap" :md="8" :sm="24" :xs="12">
<el-card class="box-card" style="height: 300px">
<div slot="header" class="clearfix">
@ -41,6 +41,7 @@
@click="val.push({ label: null, val: null, isEdit: true })"
>新增</el-button>
</div>
<el-table :data="val" style="width: 100%" height="280px">
<el-table-column prop="label" label="标签">
<template slot-scope="scope">
@ -75,33 +76,20 @@
</el-table>
</el-card>
</el-col>
</el-row>
</el-col>
<el-col :span="24">
<el-col :span="24" style="margin-top: 30px; margin-bottom: 20px;">
<el-tabs v-model="activeName" type="border-card" @tab-click="handleTabClick">
<el-tab-pane
v-for="item in childrenList"
:key="item.name"
:label="item.name+'('+item.as+')'"
:name="item.name">
<el-card v-if="tableMessage!=null">
<div slot="header" class="clearfix">
<span>资产模型基本信息</span>
</div>
<el-descriptions border :column="2">
<el-descriptions-item label="表名称">{{tableMessage.name}}</el-descriptions-item>
<el-descriptions-item label="表备注">{{ tableMessage.as }}</el-descriptions-item>
<el-descriptions-item label="数据量">{{ tableMessage.dataTotal }}</el-descriptions-item>
<el-descriptions-item label="是否核心">
<el-tag size="small"></el-tag>
</el-descriptions-item>
</el-descriptions>
</el-card>
<overall-asset-structure
:itemTest="item"
:Model="childrenListModel"/>
:itemTable="tableMessage"/>
</el-tab-pane>
</el-tabs>
</el-col>
@ -154,6 +142,8 @@ export default {
handleTabClick(tab, node,event ) {
// name childrenList item
this.selectedItem = this.childrenList.find(item => item.name === tab.name);
table(this.selectedItem.databaseName).then(
res => {
this.childrenListModel = res.data

View File

@ -29,7 +29,9 @@
/>
<OverallAssetStructure v-if="showAssets === 1"
:childrenList="childrenList"/>
:itemTest="databaseConnect"
:itemTable="databaseConnect"/>
</el-main>
</el-container>
@ -65,6 +67,10 @@ export default {
quantityList:[],
num:0,
tableNum:0,
databaseConnect:{
databaseName:null,
name:null,
},
}
},
created() {
@ -74,7 +80,6 @@ export default {
methods: {
handleNodeClick(data,node) {
if (data.type==0){
console.log("tow",data)
this.num=0
this.tableNum=0
this.quantityList.forEach(res=>{
@ -84,15 +89,14 @@ export default {
this.num+=1
}
})
}
if(data.type == 1) {
let databaseConnect={}
databaseConnect.databaseName=data.databaseName;
databaseConnect.name=data.name;
console.log(databaseConnect)
findDataBaseTable(databaseConnect).then(res=>{
this.childrenList=res.data
})
if(node.level === 2) {
this.databaseConnect={},
this.databaseConnect.databaseName=data.databaseName;
this.databaseConnect.name=data.name;
}
},
expandTable(node, resolve) {