回放,预览bug

This commit is contained in:
冯少康 2026-08-06 10:53:48 +08:00
parent 324e6302a7
commit 4b24e87192
13 changed files with 719 additions and 417 deletions

View File

@ -44,7 +44,7 @@ const defaultGeosion: any = {
defau2: false, defau2: false,
}; };
// 风场是否开启 // 风场是否开启
const weathFlag: any = { 0: false, 1: false, 2: false, 3: false }; const weathFlag: any = { 0: false, 1: false, 2: false, 3: true };
let weathRequesTime = ''; let weathRequesTime = '';
export function setWeathRequesTime(value: any) { export function setWeathRequesTime(value: any) {
weathRequesTime = value; weathRequesTime = value;
@ -215,6 +215,17 @@ const palyDateEvent: any = {
addWeathLayer(map, weathOpt.imageUrl); addWeathLayer(map, weathOpt.imageUrl);
// 清理UI // 清理UI
const eventbus = EventBusTool.getEventBus(); const eventbus = EventBusTool.getEventBus();
console.log(weathOpt,gisImgOpt,"222222222222222222")
if(gisImgOpt.weatherType==0){
weathOpt.legengOpt.unit = "℃";
}else if(gisImgOpt.weatherType==1){
weathOpt.legengOpt.unit = "kPa";
}else if(gisImgOpt.weatherType==2){
weathOpt.legengOpt.unit = "%";
}
eventbus.publish('playUI', { eventbus.publish('playUI', {
key: 'showWeathLength', key: 'showWeathLength',
legengOpt: weathOpt.legengOpt, legengOpt: weathOpt.legengOpt,
@ -234,6 +245,8 @@ const palyDateEvent: any = {
// 设置态势图层参数 // 设置态势图层参数
setTaishiParam(map: any, eventOpt?: any) { setTaishiParam(map: any, eventOpt?: any) {
gisImgOpt = { ...eventOpt }; gisImgOpt = { ...eventOpt };
console.log(gisImgOpt,"1")
weathRequesTime = eventOpt.startTime; weathRequesTime = eventOpt.startTime;
// 设置时间 // 设置时间
@ -258,6 +271,10 @@ const palyDateEvent: any = {
setWeathLayerVisity(eventOpt.isActive); setWeathLayerVisity(eventOpt.isActive);
} }
}, },
updateTimeCurrentIndex(map: any, eventOpt?: any){
gisImgOpt.hour = eventOpt.hour;
console.log(gisImgOpt,"2")
}
}; };
// 初始化地图 // 初始化地图

View File

@ -1,7 +1,7 @@
import dayjs from 'dayjs'; import dayjs from "dayjs";
// 时钟类 // 时钟类
import Clock from '@/gis/common/clock/clock/Clock'; // 根据实际路径调整 import Clock from "@/gis/common/clock/clock/Clock"; // 根据实际路径调整
import JulianDate from '../common/clock/JulianData/JulianDate'; import JulianDate from "../common/clock/JulianData/JulianDate";
let timeLoop = false; let timeLoop = false;
let olClock: any; let olClock: any;
@ -22,39 +22,49 @@ export function initClock(params?: any) {
olClock = new Clock({ shouldAnimate: false, clockRange: 1 }); olClock = new Clock({ shouldAnimate: false, clockRange: 1 });
timeLoop = true; timeLoop = true;
if (olClock && params) { if (olClock && params) {
console.log(params, "2222");
olClock.startTime = JulianDate.fromDate(new Date(params.startTime)); olClock.startTime = JulianDate.fromDate(new Date(params.startTime));
olClock.currentTime = JulianDate.fromDate(new Date(params.startTime)); olClock.currentTime = JulianDate.fromDate(new Date(params.startTime));
olClock.stopTime = JulianDate.fromDate(new Date(params.endTime)); olClock.stopTime = JulianDate.fromDate(new Date(params.endTime));
// olClock.multiplier = 60 * 60; // olClock.multiplier = 60 * 60;
olClock.multiplier = 60 * 60; olClock.multiplier = 60 * 60;
EventBusTool.getEventBus().publish('timeSliderUi', { key: 'setTime', ...params }); EventBusTool.getEventBus().publish("timeSliderUi", {
key: "setTime",
...params,
});
} }
// 触发帧回调 // 触发帧回调
_timeLoop(); _timeLoop();
// 添加动画控件UI帧回调事件 // 添加动画控件UI帧回调事件
olClock.onTick.addEventListener((time: any) => { olClock.onTick.addEventListener((time: any) => {
if (olClock.shouldAnimate) { if (olClock.shouldAnimate) {
EventBusTool.getEventBus().publish('timeSliderUi', { key: 'updateUi', time: JulianDate.toDate(time.currentTime).getTime() }); EventBusTool.getEventBus().publish("timeSliderUi", {
key: "updateUi",
time: JulianDate.toDate(time.currentTime).getTime(),
});
} }
}); });
} }
// 设置是否播放 // 设置是否播放
export function setShouldAnimate(falg: boolean) { export function setShouldAnimate(falg: boolean) {
console.log(olClock,"dsudhu");
if (falg && olClock.currentTime >= olClock.stopTime) { if (falg && olClock.currentTime >= olClock.stopTime) {
// 重置当前时间为开始时间 // 重置当前时间为开始时间
olClock.currentTime = JulianDate.clone(olClock.startTime); olClock.currentTime = JulianDate.clone(olClock.startTime);
} }
olClock.shouldAnimate = falg; olClock.shouldAnimate = falg;
EventBusTool.getEventBus().publish('timeSliderUi', { key: 'playFalg', playFalg: falg }); EventBusTool.getEventBus().publish("timeSliderUi", {
key: "playFalg",
playFalg: falg,
});
} }
export function stopPlay() { export function stopPlay() {
if (!olClock) if (!olClock) return;
return; // 暂停动画
// 暂停动画
olClock.shouldAnimate = false; olClock.shouldAnimate = false;
// 重置当前时间为开始时间 // 重置当前时间为开始时间
olClock.currentTime = JulianDate.clone(olClock.startTime); olClock.currentTime = JulianDate.clone(olClock.startTime);
@ -67,11 +77,16 @@ export function setMultiplier(num: number) {
// 设置动画时间 // 设置动画时间
export function setAnimationTime(opt: any) { export function setAnimationTime(opt: any) {
if (olClock && opt) { if (olClock && opt) {
if (!opt.startTime || !opt.endTime) { return } if (!opt.startTime || !opt.endTime) {
return;
}
olClock.startTime = JulianDate.fromDate(new Date(opt.startTime)); olClock.startTime = JulianDate.fromDate(new Date(opt.startTime));
olClock.currentTime = JulianDate.fromDate(new Date(opt.startTime)); olClock.currentTime = JulianDate.fromDate(new Date(opt.startTime));
olClock.stopTime = JulianDate.fromDate(new Date(opt.endTime)); olClock.stopTime = JulianDate.fromDate(new Date(opt.endTime));
EventBusTool.getEventBus().publish('timeSliderUi', { key: 'setTime', ...opt }); EventBusTool.getEventBus().publish("timeSliderUi", {
key: "setTime",
...opt,
});
} }
} }
// 设置当前时间 // 设置当前时间
@ -115,7 +130,7 @@ export function removeClockOnTickEvent(key: any) {
const originalCallback = callBackEvnets.get(key); const originalCallback = callBackEvnets.get(key);
olClock.onTick.removeEventListener(originalCallback); // 关键:用原始回调移除 olClock.onTick.removeEventListener(originalCallback); // 关键:用原始回调移除
callBackEvnets.delete(key); callBackEvnets.delete(key);
console.log('移除后事件列表:', callBackEvnets); // 确认已删除Map(0) console.log("移除后事件列表:", callBackEvnets); // 确认已删除Map(0)
} }
} }
@ -127,8 +142,10 @@ export function getClockTimeRange() {
const startTime = JulianDate.toDate(olClock.startTime); const startTime = JulianDate.toDate(olClock.startTime);
const endTime = JulianDate.toDate(olClock.stopTime); const endTime = JulianDate.toDate(olClock.stopTime);
const formatStartTime = dayjs(startTime.getTime()).format('YYYY-MM-DD HH:mm:ss'); const formatStartTime = dayjs(startTime.getTime()).format(
const formatEndTime = dayjs(endTime.getTime()).format('YYYY-MM-DD HH:mm:ss'); "YYYY-MM-DD HH:mm:ss",
);
const formatEndTime = dayjs(endTime.getTime()).format("YYYY-MM-DD HH:mm:ss");
return { return {
formatStartTime, formatStartTime,

View File

@ -556,7 +556,7 @@ onMounted(() => {
" "
> >
<div <div
style="width: 25%; display: flex; margin-top: 15px" style="width: 15%; display: flex; margin-top: 15px"
> >
<el-select <el-select
v-model="downTypeValue" v-model="downTypeValue"

View File

@ -72,8 +72,8 @@ const tabsList = ref<TabItem[]>([
{ label: "天", value: "day", isActive: false }, { label: "天", value: "day", isActive: false },
]); ]);
const labelLeft = ref(0) const labelLeft = ref(0);
const labelText = ref('') const labelText = ref("");
// (使) // (使)
const stationValue = ref<any>(null); const stationValue = ref<any>(null);
@ -103,6 +103,8 @@ const slodtooltip: any = (toolNum: number) => {
const active = ref("浓度分布"); const active = ref("浓度分布");
const _isPlayFirstFrame = ref(false);
function switchActive(tab: string) { function switchActive(tab: string) {
if (playFalg.value) return; if (playFalg.value) return;
active.value = tab; active.value = tab;
@ -153,17 +155,17 @@ function handleChange(val: number) {
// //
const currentTime = start.value.add(val, marskType.value); const currentTime = start.value.add(val, marskType.value);
labelText.value = currentTime.format("YYYY-MM-DD HH:mm:ss"); labelText.value = currentTime.format("YYYY-MM-DD HH:mm:ss");
setcurrentTime(currentTime.valueOf()); setcurrentTime(currentTime.valueOf());
nextTick(() => { nextTick(() => {
const sliderDom = document.querySelector('.slider .el-slider__runway') const sliderDom = document.querySelector(".slider .el-slider__runway");
if (!sliderDom) return if (!sliderDom) return;
const width = sliderDom.offsetWidth; const width = sliderDom.offsetWidth;
// //
const percent = val / totalHours.value const percent = val / totalHours.value;
// //
labelLeft.value = percent * width - 60 labelLeft.value = percent * width - 60;
}) });
} }
// //
function switchTab(tab: TabItem) { function switchTab(tab: TabItem) {
@ -267,15 +269,16 @@ function updateTimeLabel(ctime: any) {
props.activeMenu === "输运模拟" props.activeMenu === "输运模拟"
? currentHourDiff % 3 === 0 ? currentHourDiff % 3 === 0
: currentHourDiff % 1 === 0; : currentHourDiff % 1 === 0;
// currentHourDiffmarks // currentHourDiffmarks
if ( if (
currentHourDiff >= 0 && (currentHourDiff >= 0 &&
currentHourDiff <= totalHours.value && currentHourDiff <= totalHours.value &&
// && markKeys.includes(currentHourDiff) // // && markKeys.includes(currentHourDiff) //
isDifferentValue && // isDifferentValue && //
is6HourInterval is6HourInterval)||!_isPlayFirstFrame.value
) { ) {
_isPlayFirstFrame.value = true
value.value = currentHourDiff; value.value = currentHourDiff;
if (markKeys.includes(currentHourDiff)) { if (markKeys.includes(currentHourDiff)) {
// currentHourDiffmarkKeys // currentHourDiffmarkKeys
@ -286,6 +289,12 @@ function updateTimeLabel(ctime: any) {
`获取第${currentIndex + 1}组数据,当前时间为`, `获取第${currentIndex + 1}组数据,当前时间为`,
dataRequestOpt.value[currentHourDiff] dataRequestOpt.value[currentHourDiff]
); );
EventBusTool.getEventBus().publish("playData", {
key: "updateTimeCurrentIndex",
hour: currentHourDiff,
});
setWeathRequesTime(dataRequestOpt.value[currentHourDiff]); setWeathRequesTime(dataRequestOpt.value[currentHourDiff]);
// //
const params = { ...gisImgOpt }; const params = { ...gisImgOpt };
@ -302,18 +311,18 @@ function updateTimeLabel(ctime: any) {
}); });
}); });
// //
// if (weathFlag[3] === true) { if (weathFlag[3] === true&&gisImgOpt.weatherType!=3) {
// const params = { ...gisImgOpt, weatherType: 3, startTime: dataRequestOpt.value[currentHourDiff] }; const params = { ...gisImgOpt, weatherType: 3, startTime: dataRequestOpt.value[currentHourDiff],hour:currentHourDiff };
// delete params.key; delete params.key;
// delete params.endTime; delete params.endTime;
// playbackSearchData(params, true, (res) => { playbackSearchData(params, true, (res) => {
// // //
// EventBusTool.getEventBus().publish('playData', { EventBusTool.getEventBus().publish('playData', {
// key: 'addyctqjsGis', key: 'addyctqjsGis',
// data: res.result, data: res.result,
// }); });
// }); });
// } }
} }
} }
} }
@ -373,26 +382,30 @@ watch(
{ deep: true } { deep: true }
); );
watch(value, (newVal, oldVal) => { watch(
let currentTime = null; value,
if(ssmnOption.value.taskMode==-1){ (newVal, oldVal) => {
currentTime = end.value.clone().subtract(newVal, marskType.value); let currentTime = null;
}else{ if (ssmnOption.value?.taskMode == -1 && props.activeMenu === "输运模拟") {
currentTime = start.value.clone().add(newVal, marskType.value); currentTime = end.value.clone().subtract(newVal, marskType.value);
} else {
currentTime = start.value.clone().add(newVal, marskType.value);
}
labelText.value = currentTime.format("YYYY-MM-DD HH:mm:ss");
nextTick(() => {
const sliderDom = document.querySelector(".slider .el-slider__runway");
if (!sliderDom) return;
const width = sliderDom.offsetWidth;
//
const percent = newVal / totalHours.value;
//
labelLeft.value = percent * width - 60;
});
},
{
// immediate: true //
} }
labelText.value = currentTime.format("YYYY-MM-DD HH:mm:ss"); );
nextTick(() => {
const sliderDom = document.querySelector('.slider .el-slider__runway')
if (!sliderDom) return
const width = sliderDom.offsetWidth;
//
const percent = newVal / totalHours.value
//
labelLeft.value = percent * width - 60
})
}, {
// immediate: true //
})
onMounted(() => { onMounted(() => {
EventBusTool.getEventBus().subscribe("timeSliderUi", (opt: any) => { EventBusTool.getEventBus().subscribe("timeSliderUi", (opt: any) => {
@ -430,6 +443,11 @@ onMounted(() => {
break; break;
} }
}); });
EventBusTool.getEventBus().subscribe("updateHfKsFlag", (opt: any) => {
_isPlayFirstFrame.value = opt;
labelText.value = ""
});
}); });
</script> </script>
@ -505,9 +523,15 @@ onMounted(() => {
> >
<SvgIcon name="stop" title="停止" width="34" height="34" /> <SvgIcon name="stop" title="停止" width="34" height="34" />
</div> </div>
<div class="slider" style="position: relative;"> <div class="slider" style="position: relative">
<!-- <div style="color: white">value:{{ start.format("YYYY-MM-DD HH:mm:ss") }} ----- totalHours:{{ end.format("YYYY-MM-DD HH:mm:ss") }}</div> --> <!-- <div style="color: white">value:{{ start.format("YYYY-MM-DD HH:mm:ss") }} ----- totalHours:{{ end.format("YYYY-MM-DD HH:mm:ss") }}</div> -->
<div class="startTimes">{{ ssmnOption.taskMode==-1?ssmnOption.endTime:ssmnOption.startTime }}</div> <div class="startTimes">
{{
ssmnOption?.taskMode == -1 && props.activeMenu === "输运模拟"
? end.format("YYYY-MM-DD HH:mm:ss")
: start.format("YYYY-MM-DD HH:mm:ss")
}}
</div>
<el-slider <el-slider
v-model="value" v-model="value"
:disabled="isDisabledSlider" :disabled="isDisabledSlider"
@ -518,8 +542,18 @@ onMounted(() => {
:marks="marks" :marks="marks"
@input="handleChange" @input="handleChange"
/> />
<div class="endTimes">{{ ssmnOption.taskMode==-1?ssmnOption.startTime:ssmnOption.endTime }}</div> <div class="endTimes">
<div class="slider-label" :style="{ left: labelLeft + 'px' }" v-if="labelText"> {{
ssmnOption?.taskMode == -1 && props.activeMenu === "输运模拟"
? start.format("YYYY-MM-DD HH:mm:ss")
: end.format("YYYY-MM-DD HH:mm:ss")
}}
</div>
<div
class="slider-label"
:style="{ left: labelLeft + 'px' }"
v-if="labelText"
>
{{ labelText }} {{ labelText }}
</div> </div>
</div> </div>
@ -542,14 +576,14 @@ onMounted(() => {
transition: left 0.08s linear; transition: left 0.08s linear;
} }
.startTimes{ .startTimes {
position: absolute; position: absolute;
left: 0; left: 0;
bottom: -10px; bottom: -10px;
color: #fff; color: #fff;
} }
.endTimes{ .endTimes {
position: absolute; position: absolute;
right: 0; right: 0;
bottom: -10px; bottom: -10px;

View File

@ -1,90 +1,66 @@
<!-- gis地图右侧侧边栏icon文件 --> <!-- gis地图右侧侧边栏icon文件 -->
<script setup lang="ts"> <script setup lang="ts">
// Icon // Icon
import type { meteorologyItem } from '@/gis/ol/interface/common'; import type { meteorologyItem } from "@/gis/ol/interface/common";
import { domFullscreenStatus } from '@/gis/common/domHandle'; import { domFullscreenStatus } from "@/gis/common/domHandle";
import { gisImgOpt } from '@/gis/ol/index'; import { gisImgOpt, tqycAnimationType } from "@/gis/ol/index";
import { playbackSearchData, weatherDataLine, weatherPreview } from '@/utils/axios/tqyb/data/index'; import {
playbackSearchData,
weatherDataLine,
weatherPreview,
} from "@/utils/axios/tqyb/data/index";
import { ElMessage } from "element-plus";
// //
const svgList :any= ref<meteorologyItem[]>([ const svgList: any = ref<meteorologyItem[]>([
{ {
name: 'humidity', name: "humidity",
isActive: false, isActive: false,
activeName: 'humidity_active', activeName: "humidity_active",
tooltip: '湿度', tooltip: "湿度",
weatherType: 2, weatherType: 2,
}, },
{ {
name: 'temperature', name: "temperature",
isActive: false, isActive: false,
activeName: 'temperature_active', activeName: "temperature_active",
tooltip: '温度', tooltip: "温度",
weatherType: 0, weatherType: 0,
}, },
{ {
name: 'airPressure', name: "airPressure",
isActive: false, isActive: false,
activeName: 'airPressure_active', activeName: "airPressure_active",
tooltip: '气压', tooltip: "气压",
weatherType: 1, weatherType: 1,
}, },
{ {
name: 'windField', name: "windField",
isActive: true, isActive: true,
activeName: 'windField_active', activeName: "windField_active",
tooltip: '风场', tooltip: "风场",
weatherType: 3, weatherType: 3,
}, },
]); ]);
const activeName= ref('windField'); const activeName = ref("windField");
const hgOrYlId = ref({});
// //
function handleIconClick(item: meteorologyItem) { function handleIconClick(item: meteorologyItem) {
// //
const eventbus = EventBusTool.getEventBus(); const eventbus = EventBusTool.getEventBus();
if (item.name === "windField") {
if (item.name === 'windField') { ElMessage({
item.isActive = !item.isActive; message: "风场不可取消",
eventbus.publish('playData', { type: "warning",
key: 'setWeathTypeParam',
weatherType: item.weatherType,
isActive: item.isActive,
}); });
if(item.name ===activeName.value ){
eventbus.publish('playData', {
key: 'setWeatherLayerVisity',
weatherType: item.weatherType,
isActive: item.isActive,
});
}
// // true
// if (item.isActive) {
// playbackSearchData(gisImgOpt, true, (res) => {
// console.log(res);
// //
// EventBusTool.getEventBus().publish('playData', {
// key: 'addyctqjsGis',
// data: res.result,
// });
// });
// }
// else {
// // false
// eventbus.publish('playData', {
// key: 'removeWindLayer',
// });
// }
activeName.value = item.name;
return; // return; //
} }
// 湿 // 湿
const weatherGroup = ['humidity', 'temperature', 'airPressure']; const weatherGroup = ["humidity", "temperature", "airPressure"];
const isInWeatherGroup = weatherGroup.includes(item.name); const isInWeatherGroup = weatherGroup.includes(item.name);
if (isInWeatherGroup) { if (isInWeatherGroup) {
@ -92,50 +68,65 @@ activeName.value = item.name;
svgList.value.forEach((icon) => { svgList.value.forEach((icon) => {
if (weatherGroup.includes(icon.name) && icon.name !== item.name) { if (weatherGroup.includes(icon.name) && icon.name !== item.name) {
icon.isActive = false; icon.isActive = false;
eventbus.publish('playData', { eventbus.publish("playData", {
key: 'setWeathTypeParam', key: "setWeathTypeParam",
weatherType: item.weatherType, weatherType: item.weatherType,
isActive: item.isActive, isActive: item.isActive,
}); });
} }
}); });
// //
item.isActive = true; item.isActive = !item.isActive;
eventbus.publish('playData', { eventbus.publish("playData", {
key: 'setWeathTypeParam', key: "setWeathTypeParam",
weatherType: item.weatherType, weatherType: item.weatherType,
isActive: item.isActive, isActive: item.isActive,
}); });
// const eventbus = EventBusTool.getEventBus();
//
// eventbus.publish('playData', {
// key: 'removeHeatMap',
// });
// eventbus.publish('playData', {
// key: 'addHeatMap',
// });
} }
// //
// //
if (item.isActive) { if (item.isActive) {
playbackSearchData(gisImgOpt, true, (res) => { if (tqycAnimationType == 1) {
console.log(res); let obj = {
// weatherId: gisImgOpt.weatherId,
EventBusTool.getEventBus().publish('playData', { weatherType: gisImgOpt.weatherType,
key: 'addyctqjsGis', timeBatch: gisImgOpt.timeBatch,
data: res.result, };
weatherPreview(obj, (res) => {
//
EventBusTool.getEventBus().publish("playData", {
key: "addyctqjsGis",
data: res.result,
animationType: 1,
});
}); });
}); } else {
} playbackSearchData(gisImgOpt, false, (res) => {
else { //
EventBusTool.getEventBus().publish("playData", {
key: "addyctqjsGis",
data: res.result,
});
});
}
} else {
// false // false
eventbus.publish('playData', { eventbus.publish("playData", {
key: 'removeGisWindLayer', key: "setWeathTypeParam",
weatherType: 3,
isActive: true,
});
eventbus.publish("playData", {
key: "removeGisWindLayer",
});
eventbus.publish("playUI", {
key: "hideWeathLength",
}); });
} }
activeName.value = item.name; activeName.value = item.name;
} }
@ -143,44 +134,84 @@ onMounted(() => {
// //
svgList.value[0].isActive = domFullscreenStatus(); svgList.value[0].isActive = domFullscreenStatus();
// UI // UI
EventBusTool.getEventBus().subscribe('mapRightMenuUIEvent', (res: any) => { EventBusTool.getEventBus().subscribe("mapRightMenuUIEvent", (res: any) => {
// icon // icon
if (res.key === 'enterFullscreen' && !svgList.value[0].isActive) { if (res.key === "enterFullscreen" && !svgList.value[0].isActive) {
svgList.value[0].isActive = true; svgList.value[0].isActive = true;
} }
// 退icon // 退icon
else if (res.key === 'exitFullscreen' && svgList.value[0].isActive) { else if (res.key === "exitFullscreen" && svgList.value[0].isActive) {
svgList.value[0].isActive = false; svgList.value[0].isActive = false;
} }
// 退icon // 退icon
else if (res.key === 'f11KeyPressed') { else if (res.key === "f11KeyPressed") {
if (!svgList.value[0].isActive) { if (!svgList.value[0].isActive) {
svgList.value[0].isActive = true; svgList.value[0].isActive = true;
} } else {
else {
svgList.value[0].isActive = false; svgList.value[0].isActive = false;
} }
} }
// 退icon // 退icon
else if (res.key === 'switchLocalLayer') { else if (res.key === "switchLocalLayer") {
svgList.value[1].isActive = false; svgList.value[1].isActive = false;
svgList.value[2].isActive = true; svgList.value[2].isActive = true;
} }
}); });
// 湿
EventBusTool.getEventBus().subscribe("upRightHfOrylIcon", (res: any) => {
svgList.value = [
{
name: "humidity",
isActive: false,
activeName: "humidity_active",
tooltip: "湿度",
weatherType: 2,
},
{
name: "temperature",
isActive: false,
activeName: "temperature_active",
tooltip: "温度",
weatherType: 0,
},
{
name: "airPressure",
isActive: false,
activeName: "airPressure_active",
tooltip: "气压",
weatherType: 1,
},
{
name: "windField",
isActive: true,
activeName: "windField_active",
tooltip: "风场",
weatherType: 3,
},
];
});
}); });
</script> </script>
<template> <template>
<div class="icon_container"> <div class="icon_container">
<div <div
v-for="(item, index) in svgList" :key="index" class="iconBox" :class="{ 'has-active': item.isActive }" v-for="(item, index) in svgList"
:key="index"
class="iconBox"
:class="{ 'has-active': item.isActive }"
@click="handleIconClick(item)" @click="handleIconClick(item)"
> >
<div class="text"> <div class="text">
{{ item.tooltip }} {{ item.tooltip }}
</div> </div>
<div class="icon"> <div class="icon">
<SvgIcon :name="item.isActive ? item.activeName : item.name" width="20" height="20" /> <SvgIcon
:name="item.isActive ? item.activeName : item.name"
width="20"
height="20"
/>
</div> </div>
</div> </div>
</div> </div>

View File

@ -56,7 +56,7 @@ defineExpose({ updateLegend });
class="top-label" class="top-label"
:style="{ left: `${index === 0 ? (stop.position * 100 + 4) : index === (legendOptions.colorStops.length - 1) ? (stop.position * 100 - 5) : stop.position * 100}%` }" :style="{ left: `${index === 0 ? (stop.position * 100 + 4) : index === (legendOptions.colorStops.length - 1) ? (stop.position * 100 - 5) : stop.position * 100}%` }"
> >
{{ getLabelValue(stop.position) }} {{ getLabelValue(stop.position) }}{{ legendOptions.unit }}
</span> </span>
</div> </div>

View File

@ -245,6 +245,7 @@
"targetUserName": "目标用户名", "targetUserName": "目标用户名",
"selectTqybTableDataType": "请选择数据源", "selectTqybTableDataType": "请选择数据源",
"selectStartAndEndTime": "请选择起止时间", "selectStartAndEndTime": "请选择起止时间",
"selectTimeBatch":"请选择批次",
"sceneType": "场景类型", "sceneType": "场景类型",
"runtime": "运行时间", "runtime": "运行时间",
"releaseTheLowerHeight": "释放下部高度", "releaseTheLowerHeight": "释放下部高度",

View File

@ -1523,7 +1523,7 @@ getStations();
<Dialog <Dialog
v-model="configVisible" v-model="configVisible"
:title="configType === 'add' ? t('add') : t('edit')" :title="configType === 'add' ? t('add') : t('edit')"
width="60vw" width="61vw"
class="config-dialog" class="config-dialog"
> >
<div class="config-dialog-title"> <div class="config-dialog-title">
@ -1892,7 +1892,7 @@ getStations();
max-height="40vh" max-height="40vh"
class="custom-table" class="custom-table"
> >
<ElTableColumn prop="index" :label="t('deviceCode')" width="100"> <ElTableColumn prop="index" :label="t('deviceCode')" width="110">
<template #default="scope"> <template #default="scope">
<!-- <ElSelect v-if="configForm.taskMode === 1" v-model="scope.row.index" filterable--> <!-- <ElSelect v-if="configForm.taskMode === 1" v-model="scope.row.index" filterable-->
<!-- :placeholder="t('pleaseSelect')" class="config-custom-select" style="color:#fff;"--> <!-- :placeholder="t('pleaseSelect')" class="config-custom-select" style="color:#fff;"-->
@ -1950,7 +1950,7 @@ getStations();
</template> </template>
</ElTableColumn> </ElTableColumn>
<!-- 样品ID --> <!-- 样品ID -->
<ElTableColumn :label="t('sampleId')" width="80"> <ElTableColumn :label="t('sampleId')" width="95">
<template #default="scope"> <template #default="scope">
<el-input <el-input
v-model="scope.row.sampleId" v-model="scope.row.sampleId"

View File

@ -47,30 +47,7 @@ watch(drawerVisible, (newValue) => {
// } // }
// //
function handleSendData(params: any) { function handleSendData(params: any) {
console.log('选中的回放数据,需要传至gis --->', params); dialogVisible.value = false;
delete params.key
delete params.endTime
params.hour+=6;
playbackSearchData(params, false, (res) => {
console.log(res);
//
EventBusTool.getEventBus().publish('playData', {
key: 'show',
});
if (params.timeBatch) {
timeBatch.value = params.timeBatch;
}
else {
timeBatch.value = null;
}
//
EventBusTool.getEventBus().publish('playData', {
key: 'addyctqjsGis',
data: res.result,
animationType: 0,
});
dialogVisible.value = false;
});
} }
// //
function weatherPreviewHandle(params: any) { function weatherPreviewHandle(params: any) {

View File

@ -1,17 +1,41 @@
<script setup lang="ts"> <script setup lang="ts">
import {ElButton, ElOption, TableInstance, UploadInstance, UploadProps, UploadRawFile} from 'element-plus'; import {
import dayjs from 'dayjs'; ElButton,
import { ElLoading, ElMessage, ElMessageBox, ElNotification, genFileId } from 'element-plus'; ElOption,
import SparkMD5 from 'spark-md5'; TableInstance,
import { set } from 'vue'; // Vue set UploadInstance,
import { useI18n } from 'vue-i18n'; UploadProps,
import { add, deleteData, edit, getData, getTaskLog, resume, pinToTopOrUnpin } from '@/utils/axios/tqyb/task'; UploadRawFile,
import log from '@/pages/symn/log/index.vue'; } from "element-plus";
const emit = defineEmits(['playback']); import dayjs from "dayjs";
import {
ElLoading,
ElMessage,
ElMessageBox,
ElNotification,
genFileId,
} from "element-plus";
import SparkMD5 from "spark-md5";
import { set } from "vue"; // Vue set
import { useI18n } from "vue-i18n";
import {
add,
deleteData,
edit,
getData,
getTaskLog,
resume,
pinToTopOrUnpin,
} from "@/utils/axios/tqyb/task";
import log from "@/pages/symn/log/index.vue";
import { getHcQxData } from "@/utils/axios/fskjk";
const emit = defineEmits(["playback"]);
const { t } = useI18n(); const { t } = useI18n();
const upload = ref<UploadInstance>(); const upload = ref<UploadInstance>();
const configVisible = ref(false); const configVisible = ref(false);
const configType = ref(''); const configType = ref("");
/* 新增、编辑表单 */ /* 新增、编辑表单 */
const configForm = ref<any>({}); const configForm = ref<any>({});
@ -42,16 +66,16 @@ interface OptionItem {
} }
const taskStatusList = ref<OptionItem[]>([ const taskStatusList = ref<OptionItem[]>([
// -101234 // -101234
{ label: '执行失败', value: -1 }, { label: "执行失败", value: -1 },
{ label: '未开始', value: 0 }, { label: "未开始", value: 0 },
{ label: '等待中', value: 1 }, { label: "等待中", value: 1 },
{ label: '运行中', value: 2 }, { label: "运行中", value: 2 },
{ label: '已完成', value: 3 }, { label: "已完成", value: 3 },
{ label: '检查未通过', value: 4 }, { label: "检查未通过", value: 4 },
]); ]);
function search() { function search() {
console.log('搜索条件:', searchForm); console.log("搜索条件:", searchForm);
getList(); getList();
} }
function getList() { function getList() {
@ -60,36 +84,39 @@ function getList() {
startDate = searchForm.createTime[0]; startDate = searchForm.createTime[0];
endDate = searchForm.createTime[1]; endDate = searchForm.createTime[1];
} }
getData({ getData(
...searchForm, {
startDate, ...searchForm,
endDate, startDate,
pageSize: pageSize.value, endDate,
pageNum: currentPage.value, pageSize: pageSize.value,
}, (res) => { pageNum: currentPage.value,
taskList.value = res.rows; },
total.value = res.total; (res) => {
}); taskList.value = res.rows;
total.value = res.total;
}
);
} }
// //
const pinToTopTask = (row: any) => { const pinToTopTask = (row: any) => {
pinToTopOrUnpin({ id: row.id }, (res) => { pinToTopOrUnpin({ id: row.id }, (res) => {
if (res.code === 200) { if (res.code === 200) {
ElMessage.success('操作成功!'); ElMessage.success("操作成功!");
getList(); getList();
} }
}); });
}; };
function start(task: any) { function start(task: any) {
console.log('开始运行', task); console.log("开始运行", task);
resume({ taskId: task.id }, () => { resume({ taskId: task.id }, () => {
ElNotification({ ElNotification({
title: 'Tips', title: "Tips",
message: 'Execution Successful', message: "Execution Successful",
type: 'success', type: "success",
duration: 1800, duration: 1800,
}); });
getList(); getList();
@ -97,60 +124,60 @@ function start(task: any) {
} }
function saveConfigForm() { function saveConfigForm() {
console.log('保存或新增'); console.log("保存或新增");
if (configForm.value.leadTime % 6 !== 0) { if (configForm.value.leadTime % 6 !== 0) {
return ElNotification({ return ElNotification({
title: 'Tips', title: "Tips",
message: '预测时长需为6的倍数', message: "预测时长需为6的倍数",
type: 'error', type: "error",
duration: 1800, duration: 1800,
}); });
} }
if (!configForm.value.taskName) { if (!configForm.value.taskName) {
return ElNotification({ return ElNotification({
title: 'Tips', title: "Tips",
message: '请填写任务名称', message: "请填写任务名称",
type: 'error', type: "error",
duration: 1800, duration: 1800,
}); });
} }
if (!configForm.value.predictionModel) { if (!configForm.value.predictionModel) {
return ElNotification({ return ElNotification({
title: 'Tips', title: "Tips",
message: '请填写预测模型', message: "请填写预测模型",
type: 'error', type: "error",
duration: 1800, duration: 1800,
}); });
} }
if (!configForm.value.startDate) { if (!configForm.value.startDate) {
return ElNotification({ return ElNotification({
title: 'Tips', title: "Tips",
message: '请选择预测日期', message: "请选择预测日期",
type: 'error', type: "error",
duration: 1800, duration: 1800,
}); });
} }
if (!configForm.value.startTime && configForm.value.startTime !== 0) { if (!configForm.value.startTime && configForm.value.startTime !== 0) {
return ElNotification({ return ElNotification({
title: 'Tips', title: "Tips",
message: '请填写预测时间', message: "请填写预测时间",
type: 'error', type: "error",
duration: 1800, duration: 1800,
}); });
} }
if (!configForm.value.leadTime && configForm.value.leadTime !== 0) { if (!configForm.value.leadTime && configForm.value.leadTime !== 0) {
return ElNotification({ return ElNotification({
title: 'Tips', title: "Tips",
message: '请填写预测时长', message: "请填写预测时长",
type: 'error', type: "error",
duration: 1800, duration: 1800,
}); });
} }
if (!configForm.value.dataSources) { if (!configForm.value.dataSources) {
return ElNotification({ return ElNotification({
title: 'Tips', title: "Tips",
message: '请选择数据来源', message: "请选择数据来源",
type: 'error', type: "error",
duration: 1800, duration: 1800,
}); });
} }
@ -161,31 +188,35 @@ function saveConfigForm() {
// target: document.querySelector('.base-layout'), // target: document.querySelector('.base-layout'),
// }); // });
if (configType.value === 'add') { if (configType.value === "add") {
const addForm = new FormData(); const addForm = new FormData();
console.log('???', configForm.value.dataSources, typeof configForm.value.dataSources); console.log(
"???",
configForm.value.dataSources,
typeof configForm.value.dataSources
);
if (configForm.value.dataSources === 2 && configForm.value.file) { if (configForm.value.dataSources === 2 && configForm.value.file) {
addForm.append('file', configForm.value.file); addForm.append("file", configForm.value.file);
} }
addForm.append('taskName', configForm.value.taskName); addForm.append("taskName", configForm.value.taskName);
addForm.append('predictionModel', configForm.value.predictionModel); addForm.append("predictionModel", configForm.value.predictionModel);
addForm.append('startDate', configForm.value.startDate); addForm.append("startDate", configForm.value.startDate);
addForm.append('startTime', configForm.value.startTime); addForm.append("startTime", configForm.value.startTime);
addForm.append('leadTime', configForm.value.leadTime); addForm.append("leadTime", configForm.value.leadTime);
addForm.append('dataSources', configForm.value.dataSources); addForm.append("dataSources", configForm.value.dataSources);
add(addForm, () => { add(addForm, () => {
// loading.close(); // loading.close();
ElNotification({ ElNotification({
title: 'Tips', title: "Tips",
message: 'Added successfully', message: "Added successfully",
type: 'success', type: "success",
duration: 1800, duration: 1800,
}); });
getList(); getList();
}); });
} }
if (configType.value === 'edit') { if (configType.value === "edit") {
// const editValue = configForm.value = { // const editValue = configForm.value = {
// id: configForm.value.id, // id: configForm.value.id,
// taskName: configForm.value.taskName, // taskName: configForm.value.taskName,
@ -198,22 +229,22 @@ function saveConfigForm() {
// //
// }; // };
const editForm = new FormData(); const editForm = new FormData();
editForm.append('id', configForm.value.id); editForm.append("id", configForm.value.id);
if (configForm.value.dataSources === 2 && configForm.value.file) { if (configForm.value.dataSources === 2 && configForm.value.file) {
editForm.append('file', configForm.value.file); editForm.append("file", configForm.value.file);
} }
editForm.append('taskName', configForm.value.taskName); editForm.append("taskName", configForm.value.taskName);
editForm.append('predictionModel', configForm.value.predictionModel); editForm.append("predictionModel", configForm.value.predictionModel);
editForm.append('startDate', configForm.value.startDate); editForm.append("startDate", configForm.value.startDate);
editForm.append('startTime', configForm.value.startTime); editForm.append("startTime", configForm.value.startTime);
editForm.append('leadTime', configForm.value.leadTime); editForm.append("leadTime", configForm.value.leadTime);
editForm.append('dataSources', configForm.value.dataSources); editForm.append("dataSources", configForm.value.dataSources);
edit(editForm, () => { edit(editForm, () => {
// loading.close(); // loading.close();
ElNotification({ ElNotification({
title: 'Tips', title: "Tips",
message: 'Saved successfully', message: "Saved successfully",
type: 'success', type: "success",
duration: 1800, duration: 1800,
}); });
getList(); getList();
@ -224,38 +255,38 @@ function saveConfigForm() {
} }
function addTask() { function addTask() {
console.log('新增任务'); console.log("新增任务");
configForm.value = {}; configForm.value = {};
configVisible.value = true; configVisible.value = true;
configType.value = 'add'; configType.value = "add";
} }
function editTask(task: any, $index?: any) { function editTask(task: any, $index?: any) {
console.log('编辑任务', task, $index); console.log("编辑任务", task, $index);
const serveType = task.serveId ? (task.serveId.includes('/') ? '服务名' : 'SID') : ''; const serveType = task.serveId
console.log('serveType', serveType, task.serveId); ? task.serveId.includes("/")
? "服务名"
: "SID"
: "";
console.log("serveType", serveType, task.serveId);
configForm.value = { configForm.value = {
...task, ...task,
$index, $index,
serveType, serveType,
}; };
console.log('编辑任务', configForm.value); console.log("编辑任务", configForm.value);
configVisible.value = true; configVisible.value = true;
configType.value = 'edit'; configType.value = "edit";
} }
function deleteTask(task: any) { function deleteTask(task: any) {
console.log('删除任务', task); console.log("删除任务", task);
ElMessageBox.confirm( ElMessageBox.confirm(t("isSureDelete"), "Warning", {
t('isSureDelete'), confirmButtonText: t("sure"),
'Warning', cancelButtonText: t("cancel"),
{ type: "warning",
confirmButtonText: t('sure'), })
cancelButtonText: t('cancel'),
type: 'warning',
},
)
.then(() => { .then(() => {
let arr = []; let arr = [];
arr.push(task.id); arr.push(task.id);
@ -272,7 +303,7 @@ function deleteTask(task: any) {
} }
function refresh() { function refresh() {
console.log('刷新任务列表'); console.log("刷新任务列表");
getList(); getList();
} }
@ -284,29 +315,23 @@ function showLog(task: any) {
} }
function cancle() { function cancle() {
console.log('取消运行', form); console.log("取消运行", form);
ElMessageBox.confirm( ElMessageBox.confirm(t("isSureCancelTask"), "Warning", {
t('isSureCancelTask'), confirmButtonText: t("sure"),
'Warning', cancelButtonText: t("cancel"),
{ type: "warning",
confirmButtonText: t('sure'), })
cancelButtonText: t('cancel'),
type: 'warning',
},
)
.then(() => { .then(() => {
form.value = { form.value = {
...form.value, ...form.value,
taskMode: '未开始', taskMode: "未开始",
}; };
ElMessage({ ElMessage({
type: 'success', type: "success",
message: `Cancelled successfully`, message: `Cancelled successfully`,
}); });
}) })
.catch(() => { .catch(() => {});
});
} }
function handleSelectionChange(selection: any[]) { function handleSelectionChange(selection: any[]) {
@ -319,49 +344,63 @@ function handleSelectionChange(selection: any[]) {
multipleTableRef.value?.clearSelection(); // multipleTableRef.value?.clearSelection(); //
multipleTableRef.value?.toggleRowSelection(latestSelection, true); // multipleTableRef.value?.toggleRowSelection(latestSelection, true); //
currentSelection.value = [latestSelection]; currentSelection.value = [latestSelection];
} } else {
else {
// //
currentSelection.value = selection; currentSelection.value = selection;
} }
console.log('当前选中项:', currentSelection.value); console.log("当前选中项:", currentSelection.value);
} }
function playback() { function playback() {
console.log('当前选中项:', currentSelection.value); console.log("当前选中项:", currentSelection.value);
if (Object.keys(currentSelection.value).length === 0) { if (Object.keys(currentSelection.value).length === 0) {
ElMessage({ ElMessage({
type: 'warning', type: "warning",
message: t(`isSelect`), message: t(`isSelect`),
}); });
} } else {
else { const startTime = dayjs(currentSelection.value[0].startDate)
const startTime = dayjs(currentSelection.value[0].startDate).add(0, 'hour').format('YYYY-MM-DD HH:mm:ss'); .add(0, "hour")
.format("YYYY-MM-DD HH:mm:ss");
const params = { const params = {
dataType: currentSelection.value[0].predictionModel, dataType: currentSelection.value[0].predictionModel,
weatherType: 3,
startTime, startTime,
endTime: dayjs(startTime).add(currentSelection.value[0].leadTime, 'hour').format('YYYY-MM-DD HH:mm:ss'), endTime: dayjs(startTime)
// hour: currentSelection.value[0].leadTime, .add(currentSelection.value[0].leadTime, "hour")
hour: 0, .format("YYYY-MM-DD HH:mm:ss"),
}; };
emit('playback', params); EventBusTool.getEventBus().publish("playData", {
EventBusTool.getEventBus().publish('playData', { key: "setTaishiParam",
key: 'setTaishiParam',
dataType: currentSelection.value[0].predictionModel, dataType: currentSelection.value[0].predictionModel,
weatherType: 3, weatherType: 3,
startTime, startTime,
// hour: currentSelection.value[0].leadTime,
hour: 0, hour: 0,
endTime: dayjs(startTime).add(currentSelection.value[0].leadTime, 'hour').format('YYYY-MM-DD HH:mm:ss'), endTime: dayjs(startTime)
.add(currentSelection.value[0].leadTime, "hour")
.format("YYYY-MM-DD HH:mm:ss"),
});
// 湿
EventBusTool.getEventBus().publish("upRightHfOrylIcon");
//
EventBusTool.getEventBus().publish("updateHfKsFlag", false);
getHcQxData(params, (res: any) => {
if (res.code == 200) {
EventBusTool.getEventBus().publish("playData", {
key: "show",
});
emit("playback");
}
}); });
} }
} }
function handleClick(): void { function handleClick(): void {
if (fileInput.value) { if (fileInput.value) {
fileInput.value.value = ''; fileInput.value.value = "";
fileInput.value.click(); fileInput.value.click();
} }
} }
@ -370,7 +409,7 @@ function handleFileChange(event: Event): void {
const target = event.target as HTMLInputElement; const target = event.target as HTMLInputElement;
const file = target.files?.[0]; const file = target.files?.[0];
if (!file) { if (!file) {
console.warn('未选择文件'); console.warn("未选择文件");
return; return;
} }
@ -403,32 +442,68 @@ getList();
<template> <template>
<div class="ycrw"> <div class="ycrw">
<Dialog v-model="logVisible" :title="t('operationLog')" width="56vw" class="child-custom" style="top:50%;left:50%;transform: translate(-50%, -50%);"> <Dialog
v-model="logVisible"
:title="t('operationLog')"
width="56vw"
class="child-custom"
style="top: 50%; left: 50%; transform: translate(-50%, -50%)"
>
<log :data="logData" /> <log :data="logData" />
</Dialog> </Dialog>
<!-- --> <!-- -->
<Dialog v-model="configVisible" :title="configType === 'add' ? t('add') : t('edit')" width="40vw" <Dialog
style="top:230px;left:30vw" class="config-dialog"> v-model="configVisible"
<ElForm label-position="top" label-width="120px" :model="configForm" class="config-custom-form"> :title="configType === 'add' ? t('add') : t('edit')"
width="40vw"
style="top: 230px; left: 30vw"
class="config-dialog"
>
<ElForm
label-position="top"
label-width="120px"
:model="configForm"
class="config-custom-form"
>
<ElFormItem :label="t('taskName')"> <ElFormItem :label="t('taskName')">
<ElInput v-model="configForm.taskName" :placeholder="t('pleaseEnter')" class="config-custom-input" /> <ElInput
v-model="configForm.taskName"
:placeholder="t('pleaseEnter')"
class="config-custom-input"
/>
</ElFormItem> </ElFormItem>
<ElFormItem :label="t('predictionModel')"> <ElFormItem :label="t('predictionModel')">
<ElSelect v-model="configForm.predictionModel" :placeholder="t('pleaseSelect')" <ElSelect
popper-class="custom-select-dropdown" class="config-custom-select"> v-model="configForm.predictionModel"
:placeholder="t('pleaseSelect')"
popper-class="custom-select-dropdown"
class="config-custom-select"
>
<ElOption label="盘古" :value="1" /> <ElOption label="盘古" :value="1" />
<ElOption label="Graphcast" :value="2" /> <ElOption label="Graphcast" :value="2" />
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem :label="t('predictionStartDate')" class="config-custom-date"> <ElFormItem
<el-date-picker v-model="configForm.startDate" value-format="YYYY-MM-DD" width="100%" type="date" :label="t('predictionStartDate')"
:placeholder="t('pleaseSelect')" /> class="config-custom-date"
>
<el-date-picker
v-model="configForm.startDate"
value-format="YYYY-MM-DD"
width="100%"
type="date"
:placeholder="t('pleaseSelect')"
/>
</ElFormItem> </ElFormItem>
<ElFormItem :label="t('predictionStartTime')"> <ElFormItem :label="t('predictionStartTime')">
<!-- <ElInput v-model="configForm.startTime" :placeholder="t('pleaseEnter')" class="config-custom-input" /> --> <!-- <ElInput v-model="configForm.startTime" :placeholder="t('pleaseEnter')" class="config-custom-input" /> -->
<ElSelect v-model="configForm.startTime" :placeholder="t('pleaseSelect')" popper-class="custom-select-dropdown" <ElSelect
class="config-custom-select"> v-model="configForm.startTime"
:placeholder="t('pleaseSelect')"
popper-class="custom-select-dropdown"
class="config-custom-select"
>
<ElOption :value="0" /> <ElOption :value="0" />
<ElOption :value="6" /> <ElOption :value="6" />
<ElOption :value="12" /> <ElOption :value="12" />
@ -436,24 +511,44 @@ getList();
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem :label="t('predictionDuration')"> <ElFormItem :label="t('predictionDuration')">
<ElInput v-model="configForm.leadTime" :placeholder="t('pleaseEnter')" class="config-custom-input" /> <ElInput
v-model="configForm.leadTime"
:placeholder="t('pleaseEnter')"
class="config-custom-input"
/>
</ElFormItem> </ElFormItem>
<ElFormItem :label="t('dataSource')"> <ElFormItem :label="t('dataSource')">
<ElSelect v-model="configForm.dataSources" :placeholder="t('pleaseSelect')" <ElSelect
popper-class="custom-select-dropdown" class="config-custom-select"> v-model="configForm.dataSources"
:placeholder="t('pleaseSelect')"
popper-class="custom-select-dropdown"
class="config-custom-select"
>
<ElOption label="cds" :value="1" /> <ElOption label="cds" :value="1" />
<ElOption label="本地文件" :value="2" /> <ElOption label="本地文件" :value="2" />
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem v-if="configForm.dataSources === 2" :label="t('uploadFile')"> <ElFormItem
v-if="configForm.dataSources === 2"
:label="t('uploadFile')"
>
<!-- <el-upload --> <!-- <el-upload -->
<!-- ref="upload" class="upload-demo" :data="configForm" action="/api/weatherTask/create" --> <!-- ref="upload" class="upload-demo" :data="configForm" action="/api/weatherTask/create" -->
<!-- :before-upload="beforeUpload" :limit="1" :auto-upload="false" --> <!-- :before-upload="beforeUpload" :limit="1" :auto-upload="false" -->
<!-- > --> <!-- > -->
<!-- <template #trigger> --> <!-- <template #trigger> -->
<ElInput v-model="configForm.inputFile" :placeholder="t('clickToUploadFile')" class="config-custom-input" <ElInput
@click="handleClick" /> v-model="configForm.inputFile"
<input ref="fileInput" type="file" style="display: none" @change="handleFileChange"> :placeholder="t('clickToUploadFile')"
class="config-custom-input"
@click="handleClick"
/>
<input
ref="fileInput"
type="file"
style="display: none"
@change="handleFileChange"
/>
<!-- </template> --> <!-- </template> -->
<!-- </el-upload> --> <!-- </el-upload> -->
@ -463,13 +558,13 @@ getList();
<template #footer> <template #footer>
<div class="config-custom-btn"> <div class="config-custom-btn">
<el-button v-if="configType === 'add'" @click="saveConfigForm"> <el-button v-if="configType === 'add'" @click="saveConfigForm">
{{ t('add') }} {{ t("add") }}
</el-button> </el-button>
<el-button v-if="configType === 'edit'" @click="saveConfigForm"> <el-button v-if="configType === 'edit'" @click="saveConfigForm">
{{ t('save') }} {{ t("save") }}
</el-button> </el-button>
<el-button type="warning" @click="configVisible = false"> <el-button type="warning" @click="configVisible = false">
{{ t('cancel') }} {{ t("cancel") }}
</el-button> </el-button>
</div> </div>
</template> </template>
@ -477,45 +572,89 @@ getList();
<!-- 主表 --> <!-- 主表 -->
<ElForm :inline="true" :model="searchForm" class="custom-form"> <ElForm :inline="true" :model="searchForm" class="custom-form">
<ElFormItem label=""> <ElFormItem label="">
<ElInput v-model="searchForm.taskName" :placeholder="`${t('keyword')}...`" class="custom-input" /> <ElInput
v-model="searchForm.taskName"
:placeholder="`${t('keyword')}...`"
class="custom-input"
/>
</ElFormItem> </ElFormItem>
<ElFormItem :label="t('taskStatus')"> <ElFormItem :label="t('taskStatus')">
<ElSelect v-model="searchForm.taskStatus" :placeholder="t('pleaseSelect')" clearable class="custom-select"> <ElSelect
<ElOption v-for="item in taskStatusList" :key="item.value" :label="item.label" :value="item.value" /> v-model="searchForm.taskStatus"
:placeholder="t('pleaseSelect')"
clearable
class="custom-select"
>
<ElOption
v-for="item in taskStatusList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem :label="t('predictionDate')"> <ElFormItem :label="t('predictionDate')">
<ElDatePicker v-model="searchForm.createTime" value-format="YYYY-MM-DD" type="daterange" range-separator="--" <ElDatePicker
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" class="custom-date-picker" /> v-model="searchForm.createTime"
value-format="YYYY-MM-DD"
type="daterange"
range-separator="--"
:start-placeholder="t('startDate')"
:end-placeholder="t('endDate')"
class="custom-date-picker"
/>
</ElFormItem> </ElFormItem>
<ElFormItem> <ElFormItem>
<ElButton type="primary" class="custom-btn" icon="Search" @click="search"> <ElButton
{{ t('search') }} type="primary"
class="custom-btn"
icon="Search"
@click="search"
>
{{ t("search") }}
</ElButton> </ElButton>
</ElFormItem> </ElFormItem>
</ElForm> </ElForm>
<ElTable ref="multipleTableRef" :data="taskList" width="100%" max-height="60vh" class="custom-table" <ElTable
@selection-change="handleSelectionChange"> ref="multipleTableRef"
:data="taskList"
width="100%"
max-height="60vh"
class="custom-table"
@selection-change="handleSelectionChange"
>
<ElTableColumn type="selection" width="55" /> <ElTableColumn type="selection" width="55" />
<ElTableColumn type="index" :label="t('serialNumber')" width="80" /> <ElTableColumn type="index" :label="t('serialNumber')" width="80" />
<ElTableColumn prop="taskName" :label="t('taskName')" /> <ElTableColumn prop="taskName" :label="t('taskName')" />
<ElTableColumn :label="t('taskStatus')"> <ElTableColumn :label="t('taskStatus')">
<template #default="scope"> <template #default="scope">
<div v-if="scope.row.taskStatus === -1" style="color:#F5222D;">执行失败</div> <div v-if="scope.row.taskStatus === -1" style="color: #f5222d">
<div v-if="scope.row.taskStatus === 0" style="color:#8C8C8C;">未开始</div> 执行失败
<div v-if="scope.row.taskStatus === 1" style="color:#FAAD14;">等待中</div> </div>
<div v-if="scope.row.taskStatus === 2" style="color:#1677FF;">运行中</div> <div v-if="scope.row.taskStatus === 0" style="color: #8c8c8c">
<div v-if="scope.row.taskStatus === 3" style="color:#52C41A;">已完成</div> 未开始
<div v-if="scope.row.taskStatus === 4" style="color:#F5222D;">检查未通过</div> </div>
<div v-if="scope.row.taskStatus === 1" style="color: #faad14">
等待中
</div>
<div v-if="scope.row.taskStatus === 2" style="color: #1677ff">
运行中
</div>
<div v-if="scope.row.taskStatus === 3" style="color: #52c41a">
已完成
</div>
<div v-if="scope.row.taskStatus === 4" style="color: #f5222d">
检查未通过
</div>
</template> </template>
</ElTableColumn> </ElTableColumn>
<ElTableColumn prop="model" :label="t('predictionModel')"> <ElTableColumn prop="model" :label="t('predictionModel')">
<template #default="scope"> <template #default="scope">
<div v-if="scope.row.predictionModel === 1"> <div v-if="scope.row.predictionModel === 1">
{{ '盘古' }} {{ "盘古" }}
</div> </div>
<div v-if="scope.row.predictionModel === 2"> <div v-if="scope.row.predictionModel === 2">
{{ 'Graphcast' }} {{ "Graphcast" }}
</div> </div>
</template> </template>
</ElTableColumn> </ElTableColumn>
@ -538,17 +677,13 @@ getList();
<ElTableColumn prop="leadTime" :label="t('predictionDuration')"> <ElTableColumn prop="leadTime" :label="t('predictionDuration')">
<!-- 预测时长 --> <!-- 预测时长 -->
<template #default="scope"> <template #default="scope">
<div> <div>{{ scope.row.leadTime }}小时</div>
{{ scope.row.leadTime }}小时
</div>
</template> </template>
</ElTableColumn> </ElTableColumn>
<ElTableColumn prop="hours" :label="t('timeConsuming')"> <ElTableColumn prop="hours" :label="t('timeConsuming')">
<!-- 耗时 --> <!-- 耗时 -->
<template #default="scope"> <template #default="scope">
<div> <div>{{ scope.row.timeConsuming }}分钟</div>
{{ (scope.row.timeConsuming) }}分钟
</div>
</template> </template>
</ElTableColumn> </ElTableColumn>
<!--<ElTableColumn prop="creator" :label="t('creator')"> <!--<ElTableColumn prop="creator" :label="t('creator')">
@ -559,54 +694,98 @@ getList();
<ElTableColumn prop="createTime" :label="t('creationTime')" width="220" /> <ElTableColumn prop="createTime" :label="t('creationTime')" width="220" />
<ElTableColumn :label="t('operation')" width="280"> <ElTableColumn :label="t('operation')" width="280">
<template #default="scope"> <template #default="scope">
<ElButton v-if="scope.row.taskStatus === 1" type="text" class="table-btn" @click="pinToTopTask(scope)"> <ElButton
{{ true ? t('pinToTop') : t('unpin') }} v-if="scope.row.taskStatus === 1"
type="text"
class="table-btn"
@click="pinToTopTask(scope)"
>
{{ true ? t("pinToTop") : t("unpin") }}
</ElButton> </ElButton>
<ElButton v-else type="text" style="color:#588589;cursor:no-drop"> <ElButton v-else type="text" style="color: #588589; cursor: no-drop">
{{ true ? t('pinToTop') : t('unpin') }} {{ true ? t("pinToTop") : t("unpin") }}
</ElButton> </ElButton>
<!-- -1执行失败0未开始1等待中2运行中3已完成4检查未通过--> <!-- -1执行失败0未开始1等待中2运行中3已完成4检查未通过-->
<!--任务处于等待中运行中状态时不能编辑和删除处于未开始已完成检查未通过时可以删除处于已完成状态时也不能编辑--> <!--任务处于等待中运行中状态时不能编辑和删除处于未开始已完成检查未通过时可以删除处于已完成状态时也不能编辑-->
<ElButton v-if="scope.row.taskStatus === 0 || scope.row.taskStatus === -1" type="text" class="custom-text-btn" <ElButton
@click="start(scope.row, scope.$index)"> v-if="scope.row.taskStatus === 0 || scope.row.taskStatus === -1"
{{ t('start') }} type="text"
class="custom-text-btn"
@click="start(scope.row, scope.$index)"
>
{{ t("start") }}
</ElButton> </ElButton>
<ElButton v-else type="text" style="color:#588589;cursor:no-drop"> <ElButton v-else type="text" style="color: #588589; cursor: no-drop">
{{ t('start') }} {{ t("start") }}
</ElButton> </ElButton>
<ElButton type="text" class="custom-text-btn" @click="showLog(scope.row)"> <ElButton
{{ t('operationLog') }} type="text"
class="custom-text-btn"
@click="showLog(scope.row)"
>
{{ t("operationLog") }}
</ElButton> </ElButton>
<ElButton v-if="scope.row.taskStatus !== 1 && scope.row.taskStatus !== 2 && scope.row.taskStatus !== 3" type="text" class="custom-text-btn" @click="editTask(scope.row, scope.$index)"> <ElButton
{{ t('edit') }} v-if="
scope.row.taskStatus !== 1 &&
scope.row.taskStatus !== 2 &&
scope.row.taskStatus !== 3
"
type="text"
class="custom-text-btn"
@click="editTask(scope.row, scope.$index)"
>
{{ t("edit") }}
</ElButton> </ElButton>
<ElButton v-else type="text" style="color:#588589;cursor:no-drop"> <ElButton v-else type="text" style="color: #588589; cursor: no-drop">
{{ t('edit') }} {{ t("edit") }}
</ElButton> </ElButton>
<ElButton v-if="scope.row.taskStatus == 0 || scope.row.taskStatus === 3 || scope.row.taskStatus === 4" type="text" class="custom-text-btn" @click="deleteTask(scope.row)"> <ElButton
{{ t('delete') }} v-if="
scope.row.taskStatus == 0 ||
scope.row.taskStatus === 3 ||
scope.row.taskStatus === 4
"
type="text"
class="custom-text-btn"
@click="deleteTask(scope.row)"
>
{{ t("delete") }}
</ElButton> </ElButton>
<ElButton v-else type="text" style="color:#588589;cursor:no-drop"> <ElButton v-else type="text" style="color: #588589; cursor: no-drop">
{{ t('delete') }} {{ t("delete") }}
</ElButton> </ElButton>
</template> </template>
</ElTableColumn> </ElTableColumn>
</ElTable> </ElTable>
<div class="pagination"> <div class="pagination">
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 20, 50, 100, 200]" <el-pagination
size="small" :background="true" layout="total, sizes, prev, pager, next, jumper" :total="total" v-model:current-page="currentPage"
@size-change="handleSizeChange" @current-change="handleCurrentChange" /> v-model:page-size="pageSize"
:page-sizes="[10, 20, 50, 100, 200]"
size="small"
:background="true"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div> </div>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button class="custom-btn" icon="VideoPlay" @click="playback"> <el-button class="custom-btn" icon="VideoPlay" @click="playback">
{{ t('playback') }} {{ t("playback") }}
</el-button> </el-button>
<el-button class="custom-btn" icon="Plus" @click="addTask"> <el-button class="custom-btn" icon="Plus" @click="addTask">
{{ t('add') }} {{ t("add") }}
</el-button> </el-button>
<el-button type="primary" class="custom-btn" icon="Refresh" @click="refresh"> <el-button
{{ t('refresh') }} type="primary"
class="custom-btn"
icon="Refresh"
@click="refresh"
>
{{ t("refresh") }}
</el-button> </el-button>
</div> </div>
</div> </div>
@ -661,7 +840,6 @@ getList();
} }
.config-custom-date { .config-custom-date {
.el-date-editor.el-input, .el-date-editor.el-input,
.el-date-editor.el-input__wrapper { .el-date-editor.el-input__wrapper {
width: calc(20vw - 80px) !important; width: calc(20vw - 80px) !important;

View File

@ -24,6 +24,8 @@ import {
getPcValueBySjlx, getPcValueBySjlx,
} from "@/utils/axios/tqyb/data"; } from "@/utils/axios/tqyb/data";
import { getHcQxData } from "@/utils/axios/fskjk";
const propsWithDefaults = withDefaults(defineProps<Props>(), { const propsWithDefaults = withDefaults(defineProps<Props>(), {
type: "", type: "",
}); });
@ -215,24 +217,52 @@ function playback() {
type: "warning", type: "warning",
message: t(`selectTqybTableDataType`), message: t(`selectTqybTableDataType`),
}); });
return;
} }
if (!pickerValue.value.length) { if (propsWithDefaults.type != "gkqx" && !pickerValue.value.length) {
ElMessage({ ElMessage({
type: "warning", type: "warning",
message: t(`selectStartAndEndTime`), message: t(`selectStartAndEndTime`),
}); });
return;
} }
const startTime = dayjs(pickerValue.value[0]).format("YYYY-MM-DD HH:mm:ss");
const endTime = dayjs(pickerValue.value[1]).format("YYYY-MM-DD HH:mm:ss");
const params = { if (propsWithDefaults.type == "gkqx" && !timeBatch.value) {
dataType: selectValue.value, ElMessage({
weatherType: 3, type: "warning",
startTime, message: t(`selectTimeBatch`),
hour: 0, });
timeBatch: timeBatch.value, return;
}; }
//
EventBusTool.getEventBus().publish("updateHfKsFlag", false);
let startTime = null;
let endTime = null;
if (propsWithDefaults.type == "gkqx") {
startTime = dayjs(timeBatch.value, "YYYYMMDD").format(
"YYYY-MM-DD HH:mm:ss"
);
endTime = dayjs(startTime).add(384, "hour").format("YYYY-MM-DD HH:mm:ss");
} else {
startTime = dayjs(pickerValue.value[0]).format("YYYY-MM-DD HH:mm:ss");
endTime = dayjs(pickerValue.value[1]).format("YYYY-MM-DD HH:mm:ss");
}
let params = {};
if (propsWithDefaults.type == "gkqx") {
params = {
dataType: selectValue.value,
timeBatch: timeBatch.value,
};
} else {
params = {
dataType: selectValue.value,
startTime,
endTime,
};
}
EventBusTool.getEventBus().publish("playData", { EventBusTool.getEventBus().publish("playData", {
key: "setTaishiParam", key: "setTaishiParam",
dataType: selectValue.value, dataType: selectValue.value,
@ -242,9 +272,18 @@ function playback() {
hour: 0, hour: 0,
timeBatch: timeBatch.value, timeBatch: timeBatch.value,
}); });
//
weathFlag[gisImgOpt.weatherType] = true; // 湿
emit("playback", params); EventBusTool.getEventBus().publish("upRightHfOrylIcon");
getHcQxData(params, (res: any) => {
if (res.code == 200) {
EventBusTool.getEventBus().publish("playData", {
key: "show",
});
emit("playback");
}
});
} }
function disabledHour() { function disabledHour() {
@ -348,10 +387,13 @@ function previewTask(row: any) {
key: "setTaishiParam", key: "setTaishiParam",
dataType: row.dataSource, dataType: row.dataSource,
weatherType: 3, weatherType: 3,
startTime: row.dataStartTime, weatherId: row.id,
endTime: row.dataStartTime, timeBatch: row.timeBatch,
hour: 0,
}); });
// 湿
EventBusTool.getEventBus().publish("upRightHfOrylIcon");
emit("preview", params); emit("preview", params);
} }
@ -537,7 +579,7 @@ getList();
v-model="selectValue" v-model="selectValue"
:options="selectOption" :options="selectOption"
placeholder="选择数据源" placeholder="选择数据源"
style="width: 240px; margin-right: 10px" style="width: 160px; margin-right: 10px"
/> />
<!-- 时间选择 --> <!-- 时间选择 -->
@ -566,6 +608,7 @@ getList();
<ElOption v-for="v in timeBatchList" :label="v" :value="v" /> <ElOption v-for="v in timeBatchList" :label="v" :value="v" />
</ElSelect> </ElSelect>
<el-date-picker <el-date-picker
v-if="type !== 'gkqx'"
v-model="pickerValue" v-model="pickerValue"
unlink-panels unlink-panels
type="datetimerange" type="datetimerange"
@ -584,20 +627,6 @@ getList();
<el-button class="custom-btn" icon="VideoPlay" @click="playback"> <el-button class="custom-btn" icon="VideoPlay" @click="playback">
{{ t("playback") }} {{ t("playback") }}
</el-button> </el-button>
<!-- <el-upload v-if="type !== 'sjyc'" ref="upload" class="upload-file" -->
<!-- action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" :limit="1" :on-exceed="handleExceed" -->
<!-- :auto-upload="false"> -->
<!-- <template #trigger> -->
<!--<el-button v-if="propsWithDefaults.type === 'zfx'" type="primary" class="custom-btn" @click="handleClick">-->
<!-- <SvgIcon name="import" width="30" height="20" style="font-weight:bold;margin-right: 1px;" />-->
<!-- {{ t('import') }}-->
<!--</el-button>-->
<!--<el-select-v2 v-if="propsWithDefaults.type === 'zfx'" v-model="fileDatasource" :options="selectOption"-->
<!-- placeholder="选择数据源" style="width: 240px;margin-right: 10px;" />-->
<!--<input ref="fileInput" type="file" style="display: none" @change="handleFileChange">-->
<!-- </template> -->
<!-- </el-upload> -->
</div> </div>
</div> </div>
</template> </template>

View File

@ -80,3 +80,21 @@ export async function getRwscGifFileGcrz(
callback?.(response); callback?.(response);
} }
} }
/**
*
*/
export async function getHcQxData(
params: any,
callback?: (data: any) => void,
): Promise<any> {
const response = await request({
url: `${serverIp}${baseURL}/weatherData/cacheWeatherData`,
method: "GET",
params,
});
if (response.success && response.code === 200) {
callback?.(response);
}
}

View File

@ -161,7 +161,7 @@ export async function playbackSearchData(
url: `${serverIp}${baseURL}/weatherData/getWeatherData`, url: `${serverIp}${baseURL}/weatherData/getWeatherData`,
method: 'GET', method: 'GET',
params, // 包含角色信息的完整表单数据 params, // 包含角色信息的完整表单数据
isLoding, isLoding
}); });
if (response.success && response.code === 200) { if (response.success && response.code === 200) {