Browse Source

Merge branch 'master' of http://git.fmode.cn:3000/bin/edu-textbook

warrior 7 months ago
parent
commit
dd8cdc6cab

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

@@ -11,7 +11,7 @@
           版权页截图
         </a>
         }
-        <app-comp-upload [width]="320" [type]="'pdf'" (change)="upload($event, 'copyrightImgUrl')" title="上传PDF"></app-comp-upload>
+        <app-comp-upload [type]="'pdf'" [width]="320" [type]="'pdf'" (change)="upload($event, 'copyrightImgUrl')" title="上传PDF"></app-comp-upload>
 
         <div class="text upText" style="margin: 10px 0">
           支持上传PDF,大小不超过 2M
@@ -29,7 +29,7 @@
           CIP 查询截图
         </a>
         }
-        <app-comp-upload [width]="320" (change)="upload($event, 'CIPImgUrl')" title="上传PDF"></app-comp-upload>
+        <app-comp-upload [type]="'pdf'" [width]="320" (change)="upload($event, 'CIPImgUrl')" title="上传PDF"></app-comp-upload>
 
         <div class="text upText" style="margin: 10px 0">
           支持批量上传 PDF 格式,单个文件大小不超过 2M。
@@ -51,7 +51,7 @@
       </p>
       }
       }
-      <app-comp-upload [width]="320" [maxlenght]="99" (change)="upload($event, 'cipProveFile')"
+      <app-comp-upload [type]="'pdf'" [width]="320" [maxlenght]="99" (change)="upload($event, 'cipProveFile')"
         title="上传PDF"></app-comp-upload>
   
       <div class="text upText" style="margin: 10px 0">
@@ -79,7 +79,7 @@
           自查结果记录表
         </a>
         }
-        <app-comp-upload [width]="320" (change)="upload($event, 'selfResults')" title="上传PDF"></app-comp-upload>
+        <app-comp-upload [type]="'pdf'" [width]="320" (change)="upload($event, 'selfResults')" title="上传PDF"></app-comp-upload>
         <div class="text upText" style="margin: 10px 0">
           支持上传PDF,大小不超过 2M
         </div>
@@ -102,7 +102,7 @@
           专家审查意见表
         </a>
         }
-        <app-comp-upload [width]="320" (change)="upload($event, 'expertOpinion')" title="上传PDF"></app-comp-upload>
+        <app-comp-upload [type]="'pdf'" [width]="320" (change)="upload($event, 'expertOpinion')" title="上传PDF"></app-comp-upload>
         <div class="text upText" style="margin: 10px 0">
           支持批量上传 PDF、JPG、JPEG、PNG 格式,单个大小不超过 2M
         </div>
@@ -124,7 +124,7 @@
           证明材料
         </a>
         }
-        <app-comp-upload [width]="320" (change)="upload($event, 'evidence')" title="上传PDF"></app-comp-upload>
+        <app-comp-upload [type]="'pdf'" [width]="320" (change)="upload($event, 'evidence')" title="上传PDF"></app-comp-upload>
         <div class="text upText" style="margin: 10px 0">
           支持上传PDF,大小不超过 2M
         </div>
@@ -144,7 +144,7 @@
     </p>
     }
     }
-    <app-comp-upload [width]="320" [maxlenght]="99" (change)="upload($event, 'moreMaterial')"
+    <app-comp-upload [type]="'pdf'" [width]="320" [maxlenght]="99" (change)="upload($event, 'moreMaterial')"
       title="上传PDF"></app-comp-upload>
 
     <div class="text upText" style="margin: 10px 0">
@@ -167,7 +167,7 @@
     </p>
     }
     }
-    <app-comp-upload [width]="320" [maxlenght]="99" (change)="upload($event, 'examine')"
+    <app-comp-upload [type]="'pdf'" [width]="320" [maxlenght]="99" (change)="upload($event, 'examine')"
       title="上传PDF"></app-comp-upload>
 
     <div class="text upText" style="margin: 10px 0">
@@ -190,7 +190,7 @@
               申报单位承诺意见
             </a>
           }
-          <app-comp-upload [width]="320" (change)="upload($event, 'unitMaterial')" title="上传PDF"></app-comp-upload>
+          <app-comp-upload [type]="'pdf'" [width]="320" (change)="upload($event, 'unitMaterial')" title="上传PDF"></app-comp-upload>
           <div class="text upText" style="margin: 10px 0">
             支持上传PDF,大小不超过 2M
           </div>

+ 23 - 21
projects/textbook/src/modules/nav-author/components/attachment/attachment.component.ts

@@ -129,28 +129,29 @@ export class AttachmentComponent implements OnInit {
       msgList.push('版权页截图')
       isNull = true
     }
-    if (this.CIPImgUrl == '' || !this.CIPImgUrl) {
-      if (this.cipProveFile?.length > 0) {
-        let isExist = this.cipProveFile.every(item => item?.url == '' || !item?.url)
-        if (isExist) {
-          msgList.push('CIP 相关内容截图')
-          isNull = true
-        }
-      } else {
-          msgList.push('CIP 查询截图')
-          isNull = true
-      }
-    } 
     // if (this.CIPImgUrl == '' || !this.CIPImgUrl) {
