| | |
| | | import {onBeforeUnmount, onMounted, onUnmounted, ref, reactive} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | import dayjs from 'dayjs'; |
| | | import request from "@/utils/request" |
| | | import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService'; |
| | | import {ElMessage, ElMessageBox} from 'element-plus' |
| | |
| | | // id: rect.id * 10, |
| | | // })); |
| | | }; |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | const endTime = dayjs().startOf('minute'); // 当前时间,精确到分钟 |
| | | const startTime = endTime.subtract(1, 'day').startOf('minute'); // 当前时间的前一天,精确到分钟 |
| | | // 设置时间范围为 [开始时间, 结束时间] |
| | | timeRange.value = [startTime.format('YYYY-MM-DD HH:mm:ss'), endTime.format('YYYY-MM-DD HH:mm:ss')]; |
| | | }); |
| | | // 历史任务 |
| | | const handlehistorical = (row) => { |
| | |
| | | try { |
| | | const params = { |
| | | deviceId: 1, |
| | | startTime: timeRange.value[0] || '', |
| | | endTime: timeRange.value[1] || '', |
| | | startTime: (timeRange.value && timeRange.value[0]) || '', |
| | | endTime: (timeRange.value && timeRange.value[1]) || '', |
| | | glassId: glassId.value || '', |
| | | taskState: taskStat.value, |
| | | taskType: taskType.value || '' |
| | |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | const response = await request.post("/cacheGlass/edgStorageCageDetails/removeEdgDetails",{ |
| | | glassId: row.glassId |
| | | }) |
| | | const response = await request.post("/cacheGlass/edgStorageCageDetails/removeEdgDetails?glassId="+encodeURIComponent(row.glassId)) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |