From ec7f5ba1f7eb84507e1c8e7b6f66b1ecfbc22728 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 17 四月 2025 17:31:25 +0800
Subject: [PATCH] 线上监管

---
 pages/home/inspection-proxy.js |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/pages/home/inspection-proxy.js b/pages/home/inspection-proxy.js
index 03efc81..727361c 100644
--- a/pages/home/inspection-proxy.js
+++ b/pages/home/inspection-proxy.js
@@ -2,6 +2,7 @@
   fetchInspectionStatistic,
   fetchSubtaskSummaryByArea,
 } from '../../services/inspection/fetchInspection';
+import dayjs from 'dayjs';
 
 /**
  * 鐜板満宸℃煡鐩戠鐩稿叧淇℃伅鑾峰彇閫昏緫
@@ -16,6 +17,7 @@
     fetchInspection(page) {
       this.setData({ inspectionLoading: true });
       const { provinceCode, cityCode, districtCode, townCode, sceneTypeValue, time } = this.data;
+      const eTime = dayjs(time).endOf('M').format('YYYY-MM-DD HH:mm:ss');
       fetchSubtaskSummaryByArea({
         provincecode: provinceCode,
         citycode: cityCode,
@@ -23,12 +25,13 @@
         towncode: townCode,
         scensetypeid: sceneTypeValue[0],
         starttime: time,
-        endtime: time,
+        endtime: eTime,
       })
         .then(res => {
           this.setData({
             inspectionRes: res.data,
           });
+          this.fetchSupervisionByDistrict(this.data.tabIndex);
         })
         .finally(() => {
           this.setData({ inspectionLoading: false });
@@ -36,7 +39,18 @@
     },
     onTabsChange(e) {
       this.setData({ tabIndex: e.detail.value });
+      this.fetchSupervisionByDistrict(e.detail.value);
     },
+
+    fetchSupervisionByDistrict(index) {
+      if (this.data.inspectionRes.length == 0) return;
+
+      const { sceneTypeValue } = this.data;
+      const { provinceName, cityName, districtName } = this.data.inspectionRes[index];
+      const params = { provinceName, cityName, districtName, sceneTypes: sceneTypeValue };
+      this._fetchSupervision(1, params);
+    },
+
     navToInspection(e) {
       const i1 = e.detail.index;
       const { inspectionRes, time, sceneTypeText, sceneTypeValue, tabIndex } = this.data;

--
Gitblit v1.9.3