From 2c08bfb96d6523dfbf5ae543e94495c151aadbf1 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期五, 14 三月 2025 17:53:18 +0800
Subject: [PATCH] 大屏嵌入历史任务,生产统计显示

---
 UI-Project/src/views/Caching/cachingunhistory.vue |  126 ++++++++++++++++++++++++++++++++++++++----
 1 files changed, 114 insertions(+), 12 deletions(-)

diff --git a/UI-Project/src/views/Caching/cachingunhistory.vue b/UI-Project/src/views/Caching/cachingunhistory.vue
index 7374591..9192d2f 100644
--- a/UI-Project/src/views/Caching/cachingunhistory.vue
+++ b/UI-Project/src/views/Caching/cachingunhistory.vue
@@ -30,8 +30,28 @@
              style="margin-left: 15px;" value-format = "YYYY-MM-DD hh:mm:ss"
               :end-placeholder="$t('reportmanage.endtime')">
             </el-date-picker>
-          <el-button type="primary" style="margin-left: 10px;margin-bottom: 10px;" @click="sethistorical()">{{$t('reportmanage.inquire')}}</el-button>
+          <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;">
+      <el-form>
+        <el-row style="margin-top: -15px;margin-bottom: -2px;">
+          <el-col :span="4">
+              <div id="dt" style="font-size: 15px;">
+              <el-form-item :label="$t('hellow.countOutTwo')"  style="width: 14vw">
+                {{ countOutTwo }}
+              </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 }}
+              </el-form-item>
+              </div>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
         <el-table ref="table" style="margin-top: 20px;height: 580px;width: 1770px;" :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
       <el-table-column prop="glassIdIn" align="center" :label="$t('searchOrder.glassID')" min-width="80" />
           <el-table-column
@@ -93,13 +113,15 @@
 const tableDatax = ref([])
 const currentPage2 = ref(1)
 const totalRecords = ref(0)
+const countOutTwo = ref(0)
+const totalAreaOutTwo = ref(0)
 const glassId = ref('');
 const startSlot = ref('');
 const targetSlot = ref('');
 const taskState = ref('');
 const taskType = ref('');
 let getglobalDate = window.localStorage.getItem('getglobalDate')
-const historical = async (page) => {
+const historical = async () => {
   try {
   let startTime = window.localStorage.getItem('startTime')
       const response = await request.post("/cacheGlass/edgStorageDeviceTaskHistory", {
@@ -125,11 +147,36 @@
     console.error(error);
   }
 }
+const Daily = async () => {
+  try {
+  let startTime = window.localStorage.getItem('startTime')
+      const response = await request.post("/cacheGlass/edgStorageDeviceTaskHistory/queryEdgDailyProduction", {
+        deviceId: 2,
+        pageNo: 1,
+        pageSize: 20,
+        glassId: glassId.value,
+        taskState: '',
+        taskType: '',
+        startTime: startTime,
+        endTime: getglobalDate
+    })
+      if (response.code == 200) {
+        countOutTwo.value = response.data.countOutTwo
+        totalAreaOutTwo.value = response.data.totalAreaOutTwo
+      } else {
+        ElMessage.error(response.message);
+    }
+}
+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);
 };
 const historicala = async (page) => {
   try { 
@@ -140,16 +187,14 @@
         pageNo: page,
         pageSize: 20,
         glassId: glassId.value,
-        taskState: '',
-        taskType: '',
-        startTime: startTime,
-        endTime: getglobalDate
+        taskState: taskState.value,
+        taskType: taskType.value,
+        startTime: (timeRange.value && timeRange.value[0]) || '',
+        endTime: (timeRange.value && timeRange.value[1]) || '',
     })
       if (response.code == 200) {
         ElMessage.success(response.message);
         tableDatax.value = response.data.records;
-        console.log(response.data.pages);
-        
         totalRecords.value = response.data.total/2 || 0
       } else {
         ElMessage.error(response.message);
@@ -159,6 +204,35 @@
     console.error(error);
   }
 }
+const Dailya = async (page) => {
+  try { 
+  let page = window.localStorage.getItem('pagenumber')
+  let startTime = window.localStorage.getItem('startTime')
+      const response = await request.post("/cacheGlass/edgStorageDeviceTaskHistory/queryEdgDailyProduction", {
+        deviceId: 2,
+        pageNo: page,
+        pageSize: 20,
+        glassId: glassId.value,
+        taskState: taskState.value,
+        taskType: taskType.value,
+        startTime: (timeRange.value && timeRange.value[0]) || '',
+        endTime: (timeRange.value && timeRange.value[1]) || '',
+    })
+      if (response.code == 200) {
+        countOutTwo.value = response.data.countOutTwo
+        totalAreaOutTwo.value = response.data.totalAreaOutTwo
+      } else {
+        ElMessage.error(response.message);
+    }
+}
+catch (error) {
+    console.error(error);
+  }
+}
+const handleClick = async () => {
+  await sethistorical();
+  await Dailyhistorical();
+};
 // 鍘嗗彶鏌ヨ鐐瑰嚮
 const sethistorical = async () => {
   try { 
@@ -167,17 +241,44 @@
   console.log(page);
   const response = await request.post("/cacheGlass/edgStorageDeviceTaskHistory", {
         deviceId: 2,
-        pageNo: page,
+        pageNo: 1,
         pageSize: 20,
         glassId: glassId.value,
         taskState: taskState.value,
         taskType: taskType.value,
-      startTime: (timeRange.value && timeRange.value[0]) || '',
-      endTime: (timeRange.value && timeRange.value[1]) || '',
+        startTime: (timeRange.value && timeRange.value[0]) || '',
+        endTime: (timeRange.value && timeRange.value[1]) || '',
     })
       if (response.code == 200) {
+        currentPage2.value = 1;
         ElMessage.success(response.message);
         tableDatax.value = response.data.records;
+        totalRecords.value = response.data.total/2 || 0
+      } else {
+        ElMessage.error(response.message);
+    }
+}
+catch (error) {
+    console.error(error);
+  }
+}
+const Dailyhistorical = async () => {
+  try { 
+  let startTime = window.localStorage.getItem('startTime')
+  let page = window.localStorage.getItem('pagenumber')
+    const response = await request.post("/cacheGlass/edgStorageDeviceTaskHistory/queryEdgDailyProduction", {
+        deviceId: 2,
+        pageNo: 1,
+        pageSize: 20,
+        glassId: glassId.value,
+        taskState: taskState.value,
+        taskType: taskType.value,
+        startTime: (timeRange.value && timeRange.value[0]) || '',
+        endTime: (timeRange.value && timeRange.value[1]) || '',
+    })
+      if (response.code == 200) {
+        countOutTwo.value = response.data.countOutTwo
+        totalAreaOutTwo.value = response.data.totalAreaOutTwo
       } else {
         ElMessage.error(response.message);
     }
@@ -269,7 +370,8 @@
 ]
 onMounted(() => {
   parseAndSetTime();
-  historical(1);
+  historical();
+  Daily()
 });
   </script>
   <style scoped>  

--
Gitblit v1.8.0