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, 14 insertions(+), 2 deletions(-)

diff --git a/pages/home/inspection-proxy.js b/pages/home/inspection-proxy.js
index 06a155b..727361c 100644
--- a/pages/home/inspection-proxy.js
+++ b/pages/home/inspection-proxy.js
@@ -2,7 +2,7 @@
   fetchInspectionStatistic,
   fetchSubtaskSummaryByArea,
 } from '../../services/inspection/fetchInspection';
-import dayjs from "dayjs";
+import dayjs from 'dayjs';
 
 /**
  * 鐜板満宸℃煡鐩戠鐩稿叧淇℃伅鑾峰彇閫昏緫
@@ -17,7 +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')
+      const eTime = dayjs(time).endOf('M').format('YYYY-MM-DD HH:mm:ss');
       fetchSubtaskSummaryByArea({
         provincecode: provinceCode,
         citycode: cityCode,
@@ -31,6 +31,7 @@
           this.setData({
             inspectionRes: res.data,
           });
+          this.fetchSupervisionByDistrict(this.data.tabIndex);
         })
         .finally(() => {
           this.setData({ inspectionLoading: false });
@@ -38,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