|
@@ -17,15 +17,24 @@
|
|
|
@size-change="dataList"
|
|
|
@current-change="dataList"
|
|
|
>
|
|
|
- <!-- <template #filePath-form="scope">
|
|
|
- <single-upload v-model="form.filePath" />
|
|
|
- <FilesUpload v-model:src="form.filePath" v-model:src-list="form.filePath" />
|
|
|
- </template> -->
|
|
|
- <!-- <template #filePath="{ row }">
|
|
|
- <el-button link type="primary" @click.stop="imgUrlClick(row)">{{
|
|
|
- row.filePath
|
|
|
- }}</el-button>
|
|
|
- </template> -->
|
|
|
+ <template #filePath-form="scope">
|
|
|
+ <!-- <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="getSourceUrl(form.filePath)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #filePath="{ row }">
|
|
|
+ <el-button link type="primary" @click.stop="imgUrlClick(row)"
|
|
|
+ >查看PDF</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
</avue-crud>
|
|
|
<CommonTable
|
|
|
ref="commonTableRef"
|
|
@@ -34,7 +43,7 @@
|
|
|
@selected-sure="onSelectedFinish"
|
|
|
/>
|
|
|
<el-dialog v-model="dialogVisible">
|
|
|
- <img w-full :src="previewImgUrl" alt="Preview Image" />
|
|
|
+ <VuePdfEmbed :source="previewImgUrl" annotation-layer text-layer />
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -42,6 +51,8 @@
|
|
|
import { ref, getCurrentInstance } from "vue";
|
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
|
import { getTableConfig } from "./configs";
|
|
|
+import PDFView from "@/components/PDFView/index.vue";
|
|
|
+import VuePdfEmbed from "vue-pdf-embed";
|
|
|
import {
|
|
|
saveCompoents,
|
|
|
getBomVersion,
|
|
@@ -75,6 +86,9 @@ const { selectionChange, multipleUpdate } = Methords; //选中和批量删除事
|
|
|
|
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
const bomVersion = ref(null);
|
|
|
+const getSourceUrl = (filePath) => {
|
|
|
+ return import.meta.env.VITE_APP_UPLOAD_URL + filePath;
|
|
|
+};
|
|
|
const startCreat = () => {
|
|
|
if (props.tableType === "wuliaocaiji") {
|
|
|
if (data.value && data.value.length > 0) {
|
|
@@ -181,7 +195,8 @@ const onSelectedFinish = (itemValue) => {
|
|
|
const previewImgUrl = ref("");
|
|
|
const dialogVisible = ref(false);
|
|
|
const imgUrlClick = (itemValue) => {
|
|
|
- previewImgUrl.value = itemValue.imgUrl;
|
|
|
+ previewImgUrl.value =
|
|
|
+ import.meta.env.VITE_APP_UPLOAD_URL + itemValue.filePath;
|
|
|
dialogVisible.value = true;
|
|
|
};
|
|
|
|