Browse Source

忽略必要性文件校验

cehn 4 months ago
parent
commit
72f768e1e5

+ 0 - 112
projects/textbook/src/modules/nav-author/components/attachment/attachment.component.ts

@@ -95,11 +95,6 @@ export class AttachmentComponent implements OnInit {
     url: '',
   }
 
-
-  // /**作者政治审核表 {name: '',url: '',} */
-  // examine: Array<any> = []
-
-
   constructor(
     public tbookSer: textbookServer,
     private msg: NzMessageService,
@@ -117,8 +112,6 @@ 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.authorList = this.eduTextbook?.get('authorList')
     }
   }
 
@@ -172,23 +165,6 @@ 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.unitMaterial.url == '' || !this.unitMaterial.url) {
-    //   msgList.push('申报单位承诺意见')
-    //   isNull = true
-    // }
-    // if (isNull) {
-    //   this.msg.create('error', `请上传完整 ${msgList.join()}`)
-    // }
     return isNull
   }
 
@@ -260,9 +236,6 @@ export class AttachmentComponent implements OnInit {
       expertOpinion: this.expertOpinion,
       evidence: this.evidence,
       moreMaterial: this.moreMaterial,
-      // examine: this.examine,
-      // authorList:this.authorList
-      // unitMaterial: this.unitMaterial,
     }
     
     let isPageNull = this.examineNull()//检查本页空项
@@ -343,11 +316,8 @@ export class AttachmentComponent implements OnInit {
         this.eduTextbook?.set('cipProveFile', params.cipProveFile || null);
       // params.moreMaterial &&
         this.eduTextbook?.set('moreMaterial', params.moreMaterial || null);
-      // params.examine &&
-      //   this.eduTextbook?.set('examine', params.examine);
       this.eduTextbook?.set('copyrightImgUrl', params.copyrightImgUrl || null);
       this.eduTextbook?.set('CIPImgUrl', params.CIPImgUrl || null);
-      // this.eduTextbook?.set('authorList', params.authorList);
       await this.eduTextbook?.save();
       this.saveLoading = false;
       if (!isComplete) {
@@ -374,13 +344,10 @@ export class AttachmentComponent implements OnInit {
       this[type].name = file?.name
     } else if (type == 'moreMaterial' || type == 'cipProveFile') {
       this[type] = e
-    }else if (type == 'signature' || type == 'examine') {
-      this.authorList[index][type] = file?.url
     }
     // else if(type == 'cipProveFile'){
     //   this[type] = [ { name: file.name, url: file.url }]
     // }
-    // console.log(this.authorList)
   }
 
 
@@ -412,83 +379,4 @@ 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;
-    }
-  }
 }

+ 6 - 7
projects/textbook/src/modules/nav-author/components/create/author-file/author-file.component.ts

@@ -28,7 +28,7 @@ interface author {
   mobile: string;
   email: string;
   work: string;
-  signature?: string;
+  // signature?: string;
   examine?: string;
   // otherEditor?:string
 }
@@ -67,7 +67,7 @@ export class AuthorFileComponent implements OnInit {
       mobile: '',
       email: '',
       work: '',
-      signature: '',
+      // signature: '',
       examine: '',
       // otherEditor:''
     },
@@ -97,19 +97,18 @@ export class AuthorFileComponent implements OnInit {
   }
   upload(e: any, type: string, index?: any) {
     let file = e[0];
-    if (type == 'signature' || type == 'examine') {
+    if (type == 'examine') {
       this.authorList[index][type] = file?.url;
     }else if(type == 'otherEditor'){
       this.otherEditor = file?.url;
     }
     // console.log(this.authorList);
-    console.log(this.otherEditor);
+    // console.log(this.otherEditor);
   }
   async submitForm(): Promise<boolean> {
-    console.log(this.otherEditor);
-    
+    // console.log(this.otherEditor);
     let coursesVrifly = !this.authorList.some((item:any) =>
-      Object.keys(item).some((key) => key != 'otherEditor' && (item[key] == '' || item[key] == undefined))
+      Object.keys(item).some((key) => key != 'otherEditor' && key != 'signature' && (item[key] == '' || item[key] == undefined))
     );
     this.eduTextbookVolume?.set('authorList', this.authorList);
     this.eduTextbookVolume?.set('otherEditor', this.otherEditor||null);

+ 5 - 3
projects/textbook/src/modules/nav-author/components/create/author/author.component.ts

@@ -28,7 +28,7 @@ interface author {
   mobile: string;
   email: string;
   work: string;
-  signature?: string;
+  // signature?: string;
   examine?: string;
 }
 interface achievementType {
@@ -189,8 +189,10 @@ export class AuthorComponent implements OnInit {
 
   async submitForm(event?: string): Promise<boolean> {
     let params: any = this.validateForm.value;
-    let authorListVrifly = !this.authorList.some((item) =>
-      Object.values(item).some((val) => val == '' || val == undefined)
+    let authorListVrifly = !this.authorList.some((item:any) =>
+      Object.keys(item).some((key) => {
+        return key != 'signature' && (item[key] == '' || item[key] == undefined)
+      })
     );
     let achievementOptionsVrifly = !this.achievementOptions.some((item) =>
       Object.values(item).some((val) => val == '' || val == undefined)