Q-ABAB 1 year ago
parent
commit
5ca93bd3c7

+ 4 - 4
src/components/tool/pdf.js

@@ -1,13 +1,13 @@
 import html2canvas from "html2canvas";
 import jsPDF from "jspdf";
 
-export const downloadPDF = page => {
+export const downloadPDF = (page,fileName='test') => {
 
   html2canvas(page).then(function(canvas) {
-    canvas2PDF(canvas);
+    canvas2PDF(canvas,fileName);
   });
 };
-const canvas2PDF = canvas => {
+const canvas2PDF = (canvas,fileName) => {
     let contentWidth = canvas.width;
     console.log(contentWidth);
     let contentHeight = canvas.height;
@@ -41,7 +41,7 @@ const canvas2PDF = canvas => {
         }
       }
     }
-    PDF.save('测试' + '.pdf')
+    PDF.save(fileName + '.pdf')
 
 
 

+ 1 - 1
src/views/activityManage/makerActivityWordDetail.vue

@@ -270,7 +270,7 @@
               })
             },
             downloadWord(){
-              downloadPDF(this.$refs.myChild.$refs.pdfShow)
+              downloadPDF(this.$refs.myChild.$refs.pdfShow,this.wordData['type']==0?'附件 2:创客专项资金项目申请表(创客活动)':'附件 2:创客专项资金项目申请表(个人创客)')
               this.downloadDig = false;
               // this.wordData['total']=this.wordData.fund.facility*1 + this.wordData.fund.materials*1+this.wordData.fund.process*1+ this.wordData.fund.assist*1+this.wordData.fund.authenticate*1+ this.wordData.fund.match*1+this.wordData.fund.activity*1+this.wordData.fund.affair*1
               // return console.log(this.wordData);

+ 2 - 0
src/views/projectApply/components/MakerSpaceWord.vue

@@ -243,6 +243,8 @@
                 <el-input
                   type="textarea"
                   class="noCenter"
+                  maxlength="300"
+                  show-word-limit
                   :autosize="{minRows: 6}"
                   resize="none"
                   v-model="wordData['brief']">

+ 1 - 1
src/views/projectApply/components/MakerSpaceWordDetail.vue

@@ -126,7 +126,7 @@
             },
             getWord(){//下载表格
               // console.log(this.$refs.myChild.$refs.downPDF)
-                downloadPDF(this.$refs.myChild.$refs.downPDF)
+                downloadPDF(this.$refs.myChild.$refs.downPDF,"附件3:2023年二级学院特色创客空间建设项目申报书")
                 this.downloadDig=false;
             },
             changeWord(){//修改表格数据

+ 3 - 1
src/views/projectApply/components/studentProjectWord.vue

@@ -217,11 +217,13 @@
                   type="textarea"
                   :rows="6"
                   resize="none"
+                  maxlength="300"
                   placeholder="请输入项目简介"
                   style="width: 100%;"
+                  show-word-limit
                   v-model="wordData.brief">
                 </el-input>
-                <div style="color: #ccc;position: absolute;right: 60px;bottom: 10px;">{{ wordData.brief.length }}/300</div>
+                <!-- <div style="color: #ccc;position: absolute;right: 60px;bottom: 10px;">{{ wordData.brief.length }}/300</div> -->
             </td>
           </tr>
           <tr>

+ 1 - 1
src/views/projectApply/components/studentProjectWordDetail.vue

@@ -394,7 +394,7 @@
                 })
           },
           downloadWord(){
-            downloadPDF(this.$refs.myChild.$refs.pdfShow)
+            downloadPDF(this.$refs.myChild.$refs.pdfShow,'附件2:2023年学生创客项目申报书')
             // this.wordData['total']=this.wordData.fund.facility*1 + this.wordData.fund.materials*1+this.wordData.fund.process*1+ this.wordData.fund.assist*1+this.wordData.fund.authenticate*1+ this.wordData.fund.match*1+this.wordData.fund.activity*1+this.wordData.fund.affair*1
             // return console.log(this.wordData);
             // getWord(this.downWordData)

+ 3 - 4
src/views/projectManage/ProjectManagementMain.vue

@@ -72,10 +72,9 @@
                 this.AidShow = aid;
             },
             getWord(){
-                let page;
-                if(this.$route.query['Id']=='5e21b204-c206-11ed-a4cd-509a4c5b67cf')page=this.$refs.student.$refs.downPDF;
-                if(this.$route.query['Id']=='5f7a66d5-c206-11ed-a4cd-509a4c5b67cf')page=this.$refs.maker.$refs.downPDF;
-                downloadPDF(page);
+                if(this.$route.query['Id']=='5e21b204-c206-11ed-a4cd-509a4c5b67cf')downloadPDF(this.$refs.student.$refs.downPDF,'附件2:2023年学生创客项目申报书模板');
+                if(this.$route.query['Id']=='5f7a66d5-c206-11ed-a4cd-509a4c5b67cf')downloadPDF(this.$refs.maker.$refs.downPDF,'附件3:2023年二级学院特色创客空间建设项目申报书模板');
+                
             }
         },
         mounted(){

+ 2 - 4
src/views/projectSettlement/projectSettlementDetailMain.vue

@@ -70,10 +70,8 @@
         },
         methods:{
           getWord(){
-                let page;
-                if(this.$route.query['tid']=='5e21b204-c206-11ed-a4cd-509a4c5b67cf')page=this.$refs.student.$refs.downPDF;
-                if(this.$route.query['tid']=='5f7a66d5-c206-11ed-a4cd-509a4c5b67cf')page=this.$refs.maker.$refs.downPDF;
-                downloadPDF(page);
+                if(this.$route.query['tid']=='5e21b204-c206-11ed-a4cd-509a4c5b67cf')downloadPDF(this.$refs.student.$refs.downPDF,'附件2:2023年学生创客项目申报书模板');
+                if(this.$route.query['tid']=='5f7a66d5-c206-11ed-a4cd-509a4c5b67cf')downloadPDF(this.$refs.maker.$refs.downPDF,'附件3:2023年二级学院特色创客空间建设项目申报书模板');                
             }
         },
         mounted(){