xll 7 months ago
parent
commit
5c675e0bd4

+ 37 - 18
projects/textbook/src/modules/nav-author/components/attachment/attachment.component.html

@@ -9,13 +9,15 @@
       <div class="title">教材电子版</div>
       <div class="text">
         教材出版单位配合按要求上传各地推荐的本单位出版的纸质教材最新印次的完整PDF电子版;数字教材上传全部教材内容电子版或填写能够查看全部教材内容的链接地址、账号;纸质教材附带数字资源的,上传纸质教材最新印次的完整PDF电子版,以及全部数字资源电子版或能够查看全部数字资源内容的链接地址、账号
-      </div> -->
-      <!-- <nz-checkbox-group
+      </div>
+
+      <nz-checkbox-group  //nz-checkbox-group注释
         style="margin: 10px 0"
         formControlName="textbookTypes"
         [(ngModel)]="checkOptionsOne"
-      ></nz-checkbox-group> -->
-      <!-- <label nz-checkbox [ngModelOptions]="{ standalone: true }" [ngModel]="true">纸质教材</label>
+      ></nz-checkbox-group>
+
+      <label nz-checkbox [ngModelOptions]="{ standalone: true }" [ngModel]="true">纸质教材</label>
       <label nz-checkbox [ngModelOptions]="{ standalone: true }" [ngModel]="true">电子教材 / 资源</label>
       <div nz-row>
         <div nz-col nzSpan="12">
@@ -78,6 +80,16 @@
         </div>
       </div>
     </div> -->
+
+
+
+
+
+
+
+
+
+
     <!-- <div class="author-content">
       <div class="title">所有作者政治审查意见</div>
       <div class="text">
@@ -181,6 +193,15 @@
         </tbody>
       </nz-table>
     </div> -->
+
+
+
+
+
+
+
+
+
     <div class="author-content">
       <div class="title">教材版权信息</div>
       
@@ -198,16 +219,8 @@
           nzErrorTip="请上传版权页截图"
           style="width: 100%"
         >
-          <nz-upload
-            formControlName="selfResults"
-            nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-            [nzHeaders]="{ authorization: 'authorization-text' }"
-            (nzChange)="handleChange($event)"
-          >
-            <div style="color: #3e49b3">
-              <span nz-icon nzType="upload"></span>上传文件
-            </div>
-          </nz-upload>
+        <app-comp-upload [width]="320" (change)="upload($event, 'copyrightImgUrl')" title="上传截图"></app-comp-upload>
+
           <div class="text upText" style="margin: 10px 0">
             支持批量上传 PDF、JPG、JPEG、PNG 格式,单个文件大小不超过 2M
           </div>
@@ -227,7 +240,7 @@
           nzErrorTip="请上传中国版本图书馆 CIP 查询截图"
           style="width: 100%"
         >
-          <nz-upload
+          <!-- <nz-upload
             formControlName="selfResults"
             nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
             [nzHeaders]="{ authorization: 'authorization-text' }"
@@ -236,7 +249,9 @@
             <div style="color: #3e49b3">
               <span nz-icon nzType="upload"></span>上传文件
             </div>
-          </nz-upload>
+          </nz-upload> -->
+          <app-comp-upload [width]="320" (change)="upload($event, 'CIPImgUrl')" title="上传截图"></app-comp-upload>
+
           <div class="text upText" style="margin: 10px 0">
             支持批量上传 PDF 格式,单个文件大小不超过 2M。如 CIP 数据中无“教材”字样的,须再上传内容提要或前言或后记中可以证明本书为教材的相关内容截图
           </div>
@@ -360,7 +375,7 @@
       <div class="title">其他材料</div>
       <div class="text">其他佐证材料。</div>
 
-      <nz-upload
+      <!-- <nz-upload
         formControlName="moreMaterial"
         nzAction="https://www.mocky.io/v2/5cc8019d300000980a055e76"
         [nzHeaders]="{ authorization: 'authorization-text' }"
@@ -369,7 +384,9 @@
         <div style="color: #3e49b3">
           <span nz-icon nzType="upload"></span>上传文件
         </div>
