From 642d31285d7aff59415a5eb37f87a79f41d308a8 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 25 三月 2025 17:29:49 +0800
Subject: [PATCH] 新增自动评估扬尘监测数据统计结果上传功能(待完成)

---
 src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue |  225 +++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 143 insertions(+), 82 deletions(-)

diff --git a/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
index 6348a1b..82f7e2a 100644
--- a/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
+++ b/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
@@ -1,69 +1,91 @@
 <template>
-  <el-card shadow="never">
-    <template #header>
-      <div><el-text tag="b" size="large">鏁版嵁婧愭鏌�</el-text></div>
-      <el-text size="small" type="info">妫�鏌ヨ瘎浼版墍闇�鏁版嵁婧愭槸鍚﹀畬鏁�</el-text>
-      <el-text size="small" type="info">妫�鏌ヨ瘎浼版墍闇�鏁版嵁婧愭槸鍚﹀畬鏁�</el-text>
-    </template>
-    <FormCol>
-      <template v-for="(v, i) in checkResults" :key="i">
-        <el-row class="h-small" align="middle">
-          <el-col :span="14">
-            <el-row align="middle">
-              <el-text size="default" :class="v.required ? 'required' : 'not-required'">*</el-text>
-              <el-text size="default" class="m-l-4">{{ v.name }}</el-text>
-            </el-row>
-          </el-col>
-          <el-col :span="5">
-            <el-row align="middle">
-              <el-space>
-                <template v-if="v.loading">
-                  <el-icon class="is-loading"><Loading /></el-icon>
-                  <el-text size="default" type="default">妫�鏌ヤ腑...</el-text>
-                </template>
-                <template v-else-if="v.pass == true">
-                  <el-icon color="var(--el-color-success)"><Check /></el-icon>
-                  <el-text size="default" type="success">閫氳繃</el-text>
-                </template>
-                <template v-else-if="v.pass == false">
-                  <el-icon color="var(--el-color-danger)"><Close /></el-icon>
-                  <el-text size="default" type="danger">缂哄け</el-text>
-                </template>
-                <template v-else>
-                  <el-icon color="var(--el-color-warning)"><Warning /></el-icon>
-                  <el-text size="default" type="warning">鏆傜暐杩�</el-text>
-                </template>
-              </el-space>
-            </el-row>
-          </el-col>
-          <el-col :span="5">
-            <el-button
-              v-show="!v.loading"
-              :type="v.pass ? '' : 'danger'"
-              size="small"
-              @click="goto(v.path)"
-              :disabled="v.path == ''"
-            >
-              {{ v.pass ? '鍘讳慨鏀�' : '鍘诲畬鍠�' }}
-              <el-icon class="m-l-4"><Right /></el-icon>
-            </el-button>
-          </el-col>
-        </el-row>
-        <el-row align="middle" class="m-b-16">
-          <el-text size="small" class="not-required">*</el-text>
-          <el-text size="small" class="m-l-4 color-i">{{ v.des }}</el-text>
+  <div>
+    <el-card shadow="never">
+      <template #header>
+        <div><el-text tag="b" size="large">鏁版嵁婧愭鏌�</el-text></div>
+        <el-text size="small" type="info">妫�鏌ヨ瘎浼版墍闇�鏁版嵁婧愭槸鍚﹀畬鏁�</el-text>
+      </template>
+      <FormCol>
+        <template v-for="(v, i) in checkResults" :key="i">
+          <el-row class="h-small" align="middle">
+            <el-col :span="14">
+              <el-row align="middle">
+                <el-text
+                  size="default"
+                  :class="v.required ? 'required' : 'not-required'"
+                  >*</el-text
+                >
+                <el-text size="default" class="m-l-4">{{ v.name }}</el-text>
+              </el-row>
+            </el-col>
+            <el-col :span="5">
+              <el-row align="middle">
+                <el-space>
+                  <template v-if="v.loading">
+                    <el-icon class="is-loading"><Loading /></el-icon>
+                    <el-text size="default" type="default">妫�鏌ヤ腑...</el-text>
+                  </template>
+                  <template v-else-if="v.pass == true">
+                    <el-icon color="var(--el-color-success)"><Check /></el-icon>
+                    <el-text size="default" type="success">閫氳繃</el-text>
+                  </template>
+                  <template v-else-if="v.pass == false">
+                    <el-icon color="var(--el-color-danger)"><Close /></el-icon>
+                    <el-text size="default" type="danger">缂哄け</el-text>
+                  </template>
+                  <template v-else>
+                    <el-icon color="var(--el-color-warning)"
+                      ><Warning
+                    /></el-icon>
+                    <el-text size="default" type="warning">鏆傜暐杩�</el-text>
+                  </template>
+                </el-space>
+              </el-row>
+            </el-col>
+            <el-col :span="5">
+              <el-button
+                v-show="!v.loading"
+                :type="v.pass ? '' : 'danger'"
+                size="small"
+                @click="goto(v.path)"
+                :disabled="v.path == ''"
+              >
+                {{ v.pass ? '鍘讳慨鏀�' : '鍘诲畬鍠�' }}
+                <el-icon class="m-l-4"><Right /></el-icon>
+              </el-button>
+            </el-col>
+          </el-row>
+          <el-row align="middle" class="m-b-16">
+            <el-text size="small" class="not-required">*</el-text>
+            <el-text size="small" class="m-l-4 color-i">{{ v.des }}</el-text>
+          </el-row>
+        </template>
+      </FormCol>
+      <template #footer>
+        <el-row justify="space-around">
+          <el-button type="primary" size="default" @click="lastStep"
+            >涓婁竴姝�</el-button
+          >
+          <el-button
+            :disabled="!checkPass"
+            type="primary"
+            size="default"
+            @click="nextStep"
+            >涓嬩竴姝�</el-button
+          >
         </el-row>
       </template>
