|
|
|
@ -186,18 +186,54 @@ |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="预览" :visible.sync="pdfVisible" center width="60%" v-drag > |
|
|
|
<el-dialog title="预览" :visible.sync="pdfVisible" center width="60%" > |
|
|
|
|
|
|
|
<iframe :src="this.pdfUrl" frameborder="0" width="100%" height="400px"></iframe> |
|
|
|
<!-- <div class="pdf">--> |
|
|
|
<!-- <div class="pdf-tab">--> |
|
|
|
<!-- <span--> |
|
|
|
<!-- class="btn-def btn-pre"--> |
|
|
|
<!-- @click.stop="prePage">上一页</span>--> |
|
|
|
<!-- <span--> |
|
|
|
<!-- class="btn-def btn-next"--> |
|
|
|
<!-- @click.stop="nextPage">下一页</span>--> |
|
|
|
<!-- <span--> |
|
|
|
<!-- class="btn-def"--> |
|
|
|
<!-- @click.stop="clock">顺时针</span>--> |
|
|
|
<!-- <span--> |
|
|
|
<!-- class="btn-def"--> |
|
|
|
<!-- @click.stop="counterClock">逆时针</span>--> |
|
|
|
<!-- <span--> |
|
|
|
<!-- class="btn-def"--> |
|
|
|
<!-- @click.stop="pdfPrintAll">全部打印</span>--> |
|
|
|
<!-- <span--> |
|
|
|
<!-- class="btn-def"--> |
|
|
|
<!-- @click.stop="pdfPrint">部分打印</span>--> |
|
|
|
<!-- </div>--> |
|
|
|
|
|
|
|
<!-- <pdf--> |
|
|
|
<!-- ref="pdf"--> |
|
|
|
<!-- :src="this.pdfUrl"--> |
|
|
|
<!-- :page="pageNum"--> |
|
|
|
<!-- :rotate="pageRotate"--> |
|
|
|
<!-- @password="password"--> |
|
|
|
<!-- @progress="loadedRatio = $event"--> |
|
|
|
<!-- @page-loaded="pageLoaded($event)"--> |
|
|
|
<!-- @num-pages="pageTotalNum=$event"--> |
|
|
|
<!-- @error="pdfError($event)"--> |
|
|
|
<!-- @link-clicked="page = $event">--> |
|
|
|
<!-- </pdf>--> |
|
|
|
<!--<!– <div>{{pageNum}}/{{pageTotalNum}}</div>–>--> |
|
|
|
<!--<!– <div>进度:{{loadedRatio}}</div>–>--> |
|
|
|
<!--<!– <div>页面加载成功: {{curPageNum}}</div>–>--> |
|
|
|
<!-- </div>--> |
|
|
|
|
|
|
|
<div> |
|
|
|
<pdf :src="pdfUrl" ></pdf> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
import column from "../common/column"; |
|
|
|
import { |
|
|
|
searchSysLanguagePackList, |
|
|
|
@ -235,7 +271,13 @@ |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
pdfUrl: '', |
|
|
|
pdfUrl:'', |
|
|
|
pageNum:1, |
|
|
|
pageTotalNum:1, |
|
|
|
pageRotate:0, |
|
|
|
// 加载进度 |
|
|
|
loadedRatio:0, |
|
|
|
curPageNum:0, |
|
|
|
pdfVisible: false, |
|
|
|
fileList: [], |
|
|
|
active: 0, |
|
|
|
@ -750,30 +792,63 @@ |
|
|
|
methods: { |
|
|
|
// 文件下载 |
|
|
|
fileDownload(row) { |
|
|
|
|
|
|
|
// window.open( this.baseUrl+'/file/'+row.newFileName) |
|
|
|
this.pdfVisible = true |
|
|
|
axios.get('/proxyApi/ftp/file/downFtpFile/' + row.id, { |
|
|
|
responseType: 'blob', |
|
|
|
headers: { |
|
|
|
'Content-Type': 'application/json', |
|
|
|
'token':Vue.cookie.get('token') |
|
|
|
} |
|
|
|
}).then(({data}) => { |
|
|
|
// 不限制文件下载类型 |
|
|
|
const blob = new Blob([data], {type: "application/octet-stream"}) |
|
|
|
// 下载文件名称 |
|
|
|
const fileName = row.fileName |
|
|
|
// a标签下载 |
|
|
|
const linkNode = document.createElement('a') |
|
|
|
linkNode.download = fileName // a标签的download属性规定下载文件的名称 |
|
|
|
linkNode.style.display = 'none' |
|
|
|
linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL |
|
|
|
this.pdfUrl = linkNode.href |
|
|
|
// document.body.appendChild(linkNode) |
|
|
|
// linkNode.click() // 模拟在按钮上的一次鼠标单击 |
|
|
|
// URL.revokeObjectURL(linkNode.href) // 释放URL 对象 |
|
|
|
// document.body.removeChild(linkNode) |
|
|
|
}) |
|
|
|
this.pdfUrl= 'http://192.168.1.2:9002/file/'+row.newFileName |
|
|
|
// axios.get('/proxyApi/ftp/file/downFtpFile/' + row.id, { |
|
|
|
// responseType: 'blob', |
|
|
|
// headers: { |
|
|
|
// 'Content-Type': 'application/json', |
|
|
|
// 'token':Vue.cookie.get('token') |
|
|
|
// } |
|
|
|
// }).then(({data}) => { |
|
|
|
// // 不限制文件下载类型 |
|
|
|
// const blob = new Blob([data], {type: "application/octet-stream"}) |
|
|
|
// // 下载文件名称 |
|
|
|
// const fileName = row.fileName |
|
|
|
// // a标签下载 |
|
|
|
// const linkNode = document.createElement('a') |
|
|
|
// linkNode.download = fileName // a标签的download属性规定下载文件的名称 |
|
|
|
// linkNode.style.display = 'none' |
|
|
|
// linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL |
|
|
|
// this.pdfUrl = linkNode.href |
|
|
|
// // window.open( this.pdfUrl) |
|
|
|
// // document.body.appendChild(linkNode) |
|
|
|
// // linkNode.click() // 模拟在按钮上的一次鼠标单击 |
|
|
|
// // URL.revokeObjectURL(linkNode.href) // 释放URL 对象 |
|
|
|
// // document.body.removeChild(linkNode) |
|
|
|
// }) |
|
|
|
}, |
|
|
|
prePage(){ |
|
|
|
var p = this.pageNum |
|
|
|
p = p>1?p-1:this.pageTotalNum |
|
|
|
this.pageNum = p |
|
|
|
}, |
|
|
|
nextPage(){ |
|
|
|
var p = this.pageNum |
|
|
|
p = p<this.pageTotalNum?p+1:1 |
|
|
|
this.pageNum = p |
|
|
|
}, |
|
|
|
clock(){ |
|
|
|
this.pageRotate += 90 |
|
|
|
}, |
|
|
|
counterClock() { |
|
|
|
this.pageRotate -= 90 |
|
|
|
}, |
|
|
|
pageLoaded(e){ |
|
|
|
this.curPageNum = e |
|
|
|
}, |
|
|
|
pdfError(error){ |
|
|
|
console.error(error) |
|
|
|
}, |
|
|
|
pdfPrintAll(){ |
|
|
|
this.$refs.pdf.print() |
|
|
|
}, |
|
|
|
pdfPrint(){ |
|
|
|
this.$refs.pdf.print(100,[1,2]) |
|
|
|
}, |
|
|
|
|
|
|
|
initFileModel(row){ |
|
|
|
this.getFileList(row) |
|
|
|
this.setUp.fileFlag = true |
|
|
|
@ -1008,7 +1083,7 @@ |
|
|
|
// 获取button的词典 |
|
|
|
getFunctionButtonList() { |
|
|
|
searchFunctionButtonList(this.queryButton).then(({data}) => { |
|
|
|
console.log(data.data) |
|
|
|
|
|
|
|
if (data.data.length > 0) { |
|
|
|
this.buttons = data.data |
|
|
|
} else { |
|
|
|
@ -1163,7 +1238,6 @@ |
|
|
|
console.log("数据下载完成") |
|
|
|
}, |
|
|
|
fields() { |
|
|
|
console.log(this.columnList) |
|
|
|
let json = "{" |
|
|
|
this.columnList.forEach((item, index) => { |
|
|
|
if (index == this.columnList.length - 1) { |
|
|
|
@ -1174,7 +1248,6 @@ |
|
|
|
}) |
|
|
|
json += "}" |
|
|
|
let s = eval("(" + json + ")") |
|
|
|
console.log(s) |
|
|
|
|
|
|
|
return s |
|
|
|
}, |
|
|
|
|