Commit d55416fc by liangzhen

暂存

1 parent 35d12911
......@@ -17,6 +17,7 @@
"scss": "^0.2.4",
"vue": "^2.6.14",
"vue-cli": "^2.9.6",
"vue-pdf": "^4.3.0",
"vue-router": "^3.5.1",
"vuex": "^3.6.2",
"webpack": "^5.89.0"
......
<!doctype html><html lang=""><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" href="/favicon.ico"/><title>综合分析中心</title><script defer="defer" src="/js/chunk-vendors.e5f4f47b.js"></script><script defer="defer" src="/js/app.a1ce5541.js"></script><link href="/css/chunk-vendors.10dd4e95.css" rel="stylesheet"><link href="/css/app.161e41d4.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but 综合分析中心 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
<!doctype html><html lang=""><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" href="/favicon.ico"/><title>综合分析中心</title><script defer="defer" src="/js/chunk-vendors.2ac028e8.js"></script><script defer="defer" src="/js/app.ad81aa46.js"></script><link href="/css/chunk-vendors.10dd4e95.css" rel="stylesheet"><link href="/css/app.5c4c2a8b.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but 综合分析中心 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
......@@ -51,6 +51,8 @@ axios.interceptors.request.use(config => {
//响应拦截器即异常处理
axios.interceptors.response.use(response => {
let code = response.data.code;
// response.header('Access-Control-Allow-Origin', 'http://localhost:8080')
// if (response.headers.token) {
// var token = res.headers.token
......
......@@ -386,7 +386,8 @@ export default {
let resUrl = await presignedUrl(paramsUrl);
this.iframeUrl = resUrl.msg;
this.iframeUrl = '/pdf/web/viewer.html?file='+resUrl.msg;
// this.iframeUrl='/pdf/web/viewer.html?file=http://arch-file.oss-cn-beijing.aliyuncs.com/arch-file/665994f479f6157c744951bd.pdf?Expires=1718011134&OSSAccessKeyId=LTAI5tGjidtvVSCvwGxTp8FH&Signature=blOuzxUwnotgqo7mxM9rShOEJ1I%3D'
console.log(this.questionList, "总列表");
this.oldQuestionList = JSON.parse(JSON.stringify(this.questionList));
});
......@@ -400,7 +401,7 @@ export default {
url: item.url,
};
let resUrl = await presignedUrl(paramsUrl);
this.iframeUrl = resUrl.msg;
this.iframeUrl = '/pdf/web/viewer.html?file='+resUrl.msg;
} else {
// this.iframeUrl =""
this.iframeUrl = "/nopdf.png";
......
<!-- 结果公示 --><template>
<div>
<iframe src="http:/127.0.0.1:80/static/" frameborder="0" style="width:100vw;height:100vh;" id="iframe" ></iframe>
<pdf v-for="i in pageCount"
:src="pdfSrc"
:key="i + 'pdf'"
:page="i"
class="pdf-item"></pdf>
</div>
</template>
<script>
import pdf from 'vue-pdf'
export default {
data(){
return{
pageCount: 1,
// 缩放
scale: 100,
timer: null,
showPreviewFile: false,
pdfSrc:"http://arch-file.oss-cn-beijing.aliyuncs.com/arch-file/665994f479f6157c744951bd.pdf?Expires=1718011134&OSSAccessKeyId=LTAI5tGjidtvVSCvwGxTp8FH&Signature=blOuzxUwnotgqo7mxM9rShOEJ1I%3D"
}
},
components:{ pdf},
mounted(){
this.previewFile()
},
watch: {
pdfUrl: {
handler(newVal, oldVal) {
if (newVal) {
this.previewFile()
}
},
immediate: false
}
},
methods: {
/** pdf加载 */
async previewFile() {
try {
let loadingTask = pdf.createLoadingTask({
url: this.pdfUrl,
CMapReaderFactory
});
loadingTask.promise.then(pdf => {
this.pdfUrl = loadingTask
this.showPreviewFile = true;
this.pageCount = pdf.numPages;
}).catch((e) => {
console.log("pdf初始化错误", e);
Notify("文件初始化失败,请返回下载该文件查看")
})
} catch (e) {
this.$router.go(-1)
console.log("pdf加载出错了", e);
}
},
}
}
</script>
<style lang="scss" scoped>
#iframeId{
.process-fileView-pdf-container {
width: 100%;
height: 100vh;
height: 100%;
.pdf-item{
height: 100vh;
display: block !important;
}
.pdf-button-group {
position: fixed;
top: 10px;
right: 20px;
.btn-item {
width: 50px;
height: 50px;
border-radius: 100%;
}
.div-item {
margin-bottom: 8px;
}
::v-deep .van-button__text{
line-height: 20px;
}
}
}
</style>
\ No newline at end of file
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!