| | |
| | | <a-tag v-else class="tag-all" color="#f50"> 适用全部 </a-tag> |
| | | <template v-if="canDownload"> |
| | | <a-divider type="vertical"></a-divider> |
| | | <a v-if="record.isCanPreview" :disabled="!record.status" @click="downloadFile(record)">预览</a> |
| | | <a v-else :disabled="!record.status" @click="downloadFile(record)">下载</a> |
| | | <a |
| | | v-if="record.isCanPreview" |
| | | :disabled="!record.status" |
| | | @click="downloadFile(record)" |
| | | >预览</a |
| | | > |
| | | <a |
| | | v-else |
| | | :disabled="!record.status" |
| | | @click="downloadFile(record)" |
| | | >下载</a |
| | | > |
| | | </template> |
| | | <a-divider type="vertical"></a-divider> |
| | | <a-popover title="" trigger="hover"> |
| | |
| | | :width="960" |
| | | title="文件预览" |
| | | :destroyOnClose="true" |
| | | @cancel="pdfCancel"> |
| | | @cancel="pdfCancel" |
| | | > |
| | | <div style="height:600px; overflow-y: auto"> |
| | | <iframe :src="pdfInfo.src"></iframe> |
| | | </div> |
| | | |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | |
| | | import getFileTypeAndName from "@/assets/js/tools/getFileTypeAndName"; |
| | | import VuePdf from "vue-pdf"; |
| | | |
| | | |
| | | export default { |
| | | components: { |
| | | AdvanceTable, |
| | |
| | | numPages: 0, |
| | | rotate: 0, |
| | | }, |
| | | rowFileName: '', |
| | | rowFileName: "", |
| | | logList: [], |
| | | logVisible: false, |
| | | currentObj: null, |
| | |
| | | align: "center", |
| | | searchAble: true, |
| | | width: 100, |
| | | search: { |
| | | default: true, |
| | | }, |
| | | scopedSlots: { customRender: "status" }, |
| | | }, |
| | | { |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (this.rowFileName.toLowerCase() != this.resObj.fileName.toLowerCase()) { |
| | | if ( |
| | | this.rowFileName.toLowerCase() != this.resObj.fileName.toLowerCase() |
| | | ) { |
| | | this.$message.error("说明文件与该条记录可能不匹配"); |
| | | return false; |
| | | } |
| | |
| | | const { pageCurr, pageSize, conditions, columns } = this; |
| | | let params = { pageCurr, pageSize }; |
| | | let data = {}; |
| | | console.log(this.conditions['status']); |
| | | Object.keys(conditions).forEach((v) => { |
| | | switch (v) { |
| | | case "code": |
| | |
| | | list = data2.list; |
| | | total = data2.total; |
| | | } |
| | | this.dataSource = list.map(item=>{ |
| | | this.dataSource = list.map((item) => { |
| | | const fileInfo = getFileTypeAndName(item.fileUrl); |
| | | item.isCanPreview = fileInfo.type === "pdf"; |
| | | return item; |
| | |
| | | downloadFile(record) { |
| | | const fileInfo = getFileTypeAndName(record.fileUrl); |
| | | let url = this.webUrl + record.fileUrl; |
| | | if(fileInfo.type === 'pdf') { // 预览 |
| | | if (fileInfo.type === "pdf") { |
| | | // 预览 |
| | | window.open(url); |
| | | }else { // 下载 |
| | | } else { |
| | | // 下载 |
| | | let loading = this.$layer.loading(); |
| | | let link = document.createElement("a"); |
| | | link.style.display = "none"; |