From f752f50a484f63fc3786ab1c7ad563f3b17cce77 Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Fri, 15 Nov 2024 15:58:32 +0800
Subject: [PATCH] fix: 国控站

---
 src/views/reportForm/sensorday.vue |  238 +++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 190 insertions(+), 48 deletions(-)

diff --git a/src/views/reportForm/sensorday.vue b/src/views/reportForm/sensorday.vue
index b7e73d7..250d527 100644
--- a/src/views/reportForm/sensorday.vue
+++ b/src/views/reportForm/sensorday.vue
@@ -12,7 +12,10 @@
           style="width: 21rem"
         />
         <div>
-          <el-radio-group v-model="select1" style="margin-left: 20px">
+          <el-radio-group
+            v-model="select1"
+            style="margin-left: 20px"
+          >
             <el-radio-button label="������" />
             <el-radio-button label="������" />
             <el-radio-button label="������" />
@@ -22,8 +25,8 @@
         <component
           :is="dataType"
           style="padding-left: 0; margin-left: 30px"
-          @sendPickerChild="showPickerChild"
           class="select11"
+          @sendPickerChild="showPickerChild"
         />
         <el-date-picker
           v-if="dateDisplay"
@@ -37,33 +40,46 @@
         />
         <el-button
           type="primary"
-          @click="getReportForm()"
           style="margin-left: 10px"
-          >������</el-button
+          @click="getReportForm()"
         >
-        <el-button type="primary" @click="exportExcel()">������������</el-button>
+          ������
+        </el-button>
+        <el-button
+          type="primary"
+          @click="exportExcel()"
+        >
+          ������������
+        </el-button>
       </div>
     </div>
     <div class="topTitle">
       <el-table
-        :data="tableData"
         id="exportTabs"
+        :data="tableData"
         max-height="730"
-        @sort-change="changeTableSort"
         style="width: 100%"
+        @sort-change="changeTableSort"
       >
         <el-table-column
           prop="name"
           label="������������"
           align="center"
+        />
+        <el-table-column
+          label="������������"
+          align="center"
         >
-        </el-table-column>
-        <el-table-column label="������������" align="center">
           <el-table-column
             prop="composite"
             label="������"
             align="center"
           >
+            <template slot-scope="scope">
+              {{
+                scope.row.composite !== 0 ? scope.row.composite : '--'
+              }}
+            </template>
           </el-table-column>
           <el-table-column
             label="������"
@@ -71,10 +87,27 @@
             prop="compositeNum"
             sortable
           >
+            <template slot-scope="scope">
+              {{
+                scope.row.compositeNum !== 0 ? scope.row.compositeNum : '--'
+              }}
+            </template>
           </el-table-column>
         </el-table-column>
-        <el-table-column label="PM2.5" align="center">
-          <el-table-column prop="pm25" label="������"  align="center">
+        <el-table-column
+          label="PM2.5"
+          align="center"
+        >
+          <el-table-column
+            prop="pm25"
+            label="������"
+            align="center"
+          >
+            <template slot-scope="scope">
+              {{
+                scope.row.pm25 !== 0 ? scope.row.pm25 : '--'
+              }}
+            </template>
           </el-table-column>
           <el-table-column
             label="������"
@@ -82,10 +115,27 @@
             prop="pm25Num"
             sortable
           >
+            <template slot-scope="scope">
+              {{
+                scope.row.pm25Num !== 0 ? scope.row.pm25Num : '--'
+              }}
+            </template>
           </el-table-column>
         </el-table-column>
-        <el-table-column label="PM10" align="center">
-          <el-table-column prop="pm10" label="������"  align="center">
+        <el-table-column
+          label="PM10"
+          align="center"
+        >
+          <el-table-column
+            prop="pm10"
+            label="������"
+            align="center"
+          >
+            <template slot-scope="scope">
+              {{
+                scope.row.pm10 !== 0 ? scope.row.pm10 : '--'
+              }}
+            </template>
           </el-table-column>
           <el-table-column
             label="������"
