"use strict";(self["webpackChunkscproject"]=self["webpackChunkscproject"]||[]).push([[5529],{75529:function(t,e,a){a.r(e),a.d(e,{default:function(){return f}});var i=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[t._m(0),e("hr"),e("studentProjectWord",{ref:"pdf",attrs:{wordData:t.wordData,reversedMessage:t.reversedMessage},on:{fileOption2:t.fileOption2,getFile2:t.getFile2}}),e("div",{staticStyle:{position:"fixed",bottom:"5%",right:"2%"}},[e("el-button",{attrs:{type:"primary"},on:{click:t.saveDraft}},[t._v("保存草稿")]),e("el-button",{attrs:{type:"primary"},on:{click:t.test}},[t._v("保存项目")])],1),e("el-dialog",{staticClass:"pageSubmitData",attrs:{title:"提示",visible:t.submitHint,width:"600px"},on:{"update:visible":function(e){t.submitHint=e}}},[e("div",{staticClass:"deleteContent"},[t._v(" 确定保存“"+t._s(t.wordData["projectName"])+"”项目吗? ")]),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{staticClass:"AllDialogBtn",attrs:{type:"primary"},on:{click:t.submitWord}},[t._v("确认保存")]),e("el-button",{staticClass:"AllDialogBtn",on:{click:function(e){t.submitHint=!1}}},[t._v("取消")])],1)]),e("el-dialog",{attrs:{title:"展示文件",visible:t.showFile,top:"1vh",width:"80vw","append-to-body":""},on:{"update:visible":function(e){t.showFile=e}}},[e("div",{staticClass:"showFileArea",staticStyle:{height:"80vh"}},[t.videoDetail.sources?e("div",{staticClass:"workd_media",staticStyle:{width:"90%",height:"90%"}},[e("video-player",{staticClass:"video-player vjs-custom-skin",staticStyle:{width:"90%",height:"90%",margin:"0 auto"},attrs:{playsinline:!0,options:t.videoDetail},on:{play:function(e){return t.onPlayerPlay(e)}}})],1):"pdf"!=t.Wordss["type"]&&"图片"!=t.Wordss["name"]?e("vword",{staticClass:"fullStyle",staticStyle:{width:"100%",height:"100%",overflow:"auto"},attrs:{pdfUrl:"https://view.officeapps.live.com/op/view.aspx?src="+t.showFileUrl}}):"pdf"==t.Wordss["type"]?e("vpdf",{staticClass:"fullStyle",staticStyle:{width:"100%",height:"100%",overflow:"auto"},attrs:{pdfUrl:t.showFileUrl}}):"图片"==t.Wordss["name"]?e("img",{staticStyle:{width:"auto",height:"auto","max-width":"100%","max-height":"100%"},attrs:{src:t.showFileUrl,alt:"图片哦"}}):t._e()],1)]),e("el-dialog",{staticClass:"dialog_diy",attrs:{title:"修改名称",visible:t.dialogVisibleUpdateFile,"append-to-body":!0,width:"500px"},on:{"update:visible":function(e){t.dialogVisibleUpdateFile=e}}},[e("div",{staticStyle:{width:"100%",display:"flex","flex-direction":"row","flex-wrap":"nowrap","align-items":"center","justify-content":"center"}},[e("div",{staticStyle:{"min-width":"fit-content"}},[t._v("文件名称:")]),e("el-input",{attrs:{placeholder:"请输入要修改的名称"},model:{value:t.updateFile.fileName,callback:function(e){t.$set(t.updateFile,"fileName",e)},expression:"updateFile.fileName"}})],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.dialogVisibleUpdateFile=!1}}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.updateFileName}},[t._v("确 定")])],1)])],1)},o=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"pAHeader"},[e("div",{staticClass:"pAHeader1"},[t._v("创客项目申请")])])}],s=(a(57658),a(16079)),r=a(24613),n=a(48892),l=a(31093),d=a(93481),c={components:{studentProjectWord:n.Z,vpdf:l.Z,vword:d.Z},data(){return{accept:"*",loading:!1,submitHint:!1,updatedWordDig:!1,showFile:!1,dialogVisibleUpdateFile:!1,word:["DOC","DOCX","DOCM","DOTM","DOTX","PPTX","PPSX","PPT","PPS","PPTM","POTM","PPAM","POTX","PPSM","XLSX","XLS"],pdf:["PDF"],image:["BMP","PJP","APNG","PNG","JPG","GIF","SVG","JPEG","JPG","ICO","PGPEG","AVIF"],vedio:["AVI","NAVI","MPEG","ASF","MOV","WMV","3GP","RM","RMVB","FLV","F4V","H.264","H.265","REAL VIDEO","MKV","WebM","HDDVD","MP4","MPG","M4V","MGV","OGV","QTM","STR","AMC","DVX","EVO","DAT","OGG","OGM"],playerOptions:{playbackRates:[.7,1,1.5,2],autoplay:!1,muted:!1,loop:!1,preload:"auto",language:"zh-CN",aspectRatio:"16:9",fluid:!0,sources:[{type:"video/mp4",src:""}],notSupportedMessage:"此视频暂无法播放,请稍后再试",controlBar:{timeDivider:!0,durationDisplay:!0,remainingTimeDisplay:!1,fullscreenToggle:!0}},playerO:{},videoDetail:{},Wordss:{},showFileUrl:"",canonical:{Image:/^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i,File:/^https?:\/\/(.+\/)+.+(\.(docx|xlsx|ppt|pdf))$/i},updateFile:{url:"",fileName:""},wordData:{applicationDate:(0,r.YZ)(1),projectName:"",radio:"",checkList:[],schoolRadio:[],applyParsonRadio:[],applyParsonName:"",college:"",tel:"",beginTime:"",endTime:"",studentS:[{name:"",collage:"",work:""},{name:"",collage:"",work:""},{name:"",collage:"",work:""},{name:"",collage:"",work:""},{name:"",collage:"",work:""},{name:"",collage:"",work:""},{name:"",collage:"",work:""},{name:"",collage:"",work:""},{name:"",collage:"",work:""}],teacherS:[{name:"",collage:"",work:""},{name:"",collage:"",work:""},{name:"",collage:"",work:""},{name:"",collage:"",work:""}],brief:"",introduce:{back:"",innovate:"",path:"",scene:"",worth:"",team:"",cost:"",expectResults:"",expectResultsTeacher:"",expectConversion:"",plan:""},attachment:[],total:"",fund:{device:"",Material:"",processing:"",Collaboration:"",APPRAISAL:"",entery:"",activities:"",Transaction:""},opinion:[]}}},computed:{reversedMessage:function(){return 1*this.wordData.fund.device+1*this.wordData.fund.Material+1*this.wordData.fund.processing+1*this.wordData.fund.Collaboration+1*this.wordData.fund.APPRAISAL+1*this.wordData.fund.entery+1*this.wordData.fund.activities+1*this.wordData.fund.Transaction}},methods:{test(){const t=/^\s*$/g;for(let e in this.wordData)switch(e){case"projectName":if(t.test(this.wordData[e]))return this.$message.error("请输入项目名称"),document.querySelector("#projectName").scrollIntoView({behavior:"smooth"}),!1;break;case"radio":if(t.test(this.wordData[e]))return this.$message.error("请选择项目分组"),document.querySelector("#radio").scrollIntoView({behavior:"smooth"}),!1;break;case"applyParsonName":if(t.test(this.wordData[e]))return this.$message.error("请填写申请人姓名"),document.querySelector("#applyParsonName").scrollIntoView({behavior:"smooth"}),!1;break;case"college":if(t.test(this.wordData[e]))return this.$message.error("请选择所在学院"),document.querySelector("#applyParsonName").scrollIntoView({behavior:"smooth"}),!1;break;case"tel":if(t.test(this.wordData[e]))return this.$message.error("请填写联系方式"),document.querySelector("#applyParsonName").scrollIntoView({behavior:"smooth"}),!1;break;case"beginTime":if(t.test(this.wordData[e]))return this.$message.error("请选择项目起始时间"),document.querySelector("#beginTime").scrollIntoView({behavior:"smooth"}),!1;break;case"endTime":if(t.test(this.wordData[e]))return this.$message.error("请选择计划完成时间"),document.querySelector("#beginTime").scrollIntoView({behavior:"smooth"}),!1;break;case"fund":let a=0;for(let t in this.wordData.fund)a+=1*this.wordData.fund[t];if(0==a)return document.querySelector("#fund").scrollIntoView({behavior:"smooth"}),this.$message.error("请输入经费");break}this.wordData["total"]=1*this.wordData.fund.device+1*this.wordData.fund.Material+1*this.wordData.fund.processing+1*this.wordData.fund.Collaboration+1*this.wordData.fund.APPRAISAL+1*this.wordData.fund.entery+1*this.wordData.fund.activities+1*this.wordData.fund.Transaction,this.submitHint=!0},submitWord(){let t={"4a4e2cfe-e1a1-11ee-81d4-00ff5c7a43f5":"CX","56f0ad8d-e1a1-11ee-81d4-00ff5c7a43f5":"CY","ed917c55-f51d-11ed-a3f6-509a4c5b67cf":"SJ",1:"XM"};(0,s.Z)(t[this.wordData["radio"]]).then((t=>{let e={uid:this.$store.state.userInfo.userid,pNo:t,tid:"5e21b204-c206-11ed-a4cd-509a4c5b67cf",tit:encodeURIComponent(this.wordData["projectName"]),radio:this.wordData["radio"],checkList:encodeURIComponent(JSON.stringify(this.wordData["checkList"])),schoolRadio:encodeURIComponent(JSON.stringify(this.wordData["schoolRadio"])),applyParsonRadio:encodeURIComponent(JSON.stringify(this.wordData["applyParsonRadio"])),applyParsonName:encodeURIComponent(this.wordData["applyParsonName"]),cid:this.wordData["college"],tel:this.wordData["tel"],beh:this.wordData["beginTime"],planEnd:this.wordData["endTime"],cs:encodeURIComponent(JSON.stringify(this.wordData["studentS"])),ct:encodeURIComponent(JSON.stringify(this.wordData["teacherS"])),bf:encodeURIComponent(this.wordData["brief"]),introduce:encodeURIComponent(JSON.stringify(this.wordData["introduce"])),mon:encodeURIComponent(JSON.stringify(this.wordData["fund"])),f:this.wordData["total"],apply:this.wordData["applicationDate"],mem:this.wordData["studentS"].filter((t=>""!=t.name)).length+this.wordData["teacherS"].filter((t=>""!=t.name)).length,attachment:encodeURIComponent(JSON.stringify(this.wordData["attachment"]))};this.ajax.post(this.$store.state.api+"/studentProjectWordApply",e).then((async t=>{console.log(t),1==t["data"]?(this.$message.success("项目提交成功"),await this.ajax.post(this.$store.state.api+"/delDraft",{userid:this.$store.state.userInfo.userid,type:0}),this.submitHint=!1,this.$destroy(),this.$router.push("/projectApplication")):(this.$message.error("项目提交失败"),this.submitHint=!1)}),(t=>{console.log(t)})).catch((t=>{console.log(t)}))}))},saveData(){},saveDraft(){if(this.loading)return this.$message.info("请稍等...");this.loading=!0;let t={userid:this.$store.state.userInfo.userid,type:0,jsonData:encodeURIComponent(JSON.stringify(this.wordData))};this.ajax.post(this.$store.state.api+"/saveDraft",t).then((t=>{1==t.data?this.$message.success("保存成功"):this.$message.error("保存失败"),this.loading=!1}))},getDraft(){if(this.loading)return this.$message.info("请稍等...");this.loading=!0;let t={userid:this.$store.state.userInfo.userid,type:0};this.ajax.get(this.$store.state.api+"/getDraft",t).then((t=>{t.data[0].length&&(this.wordData=JSON.parse(t.data[0][0].json)),this.loading=!1}))},fileOption2(t,e,a){if("0"==a)this.checkFile(t.url);else if("1"==a){if(0==e)return;this.wordData.attachment.splice(e-1,0,this.wordData.attachment.splice(e,1)[0])}else if("2"==a){if(e==this.wordData.attachment.length-1)return;this.wordData.attachment.splice(e+1,0,this.wordData.attachment.splice(e,1)[0])}else"3"==a?(this.updateFile={...t,index:e},this.dialogVisibleUpdateFile=!0):"4"==a&&this.$confirm("确定删除该文件?","提示",{type:"error",confirmButtonText:"确定删除",cancelButtonText:"取消"}).then((t=>{this.wordData.attachment.splice(e,1)}))},getFile2(t){this.wordData.attachment.push(t)},checkFile(t){if(this.videoDetail={},-1==this.vedio.indexOf(t.split(".")[t.split(".").length-1].toLocaleUpperCase())){if(-1==this.word.indexOf(t.split(".")[t.split(".").length-1].toLocaleUpperCase())&&-1==this.pdf.indexOf(t.split(".")[t.split(".").length-1].toLocaleUpperCase())&&-1==this.image.indexOf(t.split(".")[t.split(".").length-1].toLocaleUpperCase()))return void this.downFile(t);if(this.showFileUrl=t,this.showFile=!0,"undefined"==typeof t)return{type:"",name:""};let e=t.split(".");const a=e[e.length-1];return this.canonical.Image.test(t)?(this.Wordss={type:a,name:"图片"},console.log(this.Wordss)):this.canonical.File.test(t)?(this.Wordss={type:a,name:"文档"},console.log(this.Wordss)):this.canonical.vedio.test(t)?(this.Wordss={type:a,name:"视频"},console.log(this.Wordss)):this.Wordss={type:a,name:a}}this.playerOptions.sources[0].src=t,this.videoDetail=this.playerOptions,this.showFile=!0},updateFileName(){if(!this.updateFile.fileName)return this.$message.error("请输入文件名称");this.wordData.attachment[this.updateFile.index].fileName=this.updateFile.fileName,this.dialogVisibleUpdateFile=!1},downFile(t){var e={accessKeyId:"AKIATLPEDU37QV5CHLMH",secretAccessKey:"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"};window.AWS.config.update(e),window.AWS.config.region="cn-northwest-1";let a=t,i="";i=-1!=a.indexOf("https://view.officeapps.live.com/op/view.aspx?src=")?a.split("https://view.officeapps.live.com/op/view.aspx?src=")[1]:a;var o=new window.AWS.S3({params:{Bucket:"ccrb"}});let s=decodeURIComponent(i.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1]);var r={Bucket:"ccrb",Key:s};o.getObject(r,(function(t,e){if(t)console.log(t,t.stack);else{let t=window.URL.createObjectURL(new Blob([e.Body])),a=document.createElement("a");a.name=s,a.href=t,a.download=s,a.click(),console.log(e)}}))}},mounted(){this.getDraft(),window.addEventListener("beforeunload",(()=>this.saveData()))},beforeRouteLeave(t,e,a){this.submitHint||this.saveData(),a()}},h=c,p=a(43736),u=(0,p.Z)(h,i,o,!1,null,"3be9ef60",null),f=u.exports},16079:function(t,e,a){a.d(e,{Z:function(){return r}});var i=a(36890),o=a(26125);const s={XM:"/getProjectNo",CX:"/getProjectNo",CY:"/getProjectNo",SJ:"/getProjectNo",HD:"/getActivityNo",ZJ:"/getFundNo"};function r(t="XM"){return new Promise(((e,a)=>{i.Z.get(o.Z.state.api+s[t],{uid:o.Z.state.userInfo.userid,type:t}).then((a=>{if(console.log(a["data"]),0==a["data"][0].length||null==a["data"][0][0]["No"])return e(`${t}0000001`);let i=a["data"][0][0]["No"],o=parseInt(i.slice(-7)),s=o+1,r=`${t}${s.toString().padStart(7,"0")}`;e(r)}))}))}}}]); //# sourceMappingURL=5529.f0bc9e8a.js.map