|
@@ -79,8 +79,9 @@ export async function exportProcessReportDocs(processId,bookList) {
|
|
|
let zipPath,zipUrl
|
|
|
if(docsList?.length){
|
|
|
let now = new Date();
|
|
|
+ let fileList = docsList?.map(item=>item?.pdfPath);
|
|
|
let zipName = `申报书导出-${now.getFullYear()}${now.getMonth()+1}${now.getDate()}-${now.getHours()}${now.getMinutes()}${now.getSeconds()}.zip`
|
|
|
- zipPath = await createZip(docsList?.map(item=>item?.filePath),zipName)
|
|
|
+ zipPath = await createZip(fileList,zipName)
|
|
|
if(zipPath){
|
|
|
zipUrl = (await uploadFileToOSS(zipPath))?.url || null
|
|
|
}
|
|
@@ -165,6 +166,35 @@ function renderReportDocsByTextbook(textbook){
|
|
|
clist[index] = [num,toYearMonth(json?.courses?.[index]?.date)||" ",json?.courses?.[index]?.wordage||" ",json?.courses?.[index]?.num||" ",json?.courses?.[index]?.sumNum||" ",json?.courses?.[index]?.accolade||" "]
|
|
|
}
|
|
|
|
|
|
+ // 附件信息
|
|
|
+ let mergeFiles = []
|
|
|
+ // 1.教材电子版(必须提供)
|
|
|
+ // (教材出版单位配合按要求上传各地推荐的本单位出版的纸质教材最新印次的完整PDF电子版;数字教材上传全部教材内容电子版或填写能够查看全部教材内容的链接地址、账号;纸质教材附带数字资源的,上传纸质教材最新印次的完整PDF电子版,以及全部数字资源电子版或能够查看全部数字资源内容的链接地址、账号。)
|
|
|
+ // 2.所有作者政治审查意见(必须提供)
|
|
|
+ // (对应作者姓名上传“作者政治审查表”。作者单位党委对作者进行审查,对政治思想表现情况进行评价,确保作者的正确政治方向、价值取向,无违法违纪等记录。教材编写成员涉及多个不同单位时需要各单位分别出具意见,并由所在单位党委盖章,格式要求从申报平台下载。)
|
|
|
+ // 3.图书编校质量自查结果记录表(必须提供)
|
|
|
+ // (教材出版单位对申报教材的编校质量自查后,按要求提供图书编校质量自查结果记录表,并加盖出版社公章。全册教材的不同分册以不同文件分别上传。格式要求从申报平台下载。)
|
|
|
+ if(json?.selfResults?.url){mergeFiles.push(json?.selfResults?.url)}
|
|
|
+ // 4.专家审查意见表(必须提供)
|
|
|
+ // (由第一主编所在单位和出版机构邀请校内外相关学科专业领域专家,对教材进行思想性、学术性审查。专家不少于3名,其中半数以上为校外专家,专家分别实名评价并签字,并注明所在单位及专业身份。评价人不得是本教材的作者。)
|
|
|
+ if(json?.expertOpinion?.url){mergeFiles.push(json?.expertOpinion?.url)}
|
|
|
+ // 5.教材使用情况证明材料(必须提供)
|
|
|
+ // (教材出版单位提供教材主要使用高校名单及使用情况证明材料,并加盖公章。)
|
|
|
+ if(json?.evidence?.url){mergeFiles.push(json?.evidence?.url)}
|
|
|
+ // 6.版权信息及CIP数据(必须提供)
|
|
|
+ // (版权页截图,中国版本图书馆CIP查询截图,如CIP数据中无“教材”字样的,须再上传内容提要或前言或后记中可以证明本书为教材的相关内容截图。)
|
|
|
+ if(json?.CIPImgUrl){mergeFiles.push(json?.CIPImgUrl)}
|
|
|
+ // 7.其他材料(可选提供)
|
|
|
+ if(json?.moreMaterial?.length){
|
|
|
+ json?.moreMaterial.forEach(doc=>{
|
|
|
+ if(doc?.url){
|
|
|
+ mergeFiles.push(doc?.url)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ // (其他佐证材料,限两份以内。)
|
|
|
+
|
|
|
let fixData = {
|
|
|
// 封面信息
|
|
|
titlePad:padString(json?.title,21),
|
|
@@ -257,7 +287,7 @@ function renderReportDocsByTextbook(textbook){
|
|
|
Object.keys(fixData).forEach(key=>{
|
|
|
bookData[key] = fixData[key]
|
|
|
})
|
|
|
- console.log(bookData)
|
|
|
+ // console.log(bookData)
|
|
|
// console.log(json)
|
|
|
let bookid = json.code || json?.objectId;
|
|
|
let tempFileName = path.join(`${bookid}${json.title}.docx`)
|
|
@@ -265,13 +295,19 @@ function renderReportDocsByTextbook(textbook){
|
|
|
let filePath = renderDocx(TemplateDocxPath,tempFileName,bookData)
|
|
|
// 需要API支持
|
|
|
let pdfPath = filePath.replaceAll(".docx",".pdf")
|
|
|
- filePath = await docxToPdf(filePath,pdfPath) || filePath // 成功用pdf,失败继续用docx
|
|
|
- let url = (await uploadFileToOSS(pdfPath))?.url || null
|
|
|
+ let options = {
|
|
|
+ mergeFiles:mergeFiles
|
|
|
+ }
|
|
|
+ pdfPath = await docxToPdf(filePath,pdfPath,options) || filePath // 成功用pdf,失败继续用docx
|
|
|
+ let urlDocx = (await uploadFileToOSS(filePath))?.url || null
|
|
|
+ let urlPdf = (await uploadFileToOSS(pdfPath))?.url || null
|
|
|
resolve({
|
|
|
code:bookid,
|
|
|
title:json?.title,
|
|
|
filePath,
|
|
|
- url
|
|
|
+ pdfPath,
|
|
|
+ urlDocx,
|
|
|
+ urlPdf,
|
|
|
})
|
|
|
return
|
|
|
replaceDocx(TemplateDocxPath,tempFileName,bookData,{onDocxComplete:async (filePath)=>{
|