zhanghua
2025-07-16 7c20fd15b7fbc2bd5756b39d5ab655cc849ffcc3
src/views/smoke/report/components/maintenance.vue
@@ -1,6 +1,6 @@
<template>
    <div>
      <MyHeader @getList="getRealTimeList" @exportTable="exportInTime"></MyHeader>
      <MyHeader @getList="getRealTimeList" ></MyHeader>
      <!-- 数据展示 -->
      <div style="width: 100%; overflow-x: scroll">
        <el-table
@@ -18,55 +18,55 @@
          <el-table-column label="序号" type="index" width="80">
          </el-table-column>
          <el-table-column
            prop="AcquitAtStr"
            prop="Name"
            label="监测点"          
            min-width="15%"
          >
          </el-table-column>
          <el-table-column
            prop="Addr"
            prop="MN"
            label="设备编号"          
            min-width="10%"
          >
          </el-table-column>
          <el-table-column
            prop="FanStatusStr"
            prop="AbnormalOfflineDays"
            label="异常离线天数"          
            min-width="10%"
          >
          </el-table-column>
          <el-table-column
            prop="AA"
            prop="AbnormalOfflineToProcessDays"
            label="异常离线待处理天数"          
            min-width="10%"
          >
          </el-table-column>
          <el-table-column
            prop="EmissionsConc"
            prop="ShopClosedDays"
            label="歇业天数"          
            min-width="10%"
          >
          </el-table-column>
          <el-table-column
            prop="EmissionsConc"
            prop="FilterAbnormallyUsedDays"
            label="净化器不正常使用天数"          
            min-width="10%"
          >
          </el-table-column>
          <el-table-column
            prop="EmissionsConc"
            prop="DetectorFailureDays"
            label="监测仪故障天数"          
            min-width="10%"
          >
          </el-table-column>
          <el-table-column
            prop="EmissionsConc"
            prop="OfflineCausedByShopDays"
            label="店家原因导致离线天数"          
            min-width="10%"
          >
          </el-table-column>
          <el-table-column
            prop="EmissionsConc"
            prop="AbnormalOfflineProcessRatio"
            label="处理率"          
            min-width="10%"
          >
@@ -93,7 +93,7 @@
  
  <script>
  import MyHeader from "./header/header2.vue";
  import realTimeApi from "@/api/smoke/realTime";
import statisticsApi from "@/api/smoke/statistics";
  export default {
    data() {
      return {
@@ -119,57 +119,15 @@
          };
        }
  
        realTimeApi
          .findInTimeList(params)
          .then(({ list, total }) => {
            list.forEach((e) => {
              e.AcquitAtStr = this.dateFormat(
                "YYYY-mm-dd HH:MM",
                new Date(e.AcquitAt*1000)
              );
              e.FanStatusStr = this.FanStatusStr(e.FanStatus);
              e.FilterStatusStr = this.FanStatusStr(e.FilterStatus);
              e.OnlineStatusStr = this.OnlineStatusStr(e.OnlineStatus);
              e.StatusStr = this.StatusStr(e.Status);
            });
            this.tableData = list;
            this.totalNum = total;
          })
          .catch((err) => this.$message.error(err));
        statisticsApi
        .findCurAlarmList(params)
        .then((list) => {
          this.tableData = list;
          this.totalNum = list.length;
        })
        .catch((err) => this.$message.error(err));
      },
      exportInTime(seachData) {
        let params;
        if (seachData) {
          params = this.getParam(seachData);
        }
        realTimeApi
          .exportInTime(params)
          .then((res) => {
            debugger;
            let time = new Date();
            let deathdate = time.toLocaleDateString();
            const blob = new Blob([res.data], {
              type: "application/vnd.ms-excel;charset=utf-8",
            });
            if (window.navigator.msSaveBlob) {
              window.navigator.msSaveBlob(
                blob,
                deathdate + "监测总体情况报表" + ".xls"
              );
            } else {
              const url = window.URL.createObjectURL(blob);
              const link = document.createElement("a");
              link.style.display = "none";
              link.href = url;
              link.download = deathdate + "监测总体情况报表" + ".xls";
              document.body.appendChild(link);
              link.click();
              document.body.removeChild(link);
            }
            this.$message.success("操作成功");
          })
          .catch((err) => this.$message.error(err));
      },
      getParam(seachData) {
        let params;
        if (seachData) {