| | |
| | | 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] |
| | | } |
| | | // 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) }; |
| | | } |
| | | return task; |
| | | }); |
| | | tableDataa.value = formattedTasks; |
| | | if(data.rawStationDetailsList !=null){ |
| | | tableDatab.value = data.rawStationDetailsList[0] |
| | | console.log(tableDatab.value); |
| | |
| | | console.error(error); |
| | | } |
| | | }; |
| | | // 格式化时间戳为年月日时间字符串的函数 |
| | | function formatTimestamp(timestamp) { |
| | | const date = new Date(timestamp); |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1,并补零 |
| | | const day = String(date.getDate()).padStart(2, '0'); // 补零 |
| | | const hours = String(date.getHours()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | const minutes = String(date.getMinutes()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | const seconds = String(date.getSeconds()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } |
| | | function getStatusType1(taskType) { |
| | | switch (taskType) { |
| | | case 1: |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createTime" align="center" :label="$t('film.createtime')" /> |
| | | |
| | | </el-table> |
| | | </div> |
| | | </el-card> |