shuhao 7 månader sedan
förälder
incheckning
e20d82c71b
2 ändrade filer med 6 tillägg och 6 borttagningar
  1. 2 2
      src/components/PdfDialog.vue
  2. 4 4
      src/views/home/components/homePage.vue

+ 2 - 2
src/components/PdfDialog.vue

@@ -13,8 +13,8 @@
         <div class="btn" @click="handleExport">导出</div>
         <div class="myclose cursor-pointer" @click="closeDialog"></div>
       </div>
-      <!-- <iframe class="my-body" :src="src" id="my-pdf"></iframe> -->
-      <iframe class="my-body" src="/ts.pdf" id="my-pdf"></iframe>
+       <iframe class="my-body" :src="src" id="my-pdf"></iframe>
+<!--      <iframe class="my-body" src="/ts.pdf" id="my-pdf"></iframe>-->
     </div>
   </el-dialog>
 </template>

+ 4 - 4
src/views/home/components/homePage.vue

@@ -3,7 +3,7 @@
         <div class="chart-item weather-item">
             <chart-box name="气象预警">
                 <template #title-right>
-<!--                    <div class="button" @click="gybg">果园报告</div>-->
+                    <div class="button" @click="gybg">果园报告</div>
                 </template>
                 <div class="base-wrap">
                     <div class="base-item" v-for="(item, index) in baseData.labels" :key="index">
@@ -270,9 +270,9 @@ const growObj = ref({});
 const ecologyObj = ref({});
 
 const gybg = () => {
-    // VE_API.farm_files.last({ farmId: 766, key: "pdf_report" }).then(({ data }) => {
-    // });
-    eventBus.emit("homePage:gybg", { filename: "ts", title: "果园报告" });
+    VE_API.farm_files.last({ farmId: sessionStorage.getItem("farmId"), key: "pdf_report" }).then(({ data }) => {
+      eventBus.emit("homePage:gybg", { filename: data.path, title: "果园报告" });
+    });
 };
 </script>