Selaa lähdekoodia

优化pdf代码

yangyuxuan 3 kuukautta sitten
vanhempi
commit
5c465cff44

+ 0 - 4
src/types/components.d.ts

@@ -44,8 +44,6 @@ declare module 'vue' {
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
     ElSelect: typeof import('element-plus/es')['ElSelect']
-    ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
-    ElSkeletonItem: typeof import('element-plus/es')['ElSkeletonItem']
     ElSlider: typeof import('element-plus/es')['ElSlider']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
@@ -78,7 +76,6 @@ declare module 'vue' {
     Pagination: typeof import('./../components/Pagination/index.vue')['default']
     ParentView: typeof import('./../components/ParentView/index.vue')['default']
     PdfView: typeof import('./../components/PdfView/index.vue')['default']
-    PdfViewer: typeof import('./../components/PdfView/PdfViewer.vue')['default']
     QuickZoom: typeof import('./../components/Map/quickZoom.vue')['default']
     Render: typeof import('./../components/BuildCode/render.vue')['default']
     RightTool: typeof import('./../components/Map/rightTool.vue')['default']
@@ -101,7 +98,6 @@ declare module 'vue' {
     VideoContainer2: typeof import('./../components/HKVideo/video-container2.vue')['default']
     VideoTagEdit: typeof import('./../components/VideoTagEdit/index.vue')['default']
     YMap: typeof import('./../components/Map/YMap.vue')['default']
-    YMapold: typeof import('./../components/Map/YMapold.vue')['default']
     YztMap: typeof import('./../components/Map/YztMap/index.vue')['default']
   }
   export interface ComponentCustomProperties {

+ 13 - 23
src/views/routineCommandMap/RightSection/EventReport/EventDetail.vue

@@ -104,9 +104,9 @@
     <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)">
+          <div class="link" @click="previewSummaryFile(item.name, item.url)">{{ item.name }}</div>
+          <div style="margin-left: 40px" @click="previewSummaryFile(item.name, item.url)">查看</div>
+          <div style="margin-left: 20px; display: flex; align-items: center" @click="downloadSummaryFile(item.name, item.url)">
             <span>下载</span>
             <el-icon class="icon" style="margin-left: 0px"><Download /></el-icon>
           </div>
@@ -117,9 +117,9 @@
     <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" 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)">
+          <div class="link" @click="previewSummaryFile(item.file_name, item.url)">{{ item.file_name }}</div>
+          <div style="margin-left: 40px" @click="previewSummaryFile(item.file_name, item.url)">查看</div>
+          <div style="margin-left: 20px; display: flex; align-items: center" @click="downloadSummaryFile(item.file_name, item.url)">
             <span>下载</span>
             <el-icon class="icon" style="margin-left: 0px"><Download /></el-icon>
           </div>
@@ -208,29 +208,19 @@ let eventLevelState = reactive({
 let summaryFiles = ref([]);
 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 downloadSummaryFile = (file_name, url) => {
+  download2(baseUrl + '/file/download/' + url, file_name);
 };
 const detailInfo = ref({});
-const detailInfo2 = ref({});
 const dialogTableVisible = ref(false);
-const dialogTableVisible2 = ref(false);
-const previewSummaryFile = (file) => {
-  detailInfo.value = file;
-  if (file) {
+const previewSummaryFile = (filename, url) => {
+  detailInfo.value.file_name = filename;
+  detailInfo.value.url = url;
+  if (filename) {
     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);