|
@@ -17,7 +17,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-table
|
|
|
- :data="dialogTableData"
|
|
|
+ :data="alarmList"
|
|
|
style="width: 100%"
|
|
|
height="calc(100% - 100px)"
|
|
|
>
|
|
@@ -38,7 +38,7 @@
|
|
|
<el-table-column
|
|
|
v-if="deviceType != 'booststation'"
|
|
|
align="center"
|
|
|
- prop="deviceName"
|
|
|
+ prop="code"
|
|
|
label="设备"
|
|
|
width="80"
|
|
|
show-overflow-tooltip
|
|
@@ -271,6 +271,8 @@
|
|
|
|
|
|
<script>
|
|
|
import { confirmAlart } from "@/api/zhbj/index.js";
|
|
|
+import { alarm_history } from "@/api/zhbj/index.js";
|
|
|
+import dayjs from "dayjs";
|
|
|
export default {
|
|
|
props: {
|
|
|
title: {
|
|
@@ -306,17 +308,69 @@ export default {
|
|
|
dialogTableData: [],
|
|
|
fullTableData: [],
|
|
|
stopUpdate: false,
|
|
|
+ timer: null
|
|
|
};
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
- this.initWarningList();
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getAlarmHistory();
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ this.getAlarmHistory();
|
|
|
+ }, 60000);
|
|
|
+ },
|
|
|
+ unmounted() {
|
|
|
+ clearInterval(this.timer);
|
|
|
+ this.timer = null;
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
iconfonts() {
|
|
|
return this.iconfontsObj[this.deviceType];
|
|
|
},
|
|
|
+ //查历史报警
|
|
|
+ getAlarmHistory() {
|
|
|
+ let params = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 30,
|
|
|
+ alarmId: "",
|
|
|
+ alarmType: "custom",
|
|
|
+ deviceType: "windturbine",
|
|
|
+ stationid: "",
|
|
|
+ deviceid: "",
|
|
|
+ modelId: "",
|
|
|
+ components: "",
|
|
|
+ description: "",
|
|
|
+ isclose: false,
|
|
|
+ // begin: dayjs().add(-1, "hour").format("YYYY-MM-DD HH:mm:ss"),//获取当前时间的前一天的相同时间
|
|
|
+ begin: dayjs().startOf('day').format("YYYY-MM-DD HH:mm:ss"), //获取当天 0 点
|
|
|
+ end: dayjs().format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ };
|
|
|
+ if (params.alarmType == "windturbine") {
|
|
|
+ // params.stationid = "SXJ_KGDL_DJY_FDC_STA";
|
|
|
+ params.stationid = "";
|
|
|
+ } else if (params.alarmType == "inverter") {
|
|
|
+ params.stationid = "SXJ_KGDL_JR_GDC_STA";
|
|
|
+ }
|
|
|
+ alarm_history(params, 12000).then(res => {
|
|
|
+ if (res?.data?.ls?.length > 0) {
|
|
|
+ let alarmList = [];
|
|
|
+ this.alarmList = [];
|
|
|
+ res.data.ls.forEach((ele) => {
|
|
|
+ ele.tsName = dayjs(ele.ts).format("MM-DD HH-mm-ss")
|
|
|
+ alarmList.push(ele);
|
|
|
+ });
|
|
|
+ alarmList.sort((a, b) => {
|
|
|
+ return b.ts - a.ts;
|
|
|
+ });
|
|
|
+ this.alarmList = alarmList;
|
|
|
+ console.log("alarmList===>>>>", this.alarmList);
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
|
|
|
initWarningList() {
|
|
|
if (this.$store.state.warningList?.length > 0) {
|
|
@@ -345,7 +399,9 @@ export default {
|
|
|
// return b.ts - a.ts;
|
|
|
// });
|
|
|
this.alarmList = alarmList;
|
|
|
- console.log("alarmList===>>>>", this.alarmList);
|
|
|
+ console.log("warningList===>>>>", this.$store.state.warningList);
|
|
|
+ // console.log("dialogTableData===>>>>", dialogTableData);
|
|
|
+ // console.log("alarmList===>>>>", this.alarmList);
|
|
|
if (!this.stopUpdate) {
|
|
|
this.dialogTableData = dialogTableData;
|
|
|
}
|