From f992cde6426406bc07d35f20b19cbb1ea4d2134b Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期五, 14 二月 2025 16:33:46 +0800
Subject: [PATCH] 卧式缓存时间默认向前推一天,中空一线文字更改,删除下片台模块,更新理片笼图片,解决上片模块预览时推送数据问题,解决清空时间查询报错问题
---
UI-Project/src/views/GlassStorage/rawfilmstorage.vue | 111 +++++++++++++++++++++++++++++++------------------------
1 files changed, 63 insertions(+), 48 deletions(-)
diff --git a/UI-Project/src/views/GlassStorage/rawfilmstorage.vue b/UI-Project/src/views/GlassStorage/rawfilmstorage.vue
index f81a1eb..5c76637 100644
--- a/UI-Project/src/views/GlassStorage/rawfilmstorage.vue
+++ b/UI-Project/src/views/GlassStorage/rawfilmstorage.vue
@@ -1,18 +1,15 @@
<script lang="ts" setup>
-import {Search} from "@element-plus/icons-vue";
-import {reactive} from "vue";
+import {onBeforeUnmount, onMounted, reactive, ref} from "vue";
import {useRouter} from "vue-router"
-const router = useRouter()
-import type { TableColumnCtx } from 'element-plus'
-import { ElMessage, ElMessageBox } from 'element-plus'
-import { useI18n } from 'vue-i18n'
-import { WebSocketHost ,host} from '@/utils/constants'
+import {ElMessage, ElMessageBox} from 'element-plus'
+import {useI18n} from 'vue-i18n'
+import {host, WebSocketHost} from '@/utils/constants'
import request from "@/utils/request"
-import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
-import { ref, onMounted, onUnmounted, onBeforeUnmount } from "vue";
+import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService';
+const router = useRouter()
const tableDataa = ref([])
const tableDatab = ref([])
-const { t } = useI18n()
+const {t} = useI18n()
const add = ref(false)
const dialogFormVisiblea = ref(false)
const dialogFormVisibleb = ref(false)
@@ -21,15 +18,15 @@
const Edit = ref(false)
const timeRange = ref(["2022-01-01 00:00:00", "2025-01-01 00:00:00"])
const selectValuesa = reactive([]);
- const patternWidth = ref('');
- const patternHeight = ref('');
- const patternThickness = ref('');
- const filmsId = ref('');
- const remainQuantity = ref('');
- const slot = ref('');
- const leftingStation = ref('');
+const patternWidth = ref('');
+const patternHeight = ref('');
+const patternThickness = ref('');
+const filmsId = ref('');
+const remainQuantity = ref('');
+const slot = ref('');
+const leftingStation = ref('');
const loadingline = ref('');
- let webSocket: WebSocket | null = null;
+let webSocket: WebSocket | null = null;
const value = ref('')
const options = [
{
@@ -58,17 +55,21 @@
}
});
onMounted(() => {
- // closeWebSocket();
- debugger
- // console.log("--------------webSocket")
socket = initializeWebSocket(socketUrl, handleMessage);
});
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);
@@ -100,8 +101,7 @@
}
);
if (confirmResult === 'confirm') {
-
- var url="/glassStorage/rawGlassStorageDetails/deleteWarehousing?slotId="+row.slotId;
+ var url="/glassStorage/rawGlassStorageDetails/deleteWarehousing?slot="+row.slot;
const response = await request.post(url)
// const response = await request.post("/glassStorage/rawGlassStorageDetails/deleteWarehousing",[row.slotId])
if (response.code === 200) {
@@ -192,7 +192,7 @@
}
);
if (confirmResult === 'confirm') {
- var url="/glassStorage/rawGlassStorageDetails/outWarehousing?slotId="+row.slotId;
+ var url="/glassStorage/rawGlassStorageDetails/outWarehousing?slotId="+row.slot;
const response = await request.post(url)
// const response = await request.post("/glassStorage/rawGlassStorageDetails/outWarehousing",[row.slotId])
if (response.code === 200) {
@@ -220,8 +220,8 @@
}
}
const response = await request.post("/glassStorage/rawGlassStorageTask/setRawGlassTaskRequest", {
- beginDate: timeRange.value[0],
- endDate: timeRange.value[1],
+ beginDate: (timeRange.value && timeRange.value[0]) || '',
+ endDate: (timeRange.value && timeRange.value[1]) || '',
taskState: stateList,
taskType: celllist
})
@@ -274,6 +274,17 @@
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:
@@ -314,27 +325,31 @@
return t('film.finish');//瀹屾垚
}
}
-// onUnmounted(() => {
-// if (socket) {
-// closeWebSocket(socket);
-// }
-// });
onBeforeUnmount(() => {
closeWebSocket();
});
</script>
<template>
- <div>
- <div style="display: flex; flex-direction: row; align-items: center; margin-top: 20px;">
- <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="dialogFormVisiblea = true">{{ $t('film.mes') }}</el-button>
- <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBinda">{{ $t('film.warehousing') }}</el-button>
- <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBindc">{{ $t('film.pwarehousing') }}</el-button>
- <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBinde">{{ $t('film.pwareout') }}</el-button>
- <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="datetimerange"
- format="YYYY/MM/DD HH:mm:ss"
+ <div style="height: 500px;">
+ <div style="display: flex; flex-direction: row; align-items: center; margin-top: 20px;">
+ <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="dialogFormVisiblea = true">
+ {{ $t('film.mes') }}
+ </el-button>
+ <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBinda">
+ {{ $t('film.warehousing') }}
+ </el-button>
+ <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBindc">
+ {{ $t('film.pwarehousing') }}
+ </el-button>
+ <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="handleBinde">{{
+ $t('film.pwareout')
+ }}
+ </el-button>
+ <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="datetimerange"
+ format="YYYY/MM/DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
- :start-placeholder="$t('film.starttime')"
- :end-placeholder="$t('film.endtime')"
+ :start-placeholder="$t('film.starttime')"
+ :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>
@@ -379,12 +394,14 @@
</template>
</el-table-column>
<el-table-column prop="createTime" align="center" :label="$t('film.createtime')" />
+
</el-table>
</div>
</el-card>
<div class="awatch">
- <img src="../../assets/ypcc.png" alt="" style="width: 100%;height: 120%;margin-left: 10px;position: relative;margin-top: -20px;">
-</div>
+ <img src="../../assets/ypcc.png" alt=""
+ style="width: 100%;height: 120%;margin-left: -10px;position: relative;margin-top: -20px;">
+ </div>
<el-dialog v-model="dialogFormVisiblea" top="5vh" width="85%" >
<el-table ref="table" style="margin-top: 20px;height: 700px;"
:data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
@@ -552,9 +569,7 @@
</el-dialog>
</div>
</template>
-
<style scoped>
-
#dt { display:block; float:left;line-height: 20px;margin-left: 100px;}
#dta { display:block; float:left;line-height: 20px;margin-left: 80%;}
.awatch{
--
Gitblit v1.8.0