From 8032315cc5e4092d1dfb4db3fd6ec3449cbd8bf2 Mon Sep 17 00:00:00 2001
From: cpf <1105965053@qq.com>
Date: Sat, 27 Nov 2021 10:34:57 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=B8=8A=E4=BC=A0?=
=?UTF-8?q?=E5=9B=BE=E7=89=87=E5=AE=8C=E5=96=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app/pages/plan/plan.component.html | 8 +++----
src/app/pages/plan/plan.component.scss | 2 +-
src/app/pages/plan/plan.component.ts | 31 ++++++++++++++++++++++++++
3 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/src/app/pages/plan/plan.component.html b/src/app/pages/plan/plan.component.html
index c8827f3..51e3786 100644
--- a/src/app/pages/plan/plan.component.html
+++ b/src/app/pages/plan/plan.component.html
@@ -62,12 +62,12 @@
diff --git a/src/app/pages/plan/plan.component.scss b/src/app/pages/plan/plan.component.scss
index e6e8a68..bec982c 100644
--- a/src/app/pages/plan/plan.component.scss
+++ b/src/app/pages/plan/plan.component.scss
@@ -195,7 +195,7 @@
margin-bottom: 5px;
.natureTitle{ margin-bottom: 5px; height: 20px; line-height: 20px; }
textarea{ width: 100%; height: 75px; background: rgba(145, 204, 255, 0.41); border: 1px solid #91CCFF; padding: 0; resize: none; outline: none; }
- .natureImg{ margin-bottom: 5px; img{ width: auto; height: auto; max-width: 100%; } }
+ .natureImg{ margin-bottom: 5px; img{ width: auto; height: auto; max-height: 120px; } }
.natureUpload{ margin: 0; text-align: center; width: 50px; height: 50px; line-height: 50px; }
}
}
diff --git a/src/app/pages/plan/plan.component.ts b/src/app/pages/plan/plan.component.ts
index 093947a..63e6c64 100644
--- a/src/app/pages/plan/plan.component.ts
+++ b/src/app/pages/plan/plan.component.ts
@@ -339,6 +339,7 @@ export class PlanComponent implements OnInit {
isShowNature: boolean = false; //显隐设备 属性栏
beforeOnePropertyData: FacilityInfoUIItem = null; //当前选择 设备
+ propertyImg: Viewer; //设备图标Viewer 实例
naturePosition: naturePosition = new naturePosition(); //设备栏 定位位置
//选中 设备
@@ -349,6 +350,36 @@ export class PlanComponent implements OnInit {
if (this.isShowChildComponent && this.leftDomain) {
this.leftDomain.selectFacilityId = e.getID()
}
+ if (this.beforeOnePropertyData.getPropertyData() && this.beforeOnePropertyData.getPropertyData().img) { //img
+ window.setTimeout(() => {
+ this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original' });
+ }, 0)
+ }
+ }
+
+ //上传设备 图片
+ uploadPropertyImg(e) {
+ if (e.target.files.length) {
+ let maxSize = 30 * 1024 * 1024 //限制30MB
+ let file = e.target.files[0]
+ if (file.size > maxSize) { //超出限制
+ this.message.info("上传资源需小于30MB");
+ return
+ }
+ this.isShowLoading = true //打开遮罩
+ let institutionKey = sessionStorage.getItem('unitId') || "ceshi"; //单位id
+ let buildingKey = this.buildingUIItems.find(item => { return item.getBuildingID() == this.beforeOneBuildingID })
+ let facility = this.beforeOnePropertyData
+ let url = DataManager.getResPath_facilityProperty(institutionKey, buildingKey.getBuildingID(), facility.getType(), facility.getID(), null)
+ ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传
+ this.beforeOnePropertyData.getPropertyData().img = ObjectsService.getFullPath(path + name)
+ window.setTimeout(() => {
+ this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original' });
+ }, 0)
+ this.isShowLoading = false //关闭遮罩
+ this.message.info("上传成功!");
+ })
+ }
}
allMarkPlanData: AllMarkPlanData; //处置预案节点 数据
From 59b88edf5f75e84c48fb6ac937d30c870d3742d6 Mon Sep 17 00:00:00 2001
From: cpf <1105965053@qq.com>
Date: Sat, 27 Nov 2021 13:37:09 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=B8=8A=E4=BC=A0?=
=?UTF-8?q?=E5=9B=BE=E7=89=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../left-domain/left-domain.component.html | 12 ++--
.../left-domain/left-domain.component.ts | 58 +++++++++++++++----
src/app/pages/plan/plan.component.ts | 3 +-
3 files changed, 56 insertions(+), 17 deletions(-)
diff --git a/src/app/pages/left-domain/left-domain.component.html b/src/app/pages/left-domain/left-domain.component.html
index e98e9ae..1cf03f4 100644
--- a/src/app/pages/left-domain/left-domain.component.html
+++ b/src/app/pages/left-domain/left-domain.component.html
@@ -97,10 +97,10 @@
-
@@ -128,10 +128,10 @@