输运模拟滑块图例,天气预报运算预测任务第一帧不请求接口

This commit is contained in:
冯少康 2026-08-11 11:24:30 +08:00
parent 3fc729fdb5
commit 3aff577410
8 changed files with 318 additions and 73 deletions

View File

@ -41,6 +41,10 @@ function closeGis() {
key: 'showLengend', key: 'showLengend',
value: false, value: false,
}); });
playback_EventBusCallback.publish('newSymnLegendShow', {
flag:false,
});
// //
clearGridFeatures(); clearGridFeatures();
sendPlaybackPostMassage({ code: 'abortSYMN', data: false }, {}); sendPlaybackPostMassage({ code: 'abortSYMN', data: false }, {});

View File

@ -106,15 +106,15 @@ export function initPlaybackWorkerMa(): void {
setShouldAnimate(true); setShouldAnimate(true);
// 显示图例 // 显示图例
playback_EventBusCallback.publish('legendUiData', { // playback_EventBusCallback.publish('legendUiData', {
key: 'showLengend', // key: 'showLengend',
value: true, // value: true,
}); // });
// 更改图例最大值 // 更改图例最大值
playback_EventBusCallback.publish('symnLegendUpdateMax', { // playback_EventBusCallback.publish('symnLegendUpdateMax', {
maxValue, // maxValue,
minValue, // minValue,
}); // });
} }
break; break;
case 'drawSYMN':{ // 绘制输运模拟自定义热力图 case 'drawSYMN':{ // 绘制输运模拟自定义热力图
@ -142,10 +142,10 @@ export function initPlaybackWorkerMa(): void {
// 加载自定义热力图 // 加载自定义热力图
addCustomGridLayer(gridData, maxValue, minValue); addCustomGridLayer(gridData, maxValue, minValue);
// 更改最大值 // 更改最大值
playback_EventBusCallback.publish('symnLegendUpdateMax', { // playback_EventBusCallback.publish('symnLegendUpdateMax', {
maxValue, // maxValue,
minValue, // minValue,
}); // });
} }
break; break;
case 'querySYMNOneFail': // 输运模拟接口请求失败 case 'querySYMNOneFail': // 输运模拟接口请求失败

View File

