| | |
| | | import {ElMessage, ElMessageBox} from 'element-plus' |
| | | import {useI18n} from 'vue-i18n' |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | import dayjs from 'dayjs'; |
| | | import request from "@/utils/request" |
| | | import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService'; |
| | | const router = useRouter() |
| | |
| | | const dialogFormVisiblec = ref(false) |
| | | const dialogFormVisiblee = ref(false) |
| | | const Edit = ref(false) |
| | | const timeRange = ref(["2022-01-01 00:00:00", "2025-01-01 00:00:00"]) |
| | | const timeRange = ref([]) |
| | | const selectValuesa = reactive([]); |
| | | const patternWidth = ref(''); |
| | | const patternHeight = ref(''); |
| | |
| | | taskType: '', |
| | | taskState: '', |
| | | }); |
| | | request.post("/glassStorage/rawGlassStorageTask/setRawGlassTaskRequest",{ |
| | | beginDate: "2022-01-01 00:00:00", |
| | | endDate: "2025-01-01 00:00:00", |
| | | let startTime = window.localStorage.getItem('startTime') |
| | | let endTime = window.localStorage.getItem('endTime') |
| | | request.post("/glassStorage/rawGlassStorageTask/setRawGlassTaskRequest",{ |
| | | beginDate: startTime, |
| | | endDate: endTime, |
| | | }).then((response) => { |
| | | if (response.code == 200) { |
| | | tableDataa.value = response.data |
| | |
| | | |
| | | } |
| | | }); |
| | | onMounted(() => { |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | onMounted(() => { |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | const endTime = dayjs().startOf('minute'); // 当前时间,精确到分钟 |
| | | const startTime = endTime.subtract(7, 'day').startOf('minute'); // 当前时间的前一天,精确到分钟 |
| | | // 设置时间范围为 [开始时间, 结束时间] |
| | | timeRange.value = [startTime.format('YYYY-MM-DD HH:mm:ss'), endTime.format('YYYY-MM-DD HH:mm:ss')]; |
| | | window.localStorage.setItem('startTime', startTime.format('YYYY-MM-DD HH:mm:ss')) |
| | | window.localStorage.setItem('endTime', endTime.format('YYYY-MM-DD HH:mm:ss')) |
| | | }); |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/glassStorage/api/talk/rawGlass`; |
| | | const handleMessage = (data) => { |
| | | // if(data.tasks !=null){ |
| | | // tableDataa.value = data.tasks[0] |
| | | // } |
| | | const formattedTasks = data.tasks[0].map(task => { |
| | | if (task && task.createTime) { |
| | | return { ...task, createTime: formatTimestamp(task.createTime) }; |
| | |
| | | tableDataa.value = formattedTasks; |
| | | if(data.rawStationDetailsList !=null){ |
| | | tableDatab.value = data.rawStationDetailsList[0] |
| | | console.log(tableDatab.value); |
| | | } |
| | | }; |
| | | const handleEdit = (row) => { |
| | |
| | | } |
| | | function getStatusType2(taskState) { |
| | | switch (taskState) { |
| | | case 1: |
| | | case 0: |
| | | return 'info'; |
| | | case 2: |
| | | return 'warning'; |
| | | case 3: |
| | | case 1: |
| | | return 'success'; |
| | | } |
| | | } |
| | | function getStatusText2(taskState) { |
| | | switch (taskState) { |
| | | case 1: |
| | | case 0: |
| | | return t('film.built');//新建 |
| | | case 2: |
| | | return t('film.execution');//执行中 |
| | | case 3: |
| | | return t('film.fail');//失败 |
| | | case 1: |
| | | return t('film.finish');//完成 |
| | | } |
| | | } |
| | |
| | | :end-placeholder="$t('film.endtime')" |
| | | :default-time="defaultTime" /> |
| | | <el-select v-model="selectValuesa[0]" clearable :placeholder="$t('film.taskstatus')" style="margin-left: 10px;" > |
| | | <el-option :label="$t('film.built')" value="1"></el-option> |
| | | <el-option :label="$t('film.execution')" value="2"></el-option> |
| | | <el-option :label="$t('film.finish')" value="3"></el-option> |
| | | <el-option :label="$t('film.built')" value="0"></el-option> |
| | | <el-option :label="$t('film.finish')" value="1"></el-option> |
| | | <el-option :label="$t('film.fail')" value="2"></el-option> |
| | | </el-select> |
| | | <el-select v-model="selectValuesa[1]" clearable :placeholder="$t('film.tasktype')" style="margin-left: 10px;" > |
| | | <el-option :label="$t('film.stocke')" value="1"></el-option> |
| | |
| | | </div> |
| | | </el-card> |
| | | <div class="img-dlpl"> |
| | | <div class="img-car1" :style="'z-index:999;top:20px;left:' + 330 + 'px;position:absolute;'"> |
| | | <div class="img-car1" :style="'z-index:999;top:250px;left:' + 20 + 'px;position:absolute;'"> |
| | | </div> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisiblea" top="5vh" width="85%" > |
| | |
| | | position: absolute; |
| | | background-repeat: no-repeat; |
| | | background-attachment: local; |
| | | min-height: 200px; |
| | | width: 200px; |
| | | min-height: 150px; |
| | | width: 70px; |
| | | max-width: 100%; |
| | | background-size: 200px 70px; |
| | | background-size: 70px 150px; |
| | | overflow: hidden; |
| | | position:relative |
| | | } |