|
|
@@ -26,20 +26,99 @@
|
|
|
:datasource="datasource"
|
|
|
cache-key="systemRoleTable"
|
|
|
>
|
|
|
+ <template v-slot:action="{ row }">
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="openEdit(row)"
|
|
|
+ v-if="
|
|
|
+ !row.handleStatus && $hasPermission('eam:alarmlogsheet:update')
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 处理
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ <template v-slot:triggerCount="{ row }">
|
|
|
+ <el-link type="primary" :underline="false" @click="triggerCount(row)">
|
|
|
+ {{ row.triggerCount }}
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ <template v-slot:deviceName="{ row }">
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ @click="openEdit(row, 'view')"
|
|
|
+ >
|
|
|
+ {{ row.deviceName }}
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
</ele-pro-table>
|
|
|
</el-card>
|
|
|
+ <processDialog ref="processDialogRef" @reload="reload"></processDialog>
|
|
|
+
|
|
|
+ <!-- 告警次数详情弹窗 -->
|
|
|
+ <el-dialog
|
|
|
+ title="告警详情"
|
|
|
+ :visible.sync="triggerDialogVisible"
|
|
|
+ width="70%"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <el-table :data="triggerList" border style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ type="index"
|
|
|
+ label="序号"
|
|
|
+ width="55"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="description"
|
|
|
+ label="告警描述"
|
|
|
+ align="center"
|
|
|
+ show-overflow-tooltip
|
|
|
+ min-width="180"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="triggerTime"
|
|
|
+ label="告警时间"
|
|
|
+ align="center"
|
|
|
+ show-overflow-tooltip
|
|
|
+ min-width="160"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="告警内容"
|
|
|
+ align="center"
|
|
|
+ show-overflow-tooltip
|
|
|
+ min-width="200"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <div v-if="row._deviceData && row._deviceData.length">
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in row._deviceData"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ 告警值:{{ item.attributeName }} {{ item.value }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import MessageSearch from './components/message-search.vue';
|
|
|
- import { alarmlogsheetPage } from '@/api/warning/index.js';
|
|
|
+ import processDialog from './components/processDialog.vue';
|
|
|
+ import { alarmlogsheetPage,getDetail } from '@/api/warning/index.js';
|
|
|
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
export default {
|
|
|
mixins: [dictMixins],
|
|
|
components: {
|
|
|
- MessageSearch
|
|
|
+ MessageSearch,
|
|
|
+ processDialog
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -59,7 +138,7 @@
|
|
|
label: '告警级别',
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true,
|
|
|
- minWidth: 110,
|
|
|
+ minWidth: 80,
|
|
|
formatter: (_row, _column, cellValue) => {
|
|
|
const map = {
|
|
|
1: '轻微',
|
|
|
@@ -81,9 +160,10 @@
|
|
|
{
|
|
|
prop: 'deviceName',
|
|
|
label: '设备名称',
|
|
|
+ slot: 'deviceName',
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
+ minWidth: 200
|
|
|
},
|
|
|
{
|
|
|
prop: 'description',
|
|
|
@@ -125,25 +205,72 @@
|
|
|
minWidth: 110
|
|
|
},
|
|
|
{
|
|
|
- prop: 'remark',
|
|
|
- label: '备注',
|
|
|
+ prop: 'triggerCount',
|
|
|
+ slot: 'triggerCount',
|
|
|
+ label: '告警次数',
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true,
|
|
|
minWidth: 110
|
|
|
},
|
|
|
{
|
|
|
prop: 'alarmTime',
|
|
|
- label: '告警时间',
|
|
|
+ label: '首次告警时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 160,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return this.$util.toDateString(cellValue);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'lastTriggerTime',
|
|
|
+ label: '最近告警时间',
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true,
|
|
|
minWidth: 160,
|
|
|
formatter: (_row, _column, cellValue) => {
|
|
|
return this.$util.toDateString(cellValue);
|
|
|
}
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'handleStatus',
|
|
|
+ label: '处理状态',
|
|
|
+ align: 'center',
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return { 0: '未处理', 1: '处理中', 2: '已处理' }[cellValue];
|
|
|
+ },
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'handleUserName',
|
|
|
+ label: '处理人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'remark',
|
|
|
+ label: '处理意见',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 150,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ slot: 'action',
|
|
|
+ showOverflowTooltip: true
|
|
|
}
|
|
|
],
|
|
|
// 加载状态
|
|
|
- loading: false
|
|
|
+ loading: false,
|
|
|
+ triggerDialogVisible: false,
|
|
|
+ triggerList: []
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
|
@@ -159,7 +286,31 @@
|
|
|
...where
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
+ openEdit(row, type) {
|
|
|
+ this.$refs.processDialogRef.open(row, type);
|
|
|
+ },
|
|
|
+ triggerCount(row) {
|
|
|
+ getDetail(row.id).then((res) => {
|
|
|
+ let list = Array.isArray(res) ? res : [];
|
|
|
+ list = list.map((item) => {
|
|
|
+ let deviceDataArr = [];
|
|
|
+ if (item.deviceData) {
|
|
|
+ try {
|
|
|
+ const parsed = JSON.parse(item.deviceData);
|
|
|
+ deviceDataArr = Array.isArray(parsed) ? parsed : [];
|
|
|
+ } catch (e) {
|
|
|
+ deviceDataArr = [];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ _deviceData: deviceDataArr
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.triggerList = list;
|
|
|
+ this.triggerDialogVisible = true;
|
|
|
+ });
|
|
|
+ },
|
|
|
/* 刷新表格 */
|
|
|
reload(where) {
|
|
|
this.$refs.table.reload({ page: 1, where, ruleType: 2 });
|