@@ -93,10 +143,27 @@
             prop="pm10Num"
             sortable
           >
+            <template slot-scope="scope">
+              {{
+                scope.row.pm10Num !== 0 ? scope.row.pm10Num : '--'
+              }}
+            </template>
           </el-table-column>
         </el-table-column>
-        <el-table-column label="SO2" align="center">
-          <el-table-column prop="so2" label="������"  align="center">
+        <el-table-column
+          label="SO2"
+          align="center"
+        >
+          <el-table-column
+            prop="so2"
+            label="������"
+            align="center"
+          >
+            <template slot-scope="scope">
+              {{
+                scope.row.so2 !== 0 ? scope.row.so2 : '--'
+              }}
+            </template>
           </el-table-column>
           <el-table-column
             label="������"
@@ -104,10 +171,27 @@
             prop="so2Num"
             sortable
           >
+            <template slot-scope="scope">
+              {{
+                scope.row.so2Num !== 0 ? scope.row.so2Num : '--'
+              }}
+            </template>
           </el-table-column>
         </el-table-column>
-        <el-table-column label="NO2" align="center">
-          <el-table-column prop="no2" label="������"  align="center">
+        <el-table-column
+          label="NO2"
+          align="center"
+        >
+          <el-table-column
+            prop="no2"
+            label="������"
+            align="center"
+          >
+            <template slot-scope="scope">
+              {{
+                scope.row.no2 !== 0 ? scope.row.no2 : '--'
+              }}
+            </template>
           </el-table-column>
           <el-table-column
             label="������"
@@ -115,10 +199,27 @@
             prop="no2Num"
             sortable
           >
+            <template slot-scope="scope">
+              {{
+                scope.row.no2Num !== 0 ? scope.row.no2Num : '--'
+              }}
+            </template>
           </el-table-column>
         </el-table-column>
-        <el-table-column label="CO" align="center">
-          <el-table-column prop="co" label="������"  align="center">
+        <el-table-column
+          label="CO"
+          align="center"
+        >
+          <el-table-column
+            prop="co"
+            label="������"
+            align="center"
+          >
+            <template slot-scope="scope">
+              {{
+                scope.row.co !== 0 ? scope.row.co : '--'
+              }}
+            </template>
           </el-table-column>
           <el-table-column
             label="������"
@@ -126,10 +227,27 @@
             prop="conum"
             sortable
           >
+            <template slot-scope="scope">
+              {{
+                scope.row.conum !== 0 ? scope.row.conum : '--'
+              }}
+            </template>
           </el-table-column>
         </el-table-column>
-        <el-table-column label="O3" align="center">
-          <el-table-column prop="o3" label="������"  align="center">
+        <el-table-column
+          label="O3"
+          align="center"
+        >
+          <el-table-column
+            prop="o3"
+            label="������"
+            align="center"
+          >
+            <template slot-scope="scope">
+              {{
+                scope.row.o3 !== 0 ? scope.row.o3 : '--'
+              }}
+            </template>
           </el-table-column>
           <el-table-column
             label="������"
@@ -137,10 +255,27 @@
             prop="o3Num"
             sortable
           >
+            <template slot-scope="scope">
+              {{
+                scope.row.o3Num !== 0 ? scope.row.o3Num : '--'
+              }}
+            </template>
           </el-table-column>
         </el-table-column>
-        <el-table-column label="TVOC" align="center">
-          <el-table-column prop="tovc" label="������"  align="center">
+        <el-table-column
+          label="TVOC"
+          align="center"
+        >
+          <el-table-column
+            prop="tovc"
+            label="������"
+            align="center"
+          >
+            <template slot-scope="scope">
+              {{
+                scope.row.tovc !== 0 ? scope.row.tovc : '--'
+              }}
+            </template>
           </el-table-column>
           <el-table-column
             label="������"
