liziliang 1 неделя назад
Родитель
Сommit
e04a026040

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

@@ -22,23 +22,29 @@
         <!-- <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
-            :need-to-show-pdf="true"
-            content-type="button"
-            :is-link="true"
-            :show-pdf-number="form.showAppointPageNum"
-            :pdf-source="pdfPath"
-          />
+          <!--          <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(pdfPath,form.showAppointPageNum)">
+            预览
+          </el-button>
         </div>
       </template>
       <template #filePath="{ row }">
-        <PDFView
-          :need-to-show-pdf="true"
-          content-type="button"
-          btnText="查看PDF"
-          :is-link="true"
-          :pdf-source="getSOAPpdf(row)"
-        />
+        <!--        <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.filePath,1)">
+          查看PDF
+        </el-button>
       </template>
 
 
@@ -82,6 +88,7 @@
         </div>
       </template>
     </el-dialog>
+    <PDFDrawerView ref="PDFDrawerViewRef"></PDFDrawerView>
   </div>
 </template>
 <script setup>
@@ -144,7 +151,11 @@ const {selectionChange, multipleUpdate} = Methords; //选中和批量删除事
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 const bomVersion = ref(null);
 const pdfPath = ref(null);
-
+const PDFDrawerViewRef = ref(null);
+const toShowPDF = (pdfPath, pdfNum) => {
+  let url = import.meta.env.VITE_APP_UPLOAD_URL + pdfPath;
+  PDFDrawerViewRef.value && PDFDrawerViewRef.value.showPdf(url, pdfNum);
+};
 // 如果物料采集列表有值,就只能选择当前的版本,否则先选择版本
 const versionList = ref([]);
 const versionDV = ref(false);

+ 21 - 6
src/views/base/document/index.vue

@@ -30,12 +30,15 @@
         <el-button @click="toSyncPdmFiles()" type="success">同步PDM</el-button>
       </template>
       <template #menu="{ row, index, type }">
-        <PDFView
-          :need-to-show-pdf="true"
-          content-type="button"
-          :is-link="true"
-          :pdf-source="setSource(row)"
-        />
+        <!--        <PDFView-->
+        <!--          :need-to-show-pdf="true"-->
+        <!--          content-type="button"-->
+        <!--          :is-link="true"-->
+        <!--          :pdf-source="setSource(row)"-->
+        <!--        />-->
+        <el-button link type="primary" @click="toShowPDF(row)">
+          预览
+        </el-button>
         <el-button @click="deleteRecord(row, index, done)" text type="primary"
           >删除</el-button
         >
@@ -43,6 +46,7 @@
     </avue-crud>
 
     <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
+    <PDFDrawerView ref="PDFDrawerViewRef"></PDFDrawerView>
   </div>
   <CommonTable
     ref="ctableRef"
@@ -84,6 +88,17 @@ const fileNameList = ref([]);
 const testFiles = () => {
   form.value.filePath = pdfUrlList.value[0];
 };
