From 37e480fe4017393a5bd020c0d74339c91ef69aa8 Mon Sep 17 00:00:00 2001
From: SHAOJIAHAO <55341701@qq.com>
Date: Wed, 22 Jun 2022 09:30:49 +0800
Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E4=BF=AE=E6=94=B9=E4=B8=8A?=
 =?UTF-8?q?=E4=BC=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../entry-plan-look.component.ts              | 26 +++++++------------
 .../entry-plan-look/upLoad.html               | 20 +++++++-------
 2 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts b/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
index 63c02ba..e387a1c 100644
--- a/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
+++ b/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
@@ -170,6 +170,7 @@ export class EntryPlanLookComponent implements OnInit {
   }
   //编辑预案
   editPlan(e) {
+    console.log(e)
     const config = new MatSnackBarConfig();
     config.verticalPosition = 'top';
     config.duration = 3000
@@ -368,17 +369,15 @@ export class EntryPlanLookComponent implements OnInit {
 
             const dialogRef = this.dialog.open(editUpload, {
               width: "300px",
-              height: "150px",
+              height: "200px",
               data: { id: e.id, companyId: this.companyId, unitType: this.unitdata.unittype, unitName: this.unitdata.unitname },
               disableClose: true
             });
             dialogRef.afterClosed().subscribe(data => {
               this.getAllPlanComponents()
             })
-            //this.lookPlan(e)
-          }/* ,err => {
-              this.snackBar.open(err,'确定',config);
-            } */)
+
+          })
         }
 
       }
@@ -931,7 +930,6 @@ export class AddPlanone {
       } else { this.pswShow = false }
     } else { this.pswShow = false }
 
-    // this.startUploading()
   }
 
   //上传文件
@@ -940,7 +938,6 @@ export class AddPlanone {
     let file = this.file || null //获取上传的文件
     let fileSize = file.size || null //上传文件的总大小
     let shardSize = 5 * 1024 * 1024 //5MB一个分片
-    // console.log(this.psw)
 
     if (file && fileSize <= shardSize) { //上传文件<=5MB时
       let formData = new FormData()
@@ -1133,8 +1130,6 @@ export class AddPlanone {
   website: boolean = false //网页地址
   inputNew: boolean = false //自定义编辑
   next(formdata) {
-    //console.log(formdata.value.firstCtrlthree)
-    //console.log(this.file)
     this.psw = false
     this.selectedPLanName = formdata.value.firstCtrlone
     this.selectedPLanType = formdata.value.firstCtrltwo
@@ -1720,7 +1715,6 @@ export class editUpload {
     let file = this.file || null //获取上传的文件
     let fileSize = file.size || null //上传文件的总大小
     let shardSize = 5 * 1024 * 1024 //5MB一个分片
-    // console.log(this.psw)
     if (this.file != undefined) {
       if (file && fileSize <= shardSize) { //上传文件<=5MB时
         let formData = new FormData()
@@ -1733,11 +1727,8 @@ export class editUpload {
           let options = {
             headers
           };
-
-
           this.uploadover = true
           let level = sessionStorage.getItem("level")
-          // console.log(level)
           let PlanLevel
           if (level == '0') {
             PlanLevel = 1
@@ -1765,9 +1756,12 @@ export class editUpload {
 
       } else if (file && fileSize > shardSize) { //上传文件>5MB时,分块上传
         let data = { filename: file.name }
-        //this.uploadisLoading = tru
-        this.subsectionUploading()
-
+        this.http.post(`/api/NewMultipartUpload/PlanPlatform/${this.data.companyId}/2D`, {}, { params: data }).subscribe((data: any) => { //初始化分段上传
+          this.objectName = data.objectName
+          this.uploadId = data.uploadId
+          this.uploadisLoading = true
+          this.subsectionUploading()
+        })
       }
     }
     else {
diff --git a/src/app/plan-management/entry-plan-look/upLoad.html b/src/app/plan-management/entry-plan-look/upLoad.html
index b63e1bb..29d8111 100644
--- a/src/app/plan-management/entry-plan-look/upLoad.html
+++ b/src/app/plan-management/entry-plan-look/upLoad.html
@@ -1,18 +1,20 @@
 <div class="upload">
     <div class="file">
-        <button mat-raised-button color="primary" (click)='upload()'><img style="margin-bottom: 2px;" src="../../../assets/images/bendi.png"> 重新上传文件</button>
+        <button mat-raised-button color="primary" (click)='upload()'><img style="margin-bottom: 2px;"
+                src="../../../assets/images/bendi.png"> 重新上传文件</button>
         <input id="up" style="display: none;" type="file" (change)="filechange($event)" accept=".doc,.txt,.docx,.pdf">
         <label style="font-size: 10px;">{{file==undefined?'':file.name}}</label>
     </div>
-    <!-- <div class="progressBox" *ngIf="uploadisLoading">
-                  
+    <div class="progressBox" *ngIf="uploadisLoading">
+
         <span style="font-size: 13px;">上传中...</span>
-        <mat-progress-bar mode="determinate" [value]="uploadProgress" class="progress" style="width: 320px;left: 64px;"></mat-progress-bar>
-        
-      </div> -->
+        <mat-progress-bar mode="determinate" [value]="uploadProgress" class="progress" style="width: 150px;left: 64px;">
+        </mat-progress-bar>
+
+    </div>
     <div style="margin-top: 20px;text-align: center;">
-        <button  mat-raised-button (click)="startUploading()" >确定</button>
-        <button  mat-raised-button (click)="onNoClick()" style="margin-left: 10px;">取消</button>
+        <button mat-raised-button (click)="startUploading()">确定</button>
+        <button mat-raised-button (click)="onNoClick()" style="margin-left: 10px;">取消</button>
     </div>
-    
+
 </div>
\ No newline at end of file