|
@@ -15,7 +15,8 @@
|
|
|
:day="day"
|
|
|
@setDay="setDay"
|
|
|
@onClickType="onClickType"
|
|
|
- ></x-form>
|
|
|
+ >
|
|
|
+ </x-form>
|
|
|
<new-table
|
|
|
:height="600"
|
|
|
:title="title"
|
|
@@ -23,7 +24,7 @@
|
|
|
:tableItems="tableItems"
|
|
|
:shows="tableShows"
|
|
|
>
|
|
|
- <template #right>
|
|
|
+ <!-- <template #right>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="primary"
|
|
@@ -32,7 +33,7 @@
|
|
|
@click="digAll"
|
|
|
>批量处理</el-button
|
|
|
>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
<template #type="scope">
|
|
|
<span v-if="scope.row.type === 1">环境报警</span>
|
|
|
<span v-else>设备异常</span>
|
|
@@ -110,7 +111,11 @@ import XForm from "@/components/XForm";
|
|
|
import NewTable from "@/components/newTable/NewTable";
|
|
|
import TableFooter from "@/components/TableFooter";
|
|
|
|
|
|
-import { getOneWeekAlarm, getTodayAlarmRate } from "@/utils/chenApi.js";
|
|
|
+import {
|
|
|
+ getOneWeekAlarm,
|
|
|
+ getTodayAlarmRate,
|
|
|
+ getAlarmInfo,
|
|
|
+} from "@/utils/chenApi.js";
|
|
|
|
|
|
export default {
|
|
|
name: "AlarmWarn",
|
|
@@ -127,15 +132,15 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
selectItems: [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- type: "select",
|
|
|
- label: "报警类型:",
|
|
|
- placeholder: "请选择报警类型",
|
|
|
- field: "areaId",
|
|
|
- options: [],
|
|
|
- col: 5,
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // id: 1,
|
|
|
+ // type: "select",
|
|
|
+ // label: "报警类型:",
|
|
|
+ // placeholder: "请选择报警类型",
|
|
|
+ // field: "areaId",
|
|
|
+ // options: [],
|
|
|
+ // col: 5,
|
|
|
+ // },
|
|
|
{
|
|
|
id: 3,
|
|
|
type: "text",
|
|
@@ -167,7 +172,7 @@ export default {
|
|
|
{
|
|
|
id: 7,
|
|
|
type: "button",
|
|
|
- text: "导出数据",
|
|
|
+ text: "查询",
|
|
|
col: 2,
|
|
|
click: "derive",
|
|
|
},
|
|
@@ -194,38 +199,38 @@ export default {
|
|
|
],
|
|
|
tableItems: [
|
|
|
{
|
|
|
- prop: "time",
|
|
|
+ prop: "warningTime",
|
|
|
label: "报警时间",
|
|
|
minWidth: "100",
|
|
|
- slotName: "time",
|
|
|
+ slotName: "warningTime",
|
|
|
},
|
|
|
{
|
|
|
- prop: "type",
|
|
|
+ prop: "warningName",
|
|
|
label: "报警类型",
|
|
|
minWidth: "100",
|
|
|
- slotName: "type",
|
|
|
+ slotName: "warningName",
|
|
|
},
|
|
|
{
|
|
|
- prop: "class",
|
|
|
- label: "危险等级",
|
|
|
+ prop: "levelName",
|
|
|
+ label: "报警等级",
|
|
|
minWidth: "100",
|
|
|
- slotName: "class",
|
|
|
+ slotName: "levelName",
|
|
|
},
|
|
|
{
|
|
|
- prop: "content",
|
|
|
+ prop: "msg",
|
|
|
label: "报警内容",
|
|
|
minWidth: "100",
|
|
|
- slotName: "content",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "处理结果",
|
|
|
- minWidth: "100",
|
|
|
- slotName: "handler",
|
|
|
+ slotName: "msg",
|
|
|
},
|
|
|
+ // {
|
|
|
+ // label: "handler",
|
|
|
+ // minWidth: "100",
|
|
|
+ // slotName: "handler",
|
|
|
+ // },
|
|
|
],
|
|
|
tableShows: {
|
|
|
showIndex: false,
|
|
|
- showSelect: true,
|
|
|
+ showSelect: false,
|
|
|
defaultProp: "dig",
|
|
|
},
|
|
|
total: 0,
|
|
@@ -261,18 +266,26 @@ export default {
|
|
|
// 修改size
|
|
|
sizeChange(val) {
|
|
|
this.pageSize = val;
|
|
|
- this.init();
|
|
|
+ this.pageNum = 1;
|
|
|
+ this.initAlarmInfo();
|
|
|
},
|
|
|
// 修改页数
|
|
|
pageChange(val) {
|
|
|
this.pageNum = val;
|
|
|
- this.init();
|
|
|
+ this.initAlarmInfo();
|
|
|
},
|
|
|
init() {},
|
|
|
setDay(data) {
|
|
|
- this.day = data;
|
|
|
+ this.day = data.type;
|
|
|
+ this.pageNum = 1;
|
|
|
+ this.initAlarmInfo();
|
|
|
+ },
|
|
|
+ onClickType(val) {
|
|
|
+ this.day = 4;
|
|
|
+ this.time = val.data.value1;
|
|
|
+ this.pageNum = 1;
|
|
|
+ this.initAlarmInfo();
|
|
|
},
|
|
|
- onClickType() {},
|
|
|
dig(item) {
|
|
|
this.digType = true;
|
|
|
this.dialogVisible = true;
|
|
@@ -300,10 +313,36 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ // 报警列表
|
|
|
+ initAlarmInfo() {
|
|
|
+ let params;
|
|
|
+ if (this.day === 4) {
|
|
|
+ params = {
|
|
|
+ startDate: this.time[0],
|
|
|
+ endDate: this.time[1],
|
|
|
+ type: this.day,
|
|
|
+ current: this.pageNum,
|
|
|
+ size: this.pageSize,
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ params = {
|
|
|
+ type: this.day,
|
|
|
+ current: this.pageNum,
|
|
|
+ size: this.pageSize,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ getAlarmInfo(params).then((res) => {
|
|
|
+ if (res.code === 10000) {
|
|
|
+ this.list = res.data.records;
|
|
|
+ this.total = res.data.total;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.initOneWeekAlarm(); // bar
|
|
|
this.initTodayAlarmRate(); // pie
|
|
|
+ this.initAlarmInfo(); // list
|
|
|
},
|
|
|
};
|
|
|
</script>
|