From a3d88ee006c7897d004699ebcaec0bda4439a8dd Mon Sep 17 00:00:00 2001 From: chenjingyu Date: Fri, 2 Jul 2021 15:19:50 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E5=9C=A8=E7=BA=BF=E7=BC=96?= =?UTF-8?q?=E5=88=B6=E5=B1=9E=E6=80=A7=E7=BB=93=E6=9E=84=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-plan-online-five.component.html | 24 ++++++++- .../create-plan-online-five.component.scss | 50 ++++++++++++++++++- .../create-plan-online-five.component.ts | 17 +++++-- .../plan-template.component.html | 6 +-- .../plan-template/plan-template.component.ts | 9 ++-- 5 files changed, 92 insertions(+), 14 deletions(-) diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html index 28a6962..18feb39 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html @@ -452,9 +452,31 @@ -
+ +
+ +
+
+ delete + +
+
+ + +
+
+
+
diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss index d7ea4a8..ff7d07c 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss @@ -378,7 +378,55 @@ display: flex; } } - + .keyImg { + width: 100%; + height: 100%; + .keyImgImg { + .imgbox { + margin-top: 10px; + text-align: center; + position: relative; + img { + max-width: 100%; + width: auto; + height: auto; + } + .deleteImg { + display: none; + cursor: pointer; + position: absolute; + right: 0px; + top: 0px; + } + } + .imgbox:hover { + .deleteImg { + display: block; + } + } + .uploadBtn { + display: flex; + justify-content: center; + margin: 50px 0; + position: relative; + input { + width: 112px; + height: 36px; + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + opacity: 0; + cursor: pointer; + } + } + } + .addkeyImgItem { + display: flex; + justify-content: center; + margin: 10px 0; + } + } } } } diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts index db23456..74d2a44 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2021-06-16 13:56:54 * @LastEditors: sueRimn - * @LastEditTime: 2021-06-30 14:01:35 + * @LastEditTime: 2021-07-02 14:28:59 */ import { HttpClient } from '@angular/common/http'; import { Component, Inject, OnInit, Renderer2, ViewChild, Input } from '@angular/core'; @@ -270,6 +270,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { } //重点图示上传图片 filechange(e, i) { + console.log(i) let file = e.target.files[0] || null //获取上传的文件 let fileSize = file.size || null //上传文件的总大小 let maxSize = 5 * 1024 * 1024 //5MB一个分片 @@ -277,12 +278,22 @@ export class CreatePlanOnlineFiveComponent implements OnInit { if (file && fileSize <= maxSize) { //上传文件<=5MB时 let upload = this.uploadFile(this.route.snapshot.queryParams.companyId, this.route.snapshot.queryParams.planId, file) upload.then((res: any) => { - i.imgArr.push('/api/Objects/PlanPlatform/' + res.objectName) + if(i.tableth!=undefined){ + i.tableth.json.push('/api/Objects/PlanPlatform/' + res.objectName) + }else{ + i.imgArr.push('/api/Objects/PlanPlatform/' + res.objectName) + } + }) } else { //上传文件>5MB时 let upload = this.sectionUpload(this.route.snapshot.queryParams.companyId, this.route.snapshot.queryParams.planId, file) upload.then(res => { - i.imgArr.push('/api/Objects/PlanPlatform/' + res) + if(i.tableth!=undefined){ + i.tableth.json.push('/api/Objects/PlanPlatform/' + res) + }else{ + i.imgArr.push('/api/Objects/PlanPlatform/' + res) + } + }) } } diff --git a/src/app/ui/plan-template/plan-template.component.html b/src/app/ui/plan-template/plan-template.component.html index d1a0661..8de5f3a 100644 --- a/src/app/ui/plan-template/plan-template.component.html +++ b/src/app/ui/plan-template/plan-template.component.html @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2021-05-19 15:50:20 * @LastEditors: sueRimn - * @LastEditTime: 2021-06-18 10:55:32 + * @LastEditTime: 2021-07-02 14:46:11 -->
@@ -250,9 +250,9 @@
-
+
diff --git a/src/app/ui/plan-template/plan-template.component.ts b/src/app/ui/plan-template/plan-template.component.ts index 8af92c1..f8bb21a 100644 --- a/src/app/ui/plan-template/plan-template.component.ts +++ b/src/app/ui/plan-template/plan-template.component.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2021-05-31 10:40:01 * @LastEditors: sueRimn - * @LastEditTime: 2021-06-30 14:45:53 + * @LastEditTime: 2021-07-02 14:21:31 */ import { Component, Inject, OnInit,ViewEncapsulation } from '@angular/core'; @@ -482,7 +482,7 @@ export class PlanTemplateComponent implements OnInit { } //保存 save(){ - console.log(this.newleftTabledata,this.tree) + console.log(this.newleftTabledata) const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -899,10 +899,7 @@ export class disaster{ }else{ let tree={ json:[], - config: { - nodeWidth: 90, - nodeHeight: 60 - } + name: '' } let attrubute={ headName:this.headName,