-    </FormCol>
-    <template #footer>
-      <el-row justify="space-around">
-        <el-button type="primary" size="default" @click="lastStep">涓婁竴姝�</el-button>
-        <el-button :disabled="!checkPass" type="primary" size="default" @click="nextStep"
-          >涓嬩竴姝�</el-button
-        >
-      </el-row>
-    </template>
-  </el-card>
+    </el-card>
+    <el-dialog
+      title="鎵皹鐩戞祴鏁版嵁鏈堝害缁熻绠$悊"
+      v-model="dialog1"
+      destroy-on-close
+      width="90%"
+    >
+      <CompDataResultEdit :areaInfo="areaInfo"></CompDataResultEdit>
+      <template #footer> </template>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
@@ -71,14 +93,16 @@
 import taskApi from '@/api/fysp/taskApi';
 import userMapApi from '@/api/fysp/userMapApi';
 import problemApi from '@/api/fysp/problemApi';
+import monitordataApi from '@/api/fysp/monitordataApi';
 import complaintApi from '@/api/fytz/complaintApi';
+import CompDataResultEdit from '../../CompDataResultEdit.vue';
 
 /**
- * 鐢熸垚涓�椤规暟鎹簮妫�鏌ヨ褰�
- * @param {*} _name
- * @param {*} _path
- * @param {*} _fetch
- * @param {*} _required
+ * 鐢熸垚涓�椤规暟鎹簮妫�鏌ユ潯鐩�
+ * @param {*} _name 鏉$洰鍚嶇О
+ * @param {*} _path 璺宠浆椤甸潰URL
+ * @param {*} _fetch 鏉$洰鐨勭綉缁滆姹傚嚱鏁�
+ * @param {*} _required 鏄惁蹇呴��
  */
 function baseCheckItem(_name, _path, _fetch, _required) {
   return {
@@ -91,10 +115,24 @@
     async fetch() {
       this.loading = true;
       setTimeout(async () => {
-        const res = await _fetch();
-        this.pass = res ? res.pass : undefined;
-        this.des = res ? res.des : undefined;
-        this.loading = false;
+        if (typeof _fetch === 'function') {
+          _fetch()
+            .then((res) => {
+              this.pass = res ? res.pass : undefined;
+              this.des = res ? res.des : undefined;
+            })
+            .catch(() => {
+              this.pass = false;
+              this.des = '缃戠粶閾炬帴閿欒';
+            })
+            .finally(() => {
+              this.loading = false;
+            });
+        } else {
+          this.pass = undefined;
+          this.des = undefined;
+          this.loading = false;
+        }
       }, 1000);
     }
   };
@@ -104,6 +142,9 @@
  * 璇勪及鏁版嵁婧愬畬鏁存�ф鏌�
  */
 export default {
+  components: {
+    CompDataResultEdit
+  },
   props: {
     // 姝ラ涓嬫爣
     modelValue: Number
@@ -160,7 +201,26 @@
           });
         }),
         // 鍖哄煙鑼冨洿鍐呯殑鐩戞祴鏁版嵁鏄惁瀛樺湪銆佹暟鎹椂闂磋法搴︽槸鍚﹀畬鏁淬�佹暟鎹殑鍒濇鍒嗘瀽鏄惁瀹屾垚
