mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-16 06:16:44 +08:00
增加前端pdf导出
This commit is contained in:
@@ -128,10 +128,10 @@
|
||||
class="export-dialog"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="dialogVisible">
|
||||
<div class="Exportbox">
|
||||
<div class="Exportbox" id="idPdfDom">
|
||||
<div class="export-dialog-top">
|
||||
<div class="export-dialog-left">
|
||||
<author-img :avatar="userData.avatar" :aid="userData.aid" :sex="userData.sex"></author-img>
|
||||
<!-- <author-img :avatar="userData.avatar" :aid="userData.aid" :sex="userData.sex"></author-img> -->
|
||||
<div class="userInfo-info">
|
||||
<p><span style="font-weight: 500;font-size: 22px;">{{userData.name}}</span><span style="font-size: 12px;margin-left:10px">{{userInfo.departFullName}}</span></p>
|
||||
<p>{{userData.sign}}</p>
|
||||
@@ -154,13 +154,13 @@
|
||||
<span v-if="item.contentType != 3">{{ item.content }}</span>
|
||||
<div v-else>
|
||||
<template v-for="img in item.imgList">
|
||||
<img style="max-height:145px;max-width:140px" :src="fileBaseUrl + img" alt=""/>
|
||||
<img style="max-height:145px;max-width:140px" crossOrigin="anonymous" :src="fileBaseUrl + img" alt=""/>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button class="footer-btn" style="color: #387DF7;" plain @click="dialogVisible = false">取 消</el-button>
|
||||
<!-- <el-button @click="dialogVisible = false">打 印</el-button> -->
|
||||
@@ -179,6 +179,7 @@ import AuthorImg from '@/components/Portal/authorImg.vue';
|
||||
import { mapGetters } from 'vuex';
|
||||
import {formatDate} from '@/utils/tools.js';
|
||||
import apiUser from "@/api/system/user.js";
|
||||
import htmlToPdf from '@/utils/htmlToPdf'
|
||||
export default {
|
||||
components:{interactBar,FileUpload,AuthorImg},
|
||||
computed: {
|
||||
@@ -303,7 +304,10 @@ export default {
|
||||
author:this.userData.avatar,//this.userInfo.avatar,
|
||||
}
|
||||
if(this.exportType == '1') {
|
||||
apiNote.exportPdf(data);
|
||||
window.scrollTo(0, 0);
|
||||
htmlToPdf.getPdf('我的笔记');
|
||||
|
||||
//apiNote.exportPdf(data);
|
||||
// apiNote.exportPdf(data).then(res=>{
|
||||
// if(res.status) {
|
||||
// this.$message.error('导出失败');
|
||||
|
||||
Reference in New Issue
Block a user