xll 7 months ago
parent
commit
be0f22b8d0

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

@@ -5,6 +5,12 @@
       <nz-form-item class="row" style="margin-bottom: 16px">
         <nz-form-label class="label" [nzNoColon]="true" [nzSm]="10" [nzXs]="10" nzRequired>版权页截图</nz-form-label>
         <nz-form-control class="val" nzErrorTip="请上传版权页截图" style="width: 100%">
+          @if (copyrightImgUrl) {
+            <a style="color: #3e49b3;" (click)="openFile(copyrightImgUrl)">
+              <span nz-icon nzType="file" nzTheme="outline"></span>
+              版权页截图
+            </a>
+          }
           <app-comp-upload [width]="320" (change)="upload($event, 'copyrightImgUrl')" title="上传截图"></app-comp-upload>
 
           <div class="text upText" style="margin: 10px 0">
@@ -16,7 +22,12 @@
         <nz-form-label class="label" [nzNoColon]="true" [nzSm]="10" [nzXs]="10" nzRequired>中国版本图书馆 CIP
           查询截图</nz-form-label>
         <nz-form-control class="val" nzErrorTip="请上传中国版本图书馆 CIP 查询截图" style="width: 100%">
-
+          @if (CIPImgUrl) {
+            <a style="color: #3e49b3;" (click)="openFile(CIPImgUrl)">
+              <span nz-icon nzType="file" nzTheme="outline"></span>
+              CIP 查询截图
+            </a>
+          }
           <app-comp-upload [width]="320" (change)="upload($event, 'CIPImgUrl')" title="上传截图"></app-comp-upload>
 
           <div class="text upText" style="margin: 10px 0">
@@ -34,6 +45,12 @@
         <nz-form-label class="label" [nzNoColon]="true" [nzSm]="10" [nzXs]="10"
           nzRequired>上传图书编校质量自查结果记录表</nz-form-label>
         <nz-form-control class="val" nzErrorTip="请上图书编校质量自查结果记录表" style="width: 100%">
+          @if (selfResults?.url) {
+            <a style="color: #3e49b3;" (click)="openFile(selfResults?.url)">
+              <span nz-icon nzType="file" nzTheme="outline"></span>
+              自查结果记录表
+            </a>
+          }
           <app-comp-upload [width]="320" (change)="upload($event, 'selfResults')" title="上传截图"></app-comp-upload>
           <div class="text upText" style="margin: 10px 0">
             支持批量上传 PDF、JPG、JPEG、PNG 格式,单个文件大小不超过 2M
@@ -51,6 +68,12 @@
       <nz-form-item class="row" style="margin-bottom: 16px">
         <nz-form-label class="label" [nzNoColon]="true" [nzSm]="10" [nzXs]="10" nzRequired>上传专家审核意见表</nz-form-label>
         <nz-form-control class="val" nzErrorTip="请上传专家审核意见表" style="width: 100%">
+          @if (expertOpinion?.url) {
+            <a style="color: #3e49b3;" (click)="openFile(expertOpinion?.url)">
+              <span nz-icon nzType="file" nzTheme="outline"></span>
+              专家审核意见表
+            </a>
+          }
           <app-comp-upload [width]="320" (change)="upload($event, 'expertOpinion')" title="上传截图"></app-comp-upload>
           <div class="text upText" style="margin: 10px 0">
             支持批量上传 PDF、JPG、JPEG、PNG 格式,单个大小不超过 2M
@@ -66,6 +89,12 @@
       <nz-form-item class="row" style="margin-bottom: 16px">
         <nz-form-label class="label" [nzNoColon]="true" [nzSm]="10" [nzXs]="10" nzRequired>教材使用情况证明材料</nz-form-label>
         <nz-form-control class="val" nzErrorTip="请上教材使用情况证明材料" style="width: 100%">
+          @if (evidence?.url) {
+            <a style="color: #3e49b3;" (click)="openFile(evidence?.url)">
+              <span nz-icon nzType="file" nzTheme="outline"></span>
+              证明材料
+            </a>
+          }
           <app-comp-upload [width]="320" (change)="upload($event, 'evidence')" title="上传截图"></app-comp-upload>
           <div class="text upText" style="margin: 10px 0">
             支持批量上传 PDF、JPG、JPEG、PNG 格式,单个文件大小不超过 2M
@@ -76,6 +105,16 @@
     <div class="author-content">
       <div class="title">其他材料</div>
       <div class="text">其他佐证材料。</div>
+      @if (moreMaterial.length>0) {
+        @for (url of moreMaterial; track $index) {
+          <p>
+            <a style="color: #3e49b3;" (click)="openFile(url?.url)">
+              <span nz-icon nzType="file" nzTheme="outline"></span>
+              佐证材料 {{$index+1}}
+            </a>
+          </p>
+        }
+      }
       <app-comp-upload [width]="320" [maxlenght]="99" (change)="upload($event, 'moreMaterial')" title="上传截图"></app-comp-upload>
 
       <div class="text upText" style="margin: 10px 0">
@@ -93,6 +132,12 @@
       <nz-form-item class="row" style="margin-bottom: 16px">
         <nz-form-label class="label" [nzNoColon]="true" [nzSm]="16" [nzXs]="16" nzRequired>申报单位承诺意见材料</nz-form-label>
         <nz-form-control class="val" nzErrorTip="请上传申报单位承诺意见材料" style="width: 450px">
+          @if (unitMaterial?.url) {
+            <a style="color: #3e49b3;" (click)="openFile(unitMaterial?.url)">
+              <span nz-icon nzType="file" nzTheme="outline"></span>
+              申报单位承诺意见
+            </a>
+          }
           <app-comp-upload [width]="320" (change)="upload($event, 'unitMaterial')" title="上传截图"></app-comp-upload>
           <div class="text upText" style="margin: 10px 0">
             支持批量上传 PDF、JPG、JPEG、PNG 格式,单个文件大小不超过 2M

+ 6 - 16
projects/textbook/src/modules/nav-author/components/attachment/attachment.component.ts

@@ -106,14 +106,6 @@ export class AttachmentComponent implements OnInit {
       this.moreMaterial = this.eduTextbook?.get('moreMaterial') || this.moreMaterial
       this.unitMaterial = this.eduTextbook?.get('unitMaterial') || this.unitMaterial
     }
-    console.log(    
-      'copyrightImgUrl',this.copyrightImgUrl,
-      'CIPImgUrl',this.CIPImgUrl,
-      'selfResults',this.selfResults,
-      'expertOpinion',this.expertOpinion,
-      'evidence',this.evidence,
-      'moreMaterial',this.moreMaterial,
-      'unitMaterial',this.unitMaterial)
   }
 
   /**本页必填是否存在空项 */
@@ -244,7 +236,6 @@ export class AttachmentComponent implements OnInit {
   }
 
   async saveEduTextbook(params: any, isComplete: boolean) {
-    console.log(params);
     if (!this.eduTextbook) {
       this.msg.error('请先创建教材');
       return;
@@ -276,20 +267,15 @@ export class AttachmentComponent implements OnInit {
     return;
   }
   upload(e: any, type: string) {
-    console.log(e);
-    let file = e[0];
+    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') {
       this[type].url = file?.url
-      // this[type].name = this.getFileName(file)
       this[type].name = file?.name
     } else if (type == 'moreMaterial') {
-      let newList = e.map((item: any) => {
-        return { name: this.getFileName(item), url: item }
-      })
-      this[type]=newList
+      this[type]=[...(this[type]||[]),{name:file.name,url:file.url}]
     }
   }
   /**获取文件名 */
@@ -315,4 +301,8 @@ export class AttachmentComponent implements OnInit {
       window.URL.revokeObjectURL(url);
     })
   }
+  openFile(url:string){
+    console.log(url);
+    window.open(url)
+  }
 }

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