-        baseCheckItem('鐜板満鐩戞祴鏁版嵁', '', () => {}),
+        baseCheckItem(
+          '鐜板満鐩戞祴鏁版嵁',
+          () => {
+            this.dialog1 = true;
+          },
+          () => {
+            return monitordataApi
+              .fetchDustDataResult(this.areaInfo)
+              .then((res) => {
+                const pass = res.data.length > 0;
+                let des = '';
+                if (pass) {
+                  des = `鎵惧埌鏈堝害缁熻鍏�${res.data.length}鏉;
+                } else {
+                  des = '鏈壘鍒扮浉鍏宠褰�';
+                }
+                return { pass, des };
+              });
+          }
+        ),
         // 鍖哄煙鑼冨洿鍐呯殑姣忎釜鐩戠鐐逛綅涓庣洃娴嬩华鍣ㄧ殑鍖归厤璁板綍鏄惁瀛樺湪锛岀己澶辨儏鍐电瓑
         baseCheckItem('鐩戠鐐逛綅涓庣洃娴嬬偣鍖归厤', '', () => {
           return userMapApi.fetchDeviceMap(this.areaInfo).then((res) => {
@@ -192,15 +252,14 @@
             return { pass, des };
           });
         }),
+        // complaintApi.fetchComplaints();
         // 鍖哄煙鑼冨洿鍐呯殑淇¤鎶曡瘔璁板綍鏄惁瀛樺湪锛屽彲闅忔椂琛ュ厖
-        baseCheckItem('淇¤鎶曡瘔', '', () => {
-          // complaintApi.fetchComplaints();
-        }),
+        baseCheckItem('淇¤鎶曡瘔', ''),
+        // complaintApi.fetchPunishment();
         // 鍖哄煙鑼冨洿鍐呯殑琛屾斂澶勭綒璁板綍鏄惁瀛樺湪锛屽彲闅忔椂琛ュ厖
-        baseCheckItem('琛屾斂澶勭綒', '', () => {
-          // complaintApi.fetchPunishment();
-        })
-      ]
+        baseCheckItem('琛屾斂澶勭綒', '')
+      ],
+      dialog1: false
     };
   },
   computed: {
@@ -232,8 +291,10 @@
     },
     // 璺宠浆妫�鏌ラ」鐨勯摼鎺�
     goto(path) {
-      if (path && path != '') {
+      if (typeof path === 'string' && path != '') {
         this.$router.push(path);
+      } else if (typeof path === 'function') {
+        path();
       }
     },
     // 寮�濮嬫鏌ヤ换鍔�
@@ -253,7 +314,7 @@
       //   online: true,
       //   sourceType: v.sourceType
       // };
-      this.areaInfo = value
+      this.areaInfo = value;
 
       this.checkResults.forEach((e) => {
         e.fetch();

--
Gitblit v1.9.3