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

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',
value: false,
});
playback_EventBusCallback.publish('newSymnLegendShow', {
flag:false,
});
//
clearGridFeatures();
sendPlaybackPostMassage({ code: 'abortSYMN', data: false }, {});

View File

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

View File

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

View File

@ -242,6 +242,10 @@ function stopAnimation() {
key: "showLengend",
value: false,
});
playback_EventBusCallback.publish("newSymnLegendShow", {
flag: false,
});
//
clearGridFeatures();
clearHeatmapLayer();
@ -272,13 +276,20 @@ function updateTimeLabel(ctime: any) {
// currentHourDiffmarks
if (
(currentHourDiff >= 0 &&
currentHourDiff <= totalHours.value &&
// && markKeys.includes(currentHourDiff) //
isDifferentValue && //
is6HourInterval)||!_isPlayFirstFrame.value
(currentHourDiff > 0 &&
currentHourDiff <= totalHours.value &&
// && markKeys.includes(currentHourDiff) //
isDifferentValue && //
is6HourInterval) ||
!_isPlayFirstFrame.value ||
(currentHourDiff == 0 &&
tqybysTabValue.value != "预测任务" &&
currentHourDiff <= totalHours.value &&
// && markKeys.includes(currentHourDiff) //
isDifferentValue && //
is6HourInterval)
) {
_isPlayFirstFrame.value = true
_isPlayFirstFrame.value = true;
value.value = currentHourDiff;
if (markKeys.includes(currentHourDiff)) {
// currentHourDiffmarkKeys
@ -308,20 +319,20 @@ function updateTimeLabel(ctime: any) {
EventBusTool.getEventBus().publish("playData", {
key: "addyctqjsGis",
data: res,
weatherType:params.weatherType
weatherType: params.weatherType,
});
});
// //
if (weathFlag[3] === true&&gisImgOpt.weatherType!=3) {
if (weathFlag[3] === true && gisImgOpt.weatherType != 3) {
const params1 = { ...params, weatherType: 3 };
delete params1.key;
delete params1.endTime;
playbackSearchData(params1, true, (res) => {
//
EventBusTool.getEventBus().publish('playData', {
key: 'addyctqjsGis',
EventBusTool.getEventBus().publish("playData", {
key: "addyctqjsGis",
data: res,
weatherType:3
weatherType: 3,
});
});
}
@ -350,6 +361,8 @@ const speciesValueChange = () => {
const ssmnOption = ref({});
const tqybysTabValue = ref("预测任务");
// speciesList
watch(
() => props.speciesList,
@ -448,7 +461,12 @@ onMounted(() => {
EventBusTool.getEventBus().subscribe("updateHfKsFlag", (opt: any) => {
_isPlayFirstFrame.value = opt;
labelText.value = ""
labelText.value = "";
});
EventBusTool.getEventBus().subscribe("updateTqybysTabValue", (opt: any) => {
tqybysTabValue.value = opt.value;
console.log(tqybysTabValue.value, "21321");
});
});
</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,
pinToTop,
unpin,
getTaskSimulationNuclide,
} from "@/utils/axios/symn";
import fhdfx from "./compliance/index.vue";
import gxfx from "./contribution/index.vue";
import log from "./log/index.vue";
import sxfx from "./timingAnalysis/index.vue";
import { playback_EventBusCallback } from "@/gis/worker/playbackWorkerMa";
import { activeMoudleInf } from "@/gis/ol";
import { getRwNcMaxValue } from "@/utils/axios/fskjk";
const { t, locale } = useI18n();
const formEl = ref<FormInstance>();
const dialogVisible = ref(true);
@ -290,6 +294,41 @@ const pinToTopTask = (row: any, isPin: boolean) => {
function viewTask(task: any) {
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")) {
sessionStorage.removeItem("symnZxHsId");
}
@ -299,6 +338,7 @@ function viewTask(task: any) {
form.value = {
...task,
};
drawerVisible.value = true;
// if (task.taskStatus === 2) {
//
@ -1952,21 +1992,16 @@ getStations();
<!-- 样品ID -->
<ElTableColumn :label="t('sampleId')" width="95">
<template #default="scope">
<el-input
v-model="scope.row.sampleId"
type="number"
/>
<el-input v-model="scope.row.sampleId" type="number" />
</template>
</ElTableColumn>
<!-- 样品类型 -->
<ElTableColumn :label="t('sampleType')" width="80">
<template #default="scope">
<el-select
v-model="scope.row.sampleType"
>
<el-select v-model="scope.row.sampleType">
<el-option
v-for="item in ['B','P']"
v-for="item in ['B', 'P']"
:key="item"
:label="item"
:value="item"
@ -1978,11 +2013,9 @@ getStations();
<!-- 样品级别 -->
<ElTableColumn :label="t('sampleLevel')" width="80">
<template #default="scope">
<el-select
v-model="scope.row.sampleCategory"
>
<el-select v-model="scope.row.sampleCategory">
<el-option
v-for="item in [1,2,3,4,5]"
v-for="item in [1, 2, 3, 4, 5]"
:key="item"
:label="item"
:value="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) {
// console.log(',gis --->', data);
// //
@ -152,6 +165,9 @@ function initCharts(data: any) {
Chart.setOption(option);
}
}
onMounted(() => {
EventBusTool.getEventBus().subscribe('tqybjsUiEvent', (opt: any) => {
console.log('timeBatch', opt);

View File

@ -98,3 +98,19 @@ export async function getHcQxData(
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);
}
}