From 61726910fe493a2f2baa850c9368fe35c0c29525 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Mon, 31 May 2021 16:48:03 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E6=96=B0=E5=BB=BA=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E6=B2=A1=E6=9C=89=E4=BF=A1=E7=94=A8=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=97=B6=E9=9A=8F=E6=9C=BA=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../key-unit-management.component.ts | 3 +- .../collection-tools.component.ts | 155 +++++++++++------- 2 files changed, 102 insertions(+), 56 deletions(-) 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 9d8f3e5..4e7f394 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 @@ -825,10 +825,11 @@ export class CreateUnit { } onSubmit(value){ let myDate = new Date(); + let usci = new Date().getTime() + '00000' let body = { id: "", name: value.name, - usci: value.usci, + usci: value.usci || usci, contacts: "", phone: "", address: "", 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 7a2088c..8431ded 100644 --- a/src/app/ui/collection-tools-plan/collection-tools.component.ts +++ b/src/app/ui/collection-tools-plan/collection-tools.component.ts @@ -86,7 +86,7 @@ export class CollectionToolsPlanComponent implements OnInit { gallery//viewerJs实例 //设置属性框 setAssetsProperty(obj) { - console.log('传进来的属性信息',obj) + console.log('传进来的属性信息', obj) //初始化viewerJs实例 setTimeout(() => { obj.PropertyInfos.forEach(item => { @@ -231,28 +231,37 @@ export class CollectionToolsPlanComponent implements OnInit { assetWidthIunput() { this.canvasAssetObj.Width = this.assetWidth this.canvasData.isChange = true - this.canvas.refreshIcon(this.canvasAssetObj.Id) + if(!this.isGis){ + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } + } //素材高度输入框改变 assetHeightIunput() { this.canvasAssetObj.Height = this.assetHeight this.canvasData.isChange = true - this.canvas.refreshIcon(this.canvasAssetObj.Id) + if(!this.isGis){ + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } } //素材角度输入框改变 assetAngleIunput() { this.canvasAssetObj.Angle = this.sliderValue this.canvasData.isChange = true - this.canvas.refreshIcon(this.canvasAssetObj.Id) + if(!this.isGis){ + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } } //素材厚度输入框改变 assetThicknessIunput() { this.canvasAssetObj.Thickness = this.sliderValueThickness this.canvasData.isChange = true - this.canvas.refreshIcon(this.canvasAssetObj.Id) + if(!this.isGis){ + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } } //素材是否高亮改变----->本地操作行为 @@ -277,7 +286,9 @@ export class CollectionToolsPlanComponent implements OnInit { } this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value this.canvasData.isChange = true - this.canvas.refreshIcon(this.canvasAssetObj.Id) + if(!this.isGis){ + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } } //动态属性素材布尔值框改变radio @@ -297,7 +308,9 @@ export class CollectionToolsPlanComponent implements OnInit { this.selectedcolor = item + this.selectedcolor.substring(this.selectedcolor.length - 2) this.canvasAssetObj.Color = this.selectedcolor this.canvasData.isChange = true - this.canvas.refreshIcon(this.canvasAssetObj.Id) + if(!this.isGis){ + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } } //颜色选择滑竿的值 colorDivSliderValue @@ -311,7 +324,9 @@ export class CollectionToolsPlanComponent implements OnInit { this.selectedcolor = replacepos(this.selectedcolor, 7, 8, colorOpacity.toString(16)) this.canvasAssetObj.Color = this.selectedcolor this.canvasData.isChange = true - this.canvas.refreshIcon(this.canvasAssetObj.Id) + if(!this.isGis){ + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } } //上传素材图片 @@ -557,6 +572,26 @@ export class CollectionToolsPlanComponent implements OnInit { // this.refurbishTreeData() } }) + + //点击marker关闭按钮 + window.deleteMarker = () => { + this.canvasData.isChange = true + //清除地图标点 + this.planDataMarkers.forEach((element, index) => { + if (element.id == this.clickId) { + this.planDataMarkers[index].setMap(null); + } + }); + + // 删除楼层数据 + delete this.canvasData.originaleveryStoreyData.data[this.clickId]; + // 删除建筑数据 + delete this.canvasData.originalcompanyBuildingData.data[this.clickId]; + + console.log('originalcompanyBuildingData', this.canvasData.originalcompanyBuildingData) + console.log('originaleveryStoreyData', this.canvasData.originaleveryStoreyData) + + } } //多选宽度共同改变 multipleAssetWidthInput() { @@ -1338,18 +1373,18 @@ export class CollectionToolsPlanComponent implements OnInit { } let beforeOneId = this.selectingSitePlan.id || '' //当前 选中 平面图 楼层/区域 id - let companyBuildingData = JSON.parse(JSON.stringify( this.canvasData.originalcompanyBuildingData || {} )) // 当前 单位/建筑 数据 - let storeyData = JSON.parse(JSON.stringify( this.canvasData.originaleveryStoreyData || {} )) //当前 楼层 数据 + let companyBuildingData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData || {})) // 当前 单位/建筑 数据 + let storeyData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData || {})) //当前 楼层 数据 - for(let key in companyBuildingData.data){ + for (let key in companyBuildingData.data) { if (companyBuildingData.data[key].FloorId === beforeOneId) { //处理 单位/建筑 数据是否归于当前楼层下 storeyData.data[key] = companyBuildingData.data[key] } } - for(let key in storeyData.data){ //筛选数据 没有匹配全部放入到 其他 数组 - let noMatch = this.allFireElements.find( every=> every.id===storeyData.data[key].FireElementId ) + for (let key in storeyData.data) { //筛选数据 没有匹配全部放入到 其他 数组 + let noMatch = this.allFireElements.find(every => every.id === storeyData.data[key].FireElementId) if (!noMatch && storeyData.data[key].Id != "图例") { - this.allFireElements[this.allFireElements.length-1].children.push(storeyData.data[key]) + this.allFireElements[this.allFireElements.length - 1].children.push(storeyData.data[key]) } } this.handleTreeData(storeyData) //处理tree数据结构 @@ -1364,6 +1399,44 @@ export class CollectionToolsPlanComponent implements OnInit { this.map.on('click', (e) => { this.showInfoClick(e) }); + this.map.on("complete", () => { + + for (const key in this.canvasData.originaleveryStoreyData.data) { + if (Object.prototype.hasOwnProperty.call(this.canvasData.originaleveryStoreyData.data, key)) { + const element = this.canvasData.originaleveryStoreyData.data[key]; + let markerContent = '' + + '