dashboard配置支持保存入库

This commit is contained in:
Allen
2024-04-18 12:40:14 +08:00
parent 2d7880351b
commit 8cb514d70e
3 changed files with 44 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
<script lang="ts" setup>
import { useToast } from 'vue-toast-notification'
import { useTheme } from 'vuetify'
import api from '@/api'
import store from './store'
@@ -41,10 +42,22 @@ function startSSEMessager() {
}
}
// 加载用户监控面板配置
async function loadDashboardConfig() {
const response = await api.get('/user/config/Dashboard')
if (response && response.data && response.data.value) {
const data = JSON.stringify(response.data.value)
if (data != localStorage.getItem("MP_DASHBOARD")) {
localStorage.setItem("MP_DASHBOARD", data)
}
}
}
// 页面加载时,加载当前用户数据
onBeforeMount(async () => {
setTheme()
startSSEMessager()
await loadDashboardConfig()
})
</script>