mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-07 18:25:45 +08:00
Fix dashboard (#961)
* Fix dashboard * delete line code Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
parent
273e21861d
commit
ef56a8a4f1
@ -134,7 +134,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
sendMain(dashboard) {
|
||||
this.$store.commit('setMainDashboard', dashboard)
|
||||
this.$store.dispatch('mainDashboard', dashboard)
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}
|
||||
|
@ -73,6 +73,9 @@ const dashboard = {
|
||||
console.warn(`Error getting List Dashboards: ${error.message}. Code: ${error.code}.`)
|
||||
})
|
||||
})
|
||||
},
|
||||
mainDashboard({ commit }, dashboard) {
|
||||
commit('setMainDashboard', dashboard)
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
@ -85,6 +88,9 @@ const dashboard = {
|
||||
return state.dashboard.find(
|
||||
item => item.roleUuid === roleUuid
|
||||
)
|
||||
},
|
||||
getMainDashboard: (state) => {
|
||||
return state.mainashboard
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="dashboard-editor-container">
|
||||
<el-row :gutter="8">
|
||||
<el-col :span="24" style="padding-right:8px;margin-bottom:2px;">
|
||||
<el-col v-if="!isEmptyValue(mainashboard)" :span="24" style="padding-right:8px;margin-bottom:2px;">
|
||||
<dashboard
|
||||
:metadata="mainashboard"
|
||||
:title="mainashboard.name"
|
||||
@ -41,7 +41,7 @@ export default {
|
||||
return this.$store.getters.getRoleUuid
|
||||
},
|
||||
mainashboard() {
|
||||
return this.$store.state.dashboard.mainashboard
|
||||
return this.$store.getters.getMainDashboard
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -63,7 +63,7 @@ export default {
|
||||
})
|
||||
.then(response => {
|
||||
if (this.isEmptyValue(this.mainashboard)) {
|
||||
this.$store.commit('setMainDashboard', response.dashboardsList[1])
|
||||
this.$store.dispatch('mainDashboard', response.dashboardsList[1])
|
||||
}
|
||||
this.dashboardList = response.dashboardsList
|
||||
this.$forceUpdate()
|
||||
|
Loading…
x
Reference in New Issue
Block a user