@@ -95,11 +95,11 @@
             <th nzWidth="300px">手机号码</th>
             <th nzWidth="160px">电子邮箱</th>
             <th nzWidth="160px">分工</th>
-            <th nzWidth="100px" nzRight>
+            <th nzWidth="120px" nzRight>
               作者诚信承诺签名
               <span style="color: red;">*</span>
             </th>
-            <th nzWidth="100px" nzRight>
+            <th nzWidth="120px" nzRight>
               作者政治审查表
               <span style="color: red;">*</span>
             </th>
@@ -170,14 +170,16 @@
               </nz-select>
             </td>
             <td nzRight>
-              <!-- {{data.signature? getFileName(data.signature):'未上传'}} -->
-              <app-comp-upload (change)="upload($event, 'signature',index)"
-                [title]="getFileName(data.signature)"></app-comp-upload>
+              @if (data.signature) {
+                <a style="color: #3e49b3;" (click)="openFile(data.signature)">签名文件</a>
+              }
+              <app-comp-upload (change)="upload($event, 'signature',index)"></app-comp-upload>
             </td>
             <td nzRight>
-              <!-- {{data.examine?getFileName(data.examine):'未上传'}} -->
-              <app-comp-upload (change)="upload($event, 'examine',index)"
-                [title]="getFileName(data.examine)"></app-comp-upload>
+              @if (data.examine) {
+              <a style="color: #3e49b3;" (click)="openFile(data.examine)">政治审查表 </a>
+              }
+              <app-comp-upload (change)="upload($event, 'examine',index)"></app-comp-upload>
             </td>
             <td nzRight>
               <a (click)="onPush('authorList', index)"><span nz-icon style="font-size: 20px; margin-right: 10px"

+ 3 - 0
projects/textbook/src/modules/nav-author/components/textbook-pertain/textbook-pertain.component.scss

@@ -48,4 +48,7 @@
   justify-content: space-evenly;
   // width: 200px;
   justify-content: end;
+}
+.fileLink{
+  color: blue;
 }

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

@@ -164,8 +164,6 @@ export class TextbookPertainComponent implements OnInit {
 
   ngOnInit() {
     console.log(this.eduTextbook);
-    console.log(this.eduTextbook.get('characteristic'));
-
     if (this.eduTextbook.id) {
       let list = this.eduTextbook.get('characteristic')||[]
        if(list.length>0){
@@ -178,6 +176,8 @@ export class TextbookPertainComponent implements OnInit {
             three.push(list[i])
           }else if(list[i].checked){
             this.checkTwo=list[i].label
+            let index = this.checkOptionsTwo.findIndex(item=>item.value==list[i].label)
+            this.checkOptionsTwo[index].checked=true
           }
         }
        this.checkOptionsOne=one
@@ -208,7 +208,6 @@ export class TextbookPertainComponent implements OnInit {
         ],
       });
       this.authorList = this.eduTextbook.get('authorList') || this.authorList
-      console.log(this.authorList)
       this.achievementOptions = this.eduTextbook.get('achievementOptions') || this.achievementOptions
     }
   }
@@ -217,10 +216,8 @@ export class TextbookPertainComponent implements OnInit {
       this.state.emit({ type: 'pre' });
       return
     }
-    console.log(this.validateForm.value);
     let authorListVrifly = !this.authorList.some(item => Object.values(item).some(val => val == '' || val == undefined))
     let achievementOptionsVrifly = !this.achievementOptions.some(item => Object.values(item).some(val => val == '' || val == undefined))
-    console.log(authorListVrifly, achievementOptionsVrifly);
 
     if (this.validateForm.valid) {
       let params: any = this.validateForm.value;
@@ -407,7 +404,10 @@ export class TextbookPertainComponent implements OnInit {
     return result || '未知文件名'
   }
   
-
+  openFile(url:string){
+    console.log(url);
+    window.open(url)
+  }
   downloadFile(){
     let fileName = '十四五”普通高等教育本科国家级规划教材第一次遴选推荐申报表.docx'
     const fileUrl = `../../../../../public/file/${fileName}`;