From 1496904805dff921b79504ed29a71d297a84e674 Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期二, 21 十月 2025 11:14:07 +0800
Subject: [PATCH] 中空线-创建任务-领取任务确认按钮,前端限制避免多次调用接口

---
 UI-Project/src/views/ReportWork/reportWork.vue |   72 +++++++++++++++++++++++-------------
 1 files changed, 46 insertions(+), 26 deletions(-)

diff --git a/UI-Project/src/views/ReportWork/reportWork.vue b/UI-Project/src/views/ReportWork/reportWork.vue
index 8c0fd2f..5ccecda 100644
--- a/UI-Project/src/views/ReportWork/reportWork.vue
+++ b/UI-Project/src/views/ReportWork/reportWork.vue
@@ -33,7 +33,7 @@
     </div>
     <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" >
       <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">
-        <el-table height="740" ref="table" :data="reportData"
+        <el-table height="700" ref="table" :data="reportData"
           :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }">
           <el-table-column prop="teamsGroupsName" align="center" :label="$t('reportmanage.reporteam')"
             min-width="135" />
@@ -137,6 +137,18 @@
             </template>
           </el-table-column>
         </el-table>
+      <div style="margin-top: 20px;margin-left: 40%;">
+      <el-pagination
+        v-model:current-page="currentPage"
+        :page-size="pageSize"
+        :size="large"
+        :disabled="disabled"
+        layout="prev, pager, next, jumper"
+        :total="totalRecords"
+        @current-change="handlePageChange"
+        style="margin-top: 10px;"
+    />
+    </div>
       </div>
     </el-card>
   </div>
@@ -151,33 +163,11 @@
 import { useI18n } from 'vue-i18n'
 import { inject } from 'vue';
 const globalDate = inject('globalDate');
-const timeRange = ref([])
+const currentPage = ref(1)
+const totalRecords = ref(0)
 const { t } = useI18n()
-const report = ref({
-  type: '8',
-  status: '1',
-  workingProcedure: '0',
-});
+const timeRange = ref([])
 const reportData = ref([])
-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}`;
-}
-// 鏍煎紡鍖栧悗绔椂闂村苟璁$畻涓�鍛ㄥ墠鐨勬椂闂�
-const defaultTime = ref<[Date, Date]>([new Date(), new Date()]);
-function parseAndSetTime() {
-  const backendTime = new Date(globalDate);
-  const oneWeekAgo = new Date(backendTime.getTime() - 7 * 24 * 60 * 60 * 1000); // 鍑忓幓7澶�
-  oneWeekAgo.setHours(0, 0, 0, 0);
-  timeRange.value = [formatTimestamp(oneWeekAgo), formatTimestamp(backendTime)];
-  window.localStorage.setItem('startTime', formatTimestamp(oneWeekAgo))
-}
 // const timeRange = ref([formatTimestamp(startDate), formatTimestamp(globalDate)]);
 const selectOptionsa = ref([]);
 const selectOptionsb = ref([]);
@@ -192,6 +182,11 @@
 const inputValuesb = reactive({});
 const selectedType = ref(true);
 const selectedStatus = ref(false);
+const report = ref({
+  type: '8',
+  status: '1',
+  workingProcedure: '0',
+});
 // 鏌ヨ鏁版嵁
 const selectReportData = async () => {
   const response = await request.post("/cacheVerticalGlass/damage/selectDamage", {
@@ -271,6 +266,12 @@
     console.error('Error fetching options:', error);
   }
 };
+const handlePageChange = (newPage) => {
+currentPage.value = newPage;
+window.localStorage.setItem('pagenumber', currentPage.value)
+historicala(currentPage.value);
+Dailya(currentPage.value);
+};
 const handleInputChangea = (value, rowId) => {
   // 鏇存柊瀵瑰簲琛岀殑 select 鍊�  
   selectValuesa[rowId] = value;
@@ -333,6 +334,25 @@
 //     })); 
 // };
 // let socket;
+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}`;
+}
+// 鏍煎紡鍖栧悗绔椂闂村苟璁$畻涓�鍛ㄥ墠鐨勬椂闂�
+const defaultTime = ref<[Date, Date]>([new Date(), new Date()]);
+function parseAndSetTime() {
+  const backendTime = new Date(globalDate);
+  const oneWeekAgo = new Date(backendTime.getTime() - 7 * 24 * 60 * 60 * 1000); // 鍑忓幓7澶�
+  oneWeekAgo.setHours(0, 0, 0, 0);
+  timeRange.value = [formatTimestamp(oneWeekAgo), formatTimestamp(backendTime)];
+  window.localStorage.setItem('startTime', formatTimestamp(oneWeekAgo))
+}
 onUnmounted(() => {
   socket.close();
 });

--
Gitblit v1.8.0