2025-07-27 17:42:43 +08:00
|
|
|
|
<script setup lang="ts">
|
2025-08-17 07:03:48 +08:00
|
|
|
|
import { ref, shallowRef } from 'vue';
|
2025-07-27 17:42:43 +08:00
|
|
|
|
import { useVbenModal } from '@vben/common-ui';
|
2025-08-12 13:51:35 +08:00
|
|
|
|
import {
|
|
|
|
|
Descriptions,
|
|
|
|
|
DescriptionsItem,
|
2025-08-17 07:03:48 +08:00
|
|
|
|
Image,
|
2025-08-12 13:51:35 +08:00
|
|
|
|
Tag,
|
|
|
|
|
Timeline,
|
|
|
|
|
TimelineItem,
|
|
|
|
|
} from 'ant-design-vue';
|
2025-08-17 07:03:48 +08:00
|
|
|
|
import { queryAlarmEventAttachmentsList } from '#/api/sis/alarmEventAttachments';
|
|
|
|
|
import type { AlarmEventAttachmentsVO } from '#/api/sis/alarmEventAttachments/model';
|
|
|
|
|
import { fallImg } from './data';
|
2025-07-27 17:42:43 +08:00
|
|
|
|
|
|
|
|
|
const [BasicModal, modalApi] = useVbenModal({
|
|
|
|
|
onOpenChange: handleOpenChange,
|
|
|
|
|
onClosed() {
|
2025-08-12 13:51:35 +08:00
|
|
|
|
// warningDetail.value = null;
|
2025-08-17 07:03:48 +08:00
|
|
|
|
modalApi.close();
|
2025-07-27 17:42:43 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const warningDetail = shallowRef<any>(null);
|
|
|
|
|
|
2025-08-12 13:51:35 +08:00
|
|
|
|
// 时间线显示条件配置
|
|
|
|
|
const timelineConfig = {
|
2025-08-17 07:03:48 +08:00
|
|
|
|
已完成: ['已完成'],
|
|
|
|
|
处理异常: ['已完成', '处理异常'],
|
|
|
|
|
处理中: ['已完成', '处理中', '处理异常'],
|
2025-08-12 13:51:35 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function showTimelineItem(type: string): boolean {
|
|
|
|
|
const currentStatus = warningDetail.value?.processingStatus;
|
2025-08-17 07:03:48 +08:00
|
|
|
|
return (
|
|
|
|
|
timelineConfig[type as keyof typeof timelineConfig]?.includes(
|
|
|
|
|
currentStatus,
|
|
|
|
|
) || false
|
|
|
|
|
);
|
2025-08-12 13:51:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
2025-08-17 07:03:48 +08:00
|
|
|
|
const currFiles = ref<AlarmEventAttachmentsVO[]>([]);
|
|
|
|
|
|
2025-07-27 17:42:43 +08:00
|
|
|
|
async function handleOpenChange(open: boolean) {
|
|
|
|
|
if (!open) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
modalApi.modalLoading(true);
|
|
|
|
|
const { id, data } = modalApi.getData() as {
|
|
|
|
|
id: number | string;
|
|
|
|
|
data: any[];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 从传递的数据中查找对应的记录
|
2025-08-17 07:03:48 +08:00
|
|
|
|
if (data) {
|
|
|
|
|
warningDetail.value = data;
|
2025-07-27 17:42:43 +08:00
|
|
|
|
}
|
2025-08-17 07:03:48 +08:00
|
|
|
|
// 加载事件附件信息
|
|
|
|
|
currFiles.value = await queryAlarmEventAttachmentsList(id);
|
2025-07-27 17:42:43 +08:00
|
|
|
|
modalApi.modalLoading(false);
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<BasicModal
|
|
|
|
|
:footer="false"
|
|
|
|
|
:fullscreen-button="false"
|
|
|
|
|
title="预警详情"
|
2025-08-17 07:03:48 +08:00
|
|
|
|
class="w-[60%]"
|
2025-07-27 17:42:43 +08:00
|
|
|
|
>
|
|
|
|
|
<Descriptions
|
|
|
|
|
v-if="warningDetail"
|
|
|
|
|
size="small"
|
|
|
|
|
:column="2"
|
|
|
|
|
bordered
|
|
|
|
|
:labelStyle="{ width: '120px' }"
|
2025-08-12 13:51:35 +08:00
|
|
|
|
style="margin-bottom: 30px"
|
2025-07-27 17:42:43 +08:00
|
|
|
|
>
|
|
|
|
|
<DescriptionsItem label="预警编号">
|
2025-08-17 07:03:48 +08:00
|
|
|
|
{{ warningDetail.id }}
|
2025-07-27 17:42:43 +08:00
|
|
|
|
</DescriptionsItem>
|
2025-08-17 07:03:48 +08:00
|
|
|
|
|
2025-07-27 17:42:43 +08:00
|
|
|
|
<DescriptionsItem label="预警时间">
|
2025-08-17 07:03:48 +08:00
|
|
|
|
{{ warningDetail.reportTime }}
|
2025-07-27 17:42:43 +08:00
|
|
|
|
</DescriptionsItem>
|
2025-08-17 07:03:48 +08:00
|
|
|
|
|
2025-07-27 17:42:43 +08:00
|
|
|
|
<DescriptionsItem label="级别">
|
|
|
|
|
<Tag
|
|
|
|
|
:color="
|
|
|
|
|
warningDetail.level === '特大'
|
|
|
|
|
? 'red'
|
|
|
|
|
: warningDetail.level === '重要'
|
|
|
|
|
? 'orange'
|
|
|
|
|
: 'blue'
|
|
|
|
|
"
|
|
|
|
|
>
|
2025-08-17 07:03:48 +08:00
|
|
|
|
{{ warningDetail.levelName }}
|
2025-07-27 17:42:43 +08:00
|
|
|
|
</Tag>
|
|
|
|
|
</DescriptionsItem>
|
2025-08-17 07:03:48 +08:00
|
|
|
|
|
2025-07-27 17:42:43 +08:00
|
|
|
|
<DescriptionsItem label="预警类型">
|
2025-08-17 07:03:48 +08:00
|
|
|
|
{{ warningDetail.bigTypeName + ' - ' + warningDetail.smallTypeName }}
|
|
|
|
|
</DescriptionsItem>
|
|
|
|
|
|
|
|
|
|
<DescriptionsItem label="设备ip"
|
|
|
|
|
>{{ warningDetail.deviceIp }}
|
2025-07-27 17:42:43 +08:00
|
|
|
|
</DescriptionsItem>
|
2025-08-17 07:03:48 +08:00
|
|
|
|
|
|
|
|
|
<DescriptionsItem label="设备ip"
|
|
|
|
|
>{{ warningDetail.deviceName }}
|
|
|
|
|
</DescriptionsItem>
|
|
|
|
|
|
2025-07-27 17:42:43 +08:00
|
|
|
|
<DescriptionsItem label="描述" :span="2">
|
|
|
|
|
{{ warningDetail.description }}
|
|
|
|
|
</DescriptionsItem>
|
2025-08-17 07:03:48 +08:00
|
|
|
|
|
2025-07-27 17:42:43 +08:00
|
|
|
|
<DescriptionsItem label="所在位置">
|
2025-08-17 07:03:48 +08:00
|
|
|
|
{{ warningDetail.deviceName }}
|
2025-07-27 17:42:43 +08:00
|
|
|
|
</DescriptionsItem>
|
2025-08-17 07:03:48 +08:00
|
|
|
|
|
2025-07-27 17:42:43 +08:00
|
|
|
|
<DescriptionsItem label="处理状态">
|
2025-08-17 07:03:48 +08:00
|
|
|
|
<Tag>
|
|
|
|
|
{{ warningDetail.stateName }}
|
2025-07-27 17:42:43 +08:00
|
|
|
|
</Tag>
|
|
|
|
|
</DescriptionsItem>
|
2025-08-17 07:03:48 +08:00
|
|
|
|
|
2025-07-27 17:42:43 +08:00
|
|
|
|
<DescriptionsItem label="处理情况" :span="2">
|
|
|
|
|
{{ warningDetail.processingDetails || '-' }}
|
|
|
|
|
</DescriptionsItem>
|
2025-08-17 07:03:48 +08:00
|
|
|
|
|
|
|
|
|
<DescriptionsItem label="处理时间" :span="2">
|
2025-07-27 17:42:43 +08:00
|
|
|
|
{{ warningDetail.processingTime || '-' }}
|
|
|
|
|
</DescriptionsItem>
|
2025-08-17 07:03:48 +08:00
|
|
|
|
|
|
|
|
|
<DescriptionsItem :span="1" label="附件信息">
|
|
|
|
|
<div class="file-box">
|
|
|
|
|
<div class="img-box" v-for="item in currFiles">
|
|
|
|
|
<Image
|
|
|
|
|
style="width: 120px; height: 120px"
|
|
|
|
|
:src="item.imagePath"
|
|
|
|
|
:fallback="fallImg"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-08-12 13:51:35 +08:00
|
|
|
|
</DescriptionsItem>
|
2025-08-17 07:03:48 +08:00
|
|
|
|
|
|
|
|
|
<DescriptionsItem :span="1" label="报警视频"></DescriptionsItem>
|
2025-07-27 17:42:43 +08:00
|
|
|
|
</Descriptions>
|
2025-08-17 07:03:48 +08:00
|
|
|
|
|
|
|
|
|
<Timeline>
|
2025-08-12 13:51:35 +08:00
|
|
|
|
<TimelineItem v-if="warningDetail.processingStatus === '已完成'">
|
|
|
|
|
<p style="display: flex">类型:已完成</p>
|
|
|
|
|
<p>时间:2025-06-01 11:07:59</p>
|
|
|
|
|
<p>处理人:张三</p>
|
|
|
|
|
</TimelineItem>
|
2025-08-17 07:03:48 +08:00
|
|
|
|
<TimelineItem
|
|
|
|
|
v-if="
|
|
|
|
|
warningDetail.processingStatus === '已完成' ||
|
|
|
|
|
warningDetail.processingStatus === '处理异常'
|
|
|
|
|
"
|
|
|
|
|
>
|
2025-08-12 13:51:35 +08:00
|
|
|
|
<p style="display: flex">类型:处理异常</p>
|
|
|
|
|
<p>时间:2025-06-01 11:07:59</p>
|
|
|
|
|
<p>处理人:张三</p>
|
|
|
|
|
<p>异常原因:时长不够</p>
|
|
|
|
|
</TimelineItem>
|
2025-08-17 07:03:48 +08:00
|
|
|
|
<TimelineItem
|
|
|
|
|
v-if="
|
|
|
|
|
warningDetail.processingStatus === '已完成' ||
|
|
|
|
|
warningDetail.processingStatus === '处理中' ||
|
|
|
|
|
warningDetail.processingStatus === '处理异常'
|
|
|
|
|
"
|
|
|
|
|
>
|
2025-08-12 13:51:35 +08:00
|
|
|
|
<p style="display: flex">类型:处理中</p>
|
|
|
|
|
<p>时间:2025-06-01 11:07:59</p>
|
|
|
|
|
<p>处理人:张三</p>
|
|
|
|
|
</TimelineItem>
|
|
|
|
|
<TimelineItem>
|
|
|
|
|
<p style="display: flex">类型:创建预警</p>
|
|
|
|
|
<p>时间:2025-06-01 11:07:59</p>
|
|
|
|
|
<p>处理人:张三</p>
|
|
|
|
|
</TimelineItem>
|
|
|
|
|
</Timeline>
|
2025-07-27 17:42:43 +08:00
|
|
|
|
</BasicModal>
|
|
|
|
|
</template>
|
2025-08-17 07:03:48 +08:00
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.file-box {
|
|
|
|
|
.img-box {
|
|
|
|
|
float: left;
|
|
|
|
|
margin-left: 5px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|