From bf0eb543e2deab8a1629dd2a46f8e1cd191531e1 Mon Sep 17 00:00:00 2001 From: wangjuncheng <1> Date: 星期四, 17 七月 2025 15:22:01 +0800 Subject: [PATCH] Merge branch 'master' of http://103.135.160.14:9034/r/NslWeb --- src/store/simulation.js | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 40 insertions(+), 6 deletions(-) diff --git a/src/store/simulation.js b/src/store/simulation.js index c9d7ee6..e810802 100644 --- a/src/store/simulation.js +++ b/src/store/simulation.js @@ -1,13 +1,27 @@ // stores/ui.js import { defineStore } from 'pinia' import { ref } from 'vue' +import { showDeviceDetail } from "@/store"; export const useSimStore = defineStore('simulation', () => { + // 鏂潰鏁版嵁 + const crossSection = ref([]) + const openDia = ref(true) + // 鍘嗗彶鍥炴斁鍒楄〃 + const rePlayList = ref([]) + // 鍖椾含甯傛墍鏈夋潙鐨刢ode + const townCodeAll = ref([]) + // 瀹炴椂妯℃嫙鏈�鏂扮殑layer + const layerDate = ref("") + // 甯ф暟 + const frameNum = ref(0) // 鐩綍鏍戦�変腑 const userSelectedLayers = ref([]) // 闅愭偅鐐瑰垪琛� const DeviceShowSwitch = ref(false) const DangerShowSwitch = ref(false) const DangerPoint = ref([]) + // 娉ヤ綅璁� + const selectNWJ = ref() // 鐩戞祴璁惧鍒楄〃 const devices = ref([]) const navigationShow = ref(true) @@ -40,12 +54,25 @@ const rainFalls = ref() // 闄嶉洦鍗曚綅 const intensityUnit = ref() + // 鏂规涓嬫按娣辨祦閫熺瓑鏁版嵁 + let schemWaterInfo = ref([]) const setSelectedScheme = (scheme) => { - selectedScheme.value = scheme - rainFalls.value = JSON.parse(scheme.data).rainfalls - intensityUnit.value = JSON.parse(scheme.data).intensityUnit - console.log(intensityUnit.value, 'shceme') - } + selectedScheme.value = scheme; + + try { + const parsedData = JSON.parse(scheme.data); + + // 鍙湁褰� rainfalls 鍜� intensityUnit 瀛樺湪涓旈潪绌烘椂鎵嶈祴鍊� + if (parsedData.rainfalls && parsedData.intensityUnit) { + rainFalls.value = parsedData.rainfalls; + intensityUnit.value = parsedData.intensityUnit; + } else { + console.warn("缂哄皯蹇呰鐨� rainfalls 鎴� intensityUnit 瀛楁"); + } + } catch (error) { + console.error("瑙f瀽 scheme.data 鍑洪敊", error); + } + }; const clearSelectedScheme = () => { selectedScheme.value = null } @@ -131,7 +158,6 @@ const startMNPG = () => { init() isShowEarth.value = false - } const setBackToHome = (value) => { @@ -140,6 +166,7 @@ // 瀵艰埅鐐瑰嚮 const handleNavClick = (index) => { + showDeviceDetail.value = false; switch (index) { case 1: startYHGL() @@ -193,6 +220,13 @@ isShowEarth, userSelectedLayers, devices, + frameNum, + schemWaterInfo, + layerDate, + rePlayList, + selectNWJ, + openDia, + crossSection, // 鏂规鐩稿叧鏂规硶 setSchemCard, -- Gitblit v1.9.3