|
@@ -95,8 +95,8 @@ export class AttachmentComponent implements OnInit {
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**作者政治审核表 {name: '',url: '',} */
|
|
|
- examine: Array<any> = []
|
|
|
+ // /**作者政治审核表 {name: '',url: '',} */
|
|
|
+ // examine: Array<any> = []
|
|
|
|
|
|
|
|
|
constructor(
|
|
@@ -116,7 +116,8 @@ export class AttachmentComponent implements OnInit {
|
|
|
this.moreMaterial = this.eduTextbook?.get('moreMaterial') || this.moreMaterial
|
|
|
this.cipProveFile = this.eduTextbook?.get('cipProveFile') || this.cipProveFile
|
|
|
this.unitMaterial = this.eduTextbook?.get('unitMaterial') || this.unitMaterial
|
|
|
- this.examine = this.eduTextbook?.get('examine') || this.examine
|
|
|
+ // this.examine = this.eduTextbook?.get('examine') || this.examine
|
|
|
+ this.authorList = this.eduTextbook?.get('authorList')
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -170,16 +171,16 @@ export class AttachmentComponent implements OnInit {
|
|
|
isNull = true
|
|
|
}
|
|
|
}
|
|
|
- if (this.examine?.length <= 0) {
|
|
|
- isNull = true
|
|
|
- msgList.push('作者政治审核表')
|
|
|
- } else if (this.examine?.length > 0) {
|
|
|
- let isExist = this.examine.every(item => item?.url == '' || !item?.url)
|
|
|
- if (isExist) {
|
|
|
- msgList.push('作者政治审核表')
|
|
|
- isNull = true
|
|
|
- }
|
|
|
- }
|
|
|
+ // if (this.examine?.length <= 0) {
|
|
|
+ // isNull = true
|
|
|
+ // msgList.push('作者政治审核表')
|
|
|
+ // } else if (this.examine?.length > 0) {
|
|
|
+ // let isExist = this.examine.every(item => item?.url == '' || !item?.url)
|
|
|
+ // if (isExist) {
|
|
|
+ // msgList.push('作者政治审核表')
|
|
|
+ // isNull = true
|
|
|
+ // }
|
|
|
+ // }
|
|
|
// if (this.unitMaterial.url == '' || !this.unitMaterial.url) {
|
|
|
// msgList.push('申报单位承诺意见')
|
|
|
// isNull = true
|
|
@@ -231,9 +232,9 @@ export class AttachmentComponent implements OnInit {
|
|
|
/* 检验authorList字段是否留空 */
|
|
|
let authorListAuth
|
|
|
// console.log(textBookJson.authorList);
|
|
|
- // authorListAuth = textBookJson.authorList.some((obj:any)=>{
|
|
|
- // return Object.keys(obj).some((item: string) => !obj[item])
|
|
|
- // })
|
|
|
+ authorListAuth = textBookJson.authorList.some((obj:any)=>{
|
|
|
+ return Object.keys(obj).some((item: string) => !obj[item])
|
|
|
+ })
|
|
|
// console.log(authorListAuth);
|
|
|
|
|
|
if (isVrifly || authorListAuth) {
|
|
@@ -253,7 +254,8 @@ export class AttachmentComponent implements OnInit {
|
|
|
expertOpinion: this.expertOpinion,
|
|
|
evidence: this.evidence,
|
|
|
moreMaterial: this.moreMaterial,
|
|
|
- examine: this.examine,
|
|
|
+ // examine: this.examine,
|
|
|
+ authorList:this.authorList
|
|
|
// unitMaterial: this.unitMaterial,
|
|
|
}
|
|
|
let isPageNull = this.examineNull()//检查本页空项
|
|
@@ -313,25 +315,32 @@ export class AttachmentComponent implements OnInit {
|
|
|
this.eduTextbook?.set('cipProveFile', params.cipProveFile);
|
|
|
params.moreMaterial &&
|
|
|
this.eduTextbook?.set('moreMaterial', params.moreMaterial);
|
|
|
- params.examine &&
|
|
|
- this.eduTextbook?.set('examine', params.examine);
|
|
|
+ // params.examine &&
|
|
|
+ // this.eduTextbook?.set('examine', params.examine);
|
|
|
this.eduTextbook?.set('copyrightImgUrl', params.copyrightImgUrl);
|
|
|
this.eduTextbook?.set('CIPImgUrl', params.CIPImgUrl);
|
|
|
+ this.eduTextbook?.set('authorList', params.authorList);
|
|
|
await this.eduTextbook?.save();
|
|
|
return;
|
|
|
}
|
|
|
- upload(e: any, type: string) {
|
|
|
+ upload(e: any, type: string, index?: any) {
|
|
|
let file = e[(e?.length - 1) || 0];
|
|
|
if (type == 'copyrightImgUrl' || type == 'CIPImgUrl') {
|
|
|
this[type] = file?.url
|
|
|
} else if (type == 'selfResults' || type == 'expertOpinion' ||
|
|
|
- type == 'evidence' || type == 'unitMaterial') {
|
|
|
+ type == 'evidence' || type == 'unitMaterial') {
|
|
|
this[type].url = file?.url
|
|
|
this[type].name = file?.name
|
|
|
- } else if (type == 'moreMaterial' || type == 'examine' || type == 'cipProveFile') {
|
|
|
+ } else if (type == 'moreMaterial' || type == 'cipProveFile') {
|
|
|
this[type] = [...(this[type] || []), { name: file.name, url: file.url }]
|
|
|
+ }else if (type == 'signature' || type == 'examine') {
|
|
|
+ this.authorList[index][type] = file?.url
|
|
|
}
|
|
|
+ console.log(this.authorList)
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**获取文件名 */
|
|
|
getFileName(url: string) {
|
|
|
if (!url) return ''
|
|
@@ -359,4 +368,83 @@ export class AttachmentComponent implements OnInit {
|
|
|
console.log(url);
|
|
|
window.open(url)
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**作者信息 */
|
|
|
+ authorList:Array<any>=[]
|
|
|
+
|
|
|
+ //添加作者信息
|
|
|
+ onPush(type: string, idx: number) {
|
|
|
+ switch (type) {
|
|
|
+ case 'authorList':
|
|
|
+ if (this.authorList?.length >= 6) {
|
|
|
+ this.msg.warning('最多添加6条');
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ this.authorList.splice(idx + 1, 0, {
|
|
|
+ name: '',
|
|
|
+ unit: '',
|
|
|
+ birth: '',
|
|
|
+ nationality: '',
|
|
|
+ job: '',
|
|
|
+ title: '',
|
|
|
+ mobile: '',
|
|
|
+ email: '',
|
|
|
+ work: '',
|
|
|
+ signature: '',
|
|
|
+ examine: '',
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ // case 'achievementOptions':
|
|
|
+ // if (this.achievementOptions.length >= 5) {
|
|
|
+ // this.msg.warning('最多添加5条');
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // this.achievementOptions.splice(idx + 1, 0, {
|
|
|
+ // name: '',
|
|
|
+ // unit: '',
|
|
|
+ // date: '',
|
|
|
+ // });
|
|
|
+ // break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //删除作者信息
|
|
|
+ onDel(type: string, idx: number) {
|
|
|
+ switch (type) {
|
|
|
+ case 'authorList':
|
|
|
+ if (this.authorList.length == 1) {
|
|
|
+ this.authorList = [
|
|
|
+ {
|
|
|
+ name: '',
|
|
|
+ unit: '',
|
|
|
+ birth: '',
|
|
|
+ nationality: '',
|
|
|
+ job: '',
|
|
|
+ title: '',
|
|
|
+ mobile: '',
|
|
|
+ email: '',
|
|
|
+ work: '',
|
|
|
+ signature: '',
|
|
|
+ examine: '',
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.authorList.splice(idx, 1);
|
|
|
+ break;
|
|
|
+ // case 'achievementOptions':
|
|
|
+ // if (this.achievementOptions.length == 1) {
|
|
|
+ // this.achievementOptions = [
|
|
|
+ // {
|
|
|
+ // name: '',
|
|
|
+ // unit: '',
|
|
|
+ // date: '',
|
|
|
+ // },
|
|
|
+ // ];
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // this.achievementOptions.splice(idx, 1);
|
|
|
+ // break;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|