2025-08-12 13:51:35 +08:00
|
|
|
<script setup lang="ts">
|
2025-08-18 09:06:31 +08:00
|
|
|
import { ref, shallowRef } from 'vue';
|
2025-08-12 13:51:35 +08:00
|
|
|
import { useVbenModal } from '@vben/common-ui';
|
2025-08-18 09:06:31 +08:00
|
|
|
import { Descriptions, DescriptionsItem, Image, Tag } from 'ant-design-vue';
|
|
|
|
import { queryAlarmEventAttachmentsList } from '#/api/sis/alarmEventAttachments';
|
|
|
|
import type { AlarmEventAttachmentsVO } from '#/api/sis/alarmEventAttachments/model';
|
|
|
|
import { fallImg } from './data';
|
|
|
|
import { alarmEventProcessList } from '#/api/sis/alarmEventProcess';
|
|
|
|
import type { AlarmEventProcessVO } from '#/api/sis/alarmEventProcess/model';
|
2025-08-12 13:51:35 +08:00
|
|
|
|
|
|
|
const [BasicModal, modalApi] = useVbenModal({
|
|
|
|
onOpenChange: handleOpenChange,
|
|
|
|
onClosed() {
|
2025-08-18 09:06:31 +08:00
|
|
|
// warningDetail.value = null;
|
|
|
|
modalApi.close();
|
2025-08-12 13:51:35 +08:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const warningDetail = shallowRef<any>(null);
|
2025-08-18 09:06:31 +08:00
|
|
|
const currFiles = ref<AlarmEventAttachmentsVO[]>([]);
|
2025-08-12 13:51:35 +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-18 09:06:31 +08:00
|
|
|
if (data) {
|
|
|
|
warningDetail.value = data;
|
2025-08-12 13:51:35 +08:00
|
|
|
}
|
2025-08-18 09:06:31 +08:00
|
|
|
// 加载事件附件信息
|
|
|
|
currFiles.value = await queryAlarmEventAttachmentsList(id);
|
|
|
|
// 加载处理流程
|
|
|
|
loadProcessList();
|
2025-08-12 13:51:35 +08:00
|
|
|
modalApi.modalLoading(false);
|
|
|
|
}
|
2025-08-18 09:06:31 +08:00
|
|
|
|
|
|
|
const process = ref<AlarmEventProcessVO[]>([]);
|
|
|
|
|
|
|
|
function loadProcessList() {
|
|
|
|
const data = modalApi.getData();
|
|
|
|
const params = {
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 50,
|
|
|
|
alarmId: data.id,
|
|
|
|
};
|
|
|
|
alarmEventProcessList(params).then((res) => {
|
|
|
|
const { rows = [] } = res;
|
|
|
|
process.value = rows;
|
|
|
|
});
|
|
|
|
}
|
2025-08-12 13:51:35 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<BasicModal
|
|
|
|
:footer="false"
|
|
|
|
:fullscreen-button="false"
|
|
|
|
title="预警详情"
|
2025-08-18 09:06:31 +08:00
|
|
|
class="w-[60%]"
|
2025-08-12 13:51:35 +08:00
|
|
|
>
|
|
|
|
<Descriptions
|
|
|
|
v-if="warningDetail"
|
|
|
|
size="small"
|
|
|
|
:column="2"
|
|
|
|
bordered
|
|
|
|
:labelStyle="{ width: '120px' }"
|
|
|
|
style="margin-bottom: 30px"
|
|
|
|
>
|
|
|
|
<DescriptionsItem label="预警编号">
|
2025-08-18 09:06:31 +08:00
|
|
|
{{ warningDetail.id }}
|
2025-08-12 13:51:35 +08:00
|
|
|
</DescriptionsItem>
|
2025-08-18 09:06:31 +08:00
|
|
|
|
2025-08-12 13:51:35 +08:00
|
|
|
<DescriptionsItem label="预警时间">
|
2025-08-18 09:06:31 +08:00
|
|
|
{{ warningDetail.reportTime }}
|
2025-08-12 13:51:35 +08:00
|
|
|
</DescriptionsItem>
|
2025-08-18 09:06:31 +08:00
|
|
|
|
2025-08-12 13:51:35 +08:00
|
|
|
<DescriptionsItem label="级别">
|
|
|
|
<Tag
|
|
|
|
:color="
|
|
|
|
warningDetail.level === '特大'
|
|
|
|
? 'red'
|
|
|
|
: warningDetail.level === '重要'
|
|
|
|
? 'orange'
|
|
|
|
: 'blue'
|
|
|
|
"
|
|
|
|
>
|
2025-08-18 09:06:31 +08:00
|
|
|
{{ warningDetail.levelName }}
|
2025-08-12 13:51:35 +08:00
|
|
|
</Tag>
|
|
|
|
</DescriptionsItem>
|
2025-08-18 09:06:31 +08:00
|
|
|
|
2025-08-12 13:51:35 +08:00
|
|
|
<DescriptionsItem label="预警类型">
|
2025-08-18 09:06:31 +08:00
|
|
|
{{ warningDetail.bigTypeName + ' - ' + warningDetail.smallTypeName }}
|
|
|
|
</DescriptionsItem>
|
|
|
|
|
|
|
|
<DescriptionsItem label="设备ip"
|
|
|
|
>{{ warningDetail.deviceIp }}
|
|
|
|
</DescriptionsItem>
|
|
|
|
|
|
|
|
<DescriptionsItem label="设备ip"
|
|
|
|
>{{ warningDetail.deviceName }}
|
2025-08-12 13:51:35 +08:00
|
|
|
</DescriptionsItem>
|
2025-08-18 09:06:31 +08:00
|
|
|
|
2025-08-12 13:51:35 +08:00
|
|
|
<DescriptionsItem label="描述" :span="2">
|
|
|
|
{{ warningDetail.description }}
|
|
|
|
</DescriptionsItem>
|
2025-08-18 09:06:31 +08:00
|
|
|
|
2025-08-12 13:51:35 +08:00
|
|
|
<DescriptionsItem label="所在位置">
|
2025-08-18 09:06:31 +08:00
|
|
|
{{ warningDetail.deviceName }}
|
2025-08-12 13:51:35 +08:00
|
|
|
</DescriptionsItem>
|
2025-08-18 09:06:31 +08:00
|
|
|
|
2025-08-12 13:51:35 +08:00
|
|
|
<DescriptionsItem label="处理状态">
|
2025-08-18 09:06:31 +08:00
|
|
|
<Tag>
|
|
|
|
{{ warningDetail.stateName }}
|
2025-08-12 13:51:35 +08:00
|
|
|
</Tag>
|
|
|
|
</DescriptionsItem>
|
2025-08-18 09:06:31 +08:00
|
|
|
|
2025-08-12 13:51:35 +08:00
|
|
|
<DescriptionsItem label="处理情况" :span="2">
|
|
|
|
{{ warningDetail.processingDetails || '-' }}
|
|
|
|
</DescriptionsItem>
|
2025-08-18 09:06:31 +08:00
|
|
|
|
|
|
|
<DescriptionsItem label="处理时间" :span="2">
|
2025-08-12 13:51:35 +08:00
|
|
|
{{ warningDetail.processingTime || '-' }}
|
|
|
|
</DescriptionsItem>
|
2025-08-18 09:06:31 +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-18 09:06:31 +08:00
|
|
|
|
|
|
|
<DescriptionsItem :span="1" label="报警视频"></DescriptionsItem>
|
2025-08-12 13:51:35 +08:00
|
|
|
</Descriptions>
|
|
|
|
</BasicModal>
|
|
|
|
</template>
|
2025-08-18 09:06:31 +08:00
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.file-box {
|
|
|
|
.img-box {
|
|
|
|
float: left;
|
|
|
|
margin-left: 5px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|