|
|
|
@ -3,7 +3,7 @@
|
|
|
|
|
* @Author: kery.chen
|
|
|
|
|
* @Description: 总体概览左侧
|
|
|
|
|
* @Date: 2021-11-30 11:08:50
|
|
|
|
|
* @LastEditTime: 2023-10-25 10:51:25
|
|
|
|
|
* @LastEditTime: 2023-10-25 11:17:20
|
|
|
|
|
* @FilePath : \\tcingiocpro\\src\\views\\privateOrder\\ecosphere\\components\\componentLeft.vue
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
|
|
|
@ -335,14 +335,14 @@
|
|
|
|
|
ref="fileDoc"
|
|
|
|
|
class="file-content"
|
|
|
|
|
>
|
|
|
|
|
<iframe style="height: 200%; width: 100%" :src="`https://api.idocv.com/view/url?url=${docxUrl}`" v-if="!isdevelopment"></iframe>
|
|
|
|
|
<!-- <iframe style="height: 200%; width: 100%" :src="`https://api.idocv.com/view/url?url=${docxUrl}`" v-if="!isdevelopment"></iframe> -->
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
v-if="fileExtension === 'pdf'"
|
|
|
|
|
class="file-content file-content-pdf"
|
|
|
|
|
>
|
|
|
|
|
<iframe style="height: 100%; width: 100%" :src="pdfUrl" v-if="!isdevelopment"></iframe>
|
|
|
|
|
<div v-for="i in numPages" :key="i" v-else>
|
|
|
|
|
<!-- <iframe style="height: 100%; width: 100%" :src="pdfUrl" v-if="!isdevelopment"></iframe> -->
|
|
|
|
|
<div v-for="i in numPages" :key="i">
|
|
|
|
|
<pdf ref="pdf" :key="i" :src="pdfUrl" :page="i"></pdf>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -1151,12 +1151,15 @@ export default {
|
|
|
|
|
this.fileExtension = row["材料路径"].substring(
|
|
|
|
|
row["材料路径"].lastIndexOf(".") + 1
|
|
|
|
|
);
|
|
|
|
|
let newarr = row["材料路径"].split("/");
|
|
|
|
|
let lastArr = newarr.slice(newarr.indexOf("demo") + 1, newarr.length);
|
|
|
|
|
// console.log(row['材料路径'],'process.env.VUE_APP_BASE_API2')
|
|
|
|
|
if (this.fileExtension == "pdf") {
|
|
|
|
|
this.pdfUrl = row['材料路径'];
|
|
|
|
|
this.dialogDetails = true;
|
|
|
|
|
console.log(this.pdfUrl,'this.pdfUrl')
|
|
|
|
|
// this.pdfUrl = row['材料路径'];
|
|
|
|
|
// this.dialogDetails = true;
|
|
|
|
|
// console.log(this.pdfUrl,'this.pdfUrl')
|
|
|
|
|
// this.getNumPages(process.env.VUE_APP_BASE_API2 + row["材料路径"]);
|
|
|
|
|
this.getNumPages("/demo" + "/" + lastArr.join("/"));
|
|
|
|
|
} else if (
|
|
|
|
|
this.fileExtension === "docx" ||
|
|
|
|
|
this.fileExtension === "doc"
|
|
|
|
@ -1166,19 +1169,19 @@ export default {
|
|
|
|
|
// this.dialogDetails = true;
|
|
|
|
|
// docx.renderAsync(blob, this.$refs.fileDoc);
|
|
|
|
|
|
|
|
|
|
// axios({
|
|
|
|
|
// method: "get",
|
|
|
|
|
// responseType: "blob", // 设置响应文件格式
|
|
|
|
|
// url: process.env.VUE_APP_BASE_API2 + row["材料路径"],
|
|
|
|
|
// }).then(({ data }) => {
|
|
|
|
|
// if (data) {
|
|
|
|
|
// console.log(data,'data')
|
|
|
|
|
// this.dialogDetails = true;
|
|
|
|
|
// this.$nextTick(() => {
|
|
|
|
|
// docx.renderAsync(data, this.$refs.fileDoc); // 渲染到页面预览
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
axios({
|
|
|
|
|
method: "get",
|
|
|
|
|
responseType: "blob", // 设置响应文件格式
|
|
|
|
|
url: "/demo" + "/" + lastArr.join("/"),
|
|
|
|
|
}).then(({ data }) => {
|
|
|
|
|
if (data) {
|
|
|
|
|
console.log(data,'data')
|
|
|
|
|
this.dialogDetails = true;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
docx.renderAsync(data, this.$refs.fileDoc); // 渲染到页面预览
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.docxUrl = row['材料路径'];
|
|
|
|
|
this.dialogDetails = true;
|
|
|
|
|