| | |
| | | :data="tableData" |
| | | :row-class-name="tableRowClassName" |
| | | > |
| | | <el-table-column label="序号" type="index" width="60px"> |
| | | <el-table-column label="序号" type="index" min-width="2"> |
| | | </el-table-column> |
| | | <el-table-column prop="AcquitAtStr" label="时间" width="120px"> |
| | | <el-table-column prop="MN" label="设备编码" min-width="2"> |
| | | </el-table-column> |
| | | <el-table-column prop="MsgTypeStr" label="消息类型" width="180px"> |
| | | <el-table-column prop="AcquitAtStr" label="时间" min-width="3"> |
| | | </el-table-column> |
| | | <el-table-column prop="Content" label="消息内容" width="100px"> |
| | | <el-table-column prop="MsgTypeStr" label="消息类型" min-width="2"> |
| | | </el-table-column> |
| | | <!-- <el-table-column prop="Addr" label="地址" min-width="4"> |
| | | </el-table-column> --> |
| | | <el-table-column prop="Content" label="消息内容" min-width="8"> |
| | | </el-table-column> |
| | | |
| | | <el-table-column prop="operation" label="操作" width="550px"> |
| | | <el-table-column prop="operation" label="操作" min-width="3"> |
| | | <template slot-scope="scope"> |
| | | <div class="operation"> |
| | | <span @click="handleUpload(scope.row)">上报</span> |
| | |
| | | totalNum: 0, |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | params: {}, |
| | | }; |
| | | }, |
| | | components: { MyHeader }, |
| | |
| | | }, |
| | | methods: { |
| | | getAlarmList(seachData) { |
| | | let params; |
| | | if (seachData) { |
| | | params = this.getParam(seachData); |
| | | this.params = this.getParam(seachData); |
| | | } else { |
| | | params = { |
| | | this.params = { |
| | | pageNum: this.currentPage, |
| | | pageSize: this.pageSize, |
| | | }; |
| | | } |
| | | |
| | | realTimeApi |
| | | .findAlarmList(params) |
| | | .findAlarmList(this.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); |
| | | e.MsgTypeStr = this.MsgTypeStr(e.MsgType); |
| | | }); |
| | | this.tableData = list; |
| | | this.totalNum = total; |
| | |
| | | type: "application/vnd.ms-excel;charset=utf-8", |
| | | }); |
| | | if (window.navigator.msSaveBlob) { |
| | | window.navigator.msSaveBlob(blob, deathdate + "实时数据" + ".xls"); |
| | | 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"; |
| | | link.download = deathdate + "报警信息" + ".xls"; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | |
| | | getParam(seachData) { |
| | | let params; |
| | | if (seachData) { |
| | | const seachParams = seachData.seachData; |
| | | const seachParams = seachData.seachData || seachData; |
| | | params = { |
| | | owner: seachParams.owner == undefined ? null : seachParams.owner, |
| | | onlineStatus: |
| | | seachParams.onlineStatus == undefined |
| | | ? null |
| | | : seachParams.onlineStatus, |
| | | status: seachParams.status == undefined ? null : seachParams.status, |
| | | type: seachParams.type == undefined ? null : seachParams.type, |
| | | msgType: |
| | | seachParams.msgType == undefined ? null : seachParams.msgType, |
| | | startTime: |
| | | seachParams.alarmTime == undefined |
| | | ? null |
| | |
| | | seachParams.alarmTime[1] |
| | | ), |
| | | }; |
| | | params.pageNum = this.currentPage; |
| | | params.pageSize = this.pageSize; |
| | | } |
| | | return params; |
| | | }, |
| | |
| | | // 当前页改变触发事件 |
| | | changeCurrentPage(page) { |
| | | this.currentPage = page; |
| | | this.getRealTimeList(); |
| | | this.getAlarmList(this.params); |
| | | }, |
| | | // 上一页点击事件 |
| | | handlePrev(page) { |
| | | this.currentPage = page; |
| | | this.getRealTimeList(); |
| | | this.getAlarmList(this.params); |
| | | }, |
| | | // 下一页点击事件 |
| | | handleNext(page) { |
| | | this.currentPage = page; |
| | | this.getRealTimeList(); |
| | | this.getAlarmList(this.params); |
| | | }, |
| | | dateFormat(fmt, date) { |
| | | let ret; |