-      </nz-upload>
+      </nz-upload> -->
+      <app-comp-upload [width]="320" (change)="upload($event, 'moreMaterial')" title="上传截图"></app-comp-upload>
+
       <div class="text upText" style="margin: 10px 0">
         支持批量上传 PDF、JPG、JPEG、PNG 格式,单个文件大小不超过 2M
       </div>
@@ -399,6 +416,8 @@
         </nz-form-control>
       </nz-form-item>
     </div> -->
+
+    
     <!-- <div class="author-content">
       <nz-form-label
         class="label"

+ 258 - 159
projects/textbook/src/modules/nav-author/components/attachment/attachment.component.ts

@@ -11,6 +11,8 @@ import { NzUploadChangeParam } from 'ng-zorro-antd/upload';
 import { NzUploadModule } from 'ng-zorro-antd/upload';
 import { NzModalService } from 'ng-zorro-antd/modal';
 import Parse from 'parse';
+import { CompUploadComponent } from '../../../../app/comp-upload/comp-upload.component';
+
 import {
   FormControl,
   FormGroup,
@@ -38,6 +40,7 @@ import { textbookServer } from '../../../../services/textbook';
     NzCheckboxModule,
     NzTableModule,
     NzUploadModule,
+    CompUploadComponent,
   ],
   standalone: true,
   templateUrl: './attachment.component.html',