@ -1,19 +1,26 @@
<script setup lang="ts"> <script setup lang="ts">
import type { mapPalyUiEvet } from '@/gis/ol/interface/common'; import type { mapPalyUiEvet } from "@/gis/ol/interface/common";
import { initMap } from '@/gis/ol/index'; import { initMap } from "@/gis/ol/index";
import { initOlListenHanlde } from '@/gis/ol/mapEventListen'; import { initOlListenHanlde } from "@/gis/ol/mapEventListen";
import { setShouldAnimate } from '@/gis/ol/olClock'; import { setShouldAnimate } from "@/gis/ol/olClock";
import { initPlaybackWorkerMa, playback_EventBusCallback } from '@/gis/worker/playbackWorkerMa'; import {
import { getResultGlobalAttr, getTaskSimulationSpecies } from '@/utils/axios/symn/index'; initPlaybackWorkerMa,
import MapRightMenuEvent from './mapRightMenu.vue'; playback_EventBusCallback,
} from "@/gis/worker/playbackWorkerMa";
import {
getResultGlobalAttr,
getTaskSimulationSpecies,
} from "@/utils/axios/symn/index";
import MapRightMenuEvent from "./mapRightMenu.vue";
import MapTimeSlider from './mapTimeSlider.vue'; import MapTimeSlider from "./mapTimeSlider.vue";
import MeteorologyMenu from './meteorologyMenu.vue'; import MeteorologyMenu from "./meteorologyMenu.vue";
import PollutionLegend from './pollutionLegend.vue'; import PollutionLegend from "./pollutionLegend.vue";
import SymnLegend from './symnLegend.vue'; import SymnLegend from "./symnLegend.vue";
import newSymnLegend from "./newSymnLegend.vue";
import weathLength from './weathLength.vue'; import weathLength from "./weathLength.vue";
interface playUIEventOpt { interface playUIEventOpt {
activeMenu?: string; activeMenu?: string;
@ -41,6 +48,9 @@ const legengUIFalg = ref<boolean>(false);
const legengUIObj = ref<any>(null); const legengUIObj = ref<any>(null);
// UI // UI
const symnUIFalg = ref<boolean>(false); const symnUIFalg = ref<boolean>(false);
//
const newSymnUIFalg = ref<boolean>(false);
// //
const weathLengthUIFalg = ref<any>(false); const weathLengthUIFalg = ref<any>(false);
const weathLengthUIObj = ref<any>(null); const weathLengthUIObj = ref<any>(null);
@ -48,21 +58,23 @@ const weathLengthUIObj = ref<any>(null);
// UI // UI
const meteorologyUIFalg = ref<boolean>(false); const meteorologyUIFalg = ref<boolean>(false);
const startExp = ref(0);
// gisUI // gisUI
const playUIEvents: any = { const playUIEvents: any = {
start(menuInf: playUIEventOpt) { start(menuInf: playUIEventOpt) {
animationUIFalg.value = true; animationUIFalg.value = true;
activeMenu.value = menuInf.activeMenu; activeMenu.value = menuInf.activeMenu;
// //
if (menuInf.activeMenu === '天气预报运算') { if (menuInf.activeMenu === "天气预报运算") {
meteorologyUIFalg.value = true; meteorologyUIFalg.value = true;
// tabs // tabs
isShowTabs.value = false; isShowTabs.value = false;
} }
if (menuInf.activeMenu === '数据分析') { if (menuInf.activeMenu === "数据分析") {
setShouldAnimate(true); setShouldAnimate(true);
} }
if (menuInf.activeMenu === '输运模拟') { if (menuInf.activeMenu === "输运模拟") {
// tabs // tabs
isShowTabs.value = false; isShowTabs.value = false;
// //
@ -77,29 +89,32 @@ const playUIEvents: any = {
if (menuInf.eventOpt.task.taskMode === 1) { if (menuInf.eventOpt.task.taskMode === 1) {
// //
getTaskSimulationSpecies({ taskId: taskId.value }, (res: any) => { getTaskSimulationSpecies({ taskId: taskId.value }, (res: any) => {
speciesList.value = Object.entries(res).map(([key, item]: [string | number, any]) => { speciesList.value = Object.entries(res).map(
([key, item]: [string | number, any]) => {
return { return {
label: item, // value label: item, // value
value: key, // key value: key, // key
}; };
});
});
} }
else { );
});
} else {
speciesList.value = []; speciesList.value = [];
} }
} }
if (menuInf.activeMenu === '核事件模拟') { if (menuInf.activeMenu === "核事件模拟") {
taskId.value = menuInf.eventOpt.task.id; taskId.value = menuInf.eventOpt.task.id;
// tabs // tabs
isShowTabs.value = false; isShowTabs.value = false;
// //
isShowSelect.value = true; isShowSelect.value = true;
// //
layerList.value = [{ layerList.value = [
{
label: `0`, label: `0`,
value: '0', value: "0",
}]; },
];
} }
}, },
stop() { stop() {
@ -110,6 +125,9 @@ const playUIEvents: any = {
symnUIFalg.value = false; symnUIFalg.value = false;
isShowTabs.value = true; isShowTabs.value = true;
isShowSelect.value = false; isShowSelect.value = false;
newSymnUIFalg.value = false;
}, },
showLegeng(opt?: any) { showLegeng(opt?: any) {
legengUIFalg.value = true; legengUIFalg.value = true;
@ -147,12 +165,12 @@ const playUIEvents: any = {
onMounted(() => { onMounted(() => {
// //
initMap('olContainer'); initMap("olContainer");
initOlListenHanlde(); initOlListenHanlde();
// gis // gis
const eventBus: any = EventBusTool.getEventBus(); const eventBus: any = EventBusTool.getEventBus();
eventBus.subscribe('playUI', (opt: mapPalyUiEvet) => { eventBus.subscribe("playUI", (opt: mapPalyUiEvet) => {
playUIEvents[opt.key] && playUIEvents[opt.key](opt); playUIEvents[opt.key] && playUIEvents[opt.key](opt);
}); });
@ -160,15 +178,25 @@ onMounted(() => {
// worker // worker
initPlaybackWorkerMa(); initPlaybackWorkerMa();
}); });
playback_EventBusCallback.subscribe('legendUiData', (opt: any) => { playback_EventBusCallback.subscribe("legendUiData", (opt: any) => {
switch (opt.key) { switch (opt.key) {
case 'showLengend': // case "showLengend": //
symnUIFalg.value = opt.value; symnUIFalg.value = opt.value;
break; break;
default: default:
break; break;
} }
}); });
playback_EventBusCallback.subscribe("newSymnLegendShow", (opt: any) => {
newSymnUIFalg.value = opt.flag;
if(opt.flag){
startExp.value = opt.startExp;
}else{
startExp.value = 0;
}
});
}); });
</script> </script>
@ -177,8 +205,17 @@ onMounted(() => {
<MapRightMenuEvent /> <MapRightMenuEvent />
<PollutionLegend v-show="legengUIFalg" ref="legengUIObj" /> <PollutionLegend v-show="legengUIFalg" ref="legengUIObj" />
<SymnLegend v-show="symnUIFalg" /> <SymnLegend v-show="symnUIFalg" />
<MapTimeSlider v-show="animationUIFalg" :is-show-tabs="isShowTabs" :is-show-select="isShowSelect" :task-id="taskId" <newSymnLegend v-show="newSymnUIFalg" :startExp="startExp"></newSymnLegend>
:species-list="speciesList" :active-menu="activeMenu" :global-attr="globalAttr" :layer-list="layerList" /> <MapTimeSlider
v-show="animationUIFalg"
:is-show-tabs="isShowTabs"
:is-show-select="isShowSelect"
:task-id="taskId"
:species-list="speciesList"
:active-menu="activeMenu"
:global-attr="globalAttr"
:layer-list="layerList"
/>
<MeteorologyMenu v-show="meteorologyUIFalg" /> <MeteorologyMenu v-show="meteorologyUIFalg" />
<weathLength v-show="weathLengthUIFalg" ref="weathLengthUIObj" /> <weathLength v-show="weathLengthUIFalg" ref="weathLengthUIObj" />
</div> </div>

View File

@ -242,6 +242,10 @@ function stopAnimation() {
key: "showLengend", key: "showLengend",
value: false, value: false,
}); });
playback_EventBusCallback.publish("newSymnLegendShow", {
flag: false,
});
// //
clearGridFeatures(); clearGridFeatures();
clearHeatmapLayer(); clearHeatmapLayer();
@ -272,13 +276,20 @@ function updateTimeLabel(ctime: any) {
// currentHourDiffmarks // currentHourDiffmarks
if ( if (
(currentHourDiff >= 0 && (currentHourDiff > 0 &&
currentHourDiff <= totalHours.value && currentHourDiff <= totalHours.value &&
// && markKeys.includes(currentHourDiff) // // && markKeys.includes(currentHourDiff) //
isDifferentValue && // isDifferentValue && //
is6HourInterval)||!_isPlayFirstFrame.value is6HourInterval) ||
!_isPlayFirstFrame.value ||
(currentHourDiff == 0 &&
tqybysTabValue.value != "预测任务" &&
currentHourDiff <= totalHours.value &&
// && markKeys.includes(currentHourDiff) //
isDifferentValue && //
is6HourInterval)
) { ) {
_isPlayFirstFrame.value = true _isPlayFirstFrame.value = true;
value.value = currentHourDiff; value.value = currentHourDiff;
if (markKeys.includes(currentHourDiff)) { if (markKeys.includes(currentHourDiff)) {
// currentHourDiffmarkKeys // currentHourDiffmarkKeys
@ -308,7 +319,7 @@ function updateTimeLabel(ctime: any) {
EventBusTool.getEventBus().publish("playData", { EventBusTool.getEventBus().publish("playData", {
key: "addyctqjsGis", key: "addyctqjsGis",
data: res, data: res,
weatherType:params.weatherType weatherType: params.weatherType,
}); });
}); });
// // // //
@ -318,10 +329,10 @@ function updateTimeLabel(ctime: any) {
delete params1.endTime; delete params1.endTime;
playbackSearchData(params1, true, (res) => { playbackSearchData(params1, true, (res) => {
// //
EventBusTool.getEventBus().publish('playData', { EventBusTool.getEventBus().publish("playData", {
key: 'addyctqjsGis', key: "addyctqjsGis",
data: res, data: res,
weatherType:3 weatherType: 3,
}); });
}); });
} }
@ -350,6 +361,8 @@ const speciesValueChange = () => {
const ssmnOption = ref({}); const ssmnOption = ref({});
const tqybysTabValue = ref("预测任务");
// speciesList // speciesList
watch( watch(
() => props.speciesList, () => props.speciesList,
@ -448,7 +461,12 @@ onMounted(() => {
EventBusTool.getEventBus().subscribe("updateHfKsFlag", (opt: any) => { EventBusTool.getEventBus().subscribe("updateHfKsFlag", (opt: any) => {
_isPlayFirstFrame.value = opt; _isPlayFirstFrame.value = opt;
labelText.value = "" labelText.value = "";
});
EventBusTool.getEventBus().subscribe("updateTqybysTabValue", (opt: any) => {
tqybysTabValue.value = opt.value;
console.log(tqybysTabValue.value, "21321");
}); });
}); });
</script> </script>

View File

@ -0,0 +1,121 @@
<script setup lang="ts">
import { watch } from "vue";
// 10 +
const colorList = ref([]);
// [
// { color: "#991a20", label: "10" },
// { color: "#e63920", label: "10²" },
// { color: "#ffc125", label: "10" },
// { color: "#ffdd55", label: "10¹" },
// { color: "#207830", label: "10²" },
// { color: "#42b883", label: "10³" },
// { color: "#72c8dd", label: "10" },
// { color: "#b4d8e8", label: "10" },
// { color: "#e2ccb0", label: "10" },
// { color: "#f0e8dd", label: "10" },
// ];
const colorArr = [
"bisque",
"tan",
"lightblue",
"dodgerblue",
"lightgreen",
"green",
"yellow",
"orange",
"red",
"darkred",
];
const props = defineProps({
startExp: {
type: Number,
required: true,
},
});
watch(
() => props.startExp, // props
(newVal, oldVal) => {
console.log("父组件传过来的值变化了", newVal, oldVal);
// 10
handleGenTicks(newVal);
},
{ immediate: true } // immediate:true
);
function handleGenTicks(maxVal) {
console.log("执行生成刻度", maxVal);
colorList.value = [];
colorArr.forEach((item, index) => {
let item1 = {
color: item,
label: maxVal - index,
};
colorList.value.push(item1);
});
}
</script>
<template>
<div class="legend-wrap">
<!-- 颜色条10个色块 -->
<div class="color-bar">
<div
v-for="(item, index) in colorList"
:key="index"
class="color-item"
:style="{ backgroundColor: item.color }"
></div>
</div>
<!-- 刻度10一一对应每个色块 -->
<div class="ticks">
<span v-for="(item, index) in colorList" :key="index"
>10<sup>{{ item.label }}</sup></span
>
<span
>10<sup>{{ startExp - 10 }}</sup></span
>
</div>
</div>
</template>
<style lang="less" scoped>
.legend-wrap {
display: flex;
align-items: flex-start;
gap: 8px;
position: absolute;
right: 70px;
bottom: 40px;
z-index: 10;
color: #fff;
}
.color-bar {
width: 24px;
height: 320px;
display: flex;
flex-direction: column;
margin-right: 5px;
}
.color-item {
flex: 1;
}
.ticks {
height: 330px;
display: flex;
flex-direction: column;
justify-content: space-between;
font-size: 14px;
font-family: sansserif;
position: absolute;
right: -30px;
bottom: -3px;
}
</style>

View File

@ -32,13 +32,17 @@ import {
importFile, importFile,
pinToTop, pinToTop,
unpin, unpin,
getTaskSimulationNuclide,
} from "@/utils/axios/symn"; } from "@/utils/axios/symn";
import fhdfx from "./compliance/index.vue"; import fhdfx from "./compliance/index.vue";
import gxfx from "./contribution/index.vue"; import gxfx from "./contribution/index.vue";
import log from "./log/index.vue"; import log from "./log/index.vue";
import sxfx from "./timingAnalysis/index.vue"; import sxfx from "./timingAnalysis/index.vue";
import { playback_EventBusCallback } from "@/gis/worker/playbackWorkerMa";
import { activeMoudleInf } from "@/gis/ol"; import { activeMoudleInf } from "@/gis/ol";
import { getRwNcMaxValue } from "@/utils/axios/fskjk";
const { t, locale } = useI18n(); const { t, locale } = useI18n();
const formEl = ref<FormInstance>(); const formEl = ref<FormInstance>();
const dialogVisible = ref(true); const dialogVisible = ref(true);
@ -290,6 +294,41 @@ const pinToTopTask = (row: any, isPin: boolean) => {
function viewTask(task: any) { function viewTask(task: any) {
console.log("查看任务:", task); console.log("查看任务:", task);
if (task.taskMode == 1) {
getTaskSimulationNuclide({ taskId: task.id }, (res: any) => {
const keys = Object.keys(res);
const values = Object.values(res);
let arr = [];
console.log("res", res);
keys.map((item, index) => {
arr.push({
name: values[index],
id: keys[index],
});
});
if (arr.length) {
getRwNcMaxValue({ taskId: task.id, speciesId: arr[0].id }, (res) => {
console.log(res, "21234");
const startExp = Math.ceil(Math.log10(res.result));
playback_EventBusCallback.publish("newSymnLegendShow", {
flag: true,
startExp,
});
});
}
});
} else {
getRwNcMaxValue({ taskId: task.id }, (res) => {
const startExp = Math.ceil(Math.log10(res.result));
playback_EventBusCallback.publish("newSymnLegendShow", {
flag: true,
startExp,
});
});
}
if (task.taskMode == -1 && sessionStorage.getItem("symnZxHsId")) { if (task.taskMode == -1 && sessionStorage.getItem("symnZxHsId")) {
sessionStorage.removeItem("symnZxHsId"); sessionStorage.removeItem("symnZxHsId");
} }
@ -299,6 +338,7 @@ function viewTask(task: any) {
form.value = { form.value = {
...task, ...task,
}; };
drawerVisible.value = true; drawerVisible.value = true;
// if (task.taskStatus === 2) { // if (task.taskStatus === 2) {
// //
@ -1952,19 +1992,14 @@ getStations();
<!-- 样品ID --> <!-- 样品ID -->
<ElTableColumn :label="t('sampleId')" width="95"> <ElTableColumn :label="t('sampleId')" width="95">
<template #default="scope"> <template #default="scope">
<el-input <el-input v-model="scope.row.sampleId" type="number" />
v-model="scope.row.sampleId"
type="number"
/>
</template> </template>
</ElTableColumn> </ElTableColumn>
<!-- 样品类型 --> <!-- 样品类型 -->
<ElTableColumn :label="t('sampleType')" width="80"> <ElTableColumn :label="t('sampleType')" width="80">
<template #default="scope"> <template #default="scope">
<el-select <el-select v-model="scope.row.sampleType">
v-model="scope.row.sampleType"
>
<el-option <el-option
v-for="item in ['B', 'P']" v-for="item in ['B', 'P']"
:key="item" :key="item"
@ -1978,9 +2013,7 @@ getStations();
<!-- 样品级别 --> <!-- 样品级别 -->
<ElTableColumn :label="t('sampleLevel')" width="80"> <ElTableColumn :label="t('sampleLevel')" width="80">
<template #default="scope"> <template #default="scope">
<el-select <el-select v-model="scope.row.sampleCategory">
v-model="scope.row.sampleCategory"
>
<el-option <el-option
v-for="item in [1, 2, 3, 4, 5]" v-for="item in [1, 2, 3, 4, 5]"
:key="item" :key="item"

View File

@ -28,6 +28,19 @@ watch(drawerVisible, (newValue) => {
} }
}); });
watch(
() => tabActive.value, // props
(newVal, oldVal) => {
console.log('父组件传过来的值变化了', newVal, oldVal)
// teb
EventBusTool.getEventBus().publish('updateTqybysTabValue', {
value:newVal,
});
},
{ immediate: true } // immediate:true
)
// function handleSendData(data: any) { // function handleSendData(data: any) {
// console.log(',gis --->', data); // console.log(',gis --->', data);
// // // //
@ -152,6 +165,9 @@ function initCharts(data: any) {
Chart.setOption(option); Chart.setOption(option);
} }
} }
onMounted(() => { onMounted(() => {
EventBusTool.getEventBus().subscribe('tqybjsUiEvent', (opt: any) => { EventBusTool.getEventBus().subscribe('tqybjsUiEvent', (opt: any) => {
console.log('timeBatch', opt); console.log('timeBatch', opt);

View File

@ -98,3 +98,19 @@ export async function getHcQxData(
callback?.(response); callback?.(response);
} }
} }
// 获取任务NC文件最大值
export async function getRwNcMaxValue(
params: any,
callback?: (data: any) => void,
): Promise<any> {
const response = await request({
url: `${serverIp}${baseURL}/transportResult/getNCResultGlobalMaximum`,
method: "GET",
params,
});
if (response.success && response.code === 200) {
callback?.(response);
}
}