From c50e55e6e7dcfa148eb77a09064c2a9b89ba6d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=8C=AF=E5=8D=87?= <359059686@qq.com> Date: Tue, 26 Jan 2021 11:57:21 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E9=9B=86=E5=90=88=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/working-area/model/axSelection.ts | 4 ++-- src/app/working-area/working-area.component.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/working-area/model/axSelection.ts b/src/app/working-area/model/axSelection.ts index ce7a6e0..8bd6400 100644 --- a/src/app/working-area/model/axSelection.ts +++ b/src/app/working-area/model/axSelection.ts @@ -8,7 +8,7 @@ export class AxSelection { // 获得第一个对象 public first(): any { if (this.objects.size > 0) { - return this.objects[0]; + return [...this.objects][0]; } else { return null; } @@ -19,7 +19,7 @@ export class AxSelection { } // 获得所有对象 public all() { - return this.objects; + return [...this.objects]; } // 获取集合长度 public size(): number { diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 30d61ec..7f80485 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -151,7 +151,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * RC版: 该版本已经相当成熟了,基本上不存在导致错误的BUG,与即将发行的正式版相差无几。 * Release版: 该版本意味“最终版本”,在前面版本的一系列测试版之后,终归会有一个正式版本,是最终交付用户使用的一个版本。该版本有时也称为标准版。一般情况下,Release不会以单词形式出现在软件封面上,取而代之的是符号®。 */ - public VERSION = '1.0.12.20210125_beta'; + public VERSION = '1.0.13.20210126_beta'; /** * 数据初始化 */ @@ -159,13 +159,13 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV PIXI.utils.skipHello(); this.sayHello(); this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => { - event.stopPropagation() + event.stopPropagation(); if (event.keyCode === 17) { this.isCtrlKeyClicked = true; } }); this.eventManager.addGlobalEventListener('window', 'keyup', (event: any) => { - event.stopPropagation() + event.stopPropagation(); if (event.keyCode === 17) { this.isCtrlKeyClicked = false; this.rectToolGraphics.visible = false; @@ -181,7 +181,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * 删除选中的图标 */ public deleteSelectedShape() { - if (this.selection.all().size > 0) { + if (this.selection.size() > 0) { this.selection.all().forEach(axShape => { if (this.allowEdit && this.canvasData.gameMode === axShape.assetData.GameMode) { // 删除图例对象 From afe20a612a1e83efe4bf32b93379deeebaf56cb5 Mon Sep 17 00:00:00 2001 From: chenjingyu Date: Tue, 26 Jan 2021 15:12:51 +0800 Subject: [PATCH 2/4] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E9=87=8D=E7=82=B9?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E7=AE=A1=E7=90=86=E5=AE=8C=E6=95=B4=E5=BA=A6?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=9F=A5=E8=AF=A2=E6=B8=85=E7=A9=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../key-unit-management/key-unit-management.component.html | 4 ++-- .../key-unit-management/key-unit-management.component.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/key-unit/key-unit-management/key-unit-management.component.html b/src/app/key-unit/key-unit-management/key-unit-management.component.html index ea625a8..3f25a16 100644 --- a/src/app/key-unit/key-unit-management/key-unit-management.component.html +++ b/src/app/key-unit/key-unit-management/key-unit-management.component.html @@ -75,11 +75,11 @@
- + 🠊 - +
diff --git a/src/app/key-unit/key-unit-management/key-unit-management.component.ts b/src/app/key-unit/key-unit-management/key-unit-management.component.ts index 03424f3..90b7e9a 100644 --- a/src/app/key-unit/key-unit-management/key-unit-management.component.ts +++ b/src/app/key-unit/key-unit-management/key-unit-management.component.ts @@ -548,6 +548,8 @@ export class KeyUnitManagementComponent implements OnInit { this.PageNumber = 1 this.pageEvent.pageIndex = 0 this.integritySort = '' + this.integrityScoreMax=undefined + this.integrityScoreMin=undefined this.getAllKeyUnit(); } //编辑单位名称 From 812aae1383a940754723e60363921d17d720de82 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Wed, 27 Jan 2021 09:52:46 +0800 Subject: [PATCH 3/4] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=A1=86=E9=80=89=E5=A4=9A=E4=B8=AA=E7=B4=A0=E6=9D=90=E5=90=8E?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=B1=E5=90=8C=E6=8B=A5=E6=9C=89=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collection-tools.component.html | 110 +++++++++- .../collection-tools.component.ts | 170 +++++++++++++++- .../collection-tools.component.html | 115 ++++++++++- .../collection-tools.component.ts | 191 +++++++++++++++++- .../collection-tools.component.html | 113 ++++++++++- .../collection-tools.component.ts | 172 +++++++++++++++- .../working-area/working-area.component.ts | 2 +- 7 files changed, 838 insertions(+), 35 deletions(-) diff --git a/src/app/ui/collection-tools-building/collection-tools.component.html b/src/app/ui/collection-tools-building/collection-tools.component.html index 76bf745..a3b1434 100644 --- a/src/app/ui/collection-tools-building/collection-tools.component.html +++ b/src/app/ui/collection-tools-building/collection-tools.component.html @@ -174,7 +174,7 @@ -
+

面积(平方米)

{{canvasData.selectStorey.area}}

详情

@@ -183,7 +183,7 @@
-
+

{{assetName}}

@@ -315,8 +315,112 @@
-
+ + +
+
+

宽度(像素)

+ +

高度(像素)

+ +

角度

+
+ + +
+
+ +
+

厚度

+
+ + +
+
+
+
+ 颜色 +
+ +
+
+
+
    +
  • +
+
+ 透明度 + + {{colorDivSliderValue}}% +
+
+ +
+

{{item.PropertyName}}({{item.PhysicalUnit}})

+ +
+ +
+

{{item.PropertyName}}({{item.PhysicalUnit}})

+ +
+ +
+

{{item.PropertyName}}({{item.PhysicalUnit}})

+ +
+ + + +
+

{{item.PropertyName}}

+ + +
+ +
+

{{item.PropertyName}}

+ +
+ +
+

{{item.PropertyName}}

+ +
+
+
diff --git a/src/app/ui/collection-tools-building/collection-tools.component.ts b/src/app/ui/collection-tools-building/collection-tools.component.ts index fb2e03b..99d4520 100644 --- a/src/app/ui/collection-tools-building/collection-tools.component.ts +++ b/src/app/ui/collection-tools-building/collection-tools.component.ts @@ -17,7 +17,7 @@ import { ActivatedRoute, Router } from '@angular/router'; import { TabbarAndScoreService } from 'src/app/http-interceptors/tabbar-and-score.service'; import { MaskLayerService } from 'src/app/mask-layer.service'; import * as ObjectID from 'bson-objectid'; - +import { AxMessageSystem } from 'src/app/working-area/model/axMessageSystem'; @Component({ selector: 'app-collection-tools-building', templateUrl: './collection-tools.component.html', @@ -83,9 +83,11 @@ export class CollectionToolsBuildingComponent implements OnInit { setTimeout(() => { obj.PropertyInfos.forEach(item => { if(item.PropertyType == 4){ - this.gallery = new Viewer(document.getElementById('viewerjs'),{ - url: 'data-original' - }); + if(document.getElementById('viewerjs')){ + this.gallery = new Viewer(document.getElementById('viewerjs'),{ + url: 'data-original' + }); + } } }) }, 0); @@ -611,7 +613,67 @@ export class CollectionToolsBuildingComponent implements OnInit { isSixShow = true isSixbtn = true //控制想定作业编辑按钮 isediticon = true //控制查看编辑模式的编辑模式小笔按钮 + + + isMultipleAsset:boolean = false//框选多个素材属性显隐 + multipleAsset:any = { + Width:null, + Height:null, + Angle:null, + Thickness:null, + Color:null, + PropertyInfos:[] + }//多个素材共同属性 + multipleAssetData:any//当前多选的素材 + firstMultipleAssetData:any//当前多选的第一个素材 ngOnInit(): void { + let _this = this + AxMessageSystem.addListener('selectionChanged', ()=>{ + if(this.canvas.selection.size() == 1){//如果是单选 + this.isMultipleAsset = false + // console.log('单选',this.canvas.selection.first().assetData) + this.setAssetsProperty(this.canvas.selection.first().assetData) + }else if(this.canvas.selection.size()){ + // console.log('多选') + this.multipleAssetData = this.canvas.selection.all() + this.firstMultipleAssetData = this.canvas.selection.first() + this.multipleAsset = { + Width:null, + Height:null, + Angle:null, + Thickness:null, + Color:null, + PropertyInfos:[] + } + this.isMultipleAsset = true + let firstAssetData = this.canvas.selection.first().assetData;//拿出第一个素材作为例子与其他素材进行对比 + let InteractiveMode = firstAssetData.InteractiveMode //素材连接方式 + let isInteractiveMode = this.canvas.selection.all().every(item => item.assetData.InteractiveMode === InteractiveMode) + if(isInteractiveMode){ + this.multipleAsset.InteractiveMode = InteractiveMode + } + let isFillMode = this.canvas.selection.all().every(item => item.assetData.FillMode === 0) //素材填充方式都为0 + if(isFillMode){ + this.multipleAsset.FillMode = 0 + } + this.canvas.selection.first().assetData.PropertyInfos.forEach(i => { + let index = 0 + this.canvas.selection.all().forEach(item => { + item.assetData.PropertyInfos.forEach(element => { + if(element.PropertyName == i.PropertyName && element.PropertyType == i.PropertyType && element.PropertyType != 3 && element.PropertyType != 4){ + index++ + if(index == this.canvas.selection.size()){ + let newElement = JSON.parse(JSON.stringify(element)) + newElement.PropertyValue = '' + this.multipleAsset.PropertyInfos.push(newElement) + } + } + }); + }) + }) + } + }, this) + if(this.router.url.indexOf("keyUnit/viewunitinfo") != -1 || this.router.url.indexOf("keyUnit/editplaninfo")!= -1){ this.isSixbtn = false @@ -648,6 +710,106 @@ export class CollectionToolsBuildingComponent implements OnInit { } }) } + //多选宽度共同改变 + multipleAssetWidthInput(){ + this.multipleAssetData.forEach(item=>{ + item.assetData.Width = this.multipleAsset.Width + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + }) + } + //多选高度共同改变 + multipleAssetHeightInput(){ + this.multipleAssetData.forEach(item=>{ + item.assetData.Height = this.multipleAsset.Height + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + }) + } + //多选角度共同改变 + multipleAssetAngleInput(){ + this.multipleAssetData.forEach(item=>{ + item.assetData.Angle = this.multipleAsset.Angle + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + }) + } + //多选厚度共同改变 + multipleAssetThicknessInput(){ + this.multipleAssetData.forEach(item=>{ + item.assetData.Thickness = this.multipleAsset.Thickness + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + }) + } + //多选颜色共同改变 + multipleSelectedcolor:any + multipleAssetSelectcolor(item,key){ + //在当前透明度基础上改变颜色 + this.multipleSelectedcolor = item + this.multipleAssetData.forEach(item=>{ + item.assetData.Color = this.multipleSelectedcolor + this.canvasData.isChange = true + this.canvas.refreshIcon(item.assetData.Id) + }) + } + //多选颜色滑竿改变 + multipleColorDivSliderChange(){ + let colorOpacity = Math.round(255 * this.colorDivSliderValue * 0.01) + //根据滑竿值改变16进制颜色后两位 + function replacepos(text,start,stop,replacetext){ + let mystr = text.substring(0,stop-1)+replacetext+text.substring(stop+1); + return mystr; + } + this.multipleAssetData.forEach(item=>{ + this.multipleSelectedcolor = replacepos(this.multipleSelectedcolor,7,8,colorOpacity.toString(16)) + item.assetData.Color = this.multipleSelectedcolor + this.canvasData.isChange = true + this.canvas.refreshIcon(item.assetData.Id) + }) + } + //多选状态动态属性素材input框值改变 + multipleAssetInputChange(i,e){ + e.stopPropagation() + this.multipleAssetData.forEach(item=>{ + // console.log(item) + item.assetData.PropertyInfos.forEach(element => { + if(element.PropertyName == i.PropertyName){ + element.PropertyValue = i.PropertyValue + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + } + }) + }) + } + //多选状态动态属性素材radio框值改变 + multipleAssetRadioChange(i,value){ + // e.stopPropagation() + this.multipleAssetData.forEach(item=>{ + // console.log(item) + item.assetData.PropertyInfos.forEach(element => { + if(element.PropertyName == i.PropertyName){ + element.PropertyValue = value + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + } + }) + }) + } + //多选状态动态属性素材下拉框值改变 + multipleSupplyArea(i,e){ + e.stopPropagation() + this.multipleAssetData.forEach(item=>{ + // console.log(item) + item.assetData.PropertyInfos.forEach(element => { + if(element.PropertyName == i.PropertyName){ + element.PropertyValue = i.PropertyValue + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + } + }) + }) + } diff --git a/src/app/ui/collection-tools-plan/collection-tools.component.html b/src/app/ui/collection-tools-plan/collection-tools.component.html index ac69822..9985e7b 100644 --- a/src/app/ui/collection-tools-plan/collection-tools.component.html +++ b/src/app/ui/collection-tools-plan/collection-tools.component.html @@ -153,7 +153,7 @@
属性
-
+

面积(平方米)

{{canvasData.selectStorey.area}}

详情

@@ -162,14 +162,14 @@
-
+

{{assetName}}

宽度(像素)

- +

高度(像素)

- +

角度

是否高亮

- + 选中高亮
@@ -295,7 +295,110 @@
- + +
+
+

宽度(像素)

+ +

高度(像素)

+ +

角度

+
+ + +
+
+ +
+

厚度

+
+ + +
+
+
+
+ 颜色 +
+ +
+
+
+
    +
  • +
+
+ 透明度 + + {{colorDivSliderValue}}% +
+
+ +
+

{{item.PropertyName}}({{item.PhysicalUnit}})

+ +
+ +
+

{{item.PropertyName}}({{item.PhysicalUnit}})

+ +
+ +
+

{{item.PropertyName}}({{item.PhysicalUnit}})

+ +
+ + + +
+

{{item.PropertyName}}

+ + +
+ +
+

{{item.PropertyName}}

+ +
+ +
+

{{item.PropertyName}}

+ +
+
+
diff --git a/src/app/ui/collection-tools-plan/collection-tools.component.ts b/src/app/ui/collection-tools-plan/collection-tools.component.ts index d4b9d0b..b726bde 100644 --- a/src/app/ui/collection-tools-plan/collection-tools.component.ts +++ b/src/app/ui/collection-tools-plan/collection-tools.component.ts @@ -17,7 +17,7 @@ import { ActivatedRoute, Router } from '@angular/router'; import { TabbarAndScoreService } from 'src/app/http-interceptors/tabbar-and-score.service'; import { MaskLayerService } from 'src/app/mask-layer.service'; import * as ObjectID from 'bson-objectid'; - +import { AxMessageSystem } from 'src/app/working-area/model/axMessageSystem'; @Component({ selector: 'app-collection-tools-plan', templateUrl: './collection-tools.component.html', @@ -83,9 +83,11 @@ export class CollectionToolsPlanComponent implements OnInit { setTimeout(() => { obj.PropertyInfos.forEach(item => { if(item.PropertyType == 4){ - this.gallery = new Viewer(document.getElementById('viewerjs'),{ - url: 'data-original' - }); + if(document.getElementById('viewerjs')){ + this.gallery = new Viewer(document.getElementById('viewerjs'),{ + url: 'data-original' + }); + } } }) }, 0); @@ -408,7 +410,10 @@ export class CollectionToolsPlanComponent implements OnInit { //素材是否高亮改变----->本地操作行为 assetHighLightIunput(){ - + // console.log(this.isHighLight,this.canvasAssetObj) + // let arr = [] + // arr.push(this.canvasAssetObj.Id) + // this.canvas.setHighlight(arr) } //动态属性素材input框值改变 @@ -610,12 +615,70 @@ export class CollectionToolsPlanComponent implements OnInit { isSixShow = true isSixbtn = true //控制想定作业编辑按钮 isediticon = true //控制查看编辑模式的编辑模式小笔按钮 + + isMultipleAsset:boolean = false//框选多个素材属性显隐 + multipleAsset:any = { + Width:null, + Height:null, + Angle:null, + Thickness:null, + Color:null, + PropertyInfos:[] + }//多个素材共同属性 + multipleAssetData:any//当前多选的素材 + firstMultipleAssetData:any//当前多选的第一个素材 ngOnInit(): void { + let _this = this + AxMessageSystem.addListener('selectionChanged', ()=>{ + if(this.canvas.selection.size() == 1){//如果是单选 + this.isMultipleAsset = false + console.log('单选',this.canvas.selection.first().assetData) + this.setAssetsProperty(this.canvas.selection.first().assetData) + }else if(this.canvas.selection.size()){ + console.log('多选') + this.multipleAssetData = this.canvas.selection.all() + this.firstMultipleAssetData = this.canvas.selection.first() + this.multipleAsset = { + Width:null, + Height:null, + Angle:null, + Thickness:null, + Color:null, + PropertyInfos:[] + } + this.isMultipleAsset = true + let firstAssetData = this.canvas.selection.first().assetData;//拿出第一个素材作为例子与其他素材进行对比 + let InteractiveMode = firstAssetData.InteractiveMode //素材连接方式 + let isInteractiveMode = this.canvas.selection.all().every(item => item.assetData.InteractiveMode === InteractiveMode) + if(isInteractiveMode){ + this.multipleAsset.InteractiveMode = InteractiveMode + } + let isFillMode = this.canvas.selection.all().every(item => item.assetData.FillMode === 0) //素材填充方式都为0 + if(isFillMode){ + this.multipleAsset.FillMode = 0 + } + this.canvas.selection.first().assetData.PropertyInfos.forEach(i => { + let index = 0 + this.canvas.selection.all().forEach(item => { + item.assetData.PropertyInfos.forEach(element => { + if(element.PropertyName == i.PropertyName && element.PropertyType == i.PropertyType && element.PropertyType != 3 && element.PropertyType != 4){ + index++ + if(index == this.canvas.selection.size()){ + let newElement = JSON.parse(JSON.stringify(element)) + newElement.PropertyValue = '' + this.multipleAsset.PropertyInfos.push(newElement) + } + } + }); + }) + }) + console.log(666,_this.multipleAsset.PropertyInfos) + } + }, this) if(this.router.url.indexOf("keyUnit/viewunitinfo") != -1 || this.router.url.indexOf("keyUnit/editplaninfo")!= -1){ this.isSixbtn = false } - if(!this.isSixbtn && sessionStorage.getItem("six") == "edit"){ this.isSixShow = true } @@ -647,6 +710,112 @@ export class CollectionToolsPlanComponent implements OnInit { } }) } + //多选宽度共同改变 + multipleAssetWidthInput(){ + this.multipleAssetData.forEach(item=>{ + item.assetData.Width = this.multipleAsset.Width + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + }) + } + //多选高度共同改变 + multipleAssetHeightInput(){ + this.multipleAssetData.forEach(item=>{ + item.assetData.Height = this.multipleAsset.Height + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + }) + } + //多选角度共同改变 + multipleAssetAngleInput(){ + this.multipleAssetData.forEach(item=>{ + item.assetData.Angle = this.multipleAsset.Angle + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + }) + } + //多选厚度共同改变 + multipleAssetThicknessInput(){ + this.multipleAssetData.forEach(item=>{ + item.assetData.Thickness = this.multipleAsset.Thickness + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + }) + } + //多选颜色共同改变 + multipleSelectedcolor:any + multipleAssetSelectcolor(item,key){ + //在当前透明度基础上改变颜色 + this.multipleSelectedcolor = item + this.multipleAssetData.forEach(item=>{ + item.assetData.Color = this.multipleSelectedcolor + this.canvasData.isChange = true + this.canvas.refreshIcon(item.assetData.Id) + }) + } + //多选颜色滑竿改变 + multipleColorDivSliderChange(){ + let colorOpacity = Math.round(255 * this.colorDivSliderValue * 0.01) + //根据滑竿值改变16进制颜色后两位 + function replacepos(text,start,stop,replacetext){ + let mystr = text.substring(0,stop-1)+replacetext+text.substring(stop+1); + return mystr; + } + this.multipleAssetData.forEach(item=>{ + this.multipleSelectedcolor = replacepos(this.multipleSelectedcolor,7,8,colorOpacity.toString(16)) + item.assetData.Color = this.multipleSelectedcolor + this.canvasData.isChange = true + this.canvas.refreshIcon(item.assetData.Id) + }) + } + //多选状态动态属性素材input框值改变 + multipleAssetInputChange(i,e){ + e.stopPropagation() + this.multipleAssetData.forEach(item=>{ + console.log(item) + item.assetData.PropertyInfos.forEach(element => { + if(element.PropertyName == i.PropertyName){ + element.PropertyValue = i.PropertyValue + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + } + }) + }) + } + //多选状态动态属性素材radio框值改变 + multipleAssetRadioChange(i,value){ + // e.stopPropagation() + this.multipleAssetData.forEach(item=>{ + console.log(item) + item.assetData.PropertyInfos.forEach(element => { + if(element.PropertyName == i.PropertyName){ + element.PropertyValue = value + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + } + }) + }) + } + //多选状态动态属性素材下拉框值改变 + multipleSupplyArea(i,e){ + e.stopPropagation() + this.multipleAssetData.forEach(item=>{ + console.log(item) + item.assetData.PropertyInfos.forEach(element => { + if(element.PropertyName == i.PropertyName){ + element.PropertyValue = i.PropertyValue + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + } + }) + }) + } + + + + + + @@ -655,11 +824,11 @@ export class CollectionToolsPlanComponent implements OnInit { if(this.router.url.indexOf("gis") == -1) { this.getSitePlan() } - // 监听canvas组件选中素材事件 - this.canvas.on("select",obj=>{ - //选中素材属性注入函数 - this.setAssetsProperty(obj.assetData) - }) + // // 监听canvas组件选中素材事件 + // this.canvas.on("select",obj=>{ + // //选中素材属性注入函数 + // this.setAssetsProperty(obj.assetData) + // }) // 监听canvas组件取消选中素材事件 this.canvas.on("deselect",obj=>{ this.isShowProperty = false diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index be34123..34a7582 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -227,7 +227,7 @@
-
+

面积(平方米)

{{canvasData.selectStorey.area}}

详情

@@ -236,14 +236,14 @@
-
+

{{assetName}}

宽度(像素)

- +

高度(像素)

- +

角度

- + +
+
+

宽度(像素)

+ +

高度(像素)

+ +

角度

+
+ + +
+
+ +
+

厚度

+
+ + +
+
+
+
+ 颜色 +
+ +
+
+
+
    +
  • +
+
+ 透明度 + + {{colorDivSliderValue}}% +
+
+ +
+

{{item.PropertyName}}({{item.PhysicalUnit}})

+ +
+ +
+

{{item.PropertyName}}({{item.PhysicalUnit}})

+ +
+ +
+

{{item.PropertyName}}({{item.PhysicalUnit}})

+ +
+ + + +
+

{{item.PropertyName}}

+ + +
+ +
+

{{item.PropertyName}}

+ +
+ +
+

{{item.PropertyName}}

+ +
+
+
diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index 9ac9bd6..34893d5 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -16,7 +16,7 @@ import { GameMode } from 'src/app/working-area/model/gameMode'; import { ActivatedRoute, Router } from '@angular/router'; import { MaskLayerService } from 'src/app/mask-layer.service'; import * as ObjectID from 'bson-objectid'; - +import { AxMessageSystem } from 'src/app/working-area/model/axMessageSystem'; @Component({ selector: 'app-collection-tools', templateUrl: './collection-tools.component.html', @@ -82,9 +82,11 @@ export class CollectionToolsComponent implements OnInit { setTimeout(() => { obj.PropertyInfos.forEach(item => { if(item.PropertyType == 4){ - this.gallery = new Viewer(document.getElementById('viewerjs'),{ - url: 'data-original' - }); + if(document.getElementById('viewerjs')){ + this.gallery = new Viewer(document.getElementById('viewerjs'),{ + url: 'data-original' + }); + } } }) }, 0); @@ -624,7 +626,68 @@ export class CollectionToolsComponent implements OnInit { isSixbtn = true //控制想定作业编辑按钮 isxxx = true //控制查看编辑模式的编辑模式按钮 + + isMultipleAsset:boolean = false//框选多个素材属性显隐 + multipleAsset:any = { + Width:null, + Height:null, + Angle:null, + Thickness:null, + Color:null, + PropertyInfos:[] + }//多个素材共同属性 + multipleAssetData:any//当前多选的素材 + firstMultipleAssetData:any//当前多选的第一个素材 ngOnInit(): void { + let _this = this + AxMessageSystem.addListener('selectionChanged', ()=>{ + if(this.canvas.selection.size() == 1){//如果是单选 + this.isMultipleAsset = false + // console.log('单选',this.canvas.selection.first().assetData) + this.setAssetsProperty(this.canvas.selection.first().assetData) + }else if(this.canvas.selection.size()){ + // console.log('多选') + this.multipleAssetData = this.canvas.selection.all() + this.firstMultipleAssetData = this.canvas.selection.first() + this.multipleAsset = { + Width:null, + Height:null, + Angle:null, + Thickness:null, + Color:null, + PropertyInfos:[] + } + this.isMultipleAsset = true + let firstAssetData = this.canvas.selection.first().assetData;//拿出第一个素材作为例子与其他素材进行对比 + let InteractiveMode = firstAssetData.InteractiveMode //素材连接方式 + let isInteractiveMode = this.canvas.selection.all().every(item => item.assetData.InteractiveMode === InteractiveMode) + if(isInteractiveMode){ + this.multipleAsset.InteractiveMode = InteractiveMode + } + let isFillMode = this.canvas.selection.all().every(item => item.assetData.FillMode === 0) //素材填充方式都为0 + if(isFillMode){ + this.multipleAsset.FillMode = 0 + } + this.canvas.selection.first().assetData.PropertyInfos.forEach(i => { + let index = 0 + this.canvas.selection.all().forEach(item => { + item.assetData.PropertyInfos.forEach(element => { + if(element.PropertyName == i.PropertyName && element.PropertyType == i.PropertyType && element.PropertyType != 3 && element.PropertyType != 4){ + index++ + if(index == this.canvas.selection.size()){ + let newElement = JSON.parse(JSON.stringify(element)) + newElement.PropertyValue = '' + this.multipleAsset.PropertyInfos.push(newElement) + } + } + }); + }) + }) + } + }, this) + + + this.canvasData.gameMode = GameMode.Assignment if(this.router.url.indexOf("keyUnit/viewunitinfoplan") == -1 && this.router.url.indexOf("keyUnit/viewunitinfo") != -1 || this.router.url.indexOf("keyUnit/editplaninfo")!= -1){ this.isSixbtn = false @@ -663,7 +726,106 @@ export class CollectionToolsComponent implements OnInit { }) } - + //多选宽度共同改变 + multipleAssetWidthInput(){ + this.multipleAssetData.forEach(item=>{ + item.assetData.Width = this.multipleAsset.Width + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + }) + } + //多选高度共同改变 + multipleAssetHeightInput(){ + this.multipleAssetData.forEach(item=>{ + item.assetData.Height = this.multipleAsset.Height + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + }) + } + //多选角度共同改变 + multipleAssetAngleInput(){ + this.multipleAssetData.forEach(item=>{ + item.assetData.Angle = this.multipleAsset.Angle + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + }) + } + //多选厚度共同改变 + multipleAssetThicknessInput(){ + this.multipleAssetData.forEach(item=>{ + item.assetData.Thickness = this.multipleAsset.Thickness + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + }) + } + //多选颜色共同改变 + multipleSelectedcolor:any + multipleAssetSelectcolor(item,key){ + //在当前透明度基础上改变颜色 + this.multipleSelectedcolor = item + this.multipleAssetData.forEach(item=>{ + item.assetData.Color = this.multipleSelectedcolor + this.canvasData.isChange = true + this.canvas.refreshIcon(item.assetData.Id) + }) + } + //多选颜色滑竿改变 + multipleColorDivSliderChange(){ + let colorOpacity = Math.round(255 * this.colorDivSliderValue * 0.01) + //根据滑竿值改变16进制颜色后两位 + function replacepos(text,start,stop,replacetext){ + let mystr = text.substring(0,stop-1)+replacetext+text.substring(stop+1); + return mystr; + } + this.multipleAssetData.forEach(item=>{ + this.multipleSelectedcolor = replacepos(this.multipleSelectedcolor,7,8,colorOpacity.toString(16)) + item.assetData.Color = this.multipleSelectedcolor + this.canvasData.isChange = true + this.canvas.refreshIcon(item.assetData.Id) + }) + } + //多选状态动态属性素材input框值改变 + multipleAssetInputChange(i,e){ + e.stopPropagation() + this.multipleAssetData.forEach(item=>{ + // console.log(item) + item.assetData.PropertyInfos.forEach(element => { + if(element.PropertyName == i.PropertyName){ + element.PropertyValue = i.PropertyValue + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + } + }) + }) + } + //多选状态动态属性素材radio框值改变 + multipleAssetRadioChange(i,value){ + // e.stopPropagation() + this.multipleAssetData.forEach(item=>{ + // console.log(item) + item.assetData.PropertyInfos.forEach(element => { + if(element.PropertyName == i.PropertyName){ + element.PropertyValue = value + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + } + }) + }) + } + //多选状态动态属性素材下拉框值改变 + multipleSupplyArea(i,e){ + e.stopPropagation() + this.multipleAssetData.forEach(item=>{ + // console.log(item) + item.assetData.PropertyInfos.forEach(element => { + if(element.PropertyName == i.PropertyName){ + element.PropertyValue = i.PropertyValue + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + } + }) + }) + } ngAfterViewInit(): void { diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 7f80485..5cc6f48 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -453,7 +453,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV */ public refreshIcon(id: string): void { const icon = this.backgroundImage.children.find(item => item.name === id); - console.log(icon); + // console.log(icon); if (icon instanceof AxImageShape) { icon.refresh(); } else if (icon instanceof MultipointIcon) { From 5964aa16f7671877017a99b5459fc70ae6cb6bfb Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Wed, 27 Jan 2021 09:53:11 +0800 Subject: [PATCH 4/4] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collection-tools.component.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/ui/collection-tools-plan/collection-tools.component.ts b/src/app/ui/collection-tools-plan/collection-tools.component.ts index b726bde..e434e0c 100644 --- a/src/app/ui/collection-tools-plan/collection-tools.component.ts +++ b/src/app/ui/collection-tools-plan/collection-tools.component.ts @@ -632,10 +632,10 @@ export class CollectionToolsPlanComponent implements OnInit { AxMessageSystem.addListener('selectionChanged', ()=>{ if(this.canvas.selection.size() == 1){//如果是单选 this.isMultipleAsset = false - console.log('单选',this.canvas.selection.first().assetData) + // console.log('单选',this.canvas.selection.first().assetData) this.setAssetsProperty(this.canvas.selection.first().assetData) }else if(this.canvas.selection.size()){ - console.log('多选') + // console.log('多选') this.multipleAssetData = this.canvas.selection.all() this.firstMultipleAssetData = this.canvas.selection.first() this.multipleAsset = { @@ -672,7 +672,7 @@ export class CollectionToolsPlanComponent implements OnInit { }); }) }) - console.log(666,_this.multipleAsset.PropertyInfos) + // console.log(666,_this.multipleAsset.PropertyInfos) } }, this) @@ -772,7 +772,7 @@ export class CollectionToolsPlanComponent implements OnInit { multipleAssetInputChange(i,e){ e.stopPropagation() this.multipleAssetData.forEach(item=>{ - console.log(item) + // console.log(item) item.assetData.PropertyInfos.forEach(element => { if(element.PropertyName == i.PropertyName){ element.PropertyValue = i.PropertyValue @@ -786,7 +786,7 @@ export class CollectionToolsPlanComponent implements OnInit { multipleAssetRadioChange(i,value){ // e.stopPropagation() this.multipleAssetData.forEach(item=>{ - console.log(item) + // console.log(item) item.assetData.PropertyInfos.forEach(element => { if(element.PropertyName == i.PropertyName){ element.PropertyValue = value @@ -800,7 +800,7 @@ export class CollectionToolsPlanComponent implements OnInit { multipleSupplyArea(i,e){ e.stopPropagation() this.multipleAssetData.forEach(item=>{ - console.log(item) + // console.log(item) item.assetData.PropertyInfos.forEach(element => { if(element.PropertyName == i.PropertyName){ element.PropertyValue = i.PropertyValue