From 356edc5f8597f69bcd92b4cf46f5c32914e54db8 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期一, 21 四月 2025 16:53:58 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/YiWuProject
---
UI-Project/src/views/Caching/cachingunhistory.vue | 84 +++++++++++++++++++++++++++++++-----------
1 files changed, 62 insertions(+), 22 deletions(-)
diff --git a/UI-Project/src/views/Caching/cachingunhistory.vue b/UI-Project/src/views/Caching/cachingunhistory.vue
index 0548fb6..bebbc58 100644
--- a/UI-Project/src/views/Caching/cachingunhistory.vue
+++ b/UI-Project/src/views/Caching/cachingunhistory.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;">
@@ -38,14 +43,14 @@
<el-col :span="4">
<div id="dt" style="font-size: 15px;">
<el-form-item :label="$t('hellow.countOutTwo')" style="width: 14vw">
- {{ countOutTwo }}
+ {{ countOutOne }}
</el-form-item>
</div>
</el-col>
<el-col :span="5">
<div id="dta" style="font-size: 15px;">
<el-form-item :label="$t('hellow.totalAreaOutTwo')" style="width: 14vw">
- {{ totalAreaOutTwo }}
+ {{ totalAreaOutOne }}
</el-form-item>
</div>
</el-col>
@@ -117,8 +122,8 @@
const tableDatax = ref([])
const currentPage2 = ref(1)
const totalRecords = ref(0)
-const countOutTwo = ref(0)
-const totalAreaOutTwo = ref(0)
+const countOutOne = ref(0)
+const totalAreaOutOne = ref(0)
const glassId = ref('');
const startSlot = ref('');
const targetSlot = ref('');
@@ -163,8 +168,8 @@
endTime: getglobalDate
})
if (response.code == 200) {
- countOutTwo.value = response.data.countOutTwo
- totalAreaOutTwo.value = response.data.totalAreaOutTwo
+ countOutOne.value = response.data.countOutOne
+ totalAreaOutOne.value = response.data.totalAreaOutOne
} else {
ElMessage.error(response.message);
}
@@ -189,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);
@@ -214,12 +219,12 @@
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) {
- countOutTwo.value = response.data.countOutTwo
- totalAreaOutTwo.value = response.data.totalAreaOutTwo
+ countOutOne.value = response.data.countOutOne
+ totalAreaOutOne.value = response.data.totalAreaOutOne
} else {
ElMessage.error(response.message);
}
@@ -243,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;
@@ -269,12 +274,12 @@
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) {
- countOutTwo.value = response.data.countOutTwo
- totalAreaOutTwo.value = response.data.totalAreaOutTwo
+ countOutOne.value = response.data.countOutOne
+ totalAreaOutOne.value = response.data.totalAreaOutOne
} else {
ElMessage.error(response.message);
}
@@ -293,6 +298,41 @@
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() {
--
Gitblit v1.8.0