Răsfoiți Sursa

解决刷新报错

gongtianxiao 1 lună în urmă
părinte
comite
ca3e034a5a
1 a modificat fișierele cu 12 adăugiri și 12 ștergeri
  1. 12 12
      src/components/manage/pages/ManageBasicArchive.vue

+ 12 - 12
src/components/manage/pages/ManageBasicArchive.vue

@@ -964,16 +964,6 @@ const refreshMonthlyQueueState = () => {
   persistQueue();
 };
 
-watch(
-  () => parseManageRoute(route).tab,
-  (tab) => {
-    if (tab !== 'archive') return;
-    if (monthlySub.value === 'history') loadHistoryData();
-    else loadReportingState();
-  },
-  { immediate: true },
-);
-
 const loadReportingState = async ({ resetQueue = false } = {}) => {
   if (resetQueue) {
     await enterpriseStore.refreshReportProgress({ skipSubmitted: true });
@@ -995,6 +985,18 @@ const loadReportingState = async ({ resetQueue = false } = {}) => {
   refreshMonthlyQueueState();
 };
 
+const loadHistoryData = () => enterpriseStore.ensureReportProgress({ skipSubmitted: true });
+
+watch(
+  () => parseManageRoute(route).tab,
+  (tab) => {
+    if (tab !== 'archive') return;
+    if (monthlySub.value === 'history') loadHistoryData();
+    else loadReportingState();
+  },
+  { immediate: true },
+);
+
 const mapHistoryRecord = (record, status, statusType, auditStatus) => ({
   ...record,
   status,
@@ -1139,8 +1141,6 @@ const filteredHistoryRows = computed(() => {
   });
 });
 
-const loadHistoryData = () => enterpriseStore.ensureReportProgress({ skipSubmitted: true });
-
 const formatReportMonthForExport = (period) => {
   const match = String(period ?? '').match(/^(\d{4})-(\d{2})$/);
   if (!match) return period ?? '';