فهرست منبع

pdfview修改

tamgyu 3 روز پیش
والد
کامیت
a779101db5

+ 13 - 2
src/views/base/braze/index.vue

@@ -48,12 +48,14 @@
         />
       </template>
       <template #menu="{ row, index, type }">
-        <PDFView
+<!--        <PDFView
           :need-to-show-pdf="true"
           content-type="button"
           :is-link="true"
           :pdf-source="filePath + row.filePath"
-        />
+        />-->
+        <el-button link type="primary" @click="toShowPDF(row)">
+        </el-button>
         <el-button
           type="primary"
           link
@@ -62,6 +64,7 @@
           >绑定</el-button>
       </template>
     </avue-crud>
+    <PDFDrawerView ref="PDFDrawerViewRef"></PDFDrawerView>
   </div>
 </template>
 <script setup>
@@ -81,12 +84,20 @@ const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 onMounted(() => {
   dataList();
 });
+
+const PDFDrawerViewRef = ref(null);
+const toShowPDF = (row) => {
+  let url = import.meta.env.VITE_APP_UPLOAD_URL + row.pdfPath;
+  PDFDrawerViewRef.value && PDFDrawerViewRef.value.showPdf(url);
+};
+
 const fileUrl = ref(""); //单文件
 const fileNameList = ref([]);
 const testFiles = () => {
   form.value.filePath = fileUrl.value;
   form.value.fileName = fileNameList.value[0];
 };
+
 const filePath = import.meta.env.VITE_APP_UPLOAD_URL;
 option.value = Object.assign(option.value, {
   selection: true,

+ 12 - 3
src/views/base/craftManagement/route/components/testCom.vue

@@ -40,12 +40,14 @@
         />
       </template>
       <template #menu="{ row, index, type }">
-        <PDFView
+<!--        <PDFView
           :need-to-show-pdf="true"
           content-type="button"
           :is-link="true"
           :pdf-source="filePath + row.pdfPath"
-        />
+        />-->
+        <el-button link type="primary" @click="toShowPDF(row)">
+        </el-button>
         <el-button
           @click="deleteRecord(row, index, done)"
           text
@@ -55,7 +57,7 @@
         >
       </template>
     </avue-crud>
-
+    <PDFDrawerView ref="PDFDrawerViewRef"></PDFDrawerView>
     <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
   </div>
   <CommonTable
@@ -153,6 +155,13 @@ const onSelectedFinish = (selectedValue) => {
   form.value.materialCode = selectedValue.materialCode;
 };
 
+
+const PDFDrawerViewRef = ref(null);
+const toShowPDF = (row) => {
+  let url = import.meta.env.VITE_APP_UPLOAD_URL + row.pdfPath;
+  PDFDrawerViewRef.value && PDFDrawerViewRef.value.showPdf(url);
+};
+
 /**
  * 上传excel相关
  */

+ 12 - 3
src/views/base/excel/result/index.vue

@@ -42,18 +42,20 @@
         />
       </template>
       <template #menu="{ row, index, type }">
-        <PDFView
+<!--        <PDFView
           :need-to-show-pdf="true"
           content-type="button"
           :is-link="true"
           :pdf-source="filePath + row.pdfPath"
-        />
+        />-->
+        <el-button link type="primary" @click="toShowPDF(row)">
+        </el-button>
         <el-button @click="deleteRecord(row, index, done)" text type="primary"
           >删除</el-button
         >
       </template>
     </avue-crud>
-
+    <PDFDrawerView ref="PDFDrawerViewRef"></PDFDrawerView>
     <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
   </div>
   <CommonTable
@@ -134,6 +136,13 @@ const onSelectedFinish = (selectedValue) => {
   form.value.materialCode = selectedValue.materialCode;
 };
 
+const PDFDrawerViewRef = ref(null);
+const toShowPDF = (row) => {
+  let url = import.meta.env.VITE_APP_UPLOAD_URL + row.pdfPath;
+  PDFDrawerViewRef.value && PDFDrawerViewRef.value.showPdf(url);
+};
+
+
 /**
  * 上传excel相关
  */

+ 14 - 2
src/views/base/materials/components/drawing-page.vue

@@ -55,14 +55,18 @@
         </el-select>
       </template>
       <template #menu="{ row, index, type }">
-        <PDFView
+<!--        <PDFView
           :need-to-show-pdf="true"
           content-type="button"
           :is-link="true"
           :pdf-source="filePath + row.pdfPath"
-        />
+        />-->
+        <el-button link type="primary" @click="toShowPDF(row)">
+        </el-button>
       </template>
     </avue-crud>
+    <PDFDrawerView ref="PDFDrawerViewRef"></PDFDrawerView>
+
   </div>
 </template>
 <script setup>
@@ -107,6 +111,14 @@ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等
 //   editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
 //   menu: true,
 // });
+
+const PDFDrawerViewRef = ref(null);
+const toShowPDF = (row) => {
+  let url = import.meta.env.VITE_APP_UPLOAD_URL + row.pdfPath;
+  PDFDrawerViewRef.value && PDFDrawerViewRef.value.showPdf(url);
+};
+
+
 const formRef = ref(null);
 const version = ref({
   value: "0",

+ 13 - 2
src/views/demo/hooksDemo.vue

@@ -81,14 +81,17 @@
     />
     <el-button @click="testFiles">测试上传文件的值</el-button>
     <div style="height: 100px; width: 100px; overflow: hidden">
-      <PDFView
+<!--      <PDFView
         :need-to-show-pdf="true"
         content-type="button"
         :is-link="true"
         :show-pdf-number="3"
         pdf-source="http://192.168.101.4:9000/jgfile/2024/04/20/%E7%AC%AC08%E7%AB%A0_%E8%81%9A%E5%90%88%E5%87%BD%E6%95%B0.pdf"
-      />
+      />-->
+      <el-button link type="primary" @click="toShowPDF(row)">
+      </el-button>
     </div>
+    <PDFDrawerView ref="PDFDrawerViewRef"></PDFDrawerView>
   </div>
 </template>
 <script setup>
@@ -110,6 +113,14 @@ const testFiles = () => {
   console.log("pdfUrlList", pdfUrlList.value);
 };
 
+
+const PDFDrawerViewRef = ref(null);
+const toShowPDF = (row) => {
+  let url = import.meta.env.VITE_APP_UPLOAD_URL + row.pdfPath;
+  PDFDrawerViewRef.value && PDFDrawerViewRef.value.showPdf(url);
+};
+
+
 // 数据字典相关
 const { dicts } = useDictionaryStore();