yangyuxuan vor 2 Monaten
Ursprung
Commit
77aae7d4f5

+ 3 - 2
src/types/components.d.ts

@@ -27,6 +27,7 @@ declare module 'vue' {
     ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
     ElBadge: typeof import('element-plus/es')['ElBadge']
     ElButton: typeof import('element-plus/es')['ElButton']
+    ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
     ElCol: typeof import('element-plus/es')['ElCol']
     ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
@@ -51,15 +52,15 @@ declare module 'vue' {
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
     ElSelect: typeof import('element-plus/es')['ElSelect']
+    ElSlider: typeof import('element-plus/es')['ElSlider']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
-    ElTable: typeof import('element-plus/es')['ElTable']
-    ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
     ElTag: typeof import('element-plus/es')['ElTag']
     ElText: typeof import('element-plus/es')['ElText']
     ElTimeline: typeof import('element-plus/es')['ElTimeline']
     ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
     ElTooltip: typeof import('element-plus/es')['ElTooltip']
+    ElTree: typeof import('element-plus/es')['ElTree']
     ElUpload: typeof import('element-plus/es')['ElUpload']
     ExcelEditor: typeof import('./../components/ExcelEditor/index.vue')['default']
     FileUpload: typeof import('./../components/FileUpload/index.vue')['default']

+ 1 - 1
src/views/duty/eventing/EventEditDialog.vue

@@ -169,7 +169,7 @@ const data = reactive({
     event_type: [{ required: true, message: '事件类型不能为空', trigger: 'blur' }],
     event_level: [{ required: true, message: '事件等级不能为空', trigger: 'blur' }],
     event_status: [{ required: true, message: '事件状态不能为空', trigger: 'blur' }],
-    address: [{ required: true, message: '事件地点不能为空', trigger: 'blur' }],
+    address: [{ required: true, message: '事件地点不能为空', trigger: 'change' }],
     event_time: [{ required: true, message: '事发时间不能为空', trigger: 'blur' }],
     report_time: [{ required: true, message: '上报时间不能为空', trigger: 'blur' }],
     event_source: [{ required: true, message: '事件来源不能为空', trigger: 'blur' }],

+ 66 - 10
src/views/routineCommandMap/RightSection/EventReport/EventDetail.vue

@@ -102,30 +102,62 @@
         </div>
       </div>
       <div class="common-title-box">匹配预案</div>
-      <div v-if="!!detailData.plan_name" class="info-content">
-        <div class="list">
-          <div class="list-item">
-            <i class="img" />
-            <div class="item-title">{{ detailData.plan_name }}</div>
+      <div v-if="!!planFiles && planFiles.length > 0" class="common-info-content">
+        <div class="list2">
+          <div v-for="(item, index) in planFiles" :key="index" class="list-item" style="margin-bottom: 10px">
+            <div class="link" @click="previewSummaryFile2(item)">{{ item.name }}</div>
+            <div style="margin-left: 40px" @click="previewSummaryFile2(item)">查看</div>
+            <div style="margin-left: 20px; display: flex; align-items: center" @click="downloadSummaryFile2(item)">
+              <span>下载</span>
+              <el-icon class="icon" style="margin-left: 0px"><Download /></el-icon>
+            </div>
           </div>
         </div>
       </div>
+<!--      <div v-if="!!detailData.plan_name" class="info-content">-->
+<!--        <div class="list">-->
+<!--          <div class="list-item">-->
+<!--            <i class="img" />-->
+<!--            <div class="item-title">{{ detailData.plan_name }}</div>-->
+<!--          </div>-->
+<!--        </div>-->
+<!--      </div>-->
       <div class="common-title-box">事件总结报告</div>
       <div v-if="!!summaryFiles && summaryFiles.length > 0" class="info-content">
         <div class="list2">
-          <div v-for="(item, index) in summaryFiles" :key="index" class="list-item" @click="downloadSummaryFile(item.url)">
-            <div class="link">{{ item.file_name }}</div>
-            <el-icon class="icon"><Download /></el-icon>
+          <div v-for="(item, index) in summaryFiles" :key="index" class="list-item" style="margin-bottom: 10px">
+            <div class="link" @click="previewSummaryFile(item)">{{ item.file_name }}</div>
+            <div style="margin-left: 40px" @click="previewSummaryFile(item)">查看</div>
+            <div style="margin-left: 20px; display: flex; align-items: center" @click="downloadSummaryFile(item)">
+              <span>下载</span>
+              <el-icon class="icon" style="margin-left: 0px"><Download /></el-icon>
+            </div>
           </div>
         </div>
       </div>
+<!--      <div v-if="!!summaryFiles && summaryFiles.length > 0" class="info-content">-->
+<!--        <div class="list2">-->
+<!--          <div v-for="(item, index) in summaryFiles" :key="index" class="list-item" @click="downloadSummaryFile(item.url)">-->
+<!--            <div class="link">{{ item.file_name }}</div>-->
+<!--            <el-icon class="icon"><Download /></el-icon>-->
+<!--          </div>-->
+<!--        </div>-->
+<!--      </div>-->
     </div>
     <Dialog v-model="showDeleteDialog" class="tip" type="xs" title="提示">确认删除事件吗</Dialog>
   </Dialog>
+  <Dialog type="s" v-if="dialogTableVisible" v-model="dialogTableVisible" title="文件预览" height="1800px">
+    <div>
+      <div style="margin-top: 40px">{{ detailInfo.file_name }}</div>
+      <pdf-viewer :url="baseUrl + '/file/download/' + detailInfo.url" />
+    </div>
+  </Dialog>
 </template>
 
 <script lang="ts" setup name="EventDetail">
 import { getEventDetail } from '@/api/duty/eventing';
+import { download2 } from '@/utils/request';
+import PdfViewer from '@/views/knowledge/HiddenStandards/PdfViewer.vue';
 
 const props = defineProps({
   modelValue: {
@@ -192,9 +224,32 @@ let eventLevelState = reactive({
 });
 // 下载总结报告
 let summaryFiles = ref([]);
-const downloadSummaryFile = (url) => {
-  window.open(url);
+let planFiles = ref([]);
+const baseUrl = import.meta.env.VITE_APP_BASE_API;
+const downloadSummaryFile = (file: any) => {
+  // window.open(url);
+  download2(baseUrl + '/file/download/' + file.url, file.file_name);
+};
+const detailInfo = ref({});
+const detailInfo2 = ref({});
+const dialogTableVisible = ref(false);
+const dialogTableVisible2 = ref(false);
+const previewSummaryFile = (file) => {
+  detailInfo.value = file;
+  if (file) {
+    dialogTableVisible.value = true;
+  }
 };
+const previewSummaryFile2 = (file) => {
+  detailInfo2.value = file;
+  if (file) {
+    dialogTableVisible2.value = true;
+  }
+};
+const downloadSummaryFile2 = (file: any) => {
+  download2(baseUrl + '/file/download/' + file.url, file.name);
+};
+
 const handleClose = () => {
   emits('update:modelValue', false);
 };
@@ -222,6 +277,7 @@ const initData = () => {
     eventTrackState = res.data.event_status_tracks;
     eventLevelState.data = res.data.event_level_tracks;
     summaryFiles.value = res.data.summary_file;
+    planFiles.value = res.data.plan_files;
   });
 };