瀏覽代碼

pdf修改

tamgyu 4 天之前
父節點
當前提交
1b76cb2c42
共有 1 個文件被更改,包括 15 次插入4 次删除
  1. 15 4
      src/views/base/craftManagement/route/components/bottomTable.vue

+ 15 - 4
src/views/base/craftManagement/route/components/bottomTable.vue

@@ -21,23 +21,28 @@
         <!-- <single-upload v-model="form.filePath" />
         <FilesUpload v-model:src="form.filePath" v-model:src-list="form.filePath" /> -->
         <div style="height: 100px; width: 100px; overflow: hidden">
-          <PDFView
+<!--          <PDFView
             :need-to-show-pdf="true"
             content-type="button"
             :is-link="true"
             :show-pdf-number="form.showAppointPageNum"
             :pdf-source="pdfPath"
-          />
+          />-->
+          <el-button link type="primary" @click="toShowPDF(row)">
+          </el-button>
         </div>
       </template>
       <template #filePath="{ row }">
-        <PDFView
+<!--        <PDFView
           :need-to-show-pdf="true"
           content-type="button"
           btnText="查看PDF"
           :is-link="true"
           :pdf-source="getSOAPpdf(row)"
-        />
+        />-->
+        <el-button link type="primary" @click="toShowPDF(row)">
+          查看pdf
+        </el-button>
       </template>
     </avue-crud>
     <CommonTable
@@ -178,6 +183,12 @@ const onSortChange = () => {
   });
 };
 
+const PDFDrawerViewRef = ref(null);
+const toShowPDF = (row) => {
+  let url = import.meta.env.VITE_APP_UPLOAD_URL + row.pdfPath;
+  PDFDrawerViewRef.value && PDFDrawerViewRef.value.showPdf(url);
+};
+
 // ============公共弹窗table选择相关,物料采集等使用===============
 const commonTableRef = ref({});
 const commonTableType = ref("MARTERIAL_BOM");