| | |
| | | if (!newVal) { |
| | | this.showTip = false; |
| | | this.tipMessage = ''; |
| | | this.removeKeyListener(); |
| | | } else { |
| | | this.$nextTick(() => { |
| | | this.addKeyListener(); |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | |
| | | showTipMessage(message) { |
| | | this.tipMessage = message; |
| | | this.showTip = true; |
| | | // 2秒后自动隐藏提示 |
| | | setTimeout(() => { |
| | | this.hideTip(); |
| | | }, 2000); |
| | |
| | | }, |
| | | handleError() { |
| | | console.error(`图片加载失败: ${this.currentUrl}`); |
| | | }, |
| | | |
| | | // 键盘事件处理 |
| | | handleKeydown(event) { |
| | | switch(event.key) { |
| | | case 'ArrowLeft': |
| | | event.preventDefault(); // 阻止默认行为 |
| | | this.goPrev(); |
| | | break; |
| | | case 'ArrowRight': |
| | | event.preventDefault(); |
| | | this.goNext(); |
| | | break; |
| | | case 'Escape': |
| | | event.preventDefault(); |
| | | this.close(); |
| | | break; |
| | | } |
| | | }, |
| | | addKeyListener() { |
| | | document.addEventListener('keydown', this.handleKeydown); |
| | | }, |
| | | removeKeyListener() { |
| | | document.removeEventListener('keydown', this.handleKeydown); |
| | | } |
| | | }, |
| | | mounted() { |
| | | if (this.visible) { |
| | | this.addKeyListener(); |
| | | } |
| | | }, |
| | | beforeUnmount() { |
| | | this.removeKeyListener(); |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | :src="pdfimg" |
| | | @click="handleImageClick(initialIndex)" |
| | | > |
| | | <!-- <div slot="error" class="image-slot"> |
| | | <!-- <div slot="error" class="image-slot"> |
| | | <i class="el-icon-picture-outline"></i> |
| | | </div> --> |
| | | </el-image> |
| | | <custom-image-viewer |
| | | :url-list="pdfimgsrcList" |
| | | :initial-index="currentIndex" |
| | | :visible="viewerVisible" |
| | | @update:visible="viewerVisible = $event" |
| | | @close="handleViewerClose" |
| | | /> |
| | | </el-image> |
| | | <custom-image-viewer |
| | | :url-list="pdfimgsrcList" |
| | | :initial-index="currentIndex" |
| | | :visible="viewerVisible" |
| | | @update:visible="viewerVisible = $event" |
| | | @close="handleViewerClose" |
| | | /> |
| | | </div> |
| | | <div v-else class="pdfimgmins">{{ hintitle }}</div> |
| | | </div> |
| | |
| | | <!-- <img :src="pdfimg" /> --> |
| | | <el-image |
| | | style="width: 95%; height: 90%" |
| | | @error="handleImageError" |
| | | @load="handleImageLoad" |
| | | :src="invoicepdfimg" |
| | | :preview-src-list="invoicepdfimgsrcList" |
| | | @click="invoicehandleImageClick(initialIndex)" |
| | | > |
| | | <!-- <div slot="error" class="image-slot"> |
| | | <i class="el-icon-picture-outline"></i> |
| | | </div> --> |
| | | <i class="el-icon-picture-outline"></i> |
| | | </div> --> |
| | | </el-image> |
| | | <custom-image-viewer |
| | | :url-list="invoicepdfimgsrcList" |
| | | :initial-index="invoicecurrentIndex" |
| | | :visible="invoiceviewerVisible" |
| | | @update:visible="invoiceviewerVisible = $event" |
| | | @close="invoicehandleViewerClose" |
| | | /> |
| | | </div> |
| | | <div v-else class="pdfimgmins">{{ hintitle }}</div> |
| | | </div> |
| | |
| | | import { getToken } from "@/utils/auth"; |
| | | import CustomImageViewer from "@/components/CustomImageViewer"; // 根据你的路径调整 |
| | | |
| | | |
| | | export default { |
| | | //import引入的组件需要注入到对象中才能使用 |
| | | components: { |
| | | Li_area_select, |
| | | OrgSelecter, |
| | | CustomImageViewer, |
| | | CustomImageViewer |
| | | }, |
| | | name: "fundApply", |
| | | |
| | |
| | | pdfimg: "", |
| | | pdfimgsrcList: [], |
| | | currentIndex: 0, // 初始索引 |
| | | invoicecurrentIndex: 0, // 初始索引 |
| | | initialIndex: 0, // 初始索引 |
| | | viewerVisible: false, // 控制预览组件显示 |
| | | invoiceviewerVisible: false, // 控制预览组件显示 |
| | | pdfVisible: false, |
| | | previewpdf: false, |
| | | hintitle: "请上传文件后查看", |
| | |
| | | this.currentIndex = index; |
| | | this.viewerVisible = true; |
| | | }, |
| | | invoicehandleImageClick(index) { |
| | | this.invoicecurrentIndex = index; |
| | | this.invoiceviewerVisible = true; |
| | | }, |
| | | handleViewerClose() { |
| | | this.viewerVisible = false; |
| | | }, |
| | | invoicehandleViewerClose() { |
| | | this.invoiceviewerVisible = false; |
| | | }, |
| | | handleUploadError() {}, |
| | | remove(file, fileList) { |
| | | const rbDetails = [...this.rbDetails]; |
| | |
| | | <el-image |
| | | style="width: 95%; height: 90%" |
| | | :src="invoicepdfimg" |
| | | :preview-src-list="invoicepdfimgsrcList" |
| | | @click="invoicehandleImageClick(initialIndex)" |
| | | > |
| | | <!-- <div slot="error" class="image-slot"> |
| | | <i class="el-icon-picture-outline"></i> |
| | | </div> --> |
| | | </el-image> |
| | | <custom-image-viewer |
| | | :url-list="invoicepdfimgsrcList" |
| | | :initial-index="invoicecurrentIndex" |
| | | :visible="invoiceviewerVisible" |
| | | @update:visible="invoiceviewerVisible = $event" |
| | | @close="invoicehandleViewerClose" |
| | | /> |
| | | </div> |
| | | <div v-else class="pdfimgmins">{{ hintitle }}</div> |
| | | </div> |
| | |
| | | invoicepdfimg: "", |
| | | invoicepdfimgsrcList: [], |
| | | currentIndex: 0, // 初始索引 |
| | | invoicecurrentIndex: 0, // 初始索引 |
| | | initialIndex: 0, // 初始索引 |
| | | viewerVisible: false, // 控制预览组件显示 |
| | | invoiceviewerVisible: false, // 控制预览组件显示 |
| | | |
| | | //人员类别 |
| | | persontype: null, |
| | | //到达地 |
| | |
| | | this.currentIndex = index; |
| | | this.viewerVisible = true; |
| | | }, |
| | | invoicehandleImageClick(index) { |
| | | this.invoicecurrentIndex = index; |
| | | this.invoiceviewerVisible = true; |
| | | }, |
| | | handleViewerClose() { |
| | | this.viewerVisible = false; |
| | | }, |
| | | invoicehandleViewerClose() { |
| | | this.invoiceviewerVisible = false; |
| | | }, |
| | | handleImageError() { |
| | | console.error("图片加载失败"); |
| | | }, |
| | |
| | | open: true, |
| | | proxy: { |
| | | // detail: https://cli.vuejs.org/config/#devserver-proxy |
| | | [process.env.VUE_APP_BASE_API]: { |
| | | target:`http://localhost:8080`, |
| | | //target:`http://116.62.18.175:8080`, |
| | | [process.env.VUE_APP_BASE_API]: { |
| | | // target:`http://localhost:8080`, |
| | | target:`http://192.168.100.10:8080`, |
| | | // target:`http://192.168.1.4:8086`, |
| | | // target: `https://slb.hospitalstar.com:9093`, |
| | | changeOrigin: true, |
| | |
| | | //当pdf和数据接口不在同一个请求地址下时,为pdf预览追加一个代理 |
| | | '/pdf': { |
| | | target: 'http://192.168.1.4/pdf/data', |
| | | changOrigin: true, |
| | | changOrigin: true, |
| | | pathRewrite: { |
| | | '^/pdf': '' |
| | | } |
| | | '^/pdf': '' |
| | | } |
| | | } |
| | | }, |
| | | disableHostCheck: true |