From 9ea7e2fb231db817d16c1c5158ba9adb6dba73c7 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期二, 13 五月 2025 14:26:31 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/YiWuProject
---
UI-Project/src/views/Caching/cachingbeforehistory.vue | 75 ++++++++++++++++++++++++++-----------
1 files changed, 52 insertions(+), 23 deletions(-)
diff --git a/UI-Project/src/views/Caching/cachingbeforehistory.vue b/UI-Project/src/views/Caching/cachingbeforehistory.vue
index 6f0caae..99b8c4f 100644
--- a/UI-Project/src/views/Caching/cachingbeforehistory.vue
+++ b/UI-Project/src/views/Caching/cachingbeforehistory.vue
@@ -26,10 +26,15 @@
:value="item.value"
/>
</el-select>
- <el-date-picker v-model="timeRange" type="datetimerange" range-separator="鑷�" :start-placeholder="$t('reportmanage.starttime')"
- style="margin-left: 15px;" value-format = "YYYY-MM-DD hh:mm:ss"
- :end-placeholder="$t('reportmanage.endtime')">
- </el-date-picker>
+ <el-date-picker
+ style="margin-left: 15px;"
+ v-model="timeRange"
+ type="datetimerange"
+ :shortcuts="shortcuts"
+ range-separator="鑷�"
+ :start-placeholder="$t('reportmanage.starttime')"
+ :end-placeholder="$t('reportmanage.endtime')"
+ />
<el-button type="primary" style="margin-left: 10px;margin-bottom: 10px;" @click="handleClick()">{{$t('reportmanage.inquire')}}</el-button>
</div>
<div style="margin-bottom: 10px;margin-top: 20px;margin-left: 20px;">
@@ -147,7 +152,6 @@
}
}
catch (error) {
- console.error(error);
}
}
const Daily = async () => {
@@ -171,12 +175,10 @@
}
}
catch (error) {
- console.error(error);
}
}
const handlePageChange2 = (newPage) => {
currentPage2.value = newPage;
- console.log(currentPage2.value);
window.localStorage.setItem('pagenumber', currentPage2.value)
historicala(currentPage2.value);
Dailya(currentPage2.value);
@@ -192,8 +194,8 @@
glassId: glassId.value,
taskState: taskState.value,
taskType: taskType.value,
- startTime: (timeRange.value && timeRange.value[0]) || '',
- endTime: (timeRange.value && timeRange.value[1]) || '',
+ beginDate: (formatTimestamp(timeRange.value) && formatTimestamp(timeRange.value[0])) || '',
+ endDate: (formatTimestamp(timeRange.value) && formatTimestamp(timeRange.value[1])) || '',
})
if (response.code == 200) {
ElMessage.success(response.message);
@@ -204,7 +206,6 @@
}
}
catch (error) {
- console.error(error);
}
}
const Dailya = async (page) => {
@@ -218,8 +219,8 @@
glassId: glassId.value,
taskState: taskState.value,
taskType: taskType.value,
- startTime: (timeRange.value && timeRange.value[0]) || '',
- endTime: (timeRange.value && timeRange.value[1]) || '',
+ beginDate: (formatTimestamp(timeRange.value) && formatTimestamp(timeRange.value[0])) || '',
+ endDate: (formatTimestamp(timeRange.value) && formatTimestamp(timeRange.value[1])) || '',
})
if (response.code == 200) {
countOutOne.value = response.data.countOutOne
@@ -229,7 +230,6 @@
}
}
catch (error) {
- console.error(error);
}
}
const handleClick = async () => {
@@ -241,7 +241,6 @@
try {
let startTime = window.localStorage.getItem('startTime')
let page = window.localStorage.getItem('pagenumber')
- console.log(page);
const response = await request.post("/cacheGlass/edgStorageDeviceTaskHistory", {
deviceId: 1,
pageNo: 1,
@@ -249,8 +248,8 @@
glassId: glassId.value,
taskState: taskState.value,
taskType: taskType.value,
- startTime: (timeRange.value && timeRange.value[0]) || '',
- endTime: (timeRange.value && timeRange.value[1]) || '',
+ beginDate: (formatTimestamp(timeRange.value) && formatTimestamp(timeRange.value[0])) || '',
+ endDate: (formatTimestamp(timeRange.value) && formatTimestamp(timeRange.value[1])) || '',
})
if (response.code == 200) {
currentPage2.value = 1;
@@ -262,14 +261,12 @@
}
}
catch (error) {
- console.error(error);
}
}
const Dailyhistorical = async () => {
try {
let startTime = window.localStorage.getItem('startTime')
let page = window.localStorage.getItem('pagenumber')
- console.log(page);
const response = await request.post("/cacheGlass/edgStorageDeviceTaskHistory/queryEdgDailyProduction", {
deviceId: 1,
pageNo: 1,
@@ -277,8 +274,8 @@
glassId: glassId.value,
taskState: taskState.value,
taskType: taskType.value,
- startTime: (timeRange.value && timeRange.value[0]) || '',
- endTime: (timeRange.value && timeRange.value[1]) || '',
+ beginDate: (formatTimestamp(timeRange.value) && formatTimestamp(timeRange.value[0])) || '',
+ endDate: (formatTimestamp(timeRange.value) && formatTimestamp(timeRange.value[1])) || '',
})
if (response.code == 200) {
countOutOne.value = response.data.countOutOne
@@ -288,7 +285,6 @@
}
}
catch (error) {
- console.error(error);
}
}
// 鏍煎紡鍖栨椂闂存埑涓哄勾鏈堟棩鏃堕棿瀛楃涓茬殑鍑芥暟
@@ -302,14 +298,47 @@
const seconds = String(date.getSeconds()).padStart(2, '0'); // 琛ラ浂锛堝鏋滈渶瑕佹樉绀烘椂闂达級
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
+const shortcuts = [
+ {
+ text: '鏈�杩戜竴鍛�',
+ value: () => {
+ const backendTime = new Date(getglobalDate)
+ const oneWeekAgo = new Date(getglobalDate)
+ oneWeekAgo.setHours(0, 0, 0, 0);
+ oneWeekAgo.setDate(oneWeekAgo.getDate() - 7)
+ timeRange.value = [formatTimestamp(oneWeekAgo), formatTimestamp(backendTime)]
+ window.localStorage.setItem('startTime', formatTimestamp(oneWeekAgo))
+ },
+ },
+ {
+ text: '鏈�杩戜竴涓湀',
+ value: () => {
+ const backendTime = new Date(getglobalDate)
+ const oneWeekAgo = new Date(getglobalDate)
+ oneWeekAgo.setHours(0, 0, 0, 0);
+ oneWeekAgo.setMonth(oneWeekAgo.getMonth() - 1)
+ timeRange.value = [formatTimestamp(oneWeekAgo), formatTimestamp(backendTime)]
+ window.localStorage.setItem('startTime', formatTimestamp(oneWeekAgo))
+ },
+ },
+ {
+ text: '鏈�杩戜笁涓湀',
+ value: () => {
+ const backendTime = new Date(getglobalDate)
+ const oneWeekAgo = new Date(getglobalDate)
+ oneWeekAgo.setHours(0, 0, 0, 0);
+ oneWeekAgo.setMonth(oneWeekAgo.getMonth() - 3)
+ timeRange.value = [formatTimestamp(oneWeekAgo), formatTimestamp(backendTime)]
+ window.localStorage.setItem('startTime', formatTimestamp(oneWeekAgo))
+},
+ },
+]
// 鏍煎紡鍖栧悗绔椂闂村苟璁$畻涓�鍛ㄥ墠鐨勬椂闂�
const defaultTime = ref<[Date, Date]>([new Date(), new Date()]);
function parseAndSetTime() {
const backendTime = new Date(getglobalDate);
const oneWeekAgo = new Date(backendTime.getTime() - 7 * 24 * 60 * 60 * 1000); // 鍑忓幓7澶�
oneWeekAgo.setHours(0, 0, 0, 0);
- console.log(formatTimestamp(oneWeekAgo));
- console.log(oneWeekAgo);
timeRange.value = [formatTimestamp(oneWeekAgo), formatTimestamp(backendTime)];
window.localStorage.setItem('startTime', formatTimestamp(oneWeekAgo))
}
--
Gitblit v1.8.0