From 3282e95db0207ee133d1e98d9771dec9d83b0fc4 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 02 四月 2026 16:24:38 +0800
Subject: [PATCH] 2026.4.2 新增专题管理功能

---
 pages/inspection/scene/info/devicelist-proxy.js |   52 ++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 46 insertions(+), 6 deletions(-)

diff --git a/pages/inspection/scene/info/devicelist-proxy.js b/pages/inspection/scene/info/devicelist-proxy.js
index c76d02e..aa9d42e 100644
--- a/pages/inspection/scene/info/devicelist-proxy.js
+++ b/pages/inspection/scene/info/devicelist-proxy.js
@@ -26,11 +26,21 @@
         items: [],
       },
     ],
+    // 璁惧鎯呭喌缁熻
+    deviceSummary: '',
   },
   methods: {
+    fetchAllDeviceInfo() {
+      const array = [];
+      [0, 1, 2].forEach(deviceTypeId => {
+        const f = this.fetchDeviceInfo(deviceTypeId);
+        array.push(f);
+      });
+      return Promise.all(array).then(() => this.getDeviceSummary());
+    },
     fetchDeviceInfo(deviceTypeId) {
       const { scene } = this.data;
-      fetchDevices(scene.guid, deviceTypeId).then(res => {
+      return fetchDevices(scene.guid, deviceTypeId).then(res => {
         this.setData({
           [`categories[${deviceTypeId}].items`]: res.data,
         });
@@ -38,7 +48,7 @@
     },
     onSideBarChange(e) {
       const { value } = e.detail;
-      this.fetchDeviceInfo(this.data.categories[value].type)
+      this.fetchDeviceInfo(this.data.categories[value].type);
       this.setData({ sideBarIndex: value });
     },
     addNewDevice(e) {
@@ -56,7 +66,7 @@
         },
         events: {
           updateDeviceInfoOver: () => {
-            this.fetchDeviceInfo(this.data.categories[this.data.sideBarIndex].type)
+            this.fetchDeviceInfo(this.data.categories[this.data.sideBarIndex].type);
           },
         },
       });
@@ -79,7 +89,7 @@
         },
         events: {
           updateDeviceInfoOver: () => {
-            this.fetchDeviceInfo(this.data.categories[this.data.sideBarIndex].type)
+            this.fetchDeviceInfo(this.data.categories[this.data.sideBarIndex].type);
           },
         },
       });
@@ -102,10 +112,40 @@
         },
         events: {
           updateDeviceStatusOver: () => {
-            this.fetchDeviceInfo(this.data.categories[this.data.sideBarIndex].type)
+            this.fetchDeviceInfo(this.data.categories[this.data.sideBarIndex].type);
           },
         },
       });
-    }
+    },
+
+    getDeviceSummary() {
+      const { categories } = this.data;
+      let deviceCount = 0,
+        deviceCount0 = 0,
+        deviceCount1 = 0,
+        deviceCount2 = 0,
+        moved = 0,
+        tobeDismantled = 0,
+        tobeChecked = 0,
+        tobeUpdated = 0;
+      let lastestCheck = '';
+      // 鍑犲彴璁惧锛屽叾涓湁鍑犲彴姝e父銆佸嚑鍙扮Щ浣嶃�佸嚑鍙板緟鎷嗭紝浠ュ強鍑犲彴寰呮牳瀹炪�佸嚑鍙板緟鏇存柊锛屽苟涓旀樉绀烘渶鏂版牳鏌ヤ簨浠躲�佽窛浠婂灏戝ぉ锛堣嫢瓒呰繃3涓湀灏辨爣绾級
+      categories.forEach(c => {
+        c.items.forEach(d => {
+          deviceCount++;
+          if (c.type == 0) {
+            deviceCount0++;
+          } else if (c.type == 1) {
+            deviceCount1++;
+          } else if (c.type == 2) {
+            deviceCount2++;
+          }
+        });
+      });
+
+      this.setData({
+        deviceSummary: `鍏辨湁${deviceCount}鍙拌澶囷紝鐩戞祴璁惧${deviceCount0}鍙帮紝娌荤悊璁惧${deviceCount1}鍙帮紝鐢熶骇璁惧${deviceCount2}鍙帮紝`,
+      });
+    },
   },
 });

--
Gitblit v1.9.3