|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="alarmList-container">
|
|
|
<!-- 弹窗内容 -->
|
|
|
- <div class="dialog_box">
|
|
|
+ <div class="dialog_box" :key="timer">
|
|
|
<div class="search-box">
|
|
|
<div class="search-item">
|
|
|
<span class="search-label">时间:</span>
|
|
@@ -54,7 +54,12 @@
|
|
|
</div>
|
|
|
<div class="search-item">
|
|
|
<span class="search-label">报警分类:</span>
|
|
|
- <el-select size="mini" v-model="query.category" clearable @change="searchData()">
|
|
|
+ <el-select
|
|
|
+ size="mini"
|
|
|
+ v-model="query.category"
|
|
|
+ clearable
|
|
|
+ @change="searchData()"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in categoryOptions"
|
|
|
:key="item.dictKey"
|
|
@@ -65,7 +70,12 @@
|
|
|
</div>
|
|
|
<div class="search-item">
|
|
|
<span class="search-label"> 报警级别:</span>
|
|
|
- <el-select size="mini" v-model="query.level" clearable @change="searchData">
|
|
|
+ <el-select
|
|
|
+ size="mini"
|
|
|
+ v-model="query.level"
|
|
|
+ clearable
|
|
|
+ @change="searchData"
|
|
|
+ >
|
|
|
<el-option :value="'024001'" label="一级报警"></el-option>
|
|
|
<el-option :value="'024002'" label="二级报警"></el-option>
|
|
|
<el-option :value="'024003'" label="三级报警"></el-option>
|
|
@@ -75,39 +85,64 @@
|
|
|
<div class="search-box">
|
|
|
<div class="search-item">
|
|
|
<span class="search-label">确认状态:</span>
|
|
|
- <el-select size="mini" v-model="query.confirmStatus" clearable @change="searchData">
|
|
|
+ <el-select
|
|
|
+ size="mini"
|
|
|
+ v-model="query.confirmStatus"
|
|
|
+ clearable
|
|
|
+ @change="searchData"
|
|
|
+ >
|
|
|
<el-option :value="'1'" label="已确认"></el-option>
|
|
|
<el-option :value="'0'" label="未确认"></el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="search-item">
|
|
|
<span class="search-label"> 处理状态:</span>
|
|
|
- <el-select size="mini" v-model="query.dealStatus" clearable @change="searchData">
|
|
|
+ <el-select
|
|
|
+ size="mini"
|
|
|
+ v-model="query.dealStatus"
|
|
|
+ clearable
|
|
|
+ @change="searchData"
|
|
|
+ >
|
|
|
<el-option :value="'1'" label="已处理"></el-option>
|
|
|
<el-option :value="'0'" label="未处理"></el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="search-item">
|
|
|
<span class="search-label">恢复状态:</span>
|
|
|
- <el-select size="mini" v-model="query.recoveryStatus" clearable @change="searchData">
|
|
|
+ <el-select
|
|
|
+ size="mini"
|
|
|
+ v-model="query.recoveryStatus"
|
|
|
+ clearable
|
|
|
+ @change="searchData"
|
|
|
+ >
|
|
|
<el-option :value="'1'" label="已恢复"></el-option>
|
|
|
<el-option :value="'0'" label="未恢复"></el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="search-btn" @click="searchData">
|
|
|
- <img :src="require('@/assets/imgs/dialog/icon_close.png')" alt="查询" />
|
|
|
+ <img
|
|
|
+ :src="require('@/assets/imgs/dialog/icon_close.png')"
|
|
|
+ alt="查询"
|
|
|
+ />
|
|
|
</div>
|
|
|
<div class="search-btn" @click="handleReset">
|
|
|
- <img :src="require('@/assets/imgs/dialog/icon_reset.png')" alt="重置" />
|
|
|
+ <img
|
|
|
+ :src="require('@/assets/imgs/dialog/icon_reset.png')"
|
|
|
+ alt="重置"
|
|
|
+ />
|
|
|
</div>
|
|
|
<div class="search-btn2" @click="exportData">
|
|
|
<el-button size="mini" type="success">导出</el-button>
|
|
|
</div>
|
|
|
<div class="search-btn2">
|
|
|
- <el-button size="mini" type="success" @click="handleConfirmMulti">批量确认</el-button>
|
|
|
+ <el-button size="mini" type="success" @click="handleConfirmMulti"
|
|
|
+ >批量确认</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
<div class="search-btn2">
|
|
|
- <el-button size="mini" type="success" @click="handleDealMulti">批量处理</el-button>
|
|
|
+ <el-button size="mini" type="success" @click="handleDealMulti"
|
|
|
+ >批量处理</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 内容 -->
|
|
@@ -129,7 +164,11 @@
|
|
|
transition: 'width 0.8s',
|
|
|
}"
|
|
|
>
|
|
|
- <img class="split-line" :src="require('@/assets/imgs/btn_take back@2x.png')" @click="hideDetail" />
|
|
|
+ <img
|
|
|
+ class="split-line"
|
|
|
+ :src="require('@/assets/imgs/btn_take back@2x.png')"
|
|
|
+ @click="hideDetail"
|
|
|
+ />
|
|
|
<div class="detail-content-box">
|
|
|
<div class="detail-title">
|
|
|
<img :src="require('@/assets/imgs/img_round@2x.png')" />
|
|
@@ -138,7 +177,9 @@
|
|
|
<div class="detail-content">
|
|
|
<div class="detail-item">
|
|
|
<span class="detail-label">报警位号:</span>
|
|
|
- <span class="detail-text">{{ curAlarmDetail.alarmTagName }}</span>
|
|
|
+ <span class="detail-text">{{
|
|
|
+ curAlarmDetail.alarmTagName
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
<div class="detail-item">
|
|
|
<span class="detail-label">报警内容:</span>
|
|
@@ -150,7 +191,9 @@
|
|
|
</div>
|
|
|
<div class="detail-item">
|
|
|
<span class="detail-label">报警类型:</span>
|
|
|
- <span class="detail-text">{{ curAlarmDetail.categoryStr }}</span>
|
|
|
+ <span class="detail-text">{{
|
|
|
+ curAlarmDetail.categoryStr
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
<div class="detail-item">
|
|
|
<span class="detail-label">报警时间:</span>
|
|
@@ -158,19 +201,27 @@
|
|
|
</div>
|
|
|
<div class="detail-item">
|
|
|
<span class="detail-label">确认状态:</span>
|
|
|
- <span class="detail-text">{{ curAlarmDetail.confirmStatusStr }}</span>
|
|
|
+ <span class="detail-text">{{
|
|
|
+ curAlarmDetail.confirmStatusStr
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
<div class="detail-item">
|
|
|
<span class="detail-label">确认时间:</span>
|
|
|
- <span class="detail-text">{{ curAlarmDetail.confirmTime }}</span>
|
|
|
+ <span class="detail-text">{{
|
|
|
+ curAlarmDetail.confirmTime
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
<div class="detail-item">
|
|
|
<span class="detail-label">确认人:</span>
|
|
|
- <span class="detail-text">{{ curAlarmDetail.confirmPersonName }}</span>
|
|
|
+ <span class="detail-text">{{
|
|
|
+ curAlarmDetail.confirmPersonName
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
<div class="detail-item">
|
|
|
<span class="detail-label">处理状态:</span>
|
|
|
- <span class="detail-text">{{ curAlarmDetail.dealStatusStr }}</span>
|
|
|
+ <span class="detail-text">{{
|
|
|
+ curAlarmDetail.dealStatusStr
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
<div class="detail-item">
|
|
|
<span class="detail-label">处理时间:</span>
|
|
@@ -178,24 +229,38 @@
|
|
|
</div>
|
|
|
<div class="detail-item">
|
|
|
<span class="detail-label">处理人:</span>
|
|
|
- <span class="detail-text">{{ curAlarmDetail.dealPersonName }}</span>
|
|
|
+ <span class="detail-text">{{
|
|
|
+ curAlarmDetail.dealPersonName
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
<div class="detail-item">
|
|
|
<span class="detail-label">恢复状态:</span>
|
|
|
- <span class="detail-text">{{ curAlarmDetail.recoveryStatusStr }}</span>
|
|
|
+ <span class="detail-text">{{
|
|
|
+ curAlarmDetail.recoveryStatusStr
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
<div class="detail-item">
|
|
|
<span class="detail-label">恢复时间:</span>
|
|
|
- <span class="detail-text">{{ curAlarmDetail.recoveryTime }}</span>
|
|
|
+ <span class="detail-text">{{
|
|
|
+ curAlarmDetail.recoveryTime
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
<div class="detail-item">
|
|
|
<span class="detail-label">处理方式:</span>
|
|
|
<span class="detail-text">
|
|
|
<el-radio-group v-model="curAlarmDetail.dataType">
|
|
|
- <el-radio :label="0" style="color: #fff !important">正常</el-radio>
|
|
|
- <el-radio :label="1" style="color: #fff !important">误报</el-radio>
|
|
|
- <el-radio :label="2" style="color: #fff !important">测试</el-radio>
|
|
|
- <el-radio :label="3" style="color: #fff !important">抑制</el-radio>
|
|
|
+ <el-radio :label="0" style="color: #fff !important"
|
|
|
+ >正常</el-radio
|
|
|
+ >
|
|
|
+ <el-radio :label="1" style="color: #fff !important"
|
|
|
+ >误报</el-radio
|
|
|
+ >
|
|
|
+ <el-radio :label="2" style="color: #fff !important"
|
|
|
+ >测试</el-radio
|
|
|
+ >
|
|
|
+ <el-radio :label="3" style="color: #fff !important"
|
|
|
+ >抑制</el-radio
|
|
|
+ >
|
|
|
</el-radio-group>
|
|
|
</span>
|
|
|
</div>
|
|
@@ -216,8 +281,16 @@
|
|
|
<div class="image-box">
|
|
|
<el-image
|
|
|
fit="contain"
|
|
|
- :src="`${BASE_URL}${curAlarmDetail.imageUrl.replace('\/\/', '/')}`"
|
|
|
- :preview-src-list="[`${BASE_URL}${curAlarmDetail.imageUrl.replace('\/\/', '/')}`]"
|
|
|
+ :src="`${BASE_URL}${curAlarmDetail.imageUrl.replace(
|
|
|
+ '\/\/',
|
|
|
+ '/'
|
|
|
+ )}`"
|
|
|
+ :preview-src-list="[
|
|
|
+ `${BASE_URL}${curAlarmDetail.imageUrl.replace(
|
|
|
+ '\/\/',
|
|
|
+ '/'
|
|
|
+ )}`,
|
|
|
+ ]"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -231,20 +304,34 @@
|
|
|
>
|
|
|
确认
|
|
|
</el-button>
|
|
|
- <el-button class="btn-handle" size="mini" @click="handleDeal" v-show="curAlarmDetail.dealStatus == '0'">
|
|
|
+ <el-button
|
|
|
+ class="btn-handle"
|
|
|
+ size="mini"
|
|
|
+ @click="handleDeal"
|
|
|
+ v-show="curAlarmDetail.dealStatus == '0'"
|
|
|
+ >
|
|
|
处理
|
|
|
</el-button>
|
|
|
- <el-button class="btn-cancel" size="mini" @click="handleClose">取消</el-button>
|
|
|
+ <el-button class="btn-cancel" size="mini" @click="handleClose"
|
|
|
+ >取消</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="page-box">
|
|
|
- <base-pagination :pageInfo="pageConfig" @pageChange="getAlarmDataList"></base-pagination>
|
|
|
+ <base-pagination
|
|
|
+ :pageInfo="pageConfig"
|
|
|
+ @pageChange="getAlarmDataList"
|
|
|
+ ></base-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <deal-multi-dialog :dialogConfig="dealMultiDialogConfig"></deal-multi-dialog>
|
|
|
- <confirm-multi-dialog :dialogConfig="confirmMultiDialogConfig"></confirm-multi-dialog>
|
|
|
+ <deal-multi-dialog
|
|
|
+ :dialogConfig="dealMultiDialogConfig"
|
|
|
+ ></deal-multi-dialog>
|
|
|
+ <confirm-multi-dialog
|
|
|
+ :dialogConfig="confirmMultiDialogConfig"
|
|
|
+ ></confirm-multi-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -257,18 +344,18 @@ import {
|
|
|
getDepartmentByPid,
|
|
|
download,
|
|
|
exportData,
|
|
|
-} from '@/API/alarm'
|
|
|
-import { getDictDetailByType } from '@/API/dict'
|
|
|
-import { downloadFile } from '@/utils/index'
|
|
|
-import Dayjs from 'dayjs'
|
|
|
-import BaseTableList from '@/views/components/base/BaseTableList.vue'
|
|
|
-import BasePagination from '@/views/components/base/BasePagination.vue'
|
|
|
-import DealMultiDialog from '@/views/alarm/alarmList/components/DealMultiDialog.vue'
|
|
|
-import ConfirmMultiDialog from '@/views/alarm/alarmList/components/ConfirmMultiDialog.vue'
|
|
|
-import { calendarShortcuts } from '@/utils/shortcuts'
|
|
|
-import { add } from 'lodash-es'
|
|
|
+} from "@/API/alarm";
|
|
|
+import { getDictDetailByType } from "@/API/dict";
|
|
|
+import { downloadFile } from "@/utils/index";
|
|
|
+import Dayjs from "dayjs";
|
|
|
+import BaseTableList from "@/views/components/base/BaseTableList.vue";
|
|
|
+import BasePagination from "@/views/components/base/BasePagination.vue";
|
|
|
+import DealMultiDialog from "@/views/alarm/alarmList/components/DealMultiDialog.vue";
|
|
|
+import ConfirmMultiDialog from "@/views/alarm/alarmList/components/ConfirmMultiDialog.vue";
|
|
|
+import { calendarShortcuts } from "@/utils/shortcuts";
|
|
|
+import { add } from "lodash-es";
|
|
|
export default {
|
|
|
- name: 'AlarmList',
|
|
|
+ name: "AlarmList",
|
|
|
components: {
|
|
|
BaseTableList,
|
|
|
BasePagination,
|
|
@@ -277,20 +364,21 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ timer: new Date().getTime(),
|
|
|
query: {
|
|
|
time: [
|
|
|
- Dayjs(new Date()).subtract(1, 'month').format('YYYY-MM-DD HH:mm:ss'),
|
|
|
- Dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
+ Dayjs(new Date()).subtract(1, "month").format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ Dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
|
|
],
|
|
|
- category: '',
|
|
|
- level: '',
|
|
|
- dealStatus: '',
|
|
|
- confirmStatus: '',
|
|
|
- type: '',
|
|
|
- key: '',
|
|
|
- tag: '',
|
|
|
- recoveryStatus: '',
|
|
|
- departmentId: '',
|
|
|
+ category: "",
|
|
|
+ level: "",
|
|
|
+ dealStatus: "",
|
|
|
+ confirmStatus: "",
|
|
|
+ type: "",
|
|
|
+ key: "",
|
|
|
+ tag: "",
|
|
|
+ recoveryStatus: "",
|
|
|
+ departmentId: "",
|
|
|
},
|
|
|
pageConfig: {
|
|
|
pageNo: 1,
|
|
@@ -303,18 +391,18 @@ export default {
|
|
|
// rowHeight: 42,
|
|
|
// rowSpacing: 12,
|
|
|
header: [
|
|
|
- { title: '报警时间', prop: 'eventTime', width: '' },
|
|
|
- { title: '报警位号', prop: 'alarmTagName', width: '' },
|
|
|
- { title: '报警分类', prop: 'categoryStr', width: '' },
|
|
|
- { title: '报警级别', prop: 'levelStr', width: '' },
|
|
|
- { title: '报警内容', prop: 'content', width: '40%' },
|
|
|
- { title: '确认状态', prop: 'confirmStatusStr', width: '' },
|
|
|
- { title: '处理状态', prop: 'dealStatusStr', width: '' },
|
|
|
- { title: '恢复状态', prop: 'recoveryStatusStr', width: '' },
|
|
|
+ { title: "报警时间", prop: "eventTime", width: "" },
|
|
|
+ { title: "报警位号", prop: "alarmTagName", width: "" },
|
|
|
+ { title: "报警分类", prop: "categoryStr", width: "" },
|
|
|
+ { title: "报警级别", prop: "levelStr", width: "" },
|
|
|
+ { title: "报警内容", prop: "content", width: "40%" },
|
|
|
+ { title: "确认状态", prop: "confirmStatusStr", width: "" },
|
|
|
+ { title: "处理状态", prop: "dealStatusStr", width: "" },
|
|
|
+ { title: "恢复状态", prop: "recoveryStatusStr", width: "" },
|
|
|
],
|
|
|
tableData: [],
|
|
|
- rowClick: row => {
|
|
|
- this.showDetail(row)
|
|
|
+ rowClick: (row) => {
|
|
|
+ this.showDetail(row);
|
|
|
},
|
|
|
},
|
|
|
categoryOptions: [],
|
|
@@ -327,59 +415,140 @@ export default {
|
|
|
curAlarmDetail: {},
|
|
|
dealMultiDialogConfig: {},
|
|
|
confirmMultiDialogConfig: {},
|
|
|
- }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ $route(to, from) {
|
|
|
+ // console.log(from, "前from,后to", to);
|
|
|
+ console.log(this.$route);
|
|
|
+ if (this.$route.query) {
|
|
|
+ if (this.$route.query.dateRange == "24H") {
|
|
|
+ this.query.time = [
|
|
|
+ Dayjs(new Date()).subtract(1, "day").format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ Dayjs(new Date()).format("YYYY-MM-DD 23:59:59"),
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ if (!!this.$route.query.date) {
|
|
|
+ console.log(
|
|
|
+ Dayjs(
|
|
|
+ this.$route.query.date
|
|
|
+ .replace("年", "-")
|
|
|
+ .replace("月", "-")
|
|
|
+ .replace("日", "")
|
|
|
+ )
|
|
|
+ );
|
|
|
+ this.query.time = [
|
|
|
+ Dayjs(
|
|
|
+ this.$route.query.date
|
|
|
+ .replace("年", "-")
|
|
|
+ .replace("月", "-")
|
|
|
+ .replace("日", "")
|
|
|
+ ).format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ Dayjs(
|
|
|
+ this.$route.query.date
|
|
|
+ .replace("年", "-")
|
|
|
+ .replace("月", "-")
|
|
|
+ .replace("日", "")
|
|
|
+ )
|
|
|
+ .add(1, "day")
|
|
|
+ .subtract(1, "second")
|
|
|
+ .format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ if (!!this.$route.query.confirmStatus) {
|
|
|
+ this.query.confirmStatus = this.$route.query.confirmStatus;
|
|
|
+ }
|
|
|
+ if (!!this.$route.query.dealStatus) {
|
|
|
+ this.query.dealStatus = this.$route.query.dealStatus;
|
|
|
+ }
|
|
|
+ if (!!this.$route.query.level) {
|
|
|
+ this.query.level = this.$route.query.level;
|
|
|
+ }
|
|
|
+ if (!!this.$route.query.recoveryStatus) {
|
|
|
+ this.query.recoveryStatus = this.$route.query.recoveryStatus;
|
|
|
+ }
|
|
|
+ if (!!this.$route.query.category) {
|
|
|
+ this.query.category = this.$route.query.category;
|
|
|
+ } else {
|
|
|
+ this.query.category = "";
|
|
|
+ }
|
|
|
+ if (!!this.$route.query.departmentId) {
|
|
|
+ if (typeof this.$route.query.departmentId === "string") {
|
|
|
+ this.query.departmentId = new Array(this.$route.query.departmentId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.getAlarmCategory();
|
|
|
+ this.getAlarmDataList();
|
|
|
+ this.getDepartmentByPid();
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
- console.log(this.$route)
|
|
|
- if (this.$route.query.dateRange == '24H') {
|
|
|
+ console.log(this.$route);
|
|
|
+ if (this.$route.query.dateRange == "24H") {
|
|
|
this.query.time = [
|
|
|
- Dayjs(new Date()).subtract(1, 'day').format('YYYY-MM-DD HH:mm:ss'),
|
|
|
- Dayjs(new Date()).format('YYYY-MM-DD 23:59:59'),
|
|
|
- ]
|
|
|
+ Dayjs(new Date()).subtract(1, "day").format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ Dayjs(new Date()).format("YYYY-MM-DD 23:59:59"),
|
|
|
+ ];
|
|
|
}
|
|
|
if (!!this.$route.query.date) {
|
|
|
- console.log(Dayjs(this.$route.query.date.replace('年', '-').replace('月', '-').replace('日', '')))
|
|
|
+ console.log(
|
|
|
+ Dayjs(
|
|
|
+ this.$route.query.date
|
|
|
+ .replace("年", "-")
|
|
|
+ .replace("月", "-")
|
|
|
+ .replace("日", "")
|
|
|
+ )
|
|
|
+ );
|
|
|
this.query.time = [
|
|
|
- Dayjs(this.$route.query.date.replace('年', '-').replace('月', '-').replace('日', '')).format(
|
|
|
- 'YYYY-MM-DD HH:mm:ss'
|
|
|
- ),
|
|
|
- Dayjs(this.$route.query.date.replace('年', '-').replace('月', '-').replace('日', ''))
|
|
|
- .add(1, 'day')
|
|
|
- .subtract(1, 'second')
|
|
|
- .format('YYYY-MM-DD HH:mm:ss'),
|
|
|
- ]
|
|
|
+ Dayjs(
|
|
|
+ this.$route.query.date
|
|
|
+ .replace("年", "-")
|
|
|
+ .replace("月", "-")
|
|
|
+ .replace("日", "")
|
|
|
+ ).format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ Dayjs(
|
|
|
+ this.$route.query.date
|
|
|
+ .replace("年", "-")
|
|
|
+ .replace("月", "-")
|
|
|
+ .replace("日", "")
|
|
|
+ )
|
|
|
+ .add(1, "day")
|
|
|
+ .subtract(1, "second")
|
|
|
+ .format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ ];
|
|
|
}
|
|
|
if (!!this.$route.query.confirmStatus) {
|
|
|
- this.query.confirmStatus = this.$route.query.confirmStatus
|
|
|
+ this.query.confirmStatus = this.$route.query.confirmStatus;
|
|
|
}
|
|
|
if (!!this.$route.query.dealStatus) {
|
|
|
- this.query.dealStatus = this.$route.query.dealStatus
|
|
|
+ this.query.dealStatus = this.$route.query.dealStatus;
|
|
|
}
|
|
|
if (!!this.$route.query.level) {
|
|
|
- this.query.level = this.$route.query.level
|
|
|
+ this.query.level = this.$route.query.level;
|
|
|
}
|
|
|
if (!!this.$route.query.recoveryStatus) {
|
|
|
- this.query.recoveryStatus = this.$route.query.recoveryStatus
|
|
|
+ this.query.recoveryStatus = this.$route.query.recoveryStatus;
|
|
|
}
|
|
|
if (!!this.$route.query.category) {
|
|
|
- this.query.category = this.$route.query.category
|
|
|
+ this.query.category = this.$route.query.category;
|
|
|
}
|
|
|
if (!!this.$route.query.departmentId) {
|
|
|
- if (typeof this.$route.query.departmentId === 'string') {
|
|
|
- this.query.departmentId = new Array(this.$route.query.departmentId)
|
|
|
+ if (typeof this.$route.query.departmentId === "string") {
|
|
|
+ this.query.departmentId = new Array(this.$route.query.departmentId);
|
|
|
}
|
|
|
}
|
|
|
// if (!!this.$route.query.station) {
|
|
|
// this.query.key = this.$route.query.station;
|
|
|
// }
|
|
|
- this.getAlarmCategory()
|
|
|
- this.getAlarmDataList()
|
|
|
- this.getDepartmentByPid()
|
|
|
+ this.getAlarmCategory();
|
|
|
+ this.getAlarmDataList();
|
|
|
+ this.getDepartmentByPid();
|
|
|
},
|
|
|
methods: {
|
|
|
searchData() {
|
|
|
- this.pageConfig.pageNo = 1
|
|
|
- this.getAlarmDataList()
|
|
|
+ this.pageConfig.pageNo = 1;
|
|
|
+ this.getAlarmDataList();
|
|
|
},
|
|
|
exportData() {
|
|
|
const params = {
|
|
@@ -396,30 +565,32 @@ export default {
|
|
|
key: this.query.key,
|
|
|
tag: this.query.tag,
|
|
|
departmentId:
|
|
|
- this.query.departmentId.length > 0 ? this.query.departmentId[this.query.departmentId.length - 1] : '',
|
|
|
- }
|
|
|
+ this.query.departmentId.length > 0
|
|
|
+ ? this.query.departmentId[this.query.departmentId.length - 1]
|
|
|
+ : "",
|
|
|
+ };
|
|
|
exportData(params)
|
|
|
- .then(res => {
|
|
|
+ .then((res) => {
|
|
|
if (res.code === 20000) {
|
|
|
download({ filePath: res.data, prefix: true })
|
|
|
- .then(result => {
|
|
|
- downloadFile(result.data)
|
|
|
+ .then((result) => {
|
|
|
+ downloadFile(result.data);
|
|
|
//crud.exportLoading = false;
|
|
|
})
|
|
|
- .catch(error => {
|
|
|
- console.error(error)
|
|
|
+ .catch((error) => {
|
|
|
+ console.error(error);
|
|
|
//crud.exportLoading = false;
|
|
|
- })
|
|
|
+ });
|
|
|
|
|
|
//window.location.href = 'file/downloadFile?filePath=' + res.data + '&delete=1'
|
|
|
} else {
|
|
|
- this.$message.error(res.msg)
|
|
|
+ this.$message.error(res.msg);
|
|
|
}
|
|
|
})
|
|
|
- .catch(error => {
|
|
|
- console.error(error)
|
|
|
+ .catch((error) => {
|
|
|
+ console.error(error);
|
|
|
//crud.exportLoading = false;
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
async getAlarmDataList() {
|
|
|
try {
|
|
@@ -437,10 +608,12 @@ export default {
|
|
|
key: this.query.key,
|
|
|
tag: this.query.tag,
|
|
|
departmentId:
|
|
|
- this.query.departmentId.length > 0 ? this.query.departmentId[this.query.departmentId.length - 1] : '',
|
|
|
- }
|
|
|
- const res = await getAlarmDataList(params)
|
|
|
- let alarmData = res.data.content
|
|
|
+ this.query.departmentId.length > 0
|
|
|
+ ? this.query.departmentId[this.query.departmentId.length - 1]
|
|
|
+ : "",
|
|
|
+ };
|
|
|
+ const res = await getAlarmDataList(params);
|
|
|
+ let alarmData = res.data.content;
|
|
|
// alarmData.push({
|
|
|
// eventTime: "2022-12-22 10:12:13",
|
|
|
// category: "1",
|
|
@@ -448,60 +621,60 @@ export default {
|
|
|
// dealStatus: "1",
|
|
|
// imageUrl: "",
|
|
|
// });
|
|
|
- this.tableConfig.tableData = alarmData
|
|
|
- this.pageConfig.pageTotal = res.data.total || alarmData.length
|
|
|
+ this.tableConfig.tableData = alarmData;
|
|
|
+ this.pageConfig.pageTotal = res.data.total || alarmData.length;
|
|
|
// console.log(alarmData);
|
|
|
} catch (err) {}
|
|
|
},
|
|
|
async getAlarmCount() {
|
|
|
try {
|
|
|
- const res = await getAlarmCount()
|
|
|
- const { content } = res.data
|
|
|
- this.categoryOptions = content
|
|
|
+ const res = await getAlarmCount();
|
|
|
+ const { content } = res.data;
|
|
|
+ this.categoryOptions = content;
|
|
|
} catch (err) {
|
|
|
- console.log(err)
|
|
|
+ console.log(err);
|
|
|
}
|
|
|
},
|
|
|
async getAlarmCategory() {
|
|
|
try {
|
|
|
- const param = { dictType: '100' }
|
|
|
- const res = await getDictDetailByType(param)
|
|
|
- const { content } = res.data
|
|
|
- this.categoryOptions = content
|
|
|
+ const param = { dictType: "100" };
|
|
|
+ const res = await getDictDetailByType(param);
|
|
|
+ const { content } = res.data;
|
|
|
+ this.categoryOptions = content;
|
|
|
} catch (err) {
|
|
|
- console.log(err)
|
|
|
+ console.log(err);
|
|
|
}
|
|
|
},
|
|
|
async getAlarmType(category) {
|
|
|
- this.query.type = ''
|
|
|
- this.alarmTypeOptions = []
|
|
|
- if (!category) return
|
|
|
+ this.query.type = "";
|
|
|
+ this.alarmTypeOptions = [];
|
|
|
+ if (!category) return;
|
|
|
try {
|
|
|
- const res = await getAlarmType({ category })
|
|
|
- const { content } = res.data
|
|
|
- this.alarmTypeOptions = content
|
|
|
+ const res = await getAlarmType({ category });
|
|
|
+ const { content } = res.data;
|
|
|
+ this.alarmTypeOptions = content;
|
|
|
} catch (err) {
|
|
|
- console.log(err)
|
|
|
+ console.log(err);
|
|
|
}
|
|
|
},
|
|
|
async getDepartmentByPid() {
|
|
|
try {
|
|
|
- const p = { id: '0' }
|
|
|
- const res = await getDepartmentByPid(p)
|
|
|
- let { content } = res.data
|
|
|
- content.forEach(element => {
|
|
|
- element.value = element.id
|
|
|
- element.label = element.departmentName
|
|
|
+ const p = { id: "0" };
|
|
|
+ const res = await getDepartmentByPid(p);
|
|
|
+ let { content } = res.data;
|
|
|
+ content.forEach((element) => {
|
|
|
+ element.value = element.id;
|
|
|
+ element.label = element.departmentName;
|
|
|
if (element.children) {
|
|
|
- element.children.forEach(element2 => {
|
|
|
- element2.value = element2.id
|
|
|
- element2.label = element2.departmentName
|
|
|
- })
|
|
|
+ element.children.forEach((element2) => {
|
|
|
+ element2.value = element2.id;
|
|
|
+ element2.label = element2.departmentName;
|
|
|
+ });
|
|
|
}
|
|
|
- })
|
|
|
- this.departmentOptions = content
|
|
|
+ });
|
|
|
+ this.departmentOptions = content;
|
|
|
} catch (err) {
|
|
|
- console.log(err)
|
|
|
+ console.log(err);
|
|
|
}
|
|
|
},
|
|
|
async dealAlarm() {
|
|
@@ -509,71 +682,71 @@ export default {
|
|
|
id: this.curAlarmDetail.id,
|
|
|
dealContent: this.curAlarmDetail.dealContent,
|
|
|
dataType: this.curAlarmDetail.dataType,
|
|
|
- }
|
|
|
+ };
|
|
|
try {
|
|
|
- const res = await dealAlarm(params)
|
|
|
+ const res = await dealAlarm(params);
|
|
|
if (res.code == 20000) {
|
|
|
- this.hideDetail()
|
|
|
- this.getAlarmDataList()
|
|
|
+ this.hideDetail();
|
|
|
+ this.getAlarmDataList();
|
|
|
this.$message({
|
|
|
- message: '处理完成',
|
|
|
- type: 'success',
|
|
|
- })
|
|
|
+ message: "处理完成",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
}
|
|
|
} catch (err) {
|
|
|
- console.log(err)
|
|
|
+ console.log(err);
|
|
|
}
|
|
|
},
|
|
|
async confirmAlarm() {
|
|
|
const params = {
|
|
|
id: this.curAlarmDetail.id,
|
|
|
dealContent: this.curAlarmDetail.dealContent,
|
|
|
- }
|
|
|
+ };
|
|
|
try {
|
|
|
- const res = await confirmAlarm(params)
|
|
|
+ const res = await confirmAlarm(params);
|
|
|
if (res.code == 20000) {
|
|
|
- this.hideDetail()
|
|
|
- this.getAlarmDataList()
|
|
|
+ this.hideDetail();
|
|
|
+ this.getAlarmDataList();
|
|
|
this.$message({
|
|
|
- message: '确认完成',
|
|
|
- type: 'success',
|
|
|
- })
|
|
|
+ message: "确认完成",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
}
|
|
|
} catch (err) {
|
|
|
- console.log(err)
|
|
|
+ console.log(err);
|
|
|
}
|
|
|
},
|
|
|
handleReset() {
|
|
|
this.query = {
|
|
|
time: [
|
|
|
- Dayjs(new Date()).subtract(1, 'month').format('YYYY-MM-DD HH:mm:ss'),
|
|
|
- Dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
+ Dayjs(new Date()).subtract(1, "month").format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ Dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
|
|
],
|
|
|
- category: '',
|
|
|
- dealStatus: '',
|
|
|
- type: '',
|
|
|
- }
|
|
|
- this.searchData()
|
|
|
+ category: "",
|
|
|
+ dealStatus: "",
|
|
|
+ type: "",
|
|
|
+ };
|
|
|
+ this.searchData();
|
|
|
},
|
|
|
showDetail(row) {
|
|
|
- console.log(row)
|
|
|
- this.detailShow = true
|
|
|
- this.curAlarmDetail = row
|
|
|
+ console.log(row);
|
|
|
+ this.detailShow = true;
|
|
|
+ this.curAlarmDetail = row;
|
|
|
},
|
|
|
hideDetail() {
|
|
|
- this.detailShow = false
|
|
|
- this.curAlarmDetail = {}
|
|
|
+ this.detailShow = false;
|
|
|
+ this.curAlarmDetail = {};
|
|
|
},
|
|
|
handleDeal() {
|
|
|
- console.log(this.curAlarmDetail)
|
|
|
- this.dealAlarm()
|
|
|
+ console.log(this.curAlarmDetail);
|
|
|
+ this.dealAlarm();
|
|
|
},
|
|
|
handleConfirm() {
|
|
|
- console.log(this.curAlarmDetail)
|
|
|
- this.confirmAlarm()
|
|
|
+ console.log(this.curAlarmDetail);
|
|
|
+ this.confirmAlarm();
|
|
|
},
|
|
|
handleClose() {
|
|
|
- this.hideDetail()
|
|
|
+ this.hideDetail();
|
|
|
},
|
|
|
handleDealMulti() {
|
|
|
// this.$confirm("确认退出该系统?", "提示", {
|
|
@@ -587,19 +760,19 @@ export default {
|
|
|
// window.location.reload();
|
|
|
// });
|
|
|
let ids = this.tableConfig.tableData.map((obj, index) => {
|
|
|
- return obj.id
|
|
|
- })
|
|
|
+ return obj.id;
|
|
|
+ });
|
|
|
let dialogConfig = {
|
|
|
- dialogId: 'dealMultiDialog',
|
|
|
+ dialogId: "dealMultiDialog",
|
|
|
show: true, //是否显示
|
|
|
- title: '批量处理',
|
|
|
+ title: "批量处理",
|
|
|
width: 500, //px宽度
|
|
|
height: 320, //px高度
|
|
|
center: true, //是否居中定位
|
|
|
zIndex: 10,
|
|
|
data: { ids },
|
|
|
- }
|
|
|
- this.dealMultiDialogConfig = dialogConfig
|
|
|
+ };
|
|
|
+ this.dealMultiDialogConfig = dialogConfig;
|
|
|
},
|
|
|
handleConfirmMulti() {
|
|
|
// this.$confirm("确认退出该系统?", "提示", {
|
|
@@ -613,22 +786,22 @@ export default {
|
|
|
// window.location.reload();
|
|
|
// });
|
|
|
let ids = this.tableConfig.tableData.map((obj, index) => {
|
|
|
- return obj.id
|
|
|
- })
|
|
|
+ return obj.id;
|
|
|
+ });
|
|
|
let dialogConfig = {
|
|
|
- dialogId: 'confirmMultiDialog',
|
|
|
+ dialogId: "confirmMultiDialog",
|
|
|
show: true, //是否显示
|
|
|
- title: '批量确认',
|
|
|
+ title: "批量确认",
|
|
|
width: 500, //px宽度
|
|
|
height: 320, //px高度
|
|
|
center: true, //是否居中定位
|
|
|
zIndex: 10,
|
|
|
data: { ids },
|
|
|
- }
|
|
|
- this.confirmMultiDialogConfig = dialogConfig
|
|
|
+ };
|
|
|
+ this.confirmMultiDialogConfig = dialogConfig;
|
|
|
},
|
|
|
},
|
|
|
-}
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
.alarmList-container {
|