From 0b803f46bffb4b59b5618c49eb81f1c16db672cf Mon Sep 17 00:00:00 2001 From: zhanghua <314079846@qq.com> Date: 星期日, 12 十一月 2023 10:09:46 +0800 Subject: [PATCH] 油烟统计 --- src/views/smoke/report/components/alarm.vue | 66 ++++++--------------------------- 1 files changed, 12 insertions(+), 54 deletions(-) diff --git a/src/views/smoke/report/components/alarm.vue b/src/views/smoke/report/components/alarm.vue index 3d8eb85..b18eb64 100644 --- a/src/views/smoke/report/components/alarm.vue +++ b/src/views/smoke/report/components/alarm.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,31 +18,31 @@ <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%" > @@ -69,7 +69,7 @@ <script> import MyHeader from "./header/header2.vue"; -import realTimeApi from "@/api/smoke/realTime"; +import statisticsApi from "@/api/smoke/statistics"; export default { data() { return { @@ -95,57 +95,15 @@ }; } - 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) { -- Gitblit v1.8.0