提交 c9eab9a8 authored 作者: 周文艺's avatar 周文艺

更改定时器时间

上级 1fc92cc5
...@@ -125,6 +125,7 @@ import Loading from '@/pages/all/components/loadingComponent/index.js' ...@@ -125,6 +125,7 @@ import Loading from '@/pages/all/components/loadingComponent/index.js'
import { ref, onMounted, onUnmounted, computed, watch, nextTick } from 'vue'; import { ref, onMounted, onUnmounted, computed, watch, nextTick } from 'vue';
import wss from '@/utils/requestSocekt.js' import wss from '@/utils/requestSocekt.js'
import useAppStore from '@/store/module/app' import useAppStore from '@/store/module/app'
import { fa } from 'element-plus/es/locales.mjs';
// import { loading } from 'vxe-pc-ui'; // import { loading } from 'vxe-pc-ui';
const useAppStoreInstance = useAppStore(); const useAppStoreInstance = useAppStore();
...@@ -132,7 +133,7 @@ const flagIsPlaying = ref(false) ...@@ -132,7 +133,7 @@ const flagIsPlaying = ref(false)
// 跳转到指定时间点 // 跳转到指定时间点
const jumpToSpecificTime = (targetTime) => { const jumpToSpecificTime = (targetTime,PerformDrag=false) => {
try { try {
if (!startDateTime.value || !endDateTime.value) { if (!startDateTime.value || !endDateTime.value) {
console.error("时间轴起始时间或结束时间未定义"); console.error("时间轴起始时间或结束时间未定义");
...@@ -175,7 +176,7 @@ const jumpToSpecificTime = (targetTime) => { ...@@ -175,7 +176,7 @@ const jumpToSpecificTime = (targetTime) => {
updateSelectedTimes(); updateSelectedTimes();
// 标记为手动选择时间点 // 标记为手动选择时间点
isDraged.value = false; isDraged.value = true;
is_flag_isRealtime.value = false; is_flag_isRealtime.value = false;
isConfirmedWithRange.value = false; // 设置为false以显示完整的选中区域 isConfirmedWithRange.value = false; // 设置为false以显示完整的选中区域
...@@ -198,7 +199,11 @@ const jumpToSpecificTime = (targetTime) => { ...@@ -198,7 +199,11 @@ const jumpToSpecificTime = (targetTime) => {
// // }); // // });
// // } // // }
// }); // });
playForward(); playForward();
if(PerformDrag) {
endDrag();
}
return true; return true;
} catch (error) { } catch (error) {
console.error("跳转到指定时间点出错:", error); console.error("跳转到指定时间点出错:", error);
...@@ -274,6 +279,11 @@ const wssMessageHandle = () => { ...@@ -274,6 +279,11 @@ const wssMessageHandle = () => {
// playForward(); // playForward();
console.log("再次获取数据",endDateTime.value === selectedEndTime.value.toISOString()); console.log("再次获取数据",endDateTime.value === selectedEndTime.value.toISOString());
// 只进行时间上的跳转,不执行拖动的逻辑
// jumpToSpecificTime(data.time,false)
if (endDateTime.value === selectedEndTime.value.toISOString()) { if (endDateTime.value === selectedEndTime.value.toISOString()) {
stopAutoPlay(); stopAutoPlay();
...@@ -303,10 +313,10 @@ const wssMessageHandle = () => { ...@@ -303,10 +313,10 @@ const wssMessageHandle = () => {
// console.log('我是left,type == time获取的wssRespone:', JSONdata.time.toLocaleString(), typeof JSONdata.time.toLocaleString()); // console.log('我是left,type == time获取的wssRespone:', JSONdata.time.toLocaleString(), typeof JSONdata.time.toLocaleString());
} }
// 处理服务器返回的数据 // 处理服务器返回的数据,减去1000毫秒延迟,防止setTimeout和返回数据重叠在一个时间点上
flagToNext = setTimeout(() => { flagToNext = setTimeout(() => {
stopAutoPlay(); stopAutoPlay();
}, (1000*60)/playbackSpeed.value); }, ((1000*60)/playbackSpeed.value)-1000);
}; };
// WwflagToNext = setTimeout(() => { // WwflagToNext = setTimeout(() => {
// stopAutoPlay(); // stopAutoPlay();
...@@ -465,7 +475,7 @@ const handleDateRangeChange = async (val) => { ...@@ -465,7 +475,7 @@ const handleDateRangeChange = async (val) => {
updateSelectedTimes(); updateSelectedTimes();
}); });
} }
console.log("*************",pick_select_date.value[0],"---------",formatDateTime(pick_select_date.value[0])); console.log("*************",pick_select_date.value,"---------",formatDateTime(pick_select_date.value[0]));
if(window.ue5) { if(window.ue5) {
wssOpenHandle({ wssOpenHandle({
...@@ -731,10 +741,14 @@ const updateSelectedTimes = () => { ...@@ -731,10 +741,14 @@ const updateSelectedTimes = () => {
// 更新选中时间 // 更新选中时间
selectedStartTime.value = startTime; selectedStartTime.value = startTime;
selectedEndTime.value = endTime; selectedEndTime.value = endTime;
if(!is_flag_isRealtime.value){
useAppStoreInstance.setGlobalTimeLineEndSelectTime(formatDateTime(startTime));
}
}; // console.log("************",useAppStoreInstance.globalTimeLineEndSelectTime);
};
// 已经被拖动过
const isDraged = ref(false); const isDraged = ref(false);
// false: 播放方向为向前播放,true: 播放方向为向后播放 // false: 播放方向为向前播放,true: 播放方向为向后播放
const curplaybackDirection = ref(false); const curplaybackDirection = ref(false);
...@@ -990,12 +1004,16 @@ const handleDrag = (e) => { ...@@ -990,12 +1004,16 @@ const handleDrag = (e) => {
// 结束拖动 // 结束拖动
const endDrag = () => { const endDrag = () => {
console.log("开始执行");
isDragging.value = false; isDragging.value = false;
currentDragHandle.value = null; currentDragHandle.value = null;
// 调用UE5回调函数 // 调用UE5回调函数
if (window.ue5) { if (window.ue5) {
if (isDraged.value) { if (isDraged.value) {
if (!isPlaying.value) { console.log("开始isDraged.value发送1111");
// if (!isPlaying.value) {
console.log("开始isPlaying.value发送1111");
window.ue5("callBackTimeFn", String(JSON.stringify({ window.ue5("callBackTimeFn", String(JSON.stringify({
isRealtime: false, isRealtime: false,
replayTime: formatDateTime(selectedEndTime.value), replayTime: formatDateTime(selectedEndTime.value),
...@@ -1006,7 +1024,7 @@ const endDrag = () => { ...@@ -1006,7 +1024,7 @@ const endDrag = () => {
replayTime: formatDateTime(selectedEndTime.value), replayTime: formatDateTime(selectedEndTime.value),
taskCode: String(taskCode_everyChange.value), taskCode: String(taskCode_everyChange.value),
}) })
} // }
} else { } else {
// window.ue5("callBackTimeFn", String(JSON.stringify({}))); // window.ue5("callBackTimeFn", String(JSON.stringify({})));
} }
...@@ -1033,6 +1051,12 @@ const updateTimeline = () => { ...@@ -1033,6 +1051,12 @@ const updateTimeline = () => {
}; };
onMounted(() => { onMounted(() => {
// if (isFromTosub) {
// handleDateRangeChange(useAppStoreInstance.globalSubsystemSelectedStartTime);
// jumpToSpecificTime(new Date(useAppStoreInstance.globalTimeLineEndSelectTime),true)
// endDrag()
// }
updateTimeline(); updateTimeline();
// 初始化时,默认实时传输 // 初始化时,默认实时传输
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Z 1518051043@qq.com * @Author: Z 1518051043@qq.com
* @Date: 2025-09-12 13:51:43 * @Date: 2025-09-12 13:51:43
* @LastEditors: zwy 1518051043@qq.com * @LastEditors: zwy 1518051043@qq.com
* @LastEditTime: 2025-12-31 17:50:03 * @LastEditTime: 2026-01-05 09:59:05
* @FilePath: \yuanxinPro\src\store\module\app.js * @FilePath: \yuanxinPro\src\store\module\app.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -14,6 +14,11 @@ const useAppStore = defineStore( ...@@ -14,6 +14,11 @@ const useAppStore = defineStore(
'app', 'app',
{ {
state: () => ({ state: () => ({
// 记录时间轴走的时间
globalTimeLineEndSelectTime: "2025-11-02 00:00:00",
globalTimeLineStartTime: "2025-11-02 00:00:00",
globalTimeLineEndTime: "2025-11-02 00:00:00",
subsystemSocket: null, subsystemSocket: null,
subsystemSocketContent: '', subsystemSocketContent: '',
HeartbeatInterval: null, HeartbeatInterval: null,
...@@ -39,6 +44,15 @@ const useAppStore = defineStore( ...@@ -39,6 +44,15 @@ const useAppStore = defineStore(
}), }),
actions: { actions: {
setGlobalTimeLineEndSelectTime(time) {
this.globalTimeLineEndSelectTime = time;
},
setGlobalTimeLineStartTime(time) {
this.globalTimeLineStartTime = time;
},
setGlobalTimeLineEndTime(time) {
this.globalTimeLineEndTime = time;
},
setSubsystemSocket(socket) { setSubsystemSocket(socket) {
this.subsystemSocket = socket; this.subsystemSocket = socket;
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论