@@ -63,26 +66,28 @@ export class AttachmentComponent implements OnInit {
   };
 
   validateForm: FormGroup<{
-    textbookTypes: FormControl<Array<string> | any>; //教材电子版
-    textbookFiles: FormControl<Array<string> | any>; //上传教材文件
-    links: FormControl<string>; //教材数字内容链接地址、账号
+    // textbookTypes: FormControl<Array<string> | any>; //教材电子版
+    // textbookFiles: FormControl<Array<string> | any>; //上传教材文件
+    // links: FormControl<string>; //教材数字内容链接地址、账号
     selfResults: FormControl<object | any>; //图书编校质量自查结果记录表
     expertOpinion: FormControl<object | any>; //专家审核意见表
     evidence: FormControl<object | any>; //教材使用情况证明材料
     moreMaterial: FormControl<Array<any> | any>; //其他材料
     unitMaterial: FormControl<object | any>; //申报单位承诺意见材料
-    accept: FormControl<string>; //填写诚信承诺
+    // accept: FormControl<string>; //填写诚信承诺
+    copyrightImgUrl: FormControl<string>; //版权页截图
+    CIPImgUrl: FormControl<string>; //中国版本图书馆CIP查询截图
   }> = this.fb.group({
-    textbookTypes: [''],
-    textbookFiles: [
-      [
-        {
-          url: 'https://www.jyvtc.edu.cn/yssj/resource/cms/2022/01/2022010610314324023.pdf',
-        },
-      ],
-      [Validators.required]
-    ],
-    links: ['', [Validators.required]],
+    // textbookTypes: [''],
+    // textbookFiles: [
+    //   [
+    //     {
+    //       url: 'https://www.jyvtc.edu.cn/yssj/resource/cms/2022/01/2022010610314324023.pdf',
+    //     },
+    //   ],
+    //   [Validators.required]
+    // ],
+    // links: ['', [Validators.required]],
     selfResults: [
       {
         name: '自查表.pdf',
@@ -123,67 +128,69 @@ export class AttachmentComponent implements OnInit {
       },
       [Validators.required]
     ],
-    accept: ['', [Validators.required, this.confirmationValidator]],
+    // accept: ['', [Validators.required, this.confirmationValidator]],
+    copyrightImgUrl: [''],
+    CIPImgUrl: [''],
   });
   checkOptionsOne = [
     { label: '纸质教材', value: '纸质教材', checked: true },
     { label: '电子教材 / 资源', value: '电子教材 / 资源', checked: true },
   ];
-  //所有作者政治审查意见
-  opinions: Array<opinionType> = [
-    {
-      name: '', //作者
-      unit: '', //单位
-      birth: '', //出生年月
-      nationality: '', //国籍
-      reviewFile: {
-        name: '自查表.pdf',
-        url: 'https://www.jyvtc.edu.cn/yssj/resource/cms/2022/01/2022010610314324023.pdf',
-      }, //作者政治审查表/作者签名
-    },
-  ];
-  //所有作者签名
-  authorSign: Array<opinionType> = [
-    {
-      name: '', //作者
-      unit: '', //单位
-      birth: '', //出生年月
-      nationality: '', //国籍
-      reviewFile: {
-        name: '审查表.pdf',
-        url: 'https://www.jyvtc.edu.cn/yssj/resource/cms/2022/01/2022010610314324023.pdf',
-      }, //作者政治审查表/作者签名
-    },
-  ];
+  // //所有作者政治审查意见
+  // opinions: Array<opinionType> = [
+  //   {
+  //     name: '', //作者
+  //     unit: '', //单位
+  //     birth: '', //出生年月
+  //     nationality: '', //国籍
+  //     reviewFile: {
+  //       name: '自查表.pdf',
+  //       url: 'https://www.jyvtc.edu.cn/yssj/resource/cms/2022/01/2022010610314324023.pdf',
+  //     }, //作者政治审查表/作者签名
+  //   },
+  // ];
+  // //所有作者签名
+  // authorSign: Array<opinionType> = [
+  //   {
+  //     name: '', //作者
+  //     unit: '', //单位
+  //     birth: '', //出生年月
+  //     nationality: '', //国籍
+  //     reviewFile: {
+  //       name: '审查表.pdf',
+  //       url: 'https://www.jyvtc.edu.cn/yssj/resource/cms/2022/01/2022010610314324023.pdf',
+  //     }, //作者政治审查表/作者签名
+  //   },
+  // ];
   constructor(
     public tbookSer: textbookServer,
     private fb: NonNullableFormBuilder,
     private msg: NzMessageService,
     private modal: NzModalService
-  ) {}
-  ngOnInit() {
+  ) { }
+  ngOnInit() { 
     if (this.eduTextbook.id) {
       this.validateForm = this.fb.group({
-        textbookTypes: [
-          this.eduTextbook.get('textbookTypes'),
-        ],
-        textbookFiles: [
-          this.eduTextbook.get('textbookFiles') ||
-            this.validateForm.value.textbookFiles,
-          [Validators.required]
-        ],
-        links: [
-          this.eduTextbook.get('links')?.join('\n') || '',
-          [Validators.required]
-        ],
+        // textbookTypes: [
+        //   this.eduTextbook.get('textbookTypes'),
+        // ],
+        // textbookFiles: [
+        //   this.eduTextbook.get('textbookFiles') ||
+        //   this.validateForm.value.textbookFiles,
+        //   [Validators.required]
+        // ],
+        // links: [
+        //   this.eduTextbook.get('links')?.join('\n') || '',
+        //   [Validators.required]
+        // ],
         selfResults: [
           this.eduTextbook.get('selfResults') ||
-            this.validateForm.value.selfResults,
+          this.validateForm.value.selfResults,
           [Validators.required]
         ],
         expertOpinion: [
           this.eduTextbook.get('expertOpinion') ||
-            this.validateForm.value.expertOpinion,
+          this.validateForm.value.expertOpinion,
           [Validators.required]
         ],
         evidence: [
@@ -193,16 +200,24 @@ export class AttachmentComponent implements OnInit {
         moreMaterial: [''],
         unitMaterial: [
           this.eduTextbook.get('unitMaterial') ||
-            this.validateForm.value.unitMaterial,
+          this.validateForm.value.unitMaterial,
           [Validators.required]
         ],
-        accept: [
-          this.eduTextbook.get('accept') || '',
-          [Validators.required, this.confirmationValidator]
+        // accept: [
+        //   this.eduTextbook.get('accept') || '',
+        //   [Validators.required, this.confirmationValidator]
+        // ],
+        copyrightImgUrl: [
+          this.eduTextbook.get('copyrightImgUrl') || '',
+          [Validators.required]
+        ],
+        CIPImgUrl: [
+          this.eduTextbook.get('CIPImgUrl') || '',
+          [Validators.required]
         ],
       });
-      this.opinions = this.eduTextbook.get('opinions') || this.opinions
-      this.authorSign = this.eduTextbook.get('authorSign') || this.authorSign
+      // this.opinions = this.eduTextbook.get('opinions') || this.opinions
+      // this.authorSign = this.eduTextbook.get('authorSign') || this.authorSign
     }
   }
   async submitForm(event?: string): Promise<void> {
@@ -211,36 +226,56 @@ export class AttachmentComponent implements OnInit {
       return;
     }
     console.log(this.validateForm.value);
-    let opinionsVrifly = !this.opinions.some((item) =>
-      Object.values(item).some((val) => val == '' || val == undefined)
-    );
-    let authorSignVrifly = !this.authorSign.some((item) =>
-      Object.values(item).some((val) => val == '' || val == undefined)
-    );
+    // let opinionsVrifly = !this.opinions.some((item) =>
+    //   Object.values(item).some((val) => val == '' || val == undefined)
+    // );
+    // let authorSignVrifly = !this.authorSign.some((item) =>
+    //   Object.values(item).some((val) => val == '' || val == undefined)
+    // );
     let params: any = this.validateForm.value;
+    console.log(this.validateForm)
     if (this.validateForm.valid) {
       console.log(this.validateForm.value);
       if (event == 'complete') {
-        if (!opinionsVrifly) {
-          this.msg.warning('所有作者政治审查意见填写不完整');
-          return;
-        }
-        if (!authorSignVrifly) {
-          this.msg.warning('上传所有作者签名填写不完整');
-          return;
-        }
+        // if (!opinionsVrifly) {
+        //   this.msg.warning('所有作者政治审查意见填写不完整');
+        //   return;
+        // }
+        // if (!authorSignVrifly) {
+        //   this.msg.warning('上传所有作者签名填写不完整');
+        //   return;
+        // }
         await this.saveEduTextbook(params, true);
         let textBookJson = this.eduTextbook.toJSON()
-        let ignoreFiled = ['typeNumber','importantProjectOther','createdAt','updatedAt'] //非必填字段
+        let ignoreFiled = [
+          'typeNumber',
+          'editionNumber', 
+          'importantProjectOther', 
+          'textbookFiles',
+          'createdAt', 
+          'updatedAt',
+          'copyright',
+          'authorSign',
+          'CIP',
+          'isDeleted',
+          'opinions',
+          'printNumber',
+          'printSum',
+          'render',
+          'importantProject',
+          'importantProjectOther',
+          'complete',
+          'links','recommend','printSun','discard','edition','eduProcess'
+        ] //非必填字段
         console.log(textBookJson);
-        let isVrifly = Object.keys(textBookJson).some((item:string)=>{
-          if(!ignoreFiled.includes(item) && (textBookJson[item] === '' || textBookJson[item] === undefined || textBookJson[item] === null)){
-            console.warn('字段未填写:'+item);
+        let isVrifly = Object.keys(textBookJson).some((item: string) => {
+          if (!ignoreFiled.includes(item) && (textBookJson[item] === '' || textBookJson[item] === undefined || textBookJson[item] === null)) {
+            console.warn('字段未填写:' + item);
             return true
           }
           return
         })
-        if(isVrifly){
+        if (isVrifly) {
           this.msg.warning('存在未填项')
           return
         }
@@ -252,7 +287,8 @@ export class AttachmentComponent implements OnInit {
       }
     } else {
       if (event == 'save') {
-        await this.saveEduTextbook(params, this.validateForm.valid && opinionsVrifly && authorSignVrifly);
+        // await this.saveEduTextbook(params, this.validateForm.valid && opinionsVrifly && authorSignVrifly);
+        await this.saveEduTextbook(params, this.validateForm.valid);
         this.modal.success({
           nzTitle: '保存成功',
           nzContent: '<p>已保存并且至空间</p>',
@@ -260,16 +296,62 @@ export class AttachmentComponent implements OnInit {
         });
         return;
       }
-      Object.values(this.validateForm.controls).forEach((control) => {
-        if (control.invalid) {
-          control.markAsDirty();
-          control.updateValueAndValidity({ onlySelf: true });
+
+
+
+
+
+
+
+      console.log(this.validateForm.value);
+      if (event == 'complete') {
+        await this.saveEduTextbook(params, true);
+        let textBookJson = this.eduTextbook.toJSON()
+        let ignoreFiled = ['typeNumber', 'importantProjectOther', 'createdAt', 'updatedAt'] //非必填字段
+        console.log(textBookJson);
+        let isVrifly = Object.keys(textBookJson).some((item: string) => {
+          if (!ignoreFiled.includes(item) && (textBookJson[item] === '' || textBookJson[item] === undefined || textBookJson[item] === null)) {
+            console.warn('字段未填写:' + item);
+            return true
+          }
+          return
+        })
+        if (isVrifly) {
+          this.msg.warning('存在未填项')
+          return
         }
-      });
-      this.msg.warning('请填写完整信息');
+        this.state.emit({ type: 'complete', textBook: this.eduTextbook });
+        this.eduTextbook.set('complete', true)
+        this.eduTextbook.set('status', '102')
+        await this.eduTextbook.save()
+        this.msg.success('已填写完成')
+      }
+
+
+
+
+
+      
+
+
+
+
+      // Object.values(this.validateForm.controls).forEach((control) => {
+      //   if (control.invalid) {
+      //     control.markAsDirty();
+      //     control.updateValueAndValidity({ onlySelf: true });
+      //   }
+      // });
+      // this.msg.warning('请填写完整信息');
+
+
+
+
+      
     }
     if (event == 'save') {
-      await this.saveEduTextbook(params, this.validateForm.valid && opinionsVrifly && authorSignVrifly);
+      // await this.saveEduTextbook(params, this.validateForm.valid && opinionsVrifly && authorSignVrifly);
+      await this.saveEduTextbook(params, this.validateForm.valid);
       this.modal.success({
         nzTitle: '您已填写完成',
         nzContent: '<p>已保存并且至空间</p>',
@@ -277,66 +359,66 @@ export class AttachmentComponent implements OnInit {
       });
     }
   }
-  changeCode() {}
-  getCode(e: any) {}
-  //添加作者信息
-  onPush(type: string, idx: number) {
-    switch (type) {
-      case 'opinions':
-        this.opinions.splice(idx + 1, 0, {
-          name: '', //作者
-          unit: '', //单位
-          birth: '', //出生年月
-          nationality: '', //国籍
-          reviewFile: '', //作者政治审查表/作者签名
-        });
-        break;
-      case 'authorSign':
-        this.authorSign.splice(idx + 1, 0, {
-          name: '', //作者
-          unit: '', //单位
-          birth: '', //出生年月
-          nationality: '', //国籍
-          reviewFile: '', //作者政治审查表/作者签名
-        });
-        break;
-    }
-  }
-  //删除作者信息
-  onDel(type: string, idx: number) {
-    switch (type) {
-      case 'opinions':
-        if (this.opinions.length <= 1) {
-          this.opinions = [
-            {
-              name: '', //作者
-              unit: '', //单位
-              birth: '', //出生年月
-              nationality: '', //国籍
-              reviewFile: '', //作者政治审查表/作者签名
-            },
-          ];
-          return;
-        }
-        this.opinions.splice(idx, 1);
-        break;
-      case 'authorSign':
-        if (this.authorSign.length <= 1) {
-          this.authorSign = [
-            {
-              name: '', //作者
-              unit: '', //单位
-              birth: '', //出生年月
-              nationality: '', //国籍
-              reviewFile: '', //作者政治审查表/作者签名
-            },
-          ];
-          return;
-        }
-        this.authorSign.splice(idx, 1);
-        break;
-    }
-  }
+  changeCode() { }
+  getCode(e: any) { }
+  // //添加作者信息
+  // onPush(type: string, idx: number) {
+  //   switch (type) {
+  //     case 'opinions':
+  //       this.opinions.splice(idx + 1, 0, {
+  //         name: '', //作者
+  //         unit: '', //单位
+  //         birth: '', //出生年月
+  //         nationality: '', //国籍
+  //         reviewFile: '', //作者政治审查表/作者签名
+  //       });
+  //       break;
+  //     case 'authorSign':
+  //       this.authorSign.splice(idx + 1, 0, {
+  //         name: '', //作者
+  //         unit: '', //单位
+  //         birth: '', //出生年月
+  //         nationality: '', //国籍
+  //         reviewFile: '', //作者政治审查表/作者签名
+  //       });
+  //       break;
+  //   }
+  // }
+  // //删除作者信息
+  // onDel(type: string, idx: number) {
+  //   switch (type) {
+  //     case 'opinions':
+  //       if (this.opinions.length <= 1) {
+  //         this.opinions = [
+  //           {
+  //             name: '', //作者
+  //             unit: '', //单位
+  //             birth: '', //出生年月
+  //             nationality: '', //国籍
+  //             reviewFile: '', //作者政治审查表/作者签名
+  //           },
+  //         ];
+  //         return;
+  //       }
+  //       this.opinions.splice(idx, 1);
+  //       break;
+  //     case 'authorSign':
+  //       if (this.authorSign.length <= 1) {
+  //         this.authorSign = [
+  //           {
+  //             name: '', //作者
+  //             unit: '', //单位
+  //             birth: '', //出生年月
+  //             nationality: '', //国籍
+  //             reviewFile: '', //作者政治审查表/作者签名
+  //           },
+  //         ];
+  //         return;
+  //       }
+  //       this.authorSign.splice(idx, 1);
+  //       break;
+  //   }
+  // }
   handleChange(info: NzUploadChangeParam): void {
     if (info.file.status !== 'uploading') {
       console.log(info.file, info.fileList);
@@ -366,12 +448,12 @@ export class AttachmentComponent implements OnInit {
       className: 'Company',
       objectId: this.tbookSer.company,
     });
-    params.textbookTypes &&
-      this.eduTextbook?.set('textbookTypes', params.textbookTypes);
-    params.textbookFiles &&
-      this.eduTextbook?.set('textbookFiles', params.textbookFiles);
-    let links = params.links.split(/[(\r\n)\r\n]+/);
-    links && this.eduTextbook?.set('links', links);
+    // params.textbookTypes &&
+    //   this.eduTextbook?.set('textbookTypes', params.textbookTypes);
+    // params.textbookFiles &&
+    //   this.eduTextbook?.set('textbookFiles', params.textbookFiles);
+    // let links = params.links.split(/[(\r\n)\r\n]+/);
+    // links && this.eduTextbook?.set('links', links);
     params.selfResults &&
       this.eduTextbook?.set('selfResults', params.selfResults);
     params.unitMaterial &&
@@ -381,10 +463,27 @@ export class AttachmentComponent implements OnInit {
     params.evidence && this.eduTextbook?.set('evidence', params.evidence);
     params.moreMaterial &&
       this.eduTextbook?.set('moreMaterial', params.moreMaterial);
-    params.accept && this.eduTextbook?.set('accept', params.accept);
-    this.opinions && this.eduTextbook?.set('opinions', this.opinions);
-    this.authorSign && this.eduTextbook?.set('authorSign', this.authorSign);
+    // params.accept && this.eduTextbook?.set('accept', params.accept);
+    this.eduTextbook?.set('copyrightImgUrl', params.copyrightImgUrl);
+    this.eduTextbook?.set('CIPImgUrl', params.CIPImgUrl);
+    // this.opinions && this.eduTextbook?.set('opinions', this.opinions);
+    // this.authorSign && this.eduTextbook?.set('authorSign', this.authorSign);
     await this.eduTextbook?.save();
     return;
   }
+  upload(e: any, type: string) {
+    console.log(e);
+    let file = e[0];
+    if (type == 'copyrightImgUrl' || type == 'CIPImgUrl') {
+      this.validateForm.value[type] = file
+    }else if(type == 'moreMaterial'){
+        this.validateForm.value[type]=e
+
+      // if(this.validateForm.value[type]){
+      //   this.validateForm.value[type].push(file)
+      // }else{
+      //   this.validateForm.value[type]=[file]
+      // }
+    }
+  }
 }

+ 3 - 3
projects/textbook/src/modules/nav-author/components/basic-in/basic-in.component.html

@@ -226,12 +226,12 @@
             @if (validateForm.value.importantProject == '其他省部级及以上项目') {
             <input type="text" formControlName="importantProjectOther" placeholder="请输入入选项目名称" nz-input />
             }
-            <label nz-radio nzValue="">否</label>
+            <label nz-radio nzValue="">否</label>
           </nz-radio-group>
         </nz-input-group>
       </nz-form-control>
     </nz-form-item>
-    <nz-form-item style="margin-bottom: 16px">
+    <!-- <nz-form-item style="margin-bottom: 16px">
       <nz-form-label [nzSm]="8" [nzNoColon]="true" [nzXs]="8" nzRequired>版权页截图</nz-form-label>
       <nz-form-control nzErrorTip="请上传版权页截图" [nzSm]="12" [nzXs]="12">
         <nz-input-group>
@@ -253,7 +253,7 @@
           </div>
         </nz-input-group>
       </nz-form-control>
-    </nz-form-item>
+    </nz-form-item> -->
   </form>
 </div>
 <div class="footer">

+ 9 - 9
projects/textbook/src/modules/nav-author/components/basic-in/basic-in.component.ts

@@ -95,8 +95,7 @@ export class BasicInComponent implements OnInit {
     importantProject: FormControl<string>; //初版以来是否列为重点项目
     importantProjectOther: FormControl<string>; //其他省部级及以上项目
     approvedImgUrl:FormControl<string>//重点立项教材获批截图
-    copyrightImgUrl: FormControl<string>; //版权页截图
-    CIPImgUrl: FormControl<string>; //中国版本图书馆CIP查询截图
+  
 
     // remember: FormControl<boolean>;
   }> = this.fb.group({
@@ -122,8 +121,8 @@ export class BasicInComponent implements OnInit {
     importantProject: ['', [Validators.required]],
     importantProjectOther: [''],
     approvedImgUrl:[''],
-    copyrightImgUrl: [''],
-    CIPImgUrl: [''],
+    // copyrightImgUrl: [''],
+    // CIPImgUrl: [''],
     // remember: [true],
   });
   /** 所属学科专业类显示数量*/
@@ -219,8 +218,8 @@ export class BasicInComponent implements OnInit {
       importantProject: [this.eduTextbook?.get('importantProject') || '', [Validators.required]],
       importantProjectOther: [this.eduTextbook?.get('importantProjectOther') || ''],
       approvedImgUrl: [this.eduTextbook?.get('approvedImgUrl') || 'https://www.jyvtc.edu.cn/yssj/resource/cms/2022/01/2022010610314324023.pdf', [Validators.required]],
-      copyrightImgUrl: [this.eduTextbook?.get('copyrightImgUrl') || 'https://www.jyvtc.edu.cn/yssj/resource/cms/2022/01/2022010610314324023.pdf', [Validators.required]],
-      CIPImgUrl: [this.eduTextbook?.get('CIPImgUrl') || 'https://www.jyvtc.edu.cn/yssj/resource/cms/2022/01/2022010610314324023.pdf', [Validators.required]],
+      // copyrightImgUrl: [this.eduTextbook?.get('copyrightImgUrl') || 'https://www.jyvtc.edu.cn/yssj/resource/cms/2022/01/2022010610314324023.pdf', [Validators.required]],
+      // CIPImgUrl: [this.eduTextbook?.get('CIPImgUrl') || 'https://www.jyvtc.edu.cn/yssj/resource/cms/2022/01/2022010610314324023.pdf', [Validators.required]],
     });
     this.onChangeRadio()
   }
@@ -260,7 +259,8 @@ export class BasicInComponent implements OnInit {
   upload(e: any, type:string) {
     console.log(e);
     let file = e[0];
-    if(type == 'copyrightImgUrl' || type == 'CIPImgUrl' ||type=='approvedImgUrl'){
+    // if(type == 'copyrightImgUrl' || type == 'CIPImgUrl' ||type=='approvedImgUrl'){
+    if(type=='approvedImgUrl'){
       this.validateForm.value[type] = file
     }
   }
@@ -375,9 +375,9 @@ export class BasicInComponent implements OnInit {
     this.eduTextbook?.set('printSum', params.printSum);
     this.eduTextbook?.set('importantProject', params.importantProject);
     this.eduTextbook?.set('importantProjectOther', params.importantProjectOther);
-    this.eduTextbook?.set('copyrightImgUrl', params.copyrightImgUrl);
+    // this.eduTextbook?.set('copyrightImgUrl', params.copyrightImgUrl);
+    // this.eduTextbook?.set('CIPImgUrl', params.CIPImgUrl);
     this.eduTextbook?.set('approvedImgUrl',params.approvedImgUrl)
-    this.eduTextbook?.set('CIPImgUrl', params.CIPImgUrl);
     if(this.tbookSer.profile?.user?.department.objectId){
       this.eduTextbook?.set('department', {
         __type: 'Pointer',

+ 1 - 1
projects/textbook/src/modules/nav-author/components/textbook-pertain/textbook-pertain.component.html

@@ -145,7 +145,7 @@
         </tbody>
       </nz-table>
       <p>输入诚信承诺:本人自愿参加此次申报,已认真填写并检查以上材料,保证内容真实。</p>
-      <input nz-input placeholder="请输入承诺内容" [ngModelOptions]="{ standalone: true }" [(ngModel)]="promise" />
+      <input  formControlName="accept" nz-input placeholder="请输入承诺内容" />
     </div>
     <div class="author-content">
       <div class="nav">第一主编(作者)情况</div>

+ 24 - 5
projects/textbook/src/modules/nav-author/components/textbook-pertain/textbook-pertain.component.ts

@@ -13,6 +13,8 @@ import {
   FormControl,
   FormGroup,
   NonNullableFormBuilder,
+  ValidatorFn,
+  AbstractControl,
   Validators,
 } from '@angular/forms';
 import { textbookServer } from '../../../../services/textbook';
@@ -57,6 +59,18 @@ export class TextbookPertainComponent implements OnInit {
   @Input('maxWidth') maxWidth: number = 0;
   @Output() state: EventEmitter<any> = new EventEmitter<any>();
   @Output() save: EventEmitter<any> = new EventEmitter<any>();
+    //填写诚信承诺是否正确
+    confirmationValidator: ValidatorFn = (
+      control: AbstractControl
+    ): { [s: string]: boolean } => {
+      if (
+        control.value !=
+        '本人自愿参加此次申报,已认真填写并检查以上材料,保证内容真实'
+      ) {
+        return { required: true };
+      }
+      return {};
+    };
   validateForm: FormGroup<{
     major: FormControl<string>; //适用专业代码及名称
     period: FormControl<number | any>; //课程学时
@@ -65,6 +79,8 @@ export class TextbookPertainComponent implements OnInit {
     // authorList: FormControl<Array<any> | any>; //作者信息
     authorDetails: FormControl<string>; //第一主编(作者)相关教学经历
     // achievement: FormControl<Array<any> | any>; //相关科学研究项目、成果或论文专著(限5项)
+    accept: FormControl<string>; //填写诚信承诺
+
   }> = this.fb.group({
     major: ['', [Validators.required]],
     period: ['', [Validators.required]],
@@ -73,7 +89,9 @@ export class TextbookPertainComponent implements OnInit {
     // authorList: ['', [Validators.required]],
     authorDetails: ['', [Validators.required]],
     // achievement: ['', [Validators.required]],
+    accept: ['', [Validators.required, this.confirmationValidator]],
   });
+ 
   //适用专业代码及名称
   selectList: Array<any> = [
     {
@@ -134,7 +152,7 @@ export class TextbookPertainComponent implements OnInit {
   ];
   workOptions = ['主编', '作者', '副主编', '写者'];
   /**诚信承诺 */
-  promise:string=''
+  accept:string=''
   constructor(
     public tbookSer: textbookServer,
     private fb: NonNullableFormBuilder,
@@ -164,6 +182,10 @@ export class TextbookPertainComponent implements OnInit {
           this.eduTextbook.get('authorDetails') || '',
           [Validators.required],
         ],
+        accept: [
+          this.eduTextbook.get('accept') || '',
+          [Validators.required, this.confirmationValidator]
+        ],
       });
       this.authorList = this.eduTextbook.get('authorList') || this.authorList
       console.log(this.authorList)
@@ -171,10 +193,6 @@ export class TextbookPertainComponent implements OnInit {
     }
   }
   async submitForm(event?: string): Promise<void> {
-    // if(this.promise!='本人自愿参加此次申报,已认真填写并检查以上材料,保证内容真实。'){
-    //   this.msg.warning('请输入承诺内容')
-    //   return
-    // }
     if (event == 'pre') {
       this.state.emit({ type: 'pre' });
       return
@@ -352,6 +370,7 @@ export class TextbookPertainComponent implements OnInit {
     params.authorDetails && this.eduTextbook?.set('authorDetails', params.authorDetails);
     this.eduTextbook?.set('authorList', this.authorList);
     this.eduTextbook?.set('achievementOptions', this.achievementOptions);
+    params.accept && this.eduTextbook?.set('accept', params.accept);
     await this.eduTextbook?.save();
     return;
   }