From 00b4ea43bf43d1238b51f8f5f3e85dd367e745e4 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Tue, 2 Mar 2021 10:42:18 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=B0=B4=E6=BA=90=E9=87=87=E9=9B=86=E6=8F=90=E4=BA=A4=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../water-collection.component.html | 9 +++++-- .../water-collection.component.scss | 5 +++- .../water-collection.component.ts | 25 ++++++++++++++++++- .../wait-examineer.component.html | 2 +- .../wait-examineer.component.ts | 4 +-- .../collection-tools.component.ts | 11 ++++---- 6 files changed, 43 insertions(+), 13 deletions(-) diff --git a/src/app/data-collection/water-collection/water-collection.component.html b/src/app/data-collection/water-collection/water-collection.component.html index 0d5405e..dcf1d2b 100644 --- a/src/app/data-collection/water-collection/water-collection.component.html +++ b/src/app/data-collection/water-collection/water-collection.component.html @@ -79,8 +79,13 @@
- save保存 - open_in_browser提交审核 + (待审核) + (审核通过) + (审核驳回) + + open_in_browser提交审核 + 撤销审核 + save保存 close关闭
diff --git a/src/app/data-collection/water-collection/water-collection.component.scss b/src/app/data-collection/water-collection/water-collection.component.scss index f0376c1..37f7a20 100644 --- a/src/app/data-collection/water-collection/water-collection.component.scss +++ b/src/app/data-collection/water-collection/water-collection.component.scss @@ -254,8 +254,11 @@ span:hover{ text-decoration: underline; } + .state{ + margin-right:30px; + } .submitAudit{ - margin: 0 30px; + margin-right:30px; } .close{ margin-right: 30px; diff --git a/src/app/data-collection/water-collection/water-collection.component.ts b/src/app/data-collection/water-collection/water-collection.component.ts index 7cdea43..402fa6a 100644 --- a/src/app/data-collection/water-collection/water-collection.component.ts +++ b/src/app/data-collection/water-collection/water-collection.component.ts @@ -198,7 +198,7 @@ export class WaterCollectionComponent implements OnInit { //点击水源列表 selectedLiIndex:any clickWaterLi(item,index){ - // console.log(item) + console.log(item) if(this.selectedLiIndex != index){ this.selectedLiIndex = index this.clearData() @@ -430,6 +430,29 @@ export class WaterCollectionComponent implements OnInit { }) } + } + //提交审核 + submitAudit(){ + let isTrue = window.confirm('请确认保存后提交审核,否则将无法审核最新内容,是否继续?') + if(isTrue){ + console.log('提交审核的水源',this.waterData) + let body = { + title: this.waterData.name, + operation: this.waterData.verifyState == -1 ? 0 : 1,//操作方式 + contentType: 12,//水源类型 + itemId: this.waterData.id, + verifyState: 0, + } + this.http.post('/api/ContentVerifies',body).subscribe((data) => { + console.log('提交成功',data) + this.waterData.verifyState = 0 + }) + } + + } + //撤销审核 + cancelAudit(){ + } //关闭 close(){ diff --git a/src/app/plan-audit/wait-examineer/wait-examineer.component.html b/src/app/plan-audit/wait-examineer/wait-examineer.component.html index 9719e05..f84ab8f 100644 --- a/src/app/plan-audit/wait-examineer/wait-examineer.component.html +++ b/src/app/plan-audit/wait-examineer/wait-examineer.component.html @@ -59,7 +59,7 @@ {{item.contentType=='1'?'Ⅰ级预案':item.contentType=='2'?'Ⅱ级预案':item.contentType=='3'?'Ⅲ级预案':item.contentType=='4'?'Ⅳ级预案':item.contentType=='5'? - 'Ⅴ级预案':item.contentType=='6'?'应急预案(国家级)':item.contentType=='7'?'应急预案(市级)':item.contentType=='8'?'类型预案':item.contentType=='11'?'重点单位':'消防车辆'}} + 'Ⅴ级预案':item.contentType=='6'?'应急预案(国家级)':item.contentType=='7'?'应急预案(市级)':item.contentType=='8'?'类型预案':item.contentType=='11'?'重点单位':item.contentType=='12'?'水源':item.contentType=='13'?'消防力量':item.contentType=='14'?'联动力量':'未知'}} {{item.operation=='0'?'新增':item.operation=='1'?'更新':'删除'}} {{item.verifyOrganizationName}} {{item.verifyState=='0'?'待初审':item.verifyState=='1'? diff --git a/src/app/plan-audit/wait-examineer/wait-examineer.component.ts b/src/app/plan-audit/wait-examineer/wait-examineer.component.ts index ac87c81..e182223 100644 --- a/src/app/plan-audit/wait-examineer/wait-examineer.component.ts +++ b/src/app/plan-audit/wait-examineer/wait-examineer.component.ts @@ -155,7 +155,7 @@ export class WaitExamineerComponent implements OnInit { viewer//全景图对象 radioClick(e,item){ //e.target.parentElement.bgColor='#2196F3' - //console.log(e,item) + console.log(e,item) this.organizationName='' this.id=item.id this.fetchUrl='' @@ -195,7 +195,7 @@ export class WaitExamineerComponent implements OnInit { } - }) + }) if(e.checked){ this.shenheTable.push(item) 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 aeddad8..8e0cb6b 100644 --- a/src/app/ui/collection-tools-building/collection-tools.component.ts +++ b/src/app/ui/collection-tools-building/collection-tools.component.ts @@ -1353,7 +1353,6 @@ export class CollectionToolsBuildingComponent implements OnInit { }); this.dataSource.data = treeData this.treeControl.expandAll() - } //点击树节点 @@ -1493,11 +1492,11 @@ export class CollectionToolsBuildingComponent implements OnInit { let companyBuildingData = JSON.parse(JSON.stringify( this.canvasData.originalcompanyBuildingData || {} )) // 当前 单位/建筑 数据 let storeyData = JSON.parse(JSON.stringify( this.canvasData.originaleveryStoreyData || {} )) //当前 楼层 数据 - for(let key in companyBuildingData.data){ - if (companyBuildingData.data[key].FloorId === beforeOneId) { //处理 单位/建筑 数据是否归于当前楼层下 - storeyData.data[key] = companyBuildingData.data[key] - } - } + // 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 ) if (!noMatch) { From 8282624de99d8b17f038854f1ac27497936a9ebf 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, 2 Mar 2021 11:00:35 +0800 Subject: [PATCH 2/4] 1.4.0 --- src/app/canvas-share-data.service.ts | 2 + src/app/working-area/model/axImageShape.ts | 197 +++++++++++++----- src/app/working-area/model/axMessageSystem.ts | 36 ++-- src/app/working-area/model/configuration.ts | 9 +- src/app/working-area/model/events.ts | 2 + src/app/working-area/model/grid2D.ts | 16 +- .../working-area/working-area.component.ts | 21 +- 7 files changed, 194 insertions(+), 89 deletions(-) diff --git a/src/app/canvas-share-data.service.ts b/src/app/canvas-share-data.service.ts index dbc257c..1d74555 100644 --- a/src/app/canvas-share-data.service.ts +++ b/src/app/canvas-share-data.service.ts @@ -57,6 +57,8 @@ export class CanvasShareDataService { ['水泵接合器(地上)', '水泵接合器'], ['水泵接合器(地下)', '水泵接合器'], ['水泵接合器(墙壁)', '水泵接合器'], + ['水泵接合器(喷淋)', '水泵接合器'], + ['水泵接合器(消防)', '水泵接合器'], ['消防水泵房', '消防水泵房'], ['箱式消火栓', '箱式消火栓'], ['固定水炮', '消防水炮'], diff --git a/src/app/working-area/model/axImageShape.ts b/src/app/working-area/model/axImageShape.ts index 5225df6..44a1729 100644 --- a/src/app/working-area/model/axImageShape.ts +++ b/src/app/working-area/model/axImageShape.ts @@ -7,6 +7,8 @@ import { PropertyInfo } from './PropertyInfo'; import { AxShape } from './axShape'; import { Sprite, Point, Rectangle } from 'pixi.js'; import { AxArrowConnector } from './axArrowConnector'; +import { AxMessageSystem } from './axMessageSystem'; +import { EVENT_IMAGE_RESIZE } from './events'; /** * 安信图片形状 @@ -72,12 +74,8 @@ export class AxImageShape extends AxShape { this.addChild(this.image); this.addChild(this.selectionBox); - //// - var leftUpPos = new Point(0, 0); - var upLeftDrag = false; - var leftDownPos = new Point(0, 0); - var rightUpPos = new Point(0, 0); - var rightDownPos = new Point(0, 0); + // 是否拖动 + var pointerDrag = false; // up-left this.upLeft = new PIXI.Sprite(this.pointTexture); this.upLeft.cursor = 'nwse-resize'; @@ -85,40 +83,36 @@ export class AxImageShape extends AxShape { this.addChild(this.upLeft); this.upLeft.interactive = true; this.upLeft.on('pointerdown', event => { - - upLeftDrag = true; - var imageRect = new Rectangle(this.image.x, this.image.y, this.image.width, this.image.height); - console.log('图片的边界大小', imageRect); - rightDownPos = new Point(imageRect.right, imageRect.bottom); - + pointerDrag = true; this.image.anchor.set(1); this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y + (this.image.height / 2)); event.stopPropagation(); }); this.upLeft.on('pointermove', event => { - // 移动时调整形状大小,然后重绘边框 // 检查右下角距离鼠标的位置, - if (upLeftDrag) { - leftUpPos = event.data.getLocalPosition(this.upLeft.parent); - console.log('鼠标点击位置的坐标', leftUpPos); - - this.assetData.Width = Math.abs(leftUpPos.x); - this.assetData.Height = Math.abs(leftUpPos.x); + if (pointerDrag) { + var pos = this.toLocal(event.data.global); + var dX = Math.abs(pos.x - this.image.x); + var dY = Math.abs(pos.y - this.image.y); + var result = dX > dY ? dX : dY; + this.assetData.Width = Math.abs(result); + this.assetData.Height = Math.abs(result); this.refresh(); + AxMessageSystem.send(EVENT_IMAGE_RESIZE, this.assetData); } }); this.upLeft.on('pointerup', event => { - if (upLeftDrag) { - upLeftDrag = false; + if (pointerDrag) { + pointerDrag = false; this.image.anchor.set(0.5); this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y - (this.image.height / 2)); } }); this.upLeft.on('pointerupoutside', event => { - if (upLeftDrag) { - upLeftDrag = false; + if (pointerDrag) { + pointerDrag = false; this.image.anchor.set(0.5); this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y - (this.image.height / 2)); } @@ -130,6 +124,41 @@ export class AxImageShape extends AxShape { this.upRight.anchor.set(0.5); this.addChild(this.upRight); this.upRight.interactive = true; + this.upRight.on('pointerdown', event => { + pointerDrag = true; + this.image.anchor.set(0, 1); + this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y + (this.image.height / 2)); + event.stopPropagation(); + }); + this.upRight.on('pointermove', event => { + // 移动时调整形状大小,然后重绘边框 + // 检查右下角距离鼠标的位置, + if (pointerDrag) { + var pos = this.toLocal(event.data.global); + var dX = Math.abs(pos.x - this.image.x); + var dY = Math.abs(pos.y - this.image.y); + var result = dX > dY ? dX : dY; + this.assetData.Width = Math.abs(result); + this.assetData.Height = Math.abs(result); + this.refresh(); + AxMessageSystem.send(EVENT_IMAGE_RESIZE, this.assetData); + } + + }); + this.upRight.on('pointerup', event => { + if (pointerDrag) { + pointerDrag = false; + this.image.anchor.set(0.5); + this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y - (this.image.height / 2)); + } + }); + this.upRight.on('pointerupoutside', event => { + if (pointerDrag) { + pointerDrag = false; + this.image.anchor.set(0.5); + this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y - (this.image.height / 2)); + } + }); this.upRight.visible = false; // down-left this.downLeft = new PIXI.Sprite(this.pointTexture); @@ -137,6 +166,41 @@ export class AxImageShape extends AxShape { this.downLeft.anchor.set(0.5); this.addChild(this.downLeft); this.downLeft.interactive = true; + this.downLeft.on('pointerdown', event => { + pointerDrag = true; + this.image.anchor.set(1, 0); + this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y - (this.image.height / 2)); + event.stopPropagation(); + }); + this.downLeft.on('pointermove', event => { + // 移动时调整形状大小,然后重绘边框 + // 检查右下角距离鼠标的位置, + if (pointerDrag) { + var pos = this.toLocal(event.data.global); + var dX = Math.abs(pos.x - this.image.x); + var dY = Math.abs(pos.y - this.image.y); + var result = dX > dY ? dX : dY; + this.assetData.Width = Math.abs(result); + this.assetData.Height = Math.abs(result); + this.refresh(); + AxMessageSystem.send(EVENT_IMAGE_RESIZE, this.assetData); + } + + }); + this.downLeft.on('pointerup', event => { + if (pointerDrag) { + pointerDrag = false; + this.image.anchor.set(0.5); + this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y + (this.image.height / 2)); + } + }); + this.downLeft.on('pointerupoutside', event => { + if (pointerDrag) { + pointerDrag = false; + this.image.anchor.set(0.5); + this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y + (this.image.height / 2)); + } + }); this.downLeft.visible = false; // down-right this.downRight = new PIXI.Sprite(this.pointTexture); @@ -144,32 +208,43 @@ export class AxImageShape extends AxShape { this.downRight.anchor.set(0.5); this.addChild(this.downRight); this.downRight.interactive = true; + this.downRight.on('pointerdown', event => { + pointerDrag = true; + this.image.anchor.set(0, 0); + this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y - (this.image.height / 2)); + event.stopPropagation(); + }); + this.downRight.on('pointermove', event => { + // 移动时调整形状大小,然后重绘边框 + // 检查右下角距离鼠标的位置, + if (pointerDrag) { + var pos = this.toLocal(event.data.global); + var dX = Math.abs(pos.x - this.image.x); + var dY = Math.abs(pos.y - this.image.y); + var result = dX > dY ? dX : dY; + this.assetData.Width = Math.abs(result); + this.assetData.Height = Math.abs(result); + this.refresh(); + AxMessageSystem.send(EVENT_IMAGE_RESIZE, this.assetData); + } + + }); + this.downRight.on('pointerup', event => { + if (pointerDrag) { + pointerDrag = false; + this.image.anchor.set(0.5); + this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y + (this.image.height / 2)); + } + }); + this.downRight.on('pointerupoutside', event => { + if (pointerDrag) { + pointerDrag = false; + this.image.anchor.set(0.5); + this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y + (this.image.height / 2)); + } + }); this.downRight.visible = false; //// - - - - // if (this.assetData.CanConnect) { - // // connectPoint - // this.connectPoint = new PIXI.Sprite(this.connectPointTexture); - // this.connectPoint.anchor.set(0.5); - // this.connectPoint.x = this.image.x; - // this.connectPoint.y = this.image.y; - // this.addChild(this.connectPoint); - // this.connectPoint.interactive = true; - // this.connectPoint - // .on('pointerdown', event => { - // event.stopPropagation(); - // // this.paintingPipeline(this.x, this.y); - // }) - // .on('pointerover', event => { - // this.setSelectionBox(true, this.connectPoint); - // }) - // .on('pointerout', event => { - // this.setSelectionBox(false); - // }); - // // this.showConnectionPoint(false); - // } this.setItemScale(1 / this.workingArea.backgroundImage.scale.x); } // // 设置选择框 @@ -250,8 +325,32 @@ export class AxImageShape extends AxShape { this.text.text = this.assetData.Name + '\r\n' + this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue; - this.text.x = this.image.x; - this.text.y = this.image.y - this.image.height / 2; + + if (this.image.anchor.x == 0) { + if (this.image.anchor.y == 0) { + this.text.x = this.image.x + this.image.width / 2; + this.text.y = this.image.y; + } else if (this.image.anchor.y == 0.5) { + + } else if (this.image.anchor.y == 1) { + this.text.x = this.image.x + this.image.width / 2; + this.text.y = this.image.y - this.image.height; + } + + } else if (this.image.anchor.x == 0.5) { + this.text.x = this.image.x; + this.text.y = this.image.y - this.image.height / 2; + } else if (this.image.anchor.x == 1) { + if (this.image.anchor.y == 0) { + this.text.x = this.image.x - this.image.width / 2; + this.text.y = this.image.y; + } else if (this.image.anchor.y == 0.5) { + + } else if (this.image.anchor.y == 1) { + this.text.x = this.image.x - this.image.width / 2; + this.text.y = this.image.y - this.image.height; + } + } this.angle = -this.workingArea.backgroundImage.angle; this.drawBorder(1 / this.workingArea.backgroundImage.scale.x); } diff --git a/src/app/working-area/model/axMessageSystem.ts b/src/app/working-area/model/axMessageSystem.ts index 1451f9c..fac6c6b 100644 --- a/src/app/working-area/model/axMessageSystem.ts +++ b/src/app/working-area/model/axMessageSystem.ts @@ -5,14 +5,14 @@ export class AxMessageSystem { /** 监听数组 */ private static listeners = {}; - /** + /** * 注册事件 * @param name 事件名称 * @param callback 回调函数 * @param context 上下文 */ - public static addListener(name: string, callback: () => void, context: any) { - const observers: Observer[] = AxMessageSystem.listeners[name]; + public static addListener(name: string, callback: Function, context: any) { + let observers: Observer[] = AxMessageSystem.listeners[name]; if (!observers) { AxMessageSystem.listeners[name] = []; } @@ -25,18 +25,18 @@ export class AxMessageSystem { * @param callback 回调函数 * @param context 上下文 */ - public static removeListener(name: string, callback: () => void, context: any) { - const observers: Observer[] = AxMessageSystem.listeners[name]; - if (!observers) { return; } - const length = observers.length; + public static removeListener(name: string, callback: Function, context: any) { + let observers: Observer[] = AxMessageSystem.listeners[name]; + if (!observers) return; + let length = observers.length; for (let i = 0; i < length; i++) { - const observer = observers[i]; + let observer = observers[i]; if (observer.compar(context)) { observers.splice(i, 1); break; } } - if (observers.length === 0) { + if (observers.length == 0) { delete AxMessageSystem.listeners[name]; } } @@ -46,11 +46,11 @@ export class AxMessageSystem { * @param name 事件名称 */ public static send(name: string, ...args: any[]) { - const observers: Observer[] = AxMessageSystem.listeners[name]; - if (!observers) { return; } - const length = observers.length; + let observers: Observer[] = AxMessageSystem.listeners[name]; + if (!observers) return; + let length = observers.length; for (let i = 0; i < length; i++) { - const observer = observers[i]; + let observer = observers[i]; observer.notify(name, ...args); } } @@ -61,12 +61,12 @@ export class AxMessageSystem { */ class Observer { /** 回调函数 */ - private callback: () => void; + private callback: Function = null; /** 上下文 */ private context: any = null; - constructor(callback: () => void, context: any) { - const self = this; + constructor(callback: Function, context: any) { + let self = this; self.callback = callback; self.context = context; } @@ -76,7 +76,7 @@ class Observer { * @param args 不定参数 */ notify(...args: any[]): void { - const self = this; + let self = this; self.callback.call(self.context, ...args); } @@ -85,6 +85,6 @@ class Observer { * @param context 上下文 */ compar(context: any): boolean { - return context === this.context; + return context == this.context; } } diff --git a/src/app/working-area/model/configuration.ts b/src/app/working-area/model/configuration.ts index bf0507a..f26898b 100644 --- a/src/app/working-area/model/configuration.ts +++ b/src/app/working-area/model/configuration.ts @@ -45,7 +45,7 @@ export const VIEW_RIGHT = 'rightview'; export const VIEW_LEFT = 'leftview'; export const VIEW_ISOMETRY = 'isometryview'; -export enum WallTypes{ +export enum WallTypes { STRAIGHT, CURVED } @@ -77,7 +77,8 @@ export var config = { directionalDrag: true, boundsX: 500, boundsY: 500, - viewBounds: 20000 }; + viewBounds: 60000 +}; export var wallInformation = { exterior: false, interior: false, midline: true, labels: true, exteriorlabel: 'e:', interiorlabel: 'i:', midlinelabel: 'm:' }; @@ -99,7 +100,7 @@ export class Configuration extends EventDispatcher { static getInstance() { if (this.instance === undefined - || this.instance === null) { + || this.instance === null) { this.instance = new Configuration(); } return this.instance; @@ -115,7 +116,7 @@ export class Configuration extends EventDispatcher { // this.data[key] = value; config[key] = value; // if(key !== viewBounds){ - Configuration.getInstance().dispatchEvent({ type: EVENT_CHANGED, item: Configuration.getInstance(), 'key': key, 'value': value }); + Configuration.getInstance().dispatchEvent({ type: EVENT_CHANGED, item: Configuration.getInstance(), 'key': key, 'value': value }); // } } diff --git a/src/app/working-area/model/events.ts b/src/app/working-area/model/events.ts index d7da978..d06de6a 100644 --- a/src/app/working-area/model/events.ts +++ b/src/app/working-area/model/events.ts @@ -67,3 +67,5 @@ export const EVENT_MODIFY_TEXTURE_ATTRIBUTE = 'MODIFY_TEXTURE_ATTRIBUTE_EVENT'; export const EVENT_PARAMETRIC_GEOMETRY_UPATED = 'PARAMETRIC_GEOMETRY_UPATED_EVENT'; export const EVENT_SELECTION_CHANGED = 'selectionChanged'; + +export const EVENT_IMAGE_RESIZE = 'imageResize'; diff --git a/src/app/working-area/model/grid2D.ts b/src/app/working-area/model/grid2D.ts index 9683a49..7a5c17c 100644 --- a/src/app/working-area/model/grid2D.ts +++ b/src/app/working-area/model/grid2D.ts @@ -33,8 +33,8 @@ export class Grid2D extends Graphics { let spacing = Dimensioning.cmToPixel(spacingCMS); let totalLines = gridSize / spacing; let halfSize = gridSize * 0.5; - let linewidth = Math.max(1.0 / this.gridScale, 1.0) * 1/this.canvas.scale.x;// 增加缩放系数 - let highlightLineWidth = Math.max(1 / this.gridScale, 1.0) * 1/this.canvas.scale.x;// 增加缩放系数 + let linewidth = Math.max(1.0 / this.gridScale, 1.0) * 1 / this.canvas.scale.x;// 增加缩放系数 + let highlightLineWidth = Math.max(1 / this.gridScale, 1.0) * 1 / this.canvas.scale.x;// 增加缩放系数 let normalColor = 0xE0E0E0; let highlightColor = 0xD0D0D0; const cellSize = 5; @@ -52,10 +52,10 @@ export class Grid2D extends Graphics { this.endFill(); this.beginFill(0xFF0000, 1.0); - this.drawCircle(-halfSize, -halfSize,5); - this.drawCircle(halfSize, -halfSize,5); - this.drawCircle(halfSize, halfSize,5); - this.drawCircle(-halfSize, halfSize,5); + this.drawCircle(-halfSize, -halfSize, 5); + this.drawCircle(halfSize, -halfSize, 5); + this.drawCircle(halfSize, halfSize, 5); + this.drawCircle(-halfSize, halfSize, 5); this.drawCircle(0, 0, 5); this.endFill(); } @@ -80,8 +80,8 @@ export class Grid2D extends Graphics { let spacing = Dimensioning.cmToPixel(spacingCMS); let halfSize = gridSize * 0.5; return { - x: Math.floor((x - -halfSize) / spacing), - y: Math.floor((y - -halfSize) / spacing), + x: Math.floor((x - -halfSize) / spacing), + y: Math.floor((y - -halfSize) / spacing), }; } } diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 12e5771..f3b4165 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -21,7 +21,9 @@ import { AxSelection } from './model/axSelection'; import { AxMessageSystem } from './model/axMessageSystem'; import { Grid2D } from './model/grid2D'; import { Viewport } from 'pixi-viewport'; -import { EVENT_SELECTION_CHANGED } from './model/events'; +import { EVENT_IMAGE_RESIZE, EVENT_SELECTION_CHANGED } from './model/events'; +import { Dimensioning } from './model/dimensioning'; +import { Configuration, viewBounds } from './model/configuration'; @Component({ @@ -164,8 +166,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * 重大调整-主版本号增加 * 日期变更-日期版本号增加 */ - // todo shift绘制垂直线段 - public VERSION = '1.3.0.20210220_beta'; + public VERSION = '1.4.0.20210302_rc'; /** * 数据初始化 */ @@ -208,7 +209,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.camera2D.destroy(); this.app.destroy(); } - public setMulitSelect(b: boolean) { if (b) { this.isCtrlKeyClicked = true; @@ -366,11 +366,12 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * 创建2D相机 */ private createViewport(): void { + var gridSize = Dimensioning.cmToPixel(Configuration.getNumericValue(viewBounds) * 1); this.camera2D = new Viewport({ screenWidth: this.app.view.width, screenHeight: this.app.view.height, - worldWidth: 20000, - worldHeight: 20000, + worldWidth: gridSize, + worldHeight: gridSize, interaction: this.app.renderer.plugins.interaction, }); this.camera2D.pivot.set(0.5); @@ -379,10 +380,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.camera2D .clamp({ - left: -10000, - right: 10000, - top: -10000, - bottom: 10000, + left: -gridSize / 2, + right: gridSize / 2, + top: -gridSize / 2, + bottom: gridSize / 2, }) .drag() .pinch() From aaf470cb14aee4f0e3a09d6d8f457b78e2ef788c Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Tue, 2 Mar 2021 11:20:43 +0800 Subject: [PATCH 3/4] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B0=B4=E6=BA=90=E5=AE=A1=E6=A0=B8=E7=9A=84?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../water-collection.component.html | 12 +++--- .../water-collection.component.ts | 4 +- .../wait-examineer.component.html | 24 +++++------ .../wait-examineer.component.ts | 19 +++++--- .../water-audit/water-audit.component.ts | 43 ++++++++++--------- 5 files changed, 56 insertions(+), 46 deletions(-) diff --git a/src/app/data-collection/water-collection/water-collection.component.html b/src/app/data-collection/water-collection/water-collection.component.html index dcf1d2b..2782ab8 100644 --- a/src/app/data-collection/water-collection/water-collection.component.html +++ b/src/app/data-collection/water-collection/water-collection.component.html @@ -79,13 +79,13 @@
- (待审核) - (审核通过) - (审核驳回) + (待审核) + (审核通过) + (审核驳回) - open_in_browser提交审核 - 撤销审核 - save保存 + open_in_browser提交审核 + 撤销审核 + save保存 close关闭
diff --git a/src/app/data-collection/water-collection/water-collection.component.ts b/src/app/data-collection/water-collection/water-collection.component.ts index 402fa6a..4f14906 100644 --- a/src/app/data-collection/water-collection/water-collection.component.ts +++ b/src/app/data-collection/water-collection/water-collection.component.ts @@ -441,11 +441,11 @@ export class WaterCollectionComponent implements OnInit { operation: this.waterData.verifyState == -1 ? 0 : 1,//操作方式 contentType: 12,//水源类型 itemId: this.waterData.id, - verifyState: 0, + verifyState: 3, } this.http.post('/api/ContentVerifies',body).subscribe((data) => { console.log('提交成功',data) - this.waterData.verifyState = 0 + this.waterData.verifyState = 3 }) } diff --git a/src/app/plan-audit/wait-examineer/wait-examineer.component.html b/src/app/plan-audit/wait-examineer/wait-examineer.component.html index 4db6b3b..a8fd8c8 100644 --- a/src/app/plan-audit/wait-examineer/wait-examineer.component.html +++ b/src/app/plan-audit/wait-examineer/wait-examineer.component.html @@ -90,7 +90,7 @@
- + @@ -134,7 +134,7 @@
-
+
@@ -242,11 +242,11 @@
-
+
-
-
+
+
单位名称: {{compantData.name?compantData.name : '暂无数据'}} @@ -268,17 +268,17 @@
- +
+ +
- +
- +
diff --git a/src/app/plan-audit/wait-examineer/wait-examineer.component.ts b/src/app/plan-audit/wait-examineer/wait-examineer.component.ts index 951c367..80263a3 100644 --- a/src/app/plan-audit/wait-examineer/wait-examineer.component.ts +++ b/src/app/plan-audit/wait-examineer/wait-examineer.component.ts @@ -153,17 +153,27 @@ export class WaitExamineerComponent implements OnInit { } //radio点击事件 viewer//全景图对象 + waterData:any//需要传递给子组件的水源信息 radioClick(e,item){ - this.showtype=-1 + this.showtype = -1 //e.target.parentElement.bgColor='#2196F3' console.log(e,item) this.organizationName='' this.id=item.id this.fetchUrl='' this.viewer={} - if(item.contentType==11){ - this.showtype=3 + if(item.contentType == 11){ + this.showtype = 3 sessionStorage.setItem('companyId',item.itemId) + }else if(item.contentType == 12){ + //水源 + this.showtype = 12 + }else if(item.contentType == 13){ + //消防力量 + this.showtype = 13 + }else if(item.contentType == 14){ + //联动力量 + this.showtype = 14 }else{ this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data:any)=>{ this.companyId=data.companyId @@ -200,7 +210,7 @@ export class WaitExamineerComponent implements OnInit { } - }) + }) } @@ -347,7 +357,6 @@ export class WaitExamineerComponent implements OnInit { }) } } - } //批量审核 else{ diff --git a/src/app/plan-audit/water-audit/water-audit.component.ts b/src/app/plan-audit/water-audit/water-audit.component.ts index ed885ad..3e51e5d 100644 --- a/src/app/plan-audit/water-audit/water-audit.component.ts +++ b/src/app/plan-audit/water-audit/water-audit.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; declare var AMap: any; @Component({ selector: 'app-water-audit', @@ -6,7 +6,7 @@ declare var AMap: any; styleUrls: ['./water-audit.component.scss'] }) export class WaterAuditComponent implements OnInit { - + @Input() public waterData: any;//data名字根据引用场景自定义 constructor() { } map:any newPositionMarker:any @@ -15,6 +15,7 @@ export class WaterAuditComponent implements OnInit { ' ' + '
' ngOnInit(): void { + console.log(7777,this.waterData) this.waterData.detailData = JSON.parse(this.waterData.detailData) this.fireCockData = this.waterData.detailData console.log(789, this.fireCockData) @@ -42,23 +43,23 @@ export class WaterAuditComponent implements OnInit { fireCockData:any = []//消火栓详情 poolData:any = []//水池详情 naturalWaterData:any = []//天然水源详情 - waterData:any = { - id: "60125d31d31fab7de81c56b0", - name: "上海中心消火栓01", - administrativeRegion: "上海区", - governmentLevel: "1", - village: "小高社区", - address: "国际会议中心", - location: { - x: 121.496717, - y: 31.239452 - }, - detailData: "[{\"PropertyName\":\"可用状态\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"放置形式\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"管网形式\",\"PropertyValue\":\"2\"},{\"PropertyName\":\"管网直径\",\"PropertyValue\":\"2\"},{\"PropertyName\":\"管网压力类型\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"管网压力范围\",\"PropertyValue\":\"2222\"},{\"PropertyName\":\"接口形式\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"接口口径\",\"PropertyValue\":\"3\"},{\"PropertyName\":\"最大流量\",\"PropertyValue\":\"333\"},{\"PropertyName\":\"供水单位\",\"PropertyValue\":\"剃剃头\"},{\"PropertyName\":\"联系方式\",\"PropertyValue\":\"119\"},{\"PropertyName\":\"备注\",\"PropertyValue\":\"突突突突突突\"}]", - detailItems: null, - createTime: "2021-02-03T02:36:57.451Z", - creatorId: "5e8eced2aaca5f7c1025309b", - deleted: false, - waterSourceType: 0, - integrityScore: 0.21052632 - } + // waterData:any = { + // id: "60125d31d31fab7de81c56b0", + // name: "上海中心消火栓01", + // administrativeRegion: "上海区", + // governmentLevel: "1", + // village: "小高社区", + // address: "国际会议中心", + // location: { + // x: 121.496717, + // y: 31.239452 + // }, + // detailData: "[{\"PropertyName\":\"可用状态\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"放置形式\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"管网形式\",\"PropertyValue\":\"2\"},{\"PropertyName\":\"管网直径\",\"PropertyValue\":\"2\"},{\"PropertyName\":\"管网压力类型\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"管网压力范围\",\"PropertyValue\":\"2222\"},{\"PropertyName\":\"接口形式\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"接口口径\",\"PropertyValue\":\"3\"},{\"PropertyName\":\"最大流量\",\"PropertyValue\":\"333\"},{\"PropertyName\":\"供水单位\",\"PropertyValue\":\"剃剃头\"},{\"PropertyName\":\"联系方式\",\"PropertyValue\":\"119\"},{\"PropertyName\":\"备注\",\"PropertyValue\":\"突突突突突突\"}]", + // detailItems: null, + // createTime: "2021-02-03T02:36:57.451Z", + // creatorId: "5e8eced2aaca5f7c1025309b", + // deleted: false, + // waterSourceType: 0, + // integrityScore: 0.21052632 + // } } From 73354ea13701cd46cc7843dddd166dd5ea54cadb Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Tue, 2 Mar 2021 11:33:39 +0800 Subject: [PATCH 4/4] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E5=B9=B3=E9=9D=A2?= =?UTF-8?q?=E5=9B=BE=E7=B4=A0=E6=9D=90=E4=BD=BF=E7=94=A8=E9=BC=A0=E6=A0=87?= =?UTF-8?q?=E8=B0=83=E8=8A=82=E5=A4=A7=E5=B0=8F=E5=90=8E=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=AE=BD=E9=AB=98=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collection-tools-building/collection-tools.component.ts | 5 ++++- .../ui/collection-tools-plan/collection-tools.component.ts | 5 ++++- src/app/ui/collection-tools/collection-tools.component.ts | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) 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 8e0cb6b..1b6e0e6 100644 --- a/src/app/ui/collection-tools-building/collection-tools.component.ts +++ b/src/app/ui/collection-tools-building/collection-tools.component.ts @@ -669,7 +669,10 @@ export class CollectionToolsBuildingComponent implements OnInit { this.isShowProperty = false } }, this) - + AxMessageSystem.addListener('imageResize', (eventName, args1) => { + this.assetWidth = args1.Width + this.assetHeight = args1.Height + }, this) if(this.router.url.indexOf("keyUnit/viewunitinfo") != -1){ //查看模式 this.isEditPattern = false this.isediticon = false 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 528ba81..19f6408 100644 --- a/src/app/ui/collection-tools-plan/collection-tools.component.ts +++ b/src/app/ui/collection-tools-plan/collection-tools.component.ts @@ -674,7 +674,10 @@ export class CollectionToolsPlanComponent implements OnInit { this.isShowProperty = false } }, this) - + AxMessageSystem.addListener('imageResize', (eventName, args1) => { + this.assetWidth = args1.Width + this.assetHeight = args1.Height + }, this) if(this.router.url.indexOf("keyUnit/viewunitinfo") != -1){ //查看模式 this.isEditPattern = false this.isediticon = false diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index b7d32ae..760e33e 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -691,7 +691,10 @@ export class CollectionToolsComponent implements OnInit { this.isShowProperty = false } }, this) - + AxMessageSystem.addListener('imageResize', (eventName, args1) => { + this.assetWidth = args1.Width + this.assetHeight = args1.Height + }, this) this.canvasData.gameMode = GameMode.Assignment if (sessionStorage.getItem('editable') == "0") { //查看模式 this.isEditPattern = false