|
|
@@ -61,10 +61,10 @@
|
|
|
>
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
<template v-if="column.dataIndex === 'alarmLevel'">
|
|
|
- {{ getDictLabel(record.alarmLevel, alarmLevel.value) }}
|
|
|
+ {{ levelLabel(record.alarmLevel) }}
|
|
|
</template>
|
|
|
<template v-else-if="column.dataIndex === 'alarmCategory'">
|
|
|
- {{ getDictLabel(record.alarmCategory, alarmCategory.value) }}
|
|
|
+ {{ categoryLabel(record.alarmCategory) }}
|
|
|
</template>
|
|
|
<template v-else-if="column.dataIndex === 'processFlag'">
|
|
|
<a-tag :color="processColorMap[record.processFlag] || 'default'">
|
|
|
@@ -83,7 +83,7 @@ import {message, Modal} from 'ant-design-vue';
|
|
|
import dayjs from 'dayjs';
|
|
|
import {saveAs} from 'file-saver';
|
|
|
import {blobValidate} from '@/utils/bearjia';
|
|
|
-import {useDict, getDictLabel, getDictClass} from '@/composables/useDict';
|
|
|
+import {useDict} from '@/composables/useDict';
|
|
|
import {listEventRecord, processEventRecord, exportEventRecord} from '@/api/alarm/eventRecord';
|
|
|
|
|
|
const {alarm_category, alarm_level} = useDict('alarm_category', 'alarm_level');
|
|
|
@@ -97,6 +97,16 @@ const levelOptions = computed(() =>
|
|
|
alarmLevel.value.map((o) => ({label: o.label, value: o.value}))
|
|
|
);
|
|
|
|
|
|
+// 表格列展示: 从下拉options中取字典label, 无匹配时回退原始值
|
|
|
+const levelLabelMap = computed(() =>
|
|
|
+ Object.fromEntries(levelOptions.value.map((o) => [String(o.value), o.label]))
|
|
|
+);
|
|
|
+const categoryLabelMap = computed(() =>
|
|
|
+ Object.fromEntries(categoryOptions.value.map((o) => [String(o.value), o.label]))
|
|
|
+);
|
|
|
+const levelLabel = (val) => (val == null ? '' : levelLabelMap.value[String(val)] ?? val);
|
|
|
+const categoryLabel = (val) => (val == null ? '' : categoryLabelMap.value[String(val)] ?? val);
|
|
|
+
|
|
|
const confirmedOptions = [
|
|
|
{label: '已确认', value: true},
|
|
|
{label: '未确认', value: false}
|
|
|
@@ -196,7 +206,7 @@ const handleProcess = () => {
|
|
|
}
|
|
|
Modal.confirm({
|
|
|
title: '确认告警',
|
|
|
- content: `确定将选中的 ${selectedRowKeys.value.length} 条告警标记为已处理吗?仅未处理的告警会被处理。`,
|
|
|
+ content: `确定将选中的 ${selectedRowKeys.value.length} 条告警标记为已处理吗?非已处理的告警将被置为已处理。`,
|
|
|
okText: '确认',
|
|
|
cancelText: '取消',
|
|
|
onOk: async () => {
|
|
|
@@ -221,7 +231,7 @@ const handleExport = async () => {
|
|
|
const res = await exportEventRecord(buildParams());
|
|
|
const isFile = await blobValidate(res);
|
|
|
if (isFile) {
|
|
|
- const name = `事件查询_${dayjs().format('YYYYMMDDHHmmss')}.xlsx`;
|
|
|
+ const name = `事件查询_${dayjs(query.alarmDate || dayjs()).format('YYYYMMDD')}.xlsx`;
|
|
|
saveAs(new Blob([res]), name);
|
|
|
message.success('导出成功');
|
|
|
} else {
|