+const PDFDrawerViewRef = ref(null);
+const toShowPDF = (row) => {
+  let url = null;
+  if (row.sourceType == 1) {
+    return row.filePath;
+    url = url + row.pdfPath;
+  } else if (row.sourceType == 2) {
+    url = url + filePath + row.filePath;
+  }
+  PDFDrawerViewRef.value && PDFDrawerViewRef.value.showPdf(url);
+};
 const filePath = import.meta.env.VITE_APP_UPLOAD_URL;
 const test = () => {
   isShowTable.value = true;

+ 15 - 6
src/views/base/excel/result/index.vue

@@ -42,12 +42,15 @@
         />
       </template>
       <template #menu="{ row, index, type }">
-        <PDFView
-          :need-to-show-pdf="true"
-          content-type="button"
-          :is-link="true"
-          :pdf-source="filePath + row.pdfPath"
-        />
+        <!--        <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
         >
@@ -55,6 +58,7 @@
     </avue-crud>
 
     <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
+    <PDFDrawerView ref="PDFDrawerViewRef"></PDFDrawerView>
   </div>
   <CommonTable
     ref="ctableRef"
@@ -88,6 +92,11 @@ const test = () => {
   isShowTable.value = true;
   tableType.value = tableType.value == 1 ? 2 : 1;
 };
+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 ctableRef = ref(null);
 const changeItem = (row) => {
   updateDrawaing(row).then(() => {

+ 16 - 7
src/views/base/frock/components/drawing-page.vue

@@ -56,15 +56,19 @@
         </el-select>
       </template>
       <template #menu="{ row, index, type }">
-        <PDFView
-          :need-to-show-pdf="true"
-          content-type="button"
-          :is-link="true"
-          :show-pdf-number="1"
-          :pdf-source="filePath + row.pdfPath"
-        />
+        <!--        <PDFView-->
+        <!--          :need-to-show-pdf="true"-->
+        <!--          content-type="button"-->
+        <!--          :is-link="true"-->
+        <!--          :show-pdf-number="1"-->
+        <!--          :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>
@@ -104,6 +108,11 @@ 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, 1);
+};
 const formRef = ref(null);
 const version = ref({
   value: "0",

+ 16 - 7
src/views/base/materials/components/drawing-page.vue

@@ -56,15 +56,19 @@
         </el-select>
       </template>
       <template #menu="{ row, index, type }">
-        <PDFView
-          :need-to-show-pdf="true"
-          content-type="button"
-          :is-link="true"
-          :show-pdf-number="1"
-          :pdf-source="filePath + row.pdfPath"
-        />
+        <!--        <PDFView-->
+        <!--          :need-to-show-pdf="true"-->
+        <!--          content-type="button"-->
+        <!--          :is-link="true"-->
+        <!--          :show-pdf-number="1"-->
+        <!--          :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>
@@ -79,6 +83,11 @@ const fileList = ref([]);
 const uploadKey = ref(false);
 const { dicts } = useDictionaryStore();
 const filePath = import.meta.env.VITE_APP_UPLOAD_URL;
+const PDFDrawerViewRef = ref(null);
+const toShowPDF = (row) => {
+  let url = import.meta.env.VITE_APP_UPLOAD_URL + row.pdfPath;
+  PDFDrawerViewRef.value && PDFDrawerViewRef.value.showPdf(url, 1);
+};
 const test = () => {
   isShowTable.value = true;
   tableType.value = tableType.value == 1 ? 2 : 1;

+ 26 - 15
src/views/flow/common/CheckTopInfos/components/op_bottom_table.vue

@@ -20,28 +20,35 @@
 
       <template #filePath-form="scope">
         <div style="height: 100px; width: 100px; overflow: hidden">
-          <PDFView
-            :need-to-show-pdf="true"
-            content-type="button"
-            :is-link="true"
-            :show-pdf-number="form.showAppointPageNum"
-            :pdf-source="pdfPath"
-          />
+          <!--          <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(pdfPath,form.showAppointPageNum)">
+            预览
+          </el-button>
         </div>
       </template>
       <template #filePath="{ row }">
-        <PDFView
-          :need-to-show-pdf="true"
-          content-type="button"
-          btnText="查看PDF"
-          :is-link="true"
-          :pdf-source="getSOAPpdf(row)"
-        />
+        <!--        <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.filePath,1)">
+          查看PDF
+        </el-button>
       </template>
     </avue-crud>
     <el-dialog v-model="dialogVisible">
       <VuePdfEmbed :source="previewImgUrl" annotation-layer text-layer/>
     </el-dialog>
+    <PDFDrawerView ref="PDFDrawerViewRef"></PDFDrawerView>
   </div>
 </template>
 <script setup>
@@ -80,7 +87,11 @@ const props = defineProps({
     type: String,
   },
 });
-
+const PDFDrawerViewRef = ref(null);
+const toShowPDF = (pdfPath, pdfNum) => {
+  let url = import.meta.env.VITE_APP_UPLOAD_URL + pdfPath;
+  PDFDrawerViewRef.value && PDFDrawerViewRef.value.showPdf(url, pdfNum);
+};
 const route = useRoute();
 const tableConfig = getTableConfig(props.operationId);
 // 传入一个url,后面不带/