| | |
| | | |
| | | </h1> |
| | | </div> |
| | | <li v-for="(item,index) in fileList1"> |
| | | <el-link :href="'/pdfShowInfo?filePath='+item" type="success">{{fileList[index]}}</el-link> |
| | | <li v-for="(item,index) in fileList"> |
| | | <el-link @click="handleDownload(fileLs[index])" type="success">{{fileList[index]}}-------下载</el-link> |
| | | </li> |
| | | <!-- <h4 class="form-header"> </h4> |
| | | <div style="margin-left: 20px;"> |
| | |
| | | |
| | | <script> |
| | | import {listFScan,getFScanInfo,addFScan,delFScan,getFSInfo,updateFScan, uploadPic, uploadPic1, download} from "@/api/fscan/index"; |
| | | |
| | | import {blobValidate} from "@/utils/ruoyi"; |
| | | export default { |
| | | components: { |
| | | pdf |
| | | }, |
| | | // components: { |
| | | // pdf |
| | | // }, |
| | | data() { |
| | | return { |
| | | fileList1:[], |
| | | fileList:[], |
| | | fileLs:[], |
| | | pdfSrc: '', |
| | | numPages: undefined, |
| | | } |
| | |
| | | //发起请求拿到pdfSrc |
| | | let _this = this |
| | | getFScanInfo(id).then(response => { |
| | | // alert(23) |
| | | |
| | | |
| | | //console.log(response) |
| | | // if(response.msg=="操作成功") |
| | | { |
| | |
| | | this.fileList1 = response.data.filePath.split(","); |
| | | for(let i = 0; i < this.fileList1.length; i++) |
| | | { |
| | | if(this.fileList1[i].length!=0){ |
| | | this.fileLs.push(this.fileList1[i]) |
| | | var lsr = this.fileList1[i].split("/") |
| | | var ls = lsr[lsr.length - 1].split("_") |
| | | var lr = ls[ls.length-1].split(".") |
| | | var pnam = ls[0] + "." + lr[lr.length-1] |
| | | this.fileList.push(pnam) |
| | | this.fileList.push(pnam)} |
| | | |
| | | |
| | | |
| | | } |
| | | console.log(this.fileLs) |
| | | console.log("--------------------") |
| | | |
| | | // alert(1234) |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | methods:{ |
| | | handleDownload(url) { |
| | | |
| | | var formData = {'path':url.replace(process.env.VUE_APP_BASE_TRUE_API,"")}; |
| | | let lens = formData.path.split(".") |
| | | let suffix = lens[lens.length-1] |
| | | console.log(formData) |
| | | download(formData).then(async (response) => { |
| | | const isLogin = await blobValidate(response); |
| | | let nt = new Date().getTime() |
| | | let filename = 'scods_'+nt+'.'+suffix |
| | | const blob = new Blob([response]) |
| | | saveAs(blob, filename) |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |