Browse Source

update upload

warrior 7 months ago
parent
commit
5c6fd02e6f

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

@@ -76,7 +76,7 @@
     <div class="author-content">
       <div class="title">其他材料</div>
       <div class="text">其他佐证材料。</div>
-      <app-comp-upload [width]="320" (change)="upload($event, 'moreMaterial')" title="上传截图"></app-comp-upload>
+      <app-comp-upload [width]="320" [maxlenght]="99" (change)="upload($event, 'moreMaterial')" title="上传截图"></app-comp-upload>
 
       <div class="text upText" style="margin: 10px 0">
         支持批量上传 PDF、JPG、JPEG、PNG 格式,单个文件大小不超过 2M

+ 4 - 3
projects/textbook/src/modules/nav-author/components/attachment/attachment.component.ts

@@ -260,11 +260,12 @@ export class AttachmentComponent implements OnInit {
     console.log(e);
     let file = e[0];
     if (type == 'copyrightImgUrl' || type == 'CIPImgUrl') {
-      this[type] = file
+      this[type] = file?.url
     } else if (type == 'selfResults' || type == 'expertOpinion' ||
       type == 'evidence' || type == 'unitMaterial') {
-      this[type].url = file
-      this[type].name = this.getFileName(file)
+      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 }

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

@@ -122,7 +122,7 @@
         <nz-form-label [nzSm]="8" [nzNoColon]="true" [nzXs]="8" nzRequired>教材获批截图</nz-form-label>
         <nz-form-control nzErrorTip="请上传教材获批截图" [nzSm]="12" [nzXs]="12">
           <nz-input-group>
-            <app-comp-upload [width]="320" (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>

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

@@ -245,7 +245,7 @@ export class BasicInComponent implements OnInit {
     let file = e[0];
     // if(type == 'copyrightImgUrl' || type == 'CIPImgUrl' ||type=='approvedImgUrl'){
     if(type=='approvedImgUrl'){
-      this.validateForm.value[type] = file
+      this.validateForm.value[type] = file?.name
     }
   }
   async submitForm(event?: string): Promise<void> {