|
@@ -26,7 +26,13 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-if="attachment" class="pdf-box">
|
|
|
- <pdf
|
|
|
+ <iframe
|
|
|
+ :src="attachment"
|
|
|
+ width="100%"
|
|
|
+ height="1000px"
|
|
|
+ id="ifm"
|
|
|
+ ></iframe>
|
|
|
+ <!-- <pdf
|
|
|
ref="pdf"
|
|
|
:src="attachment"
|
|
|
v-for="i in numPages"
|
|
@@ -34,7 +40,7 @@
|
|
|
:page="i"
|
|
|
>
|
|
|
{{ i / numPages }}
|
|
|
- </pdf>
|
|
|
+ </pdf> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -45,10 +51,10 @@ import Header from "@/components/inputModules/common/Header";
|
|
|
import HeaderOne from "@/components/inputModules/common/HeaderOne";
|
|
|
import pdf from "vue-pdf";
|
|
|
import { updateWordPack } from "@/utils/i18n";
|
|
|
-import { getToken } from "@/utils/auth";
|
|
|
+import { getToken, getConfig } from "@/utils/auth";
|
|
|
import { Base64 } from "js-base64";
|
|
|
|
|
|
-import { TextbookAPI, LearnWebSI } from "@/api/ajax";
|
|
|
+import { TextbookAPI, LearnWebSI, getContentFile } from "@/api/ajax";
|
|
|
export default {
|
|
|
name: "TextbookDetailPdf",
|
|
|
components: {
|
|
@@ -71,6 +77,7 @@ export default {
|
|
|
IsDownload: false, //是否可以下载
|
|
|
allList: null,
|
|
|
isData: false,
|
|
|
+ file_preview_url: "",
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -126,12 +133,18 @@ export default {
|
|
|
})
|
|
|
.then((res) => {
|
|
|
this.data = res;
|
|
|
- this.loading = false;
|
|
|
- this.attachment =
|
|
|
- process.env.VUE_APP_PDF_API +
|
|
|
- Base64.decode(this.$route.query.relativePath);
|
|
|
- this.getNumPages();
|
|
|
- console.log(this.attachment);
|
|
|
+ let Mname = "file_store_manager-GetFileStoreInfo";
|
|
|
+ getContentFile(Mname, {
|
|
|
+ file_id: Base64.decode(this.$route.query.fileId),
|
|
|
+ }).then((res) => {
|
|
|
+ this.attachment =
|
|
|
+ `${this.file_preview_url}/onlinePreview?url=` +
|
|
|
+ Base64.encode(res.file_url);
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ // this.attachment =
|
|
|
+ // process.env.VUE_APP_PDF_API +
|
|
|
+ // Base64.decode(this.$route.query.relativePath);
|
|
|
})
|
|
|
.catch((res) => {
|
|
|
this.loading = false;
|
|
@@ -139,6 +152,8 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
async created() {
|
|
|
+ let data = JSON.parse(getConfig());
|
|
|
+ this.file_preview_url = data.doc_preview_service_address;
|
|
|
await updateWordPack({
|
|
|
word_key_list: [
|
|
|
"Key5",
|