fix: 数据字典(资产结构概述)

master
rouchen 2024-04-29 14:18:30 +08:00
parent 0b4392c9e8
commit dd836a6f18
4 changed files with 82 additions and 59 deletions

View File

@ -176,3 +176,4 @@ export function overallDataStructure() {
method: 'post'
})
}

View File

@ -2,7 +2,8 @@
<div>
<el-card>
<div slot="header" class="clearfix">
<span>资产模型基本信息</span>
<span>111资产模型基本信息</span>
</div>
<el-descriptions border :column="2" >
@ -56,9 +57,9 @@
placement="left"
width="200"
trigger="hover">
<el-table :data="thisDict[scope.row.dictKey]">
<el-table-column property="dictionaryName" label="字典标签"/>
<el-table-column dictionaryValue="value" label="字典值"/>
<el-table :data="hamap[scope.row.dictKey]">
<el-table-column property="label" label="字典标签"/>
<el-table-column property="val" label="字典值"/>
</el-table>
<el-tag slot="reference">{{scope.row.dictKey}}</el-tag>
</el-popover>
@ -74,7 +75,6 @@
<el-dialog title="资产结构修改" width="80%" :visible.sync="formStatus">
<el-form :model="form" label-width="120px">
{{form}}
<el-row>
<el-col :span="12">
<el-form-item label="名称">
@ -145,20 +145,20 @@
</el-form-item>
</el-col>
</el-row>
{{dictName}}
<el-row v-if="form.isDict === 'Y'">
<el-col :span="24">
<el-form-item label="字典">
<el-select v-model="form.dictKey" @change="selectedChange">
<el-option v-for="(value, key) in dictMap" :key="value.id" :label="value.name" :value="value.id"></el-option>
<el-select v-model="form.dictKey">
<el-option v-for="(value, key) in hamap" :key="key" :label="key" :value="key"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item>
<el-table :data="thisDict" striped border>
<el-table-column property="dictionaryName" label="字典标签"/>
<el-table-column property="dictionaryValue" label="字典值"/>
<el-table :data="hamap[form.dictKey]" striped border>
<el-table-column property="label" label="字典标签"/>
<el-table-column property="val" label="字典值"/>
</el-table>
</el-form-item>
</el-col>
@ -166,7 +166,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="formStatus = false"> </el-button>
<el-button type="primary" @click=" utilAssetModel(form,thisDict)"> </el-button>
<el-button type="primary" @click=" utilAssetModel(form)"> </el-button>
</div>
</el-dialog>
</div>
@ -206,7 +206,6 @@ export default {
],
form: {},
formStatus: false,
dictMap: [],
// "system_sex": [
// { label: '', val: '1', isEdit: false },
// { label: '', val: '2', isEdit: false },
@ -216,8 +215,7 @@ export default {
// { label: '', val: '1', isEdit: false },
// { label: '', val: '0', isEdit: false }
// ],
dict: [],
thisDict:[]
hamap: {}
}
},
created() {
@ -228,7 +226,25 @@ export default {
this.$off('send',this.childrenMess );
this.$off('大头小头',this.selectData);
},
watch :{
"dictName": {
handler(val){
val.forEach(data => {
console.log("datadata",data)
const key = `system_${data.name.toLowerCase().replace(/ /g, '_')}`; // key
this.$set(this.hamap, key, data.dictionaryTypes.map(
dictionaryTypes => ({
label: dictionaryTypes.dictionaryName,
val: dictionaryTypes.dictionaryValue,
isEdit: dictionaryTypes.dictionStatus
})
));
console.log("dictdict",this.hamap)
})
},
immediate :true
}
},
methods: {
utilAssetModel(from){
utilAssetModel(from).then(res => {
@ -236,10 +252,6 @@ export default {
})
this.formStatus = false
},
selectedChange(val){
console.log(111,val)
this.thisDict=this.dictMap.filter(x=>x.id===val)[0].dictionaryTypes;
},
sendSelectAll(){
bus.$emit("sendSelecr", this. selectAll)
},
@ -248,15 +260,23 @@ export default {
this.childrenMess = data
})
bues.$on('大头小头',(data) =>{
console.log("大头小头",data)
this.selectData = data
})
bues.$on('ss',(data) =>{
this.dictMap = data
bes.$on('dictName',(data) =>{
console.log("dictName",data)
this.dictName = data
})
},
update(row) {
console.log("rrrrrrrrrrrrr",row)
console.log("row",row)
// utilAssetModel(row).then(res => {
// this.$message.success(res.data)
// })
this.form = row;
// this.form.dictMap = this.dictMap
this.formStatus = true;
}
}

View File

@ -1,7 +1,7 @@
<template>
<el-row :gutter="40" class="panel-group">
<div class="title-header">
{{title}} - 资产结构概述
{{title}} - 资产结构概述
</div>
<el-col :sm="12" :xs="12" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('messages')">
@ -12,7 +12,7 @@
<div class="card-panel-text">
资产模型
</div>
<count-to :duration="3000" :end-val="this.DataStructure.table" :start-val="0" class="card-panel-num"/>
<count-to :duration="3000" :end-val="shu.table" :start-val="0" class="card-panel-num"/>
</div>
</div>
</el-col>
@ -25,7 +25,7 @@
<div class="card-panel-text">
数据模型
</div>
<count-to :duration="3200" :end-val="this.DataStructure.datas" :start-val="0" class="card-panel-num"/>
<count-to :duration="3200" :end-val="shu.datas" :start-val="0" class="card-panel-num"/>
</div>
</div>
</el-col>
@ -145,7 +145,8 @@ export default {
props: [
'selectAll',
'dictName',
'bb'
'bb',
'shu'
],
// watch:{
// activeTab(newVal,oldVal){
@ -173,7 +174,6 @@ export default {
},
selectData: [],
chirien: [],
DataStructure:{}
}
},
components: {
@ -184,27 +184,21 @@ export default {
status$on('sendSelecr',data => {
this.selectAll = data
})
this.selectDataStructure()
},
methods: {
selectDataStructure(){
overallDataStructure().then(res =>{
console.log(res)
this.DataStructure = res.data
})
},
},
methods: {
selectDataStur(tab){
this.selectedItem = this.selectAll.find(item => item.name == tab.label);
selectDataStur(this.selectedItem.name).then(res => {
this.selectData = res.data
console.log(this.selectData)
})
selectChild(this.selectedItem.name).then(res => {
this.chirien = res.data
buss.$emit("send",this.chirien)
bues.$emit("大头小头",this.selectData)
bues.$emit("ss",this.dictName)
})
buss.$emit("send",this.chirien)
bues.$emit("大头小头",this.selectData)
bes.$emit("dictName",this.dictName)
},
//
editConfirm(item,row){
@ -269,7 +263,8 @@ export default {
util(row){
console.log("rowrow",row)
this.form = row;
this.formStatus = true; }
this.formStatus = true;
}
}
</script>

View File

@ -17,8 +17,8 @@
<el-container>
<el-main>
<OverallAssets v-if="showAssets == null"/>
<overall-specific-assets v-if="showAssets == 1" v-bind:bb="aa" v-bind:dictName="dictAddName" v-bind:selectAll="chir" v-bind:childrenMess="childr" v-bind:selectData="dataStructure" :title="title"/>
<overall-asset-structure v-if="showAssets == 2" v-bind:bb="aa" v-bind:dictName="dictAddName" v-bind:selectAll="chir" v-bind:childrenMess="childr" v-bind:selectData="dataStructure" :title="title"/>
<overall-specific-assets v-if="showAssets == 1" v-bind:bb="aa" v-bind:dictName="dictAddName" v-bind:selectAll="chir" v-bind:childrenMess="childr" v-bind:shu="DataStructure" v-bind:selectData="dataStructure" :title="title"/>
<overall-asset-structure v-if="showAssets == 2" v-bind:bb="aa" v-bind:dictName="dictAddName" v-bind:selectAll="chir" v-bind:childrenMess="childr" v-bind:shu="DataStructure" v-bind:selectData="dataStructure" :title="title"/>
</el-main>
</el-container>
@ -29,6 +29,7 @@ import OverallAssets from './dashboard/OverallAssets.vue'
import OverallSpecificAssets from './dashboard/OverallSpecificAssets.vue'
import OverallAssetStructure from './dashboard/OverallAssetStructure.vue'
import {
overallDataStructure,
selectChild,
selectChildAll,
selectDataSource,
@ -80,30 +81,29 @@ export default {
chir: [],
dictAddName: [],
aa: 0,
DataStructure: {}
}
},
created() {
this.selectDataSource()
},
methods: {
selctChild(tableName){
// console.log("table",tableName)
// selectChild(tableName).then(res =>{
// console.log("childrenList",res)
// this.childr=res.data
// })
},
selectDepartment(selectDepartment){
// selectDepartmen(selectDepartment).then(res=>{
// console.log("res",res)
// this.childrenList = res.data
// })
},
// selctChild(tableName){
// // console.log("table",tableName)
// // selectChild(tableName).then(res =>{
// // console.log("childrenList",res)
// // this.childr=res.data
// // })
// },
// selectDepartment(selectDepartment){
// // selectDepartmen(selectDepartment).then(res=>{
// // console.log("res",res)
// // this.childrenList = res.data
// // })
// },
selectDataSource(){
selectDataSource().then(res=>{
this.assetStructureList = res.data
})
},
expandTable(node, resolve){
@ -119,7 +119,12 @@ export default {
selectDepartmen(node.data.databaseName).then(res=>{
this.childrenList = res.data
})
if (node.level==1){
overallDataStructure().then(res =>{
console.log(res)
this.DataStructure = res.data
})
}
if (data.type == 1){
this.aa=data.id
console.log("55555555555555555",data)
@ -149,6 +154,8 @@ export default {
selectDataStur(data.name).then(res=>{
this.dataStructure= res.data
})
}
}
}