添加降雨推演步骤条

This commit is contained in:
wzy-warehouse
2026-05-07 10:39:34 +08:00
parent a125872cf5
commit 08e6897d13
4 changed files with 73 additions and 39 deletions
@@ -1,11 +1,11 @@
<template> <template>
<div class="step-box"> <div class="step-box" v-show="useStatusStore().uiComponents.stepBar.show">
<el-steps <el-steps
style="max-width: 100%" style="width: 100%; background-color: #ffffff00"
:active="useStepStore().currentStep" :active="useStepStore().currentStep"
finish-status="success" finish-status="success"
simple process-status="success"
v-if="useStepStore().stepList.length > 0" align-center
> >
<el-step <el-step
v-for="(item, index) in useStepStore().stepList" v-for="(item, index) in useStepStore().stepList"
@@ -17,13 +17,14 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { useStatusStore } from '@/stores/useStatusStore';
import { useStepStore } from '@/stores/useStepStore'; import { useStepStore } from '@/stores/useStepStore';
</script> </script>
<style scoped> <style scoped>
.step-box { .step-box {
width: 100%; width: 100%;
height: 50px; height: 65px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@@ -33,4 +34,8 @@
background-color: rgba(14, 52, 98, 0.8); background-color: rgba(14, 52, 98, 0.8);
z-index: 1000; z-index: 1000;
} }
:deep(.is-wait) {
color: #fff;
}
</style> </style>
+8 -33
View File
@@ -3,6 +3,7 @@ import { CesiumUtilsSingleton } from '@/utils/cesium/CesiumUtils.ts';
import config from '@/config/config.json'; import config from '@/config/config.json';
import { useLeftLegendStore } from '@/stores/useLeftLegendStore'; import { useLeftLegendStore } from '@/stores/useLeftLegendStore';
import { useScene } from '../useScene'; import { useScene } from '../useScene';
import { useRainstormDeduction } from '../rainstorm/useRainstormDeduction';
export const useRightHandle = () => { export const useRightHandle = () => {
/** /**
@@ -11,50 +12,24 @@ export const useRightHandle = () => {
*/ */
const rainstormSimulation = (status: unknown) => { const rainstormSimulation = (status: unknown) => {
if (status as boolean) { if (status as boolean) {
// 显示步骤
useRainstormDeduction().showStep();
// 开启暴雨模拟:显示降雨栅格图层 // 开启暴雨模拟:显示降雨栅格图层
useStatusStore().weatherLayers.showRainfallGrid.loading = true; useStatusStore().weatherLayers.showRainfallGrid.loading = true;
useStatusStore().weatherLayers.showRainfallGrid.show = true; useStatusStore().weatherLayers.showRainfallGrid.show = true;
// 添加图例 // 添加图例
useLeftLegendStore().legendListInfo.precipitation = { useRainstormDeduction().addLegend();
title: '降雨量图例',
list: [
{
label: '无雨/微雨; <0.1mm/12h',
color: 'rgba(200,200,200,0)',
},
{
label: '小雨;<5mm/12h',
color: 'rgba(0,0,255,0.4)',
},
{
label: '中雨; <15mm/12h',
color: 'rgba(0,255,255,0.5)',
},
{
label: '大雨; <30mm/12h',
color: 'rgba(0,255,0,0.6)',
},
{
label: '暴雨; <70mm/12h',
color: 'rgba(255,255,0,0.7)',
},
{
label: '大暴雨; <140mm/12h',
color: 'rgba(255,165,0,0.8)',
},
{
label: '特大暴雨; >140mm/12h',
color: 'rgba(255,0,0,0.9)',
},
],
};
} else { } else {
// 关闭暴雨模拟:隐藏降雨栅格图层 // 关闭暴雨模拟:隐藏降雨栅格图层
useStatusStore().weatherLayers.showRainfallGrid.show = false; useStatusStore().weatherLayers.showRainfallGrid.show = false;
// 删除图例 // 删除图例
delete useLeftLegendStore().legendListInfo.precipitation; delete useLeftLegendStore().legendListInfo.precipitation;
// 隐藏步骤条
useStatusStore().uiComponents.stepBar.show = false;
} }
}; };
+1 -1
View File
@@ -170,7 +170,7 @@ export const useRainDisasterChain = () => {
*/ */
const rightButtonInfo = [ const rightButtonInfo = [
{ {
name: '雨推演', name: '雨推演',
callback: (status: unknown) => callback: (status: unknown) =>
useRightHandle().rainstormSimulation(status), useRightHandle().rainstormSimulation(status),
}, },
@@ -0,0 +1,54 @@
import { useLeftLegendStore } from '@/stores/useLeftLegendStore';
import { useStatusStore } from '@/stores/useStatusStore';
import { useStepStore } from '@/stores/useStepStore';
export const useRainstormDeduction = () => {
/**
* 显示步骤
*/
const showStep = () => {
useStatusStore().uiComponents.stepBar.show = true;
useStepStore().stepList = ['获取雨量', '模型计算', '灾害预警', '报告产出'];
};
/**
* 添加图例
*/
const addLegend = () => {
useLeftLegendStore().legendListInfo.precipitation = {
title: '降雨量图例',
list: [
{
label: '无雨/微雨; <0.1mm/12h',
color: 'rgba(200,200,200,0)',
},
{
label: '小雨;<5mm/12h',
color: 'rgba(0,0,255,0.4)',
},
{
label: '中雨; <15mm/12h',
color: 'rgba(0,255,255,0.5)',
},
{
label: '大雨; <30mm/12h',
color: 'rgba(0, 255, 0, 0.89)',
},
{
label: '暴雨; <70mm/12h',
color: 'rgba(255,255,0,0.7)',
},
{
label: '大暴雨; <140mm/12h',
color: 'rgba(255,165,0,0.8)',
},
{
label: '特大暴雨; >140mm/12h',
color: 'rgba(255,0,0,0.9)',
},
],
};
};
return { showStep, addLegend };
};