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> <template>
<div> <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;"> <el-card style=" margin-top: 20px;">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>资产模型详细信息</span> <span>资产模型详细信息</span>
@ -16,8 +30,8 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="type" label="类型" /> <el-table-column prop="detailType" label="类型" />
<el-table-column prop="mappingType" label="映射类型" /> <el-table-column prop="type" label="映射类型" />
<el-table-column prop="length" label="长度" /> <el-table-column prop="length" label="长度" />
<el-table-column prop="decimalPlaces" label="小数位" /> <el-table-column prop="decimalPlaces" label="小数位" />
<el-table-column prop="isNull" label="是否为空" > <el-table-column prop="isNull" label="是否为空" >
@ -27,7 +41,14 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </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="是否字典" > <el-table-column prop="isDict" label="是否字典" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.isDict === 'Y'" size="small" type="success"> <el-tag v-if="scope.row.isDict === 'Y'" size="small" type="success">
@ -62,7 +83,7 @@
</el-table> </el-table>
</el-card> </el-card>
<el-dialog title="资产结构修改" width="80%" :visible.sync="formStatus"> <el-dialog title="资产结构修改" width="80%" :visible.sync="formStatus" >
<el-form :model="form" label-width="120px"> <el-form :model="form" label-width="120px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@ -164,18 +185,17 @@
import bus from '@/views/dataSource/assets/dashboard/bus' 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 { export default {
name: 'OverallAssetStructure', name: 'OverallAssetStructure',
props:{ props:['itemTest','itemTable'],
'itemTest':{}
},
data() { data() {
return { return {
localEssential: null, localEssential: null,
localTableMessage: null, localTableMessage: null,
formStatus: false, formStatus: false,
tableMessage:{},
form:{}, form:{},
dictMap: { dictMap: {
"system_sex": [ "system_sex": [
@ -189,7 +209,8 @@ export default {
], ],
}, },
sendTest:[], sendTest:[],
tableMessage:[], databaseConnect:null,
tableList:[],
} }
}, },
beforeDestroy() { beforeDestroy() {
@ -199,20 +220,49 @@ export default {
watch:{ watch:{
"itemTest": { "itemTest": {
handler(val){ 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( database(val.name).then(
res => { res => {
this.sendTest=res.data this.sendTest=res.data
} }
) )
}
}, },
immediate:true, 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() { created() {
}, },
methods: { methods: {
updEssential(row){ updEssential(row){
this.form=row this.form=row
this.formStatus=true this.formStatus=true
}, },

View File

@ -31,7 +31,7 @@
</div> </div>
</el-col> </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-col v-for="(val,key) in dictMap" :md="8" :sm="24" :xs="12">
<el-card class="box-card" style="height: 300px"> <el-card class="box-card" style="height: 300px">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
@ -41,6 +41,7 @@
@click="val.push({ label: null, val: null, isEdit: true })" @click="val.push({ label: null, val: null, isEdit: true })"
>新增</el-button> >新增</el-button>
</div> </div>
<el-table :data="val" style="width: 100%" height="280px"> <el-table :data="val" style="width: 100%" height="280px">
<el-table-column prop="label" label="标签"> <el-table-column prop="label" label="标签">
<template slot-scope="scope"> <template slot-scope="scope">
@ -75,33 +76,20 @@
</el-table> </el-table>
</el-card> </el-card>
</el-col> </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-tabs v-model="activeName" type="border-card" @tab-click="handleTabClick">
<el-tab-pane <el-tab-pane
v-for="item in childrenList" v-for="item in childrenList"
:key="item.name" :key="item.name"
:label="item.name+'('+item.as+')'" :label="item.name+'('+item.as+')'"
:name="item.name"> :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 <overall-asset-structure
:itemTest="item" :itemTest="item"
:Model="childrenListModel"/> :itemTable="tableMessage"/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-col> </el-col>
@ -154,6 +142,8 @@ export default {
handleTabClick(tab, node,event ) { handleTabClick(tab, node,event ) {
// name childrenList item // name childrenList item
this.selectedItem = this.childrenList.find(item => item.name === tab.name); this.selectedItem = this.childrenList.find(item => item.name === tab.name);
table(this.selectedItem.databaseName).then( table(this.selectedItem.databaseName).then(
res => { res => {
this.childrenListModel = res.data this.childrenListModel = res.data

View File

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