-    //   msgList.push('CIP查询截图')
-    //   isCipNull = true
-    // }else if (this.cipProveFile?.length > 0) {
-    //   let isExist = this.cipProveFile.every(item => item?.url == '' || !item?.url)
-    //   if (isExist) {
-    //     msgList.push('CIP证明材料')
-    //     isNull = true
+    //   if (this.cipProveFile?.length > 0) {
+    //     let isExist = this.cipProveFile.every(item => item?.url == '' || !item?.url)
+    //     if (isExist) {
+    //       msgList.push('CIP 相关内容截图')
+    //       isNull = true
+    //     }
+    //   } else {
+    //       msgList.push('CIP 查询截图')
+    //       isNull = true
     //   }
-    // }
+    // } 
+    if (this.CIPImgUrl == '' || !this.CIPImgUrl) {
+      msgList.push('CIP查询截图')
+      isNull = true
+    }
+    if (this.cipProveFile?.length > 0) {
+      let isExist = this.cipProveFile.every(item => item?.url == '' || !item?.url)
+      if (isExist) {
+        msgList.push('CIP证明材料')
+        isNull = true
+      }
+    }
     if (this.selfResults.url == '' || !this.selfResults.url) {
       msgList.push('自查结果记录表')
       isNull = true
@@ -215,7 +216,8 @@ export class AttachmentComponent implements OnInit {
       'importantProject', 'importantProjectOther', 'complete', 'links', 'recommend',
       'printSun', 'discard', 'edition', 'eduProcess', 'authors', 'editor',
       'copyrightImgUrl', 'CIPImgurl', 'selfResults', 'expertOpinion', 'evidence',
-      'moreMaterial', 'unitMaterial', 'approvedImgUrl', 'department','CIPImgUrl','cipProveFile'
+      'moreMaterial', 'unitMaterial', 'approvedImgUrl', 'department','CIPImgUrl','cipProveFile',
+      'examine'
     ] //非必填字段
     let textBookJson = this.eduTextbook.toJSON()
 

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

@@ -127,8 +127,14 @@
       <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">
+          @if (validateForm?.value?.approvedImgUrl) {
+            <a style="color: #3e49b3;font-size: 14px;" (click)="openFile(validateForm?.value?.approvedImgUrl)">
+              <span nz-icon nzType="file" nzTheme="outline"></span>
+              教材获批截图
+            </a>
+          }
           <nz-input-group>
-            <app-comp-upload [files]="approvedImgList" (change)="upload($event, 'approvedImgUrl')" title="上传教材获批截图"></app-comp-upload>
+            <app-comp-upload (change)="upload($event, 'approvedImgUrl')" title="上传教材获批截图"></app-comp-upload>
           </nz-input-group>
           <p style="color: gray;">支持上传 PDF 格式,文件大小不超过 2M</p>
         </nz-form-control>

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

@@ -427,4 +427,7 @@ export class BasicInComponent implements OnInit {
     }, 500);
  
   }
+  openFile(url: any) {
+    window.open(url)
+  }
 }

+ 24 - 16
projects/textbook/src/services/EduTextbook.ts

@@ -8,12 +8,12 @@ export const EduTextbook = {
         },
         "user": {
             "type": "Pointer",
-            "targetClass":"_User",
+            "targetClass": "_User",
             "required": false
         },
         "department": { //所属流程
             "type": "Pointer",
-            "targetClass":"Department",
+            "targetClass": "Department",
             "required": false
         },
         "render": { //是否提交
@@ -117,7 +117,7 @@ export const EduTextbook = {
             "required": false
         },
         "importantProject": {//重点项目
-            "type": "String",
+            "type": "Array",
             "required": false
         },
         "importantProjectOther": {//重点项目-其他
@@ -212,31 +212,39 @@ export const EduTextbook = {
             "type": "String",
             "required": false
         },
-        "approvedImgUrl":{//重点立项教材获批截图            
-            "type":'String',
+        "approvedImgUrl": {//重点立项教材获批截图            
+            "type": 'String',
             "required": false
         },
         "eduProcess": {//所属流程
             "type": "Pointer",
-            "targetClass":"EduProcess",
+            "targetClass": "EduProcess",
             "required": false
         },
-        "code":{//编号
-            "type":'String',
+        "code": {//编号
+            "type": 'String',
             "required": false
         },
-        'editionUnit':{
-            "type":'String',
+        'editionUnit': {
+            "type": 'String',
             "required": false
         },
-        'copyrightImgUrl':{
-            "type":'String',
-            "required": false  
+        'copyrightImgUrl': {
+            "type": 'String',
+            "required": false
+        },
+        'CIPImgurl': {
+            "type": 'String',
+            "required": false
         },
-        'CIPImgurl':{
-            "type":'String',
+        'cipProveFile':{//cip相关截图
+            "type":'Array',
             "required": false  
-        }
+        },
+        'examine': {//作者政治审核表
+            "type": 'Array',
+            "required": false
+        },
     },
     "classLevelPermissions": {
         "find": {

+ 9 - 1
server/db/schemas/EduTextbook.js

@@ -117,7 +117,7 @@ export const EduTextbook = {
             "required": false
         },
         "importantProject": {//重点项目
-            "type": "String",
+            "type": "Array",
             "required": false
         },
         "importantProjectOther": {//重点项目-其他
@@ -236,6 +236,14 @@ export const EduTextbook = {
         'CIPImgurl':{
             "type":'String',
             "required": false  
+        },
+        'examine':{//作者政治审核表
+            "type":'Array',
+            "required": false  
+        },
+        'cipProveFile':{//cip相关截图
+            "type":'Array',
+            "required": false  
         }
     },
     "classLevelPermissions": {