|
@@ -0,0 +1,87 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <main class="safety-platform-container__main">
|
|
|
|
|
+ <header class="info-container__header">
|
|
|
|
|
+ <el-tooltip
|
|
|
|
|
+ :content="NoticeDetail?.name"
|
|
|
|
|
+ placement="bottom-start"
|
|
|
|
|
+ effect="light"
|
|
|
|
|
+ :hide-after="0"
|
|
|
|
|
+ v-if="NoticeDetail?.name && NoticeDetail.name.length > 50"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span class="title">{{ NoticeDetail?.name }}</span>
|
|
|
|
|
+ </el-tooltip>
|
|
|
|
|
+ <span class="title" v-else>{{ NoticeDetail?.name }}</span>
|
|
|
|
|
+ <div class="notice">
|
|
|
|
|
+ <p class="info-item">
|
|
|
|
|
+ 创建人:<span class="info-content">{{ NoticeDetail?.realname }}</span>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <p class="info-item">
|
|
|
|
|
+ 发布时间:<span class="info-content">{{ NoticeDetail?.releaseTime }}</span>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </header>
|
|
|
|
|
+ <section class="divider"></section>
|
|
|
|
|
+ <section class="content">
|
|
|
|
|
+ <div v-html="NoticeDetail?.content"></div>
|
|
|
|
|
+ </section>
|
|
|
|
|
+ <section class="file" v-if="NoticeDetail?.noticeFiles.length">
|
|
|
|
|
+ <span class="info-content" style="font-size: 14px">文件({{ NoticeDetail?.noticeFiles.length }})</span>
|
|
|
|
|
+
|
|
|
|
|
+ <a @click="downloadAll">下载全部</a>
|
|
|
|
|
+ <div class="file-list">
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="file-item"
|
|
|
|
|
+ v-for="item in NoticeDetail?.noticeFiles"
|
|
|
|
|
+ :key="item.fileId"
|
|
|
|
|
+ @click="previewOnline(item.fileUrl, item.fileType as keyof typeof FILE_TYPE_ICON)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span class="file-item--name">{{ item.fileName }}</span>
|
|
|
|
|
+ <div class="file-item--footer">
|
|
|
|
|
+ <div class="info">
|
|
|
|
|
+ <img :src="FILE_TYPE_ICON[item.fileType as keyof typeof FILE_TYPE_ICON]" />
|
|
|
|
|
+ <span>{{ item.fileSize }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <a @click.stop="downloadFile(item.fileUrl, item.fileName)">下载</a>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </section>
|
|
|
|
|
+ </main>
|
|
|
|
|
+
|
|
|
|
|
+ <PreviewOnline ref="previewOnlineRef" />
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script setup lang="ts">
|
|
|
|
|
+ import { ref, onMounted } from 'vue';
|
|
|
|
|
+ import PreviewOnline from '@/views/disaster/components/PreviewOnline.vue';
|
|
|
|
|
+ import { downloadFile } from '@/views/disaster/utils';
|
|
|
|
|
+ import { FILE_TYPE_ICON } from '../constants';
|
|
|
|
|
+ import { NoticeDetailResponse } from '../types';
|
|
|
|
|
+
|
|
|
|
|
+ const props = defineProps<{
|
|
|
|
|
+ id: number;
|
|
|
|
|
+ }>();
|
|
|
|
|
+
|
|
|
|
|
+ const previewOnlineRef = ref<InstanceType<typeof PreviewOnline>>();
|
|
|
|
|
+
|
|
|
|
|
+ const previewOnline = (url: string | undefined, type: keyof typeof FILE_TYPE_ICON) => {
|
|
|
|
|
+ if (url) {
|
|
|
|
|
+ previewOnlineRef.value?.open(url, type);
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const NoticeDetail = ref<NoticeDetailResponse>();
|
|
|
|
|
+
|
|
|
|
|
+ const downloadAll = () => {
|
|
|
|
|
+ NoticeDetail.value?.noticeFiles.forEach((item) => {
|
|
|
|
|
+ downloadFile(item.fileUrl, item.fileName);
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ onMounted(() => {});
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style scoped lang="scss">
|
|
|
|
|
+ @use '@/styles/page-details-layout.scss' as *;
|
|
|
|
|
+ @use '../style/view-page.scss' as *;
|
|
|
|
|
+</style>
|