@@ -148,6 +283,11 @@
             prop="tovcnum"
             sortable
           >
+            <template slot-scope="scope">
+              {{
+                scope.row.tovcnum !== 0 ? scope.row.tovcnum : '--'
+              }}
+            </template>
           </el-table-column>
         </el-table-column>
       </el-table>
@@ -182,7 +322,7 @@
     weekPicker,
   },
   props: {},
-  data() {
+  data () {
     // ������������������
     return {
       newData: [],
@@ -217,7 +357,7 @@
   computed: {},
   // ������data������������������
   watch: {
-    select1(nv, ov) {
+    select1 (nv, ov) {
       if (nv === '������') {
         this.dataType = 'HourPicker'
         this.unit = 1
@@ -237,7 +377,7 @@
         this.dateDisplay = false
       }
     },
-    newMac(newVal, oldval) {
+    newMac (newVal, oldval) {
       this.newMac1 = []
       for (let i = 0; i < newVal.length; i++) {
         // console.log(newVal[i], 111)
@@ -248,25 +388,25 @@
   },
 
   // ������������ - ��������������������������������� this ���������
-  created() {
+  created () {
     this.getData()
   },
   // ������������ - ��������������������������� DOM ���������
-  mounted() {},
-  beforeCreate() {}, // ������������ - ������������
-  beforeMount() {}, // ������������ - ������������
-  beforeUpdate() {}, // ������������ - ������������
-  updated() {}, // ������������ - ������������
-  beforeDestroy() {}, // ������������ - ������������
-  destroyed() {}, // ������������ - ������������
-  activated() {},
+  mounted () {},
+  beforeCreate () {}, // ������������ - ������������
+  beforeMount () {}, // ������������ - ������������
+  beforeUpdate () {}, // ������������ - ������������
+  updated () {}, // ������������ - ������������
+  beforeDestroy () {}, // ������������ - ������������
+  destroyed () {}, // ������������ - ������������
+  activated () {},
   // ������������
   methods: {
-    showPickerChild(data) {
+    showPickerChild (data) {
       this.newData = data
     },
     // ������������rank������(���������������������������������������������������������������)
-    changeTableSort() {
+    changeTableSort () {
       var sortTableData = this.$refs.mytable.tableData
       // console.log(this.$refs.mytable.tableData, 111)
       for (let i = 0; i < sortTableData.length; i++) {
@@ -275,7 +415,7 @@
     },
 
     // ������������
-    exportExcel() {
+    exportExcel () {
       /* generate workbook object from table */
       var xlsxParam = { raw: true } // ���������������������������������������������������
       var wb = XLSX.utils.table_to_book(
@@ -302,7 +442,7 @@
       return wbout
     },
     // ������������������
-    getData() {
+    getData () {
       this.$request({
         url: '/monitorPoint/queryMonitorPoints',
         method: 'get',
@@ -320,14 +460,16 @@
               label: this.defaultData[i].name,
             })
             this.options[i].children = []
-            for (let j = 0; j < this.defaultData[i].devices.length; j++) {
-              this.options[i].children.push({
-                value: [
-                  this.defaultData[i].devices[j].name,
-                  this.defaultData[i].devices[j].mac,
-                ],
-                label: this.defaultData[i].devices[j].name,
-              })
+            if (this.defaultData[i].devices) {
+              for (let j = 0; j < this.defaultData[i].devices.length; j++) {
+                this.options[i].children.push({
+                  value: [
+                    this.defaultData[i].devices[j].name,
+                    this.defaultData[i].devices[j].mac,
+                  ],
+                  label: this.defaultData[i].devices[j].name,
+                })
+              }
             }
           }
         })
@@ -336,7 +478,7 @@
         })
     },
     // ������������������
-    getReportForm() {
+    getReportForm () {
       console.log(this.newData)
       this.$request({
         // url: '/monitorPoint/listMonitoring',

--
Gitblit v1.8.0