// stores/ui.js
|
import { defineStore } from 'pinia'
|
import { ref } from 'vue'
|
|
export const useSimStore = defineStore('ui', () => {
|
// 所有UI状态
|
const navigationShow = ref(true)
|
const leftShow = ref(false)
|
const rightShow = ref(false)
|
const plottingShow = ref(false)
|
const messageShow = ref(false)
|
const announcementShow = ref(false)
|
const functionShow = ref(false)
|
const locationShow = ref(false)
|
const tableShow = ref(false)
|
const flowShow = ref(false)
|
const debuffShow = ref(false)
|
const rightRiverShow = ref(false)
|
const showPreview = ref(false)
|
const weatherShow = ref(false)
|
const barShow = ref(false)
|
const deviceShow = ref(false)
|
const showResultAssess = ref(false)
|
const showLayerTree = ref(true)
|
const showDangerAssess = ref(false)
|
|
// 初始化方法
|
const init = () => {
|
navigationShow.value = true
|
leftShow.value = false
|
rightShow.value = false
|
plottingShow.value = false
|
messageShow.value = false
|
announcementShow.value = false
|
functionShow.value = false
|
locationShow.value = false
|
tableShow.value = false
|
flowShow.value = false
|
rightRiverShow.value = false
|
showPreview.value = false
|
deviceShow.value = false
|
showResultAssess.value = false
|
showDangerAssess.value = false
|
}
|
|
|
const startYHGL = () => {
|
init()
|
locationShow.value = true
|
}
|
|
const startZHJC = () => {
|
init()
|
functionShow.value = true
|
deviceShow.value = true
|
}
|
|
const startMNFZ = () => {
|
init()
|
leftShow.value = true
|
rightRiverShow.value = true
|
}
|
|
const startMNPG = () => {
|
init()
|
showResultAssess.value = true
|
showDangerAssess.value = true
|
}
|
|
// 导航点击
|
const handleNavClick = (index) => {
|
switch (index) {
|
case 1:
|
startYHGL()
|
break
|
case 2:
|
startZHJC()
|
break
|
case 3:
|
startMNFZ()
|
break
|
case 4:
|
startMNPG()
|
break
|
}
|
}
|
return {
|
navigationShow,
|
leftShow,
|
rightShow,
|
plottingShow,
|
messageShow,
|
announcementShow,
|
functionShow,
|
locationShow,
|
tableShow,
|
flowShow,
|
debuffShow,
|
rightRiverShow,
|
showPreview,
|
weatherShow,
|
barShow,
|
deviceShow,
|
showResultAssess,
|
showLayerTree,
|
showDangerAssess,
|
handleNavClick,
|
init,
|
startYHGL,
|
startZHJC,
|
startMNFZ,
|
startMNPG
|
}
|
})
|