| | |
| | | <template> |
| | | <div> |
| | | <MyHeader @getList="getRealTimeList" @exportTable="exportInTime"></MyHeader> |
| | | <MyHeader @getList="getRealTimeList" ></MyHeader> |
| | | <!-- 数据展示 --> |
| | | <div style="width: 100%; overflow-x: scroll"> |
| | | <el-table |
| | |
| | | <el-table-column label="序号" type="index" width="80"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="AcquitAtStr" |
| | | prop="Name" |
| | | label="监测点" |
| | | min-width="20%" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="Addr" |
| | | prop="CGranule" |
| | | label="超标天数" |
| | | min-width="10%" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="FanStatusStr" |
| | | prop="FilterAbnormallyUsedDays" |
| | | label="净化器不正常使用天数" |
| | | min-width="20%" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="AA" |
| | | prop="AbnormalOfflineDays" |
| | | label="异常使用天数" |
| | | min-width="10%" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="EmissionsConc" |
| | | prop="FilterWashTimes" |
| | | label="清洗记录(次)" |
| | | min-width="10%" |
| | | > |
| | |
| | | |
| | | <script> |
| | | import MyHeader from "./header/header2.vue"; |
| | | import realTimeApi from "@/api/smoke/realTime"; |
| | | import statisticsApi from "@/api/smoke/statistics"; |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | }; |
| | | } |
| | | |
| | | realTimeApi |
| | | .findInTimeList(params) |
| | | .then(({ list, total }) => { |
| | | list.forEach((e) => { |
| | | e.AcquitAtStr = this.dateFormat( |
| | | "YYYY-mm-dd HH:MM", |
| | | new Date(e.AcquitAt) |
| | | ); |
| | | e.FanStatusStr = this.FanStatusStr(e.FanStatus); |
| | | e.FilterStatusStr = this.FanStatusStr(e.FilterStatus); |
| | | e.OnlineStatusStr = this.OnlineStatusStr(e.OnlineStatus); |
| | | e.StatusStr = this.StatusStr(e.Status); |
| | | }); |
| | | statisticsApi |
| | | .findCurAlarmList(params) |
| | | .then((list) => { |
| | | this.tableData = list; |
| | | this.totalNum = total; |
| | | 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) { |