From 18b350e37ae26c9161a956bacca81d13716c4c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=8C=AF=E5=8D=87?= <359059686@qq.com> Date: Fri, 8 Jan 2021 08:57:51 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AE=89=E4=BF=A1?= =?UTF-8?q?=E5=9B=BE=E4=BE=8B=20=E7=89=88=E6=9C=AC1.0.0.20210107=5Fbeta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debug.log | 2 + src/app/working-area/model/arrows.ts | 41 -- .../working-area/model/axArrowConnector.ts | 42 +- src/app/working-area/model/axImageShape.ts | 366 +++------- src/app/working-area/model/axLegend.ts | 116 +++ .../working-area/model/axPreviewImageShape.ts | 9 + src/app/working-area/model/axShape.ts | 159 ++++- src/app/working-area/model/gameMode.ts | 3 +- src/app/working-area/model/legend.ts | 68 -- src/app/working-area/model/multipointIcon.ts | 93 +-- src/app/working-area/model/polygonIcon.ts | 132 +--- .../working-area/working-area.component.ts | 661 +++++++++++------- 12 files changed, 866 insertions(+), 826 deletions(-) create mode 100644 debug.log delete mode 100644 src/app/working-area/model/arrows.ts create mode 100644 src/app/working-area/model/axLegend.ts delete mode 100644 src/app/working-area/model/legend.ts diff --git a/debug.log b/debug.log new file mode 100644 index 0000000..5f9ed26 --- /dev/null +++ b/debug.log @@ -0,0 +1,2 @@ +[1229/141605.754:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3) +[0104/100053.968:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3) diff --git a/src/app/working-area/model/arrows.ts b/src/app/working-area/model/arrows.ts deleted file mode 100644 index a553771..0000000 --- a/src/app/working-area/model/arrows.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { WorkingAreaComponent } from '../working-area.component'; -import * as PIXI from 'pixi.js'; - -/** - * 绠ご - * 鍒涘缓涓涓彧鏈2涓偣缁勬垚鐨勭澶 - */ -export class Arrows extends PIXI.Container { - public line: PIXI.Graphics = new PIXI.Graphics(); - public ready = false; - constructor(public assetData: any, private workingArea: WorkingAreaComponent) { - super(); - this.workingArea.backgroundImage.addChild(this); - this.name = this.assetData.Id; - this.addChild(this.line); - this.refresh(); - this.interactive = true; - this.on('mousedown', event => { - if (!this.ready) { return; } - event.stopPropagation(); - this.workingArea.selection.selectOne(this); - }); - } - /** - * 鍒锋柊 - */ - public refresh() { - this.line.clear(); - this.line.lineStyle(5, 0xff0000, 1); - this.line.moveTo(this.assetData.pointA.x, this.assetData.pointA.y); - this.line.lineTo(this.assetData.pointB.x, this.assetData.pointB.y); - - const angle = Math.atan2((this.assetData.pointB.y - this.assetData.pointA.y), (this.assetData.pointB.x - this.assetData.pointA.x)) - * (180 / Math.PI) + 90; - - this.line.beginFill(0xff0000); - console.log(Math.PI / 180 / 1.6); - this.line.drawStar(this.assetData.pointB.x, this.assetData.pointB.y, 3, 10, 0, (Math.PI / 180 * angle)); - this.line.endFill(); - } -} diff --git a/src/app/working-area/model/axArrowConnector.ts b/src/app/working-area/model/axArrowConnector.ts index 8b72b39..68b2828 100644 --- a/src/app/working-area/model/axArrowConnector.ts +++ b/src/app/working-area/model/axArrowConnector.ts @@ -7,8 +7,6 @@ import { Sprite } from 'pixi.js'; * 杩炴帴绠ご */ export class AxArrowConnector extends AxShape { - - pointTexture: PIXI.Texture = PIXI.Texture.from('assets/images/handle-main.png') pointSprites: Array = new Array(); line: PIXI.Graphics; text: PIXI.Text; @@ -51,6 +49,7 @@ export class AxArrowConnector extends AxShape { this.drawPoints(); this.sortableChildren = true; this.text.zIndex = this.children.length; + this.text.visible = this.showName; } public drawPoints() { @@ -63,29 +62,30 @@ export class AxArrowConnector extends AxShape { }); this.pointSprites.forEach((value, index, array) => { value.interactive = true; - value.on('mousedown', event => { - event.stopPropagation(); - if (this.workingArea.allowEdit && this.assetData.GameMode === this.workingArea.canvasData.gameMode) { - event.currentTarget.data = event.data; - event.currentTarget.alpha = 0.5; - event.currentTarget.dragging = true; - } - }) - .on('mouseup', event => { + value + .on('pointerdown', event => { + event.stopPropagation(); + if (this.workingArea.allowEdit && this.assetData.GameMode === this.workingArea.canvasData.gameMode) { + event.currentTarget.data = event.data; + event.currentTarget.alpha = 0.5; + event.currentTarget.dragging = true; + } + }) + .on('pointerup', event => { if (event.currentTarget.dragging) { event.currentTarget.alpha = 1; event.currentTarget.dragging = false; event.currentTarget.data = null; } }) - .on('mouseupoutside', event => { + .on('pointerupoutside', event => { if (event.currentTarget.dragging) { event.currentTarget.alpha = 1; event.currentTarget.dragging = false; event.currentTarget.data = null; } }) - .on('mousemove', event => { + .on('pointermove', event => { if (event.currentTarget.dragging) { const newPosition = event.currentTarget.data.getLocalPosition(event.currentTarget.parent); event.currentTarget.x = newPosition.x; @@ -95,22 +95,30 @@ export class AxArrowConnector extends AxShape { this.assetData.MultiPoint[index].y = newPosition.y; this.workingArea.canvasData.isChange = true; this.refresh(); + this.drawBorder(1 / this.workingArea.backgroundImage.scale.x); } }) .on('rightclick', event => { }); }) - this.setPointsVisible(false); + this.setPointVisiable(false); } /** * 璁剧疆鐐规樉绀虹姸鎬 * @param b true/false */ - public setPointsVisible(b:boolean) { + public setPointVisiable(b:boolean) { this.pointSprites.forEach(item => { item.visible = b; }) + } + // 璁剧疆缂╂斁 + public setItemScale(scale: number) { + this.text.scale.set(scale); + this.pointSprites.forEach(point => { + point.scale.set(scale); + }); } /** * 鍒锋柊褰㈢姸 @@ -121,8 +129,8 @@ export class AxArrowConnector extends AxShape { if (pts.length < 2) { return; } - this.text.position = pts[0]; - this.text.anchor.set(0.5, 1); + this.text.position = this.getLineCenter(pts[0], pts[1]); + this.text.anchor.set(0.5); this.text.text = this.assetData.Name + '\r\n' + this.assetData.PropertyInfos?.find(item => item.PropertyName === '鍚嶇О/缂栧彿')?.PropertyValue; diff --git a/src/app/working-area/model/axImageShape.ts b/src/app/working-area/model/axImageShape.ts index 67466be..f496619 100644 --- a/src/app/working-area/model/axImageShape.ts +++ b/src/app/working-area/model/axImageShape.ts @@ -13,6 +13,7 @@ import { AxArrowConnector } from './axArrowConnector'; * AxImageShape */ export class AxImageShape extends AxShape { + connectPointTexture = PIXI.Texture.from('assets/images/handle-secondary.png'); style = new PIXI.TextStyle({ fontFamily: 'Arial', fontSize: 18, @@ -34,26 +35,19 @@ export class AxImageShape extends AxShape { + '\r\n' + this.assetData.PropertyInfos?.find(item => item.PropertyName === '鍚嶇О/缂栧彿')?.PropertyValue, this.style); - /** - * 閫変腑鍦嗙偣 - */ - image: PIXI.Sprite; selectionBox = new PIXI.Graphics(); - connectPointTexture = PIXI.Texture.from('assets/images/handle-secondary.png'); - connectPoint: Sprite; - // 鍙Щ鍔ㄧ殑 - // 鍙変腑鐨 + connectPoint: Sprite; - // up: PIXI.Sprite; - // down: PIXI.Sprite; - // left: PIXI.Sprite; - // right: PIXI.Sprite; - // upLeft: PIXI.Sprite; - // upRight: PIXI.Sprite; - // downLeft: PIXI.Sprite; - // downRight: PIXI.Sprite; + up: PIXI.Sprite; + down: PIXI.Sprite; + left: PIXI.Sprite; + right: PIXI.Sprite; + upLeft: PIXI.Sprite; + upRight: PIXI.Sprite; + downLeft: PIXI.Sprite; + downRight: PIXI.Sprite; constructor(assetData: any, workingArea: WorkingAreaComponent) { super(assetData, workingArea); this.x = this.assetData.Point.x; @@ -68,85 +62,43 @@ export class AxImageShape extends AxShape { this.image.height = this.assetData.Height; this.image.alpha = 1; this.image.anchor.set(0.5); - // this.image.interactive = true; - // this.image.buttonMode = true; - // this.image - // .on('mousedown', event => { - // event.stopPropagation(); - // this.workingArea.selection.selectOne(this); - // // this.paintingPipeline(this.x, this.y); - // // 濡傛灉閾炬帴瀵硅薄涓嶄负绌,绂佹绉诲姩 - // if (this.workingArea.allowEdit && this.assetData.GameMode === this.workingArea.canvasData.gameMode) { - // event.currentTarget.parent.data = event.data; - // event.currentTarget.parent.alpha = 0.5; - // event.currentTarget.parent.dragging = true; - // } - // }) - // .on('mouseup', event => { - // if (event.currentTarget.parent.dragging) { - // event.currentTarget.parent.alpha = 1; - // event.currentTarget.parent.dragging = false; - // event.currentTarget.parent.data = null; - // } - // }) - // .on('mouseupoutside', event => { - // if (event.currentTarget.parent.dragging) { - // event.currentTarget.parent.alpha = 1; - // event.currentTarget.parent.dragging = false; - // event.currentTarget.parent.data = null; - // } - // }) - // .on('mousemove', event => { - // if (event.currentTarget.parent.dragging) { - // // // 濡傛灉鎷栧姩杩囩▼涓彂鐜扮埗瀵硅薄涓嶆槸鑳屾櫙鍥 - // // if (this.parent !== this.workingArea.backgroundImage) { - // // this.setParent(this.workingArea.backgroundImage); - // // if (this.assetData.FixedSize) { - // // const scale = 1 / this.workingArea.backgroundImage.scale.x; - // // this.scale.set(scale); - // // } - // // } - // const newPosition = event.currentTarget.parent.data.getLocalPosition(event.currentTarget.parent.parent); - // event.currentTarget.parent.x = newPosition.x; - // event.currentTarget.parent.y = newPosition.y; - // this.assetData.Point = new PIXI.Point(this.x, this.y); - // this.workingArea.canvasData.isChange = true; - // } - // }) - // .on('rightclick', event => { - - // }) - // .on('mouseover', event => { - // event.stopPropagation(); - // if (this.workingArea.previewImage !== null - // && this.workingArea.getPaintMode() === PaintMode.singlePointIcon) { - // this.workingArea.previewImage.visible = false; - // } - // // if (this.assetData.CanConnect) { - // // this.setSelectionBox(true, this.image); - // // } - // }) - // .on('mouseout', event => { - // event.stopPropagation(); - // if (this.workingArea.previewImage !== null - // && this.workingArea.getPaintMode() === PaintMode.singlePointIcon) { - // this.workingArea.previewImage.visible = true; - // } - // // if (this.assetData.CanConnect) { - // // this.setSelectionBox(false); - // // } - // }); this.text.x = this.image.x; this.text.y = this.image.y - this.image.height / 2; this.text.anchor.set(0.5, 1); - - if (this.assetData.GameMode === 2) { - this.text.visible = false; - } + this.text.visible = this.showName; this.addChild(this.text); this.addChild(this.image); this.addChild(this.selectionBox); + //// + // up-left + this.upLeft = new PIXI.Sprite(this.pointTexture); + this.upLeft.anchor.set(0.5); + this.addChild(this.upLeft); + this.upLeft.interactive = true; + this.upLeft.visible = false; + // up-right + this.upRight = new PIXI.Sprite(this.pointTexture); + this.upRight.anchor.set(0.5); + this.addChild(this.upRight); + this.upRight.interactive = true; + this.upRight.visible = false; + // down-left + this.downLeft = new PIXI.Sprite(this.pointTexture); + this.downLeft.anchor.set(0.5); + this.addChild(this.downLeft); + this.downLeft.interactive = true; + this.downLeft.visible = false; + // down-right + this.downRight = new PIXI.Sprite(this.pointTexture); + this.downRight.anchor.set(0.5); + this.addChild(this.downRight); + this.downRight.interactive = true; + this.downRight.visible = false; + //// + + + if (this.assetData.CanConnect) { // connectPoint this.connectPoint = new PIXI.Sprite(this.connectPointTexture); @@ -156,180 +108,19 @@ export class AxImageShape extends AxShape { this.addChild(this.connectPoint); this.connectPoint.interactive = true; this.connectPoint - .on('mousedown', event => { + .on('pointerdown', event => { event.stopPropagation(); this.paintingPipeline(this.x, this.y); }) - .on('mouseover', event => { + .on('pointerover', event => { this.setSelectionBox(true, this.connectPoint); }) - .on('mouseout', event => { + .on('pointerout', event => { this.setSelectionBox(false); - }); - // // up - // this.up = new PIXI.Sprite(this.selectedPointTexture); - // this.up.anchor.set(0.5); - // this.up.x = this.image.x; - // this.up.y = this.image.y - (this.image.height / 2); - // this.addChild(this.up); - // this.up.interactive = true; - // this.up - // .on('mousedown', event => { - // event.stopPropagation(); - // const pt = this.toGlobal(new PIXI.Point(this.up.x, this.up.y)); - // const pt2 = this.workingArea.backgroundImage.toLocal(pt); - // this.paintingPipeline(pt2.x, pt2.y); - // }) - // .on('mouseover', event => { - // this.setSelectionBox(true, this.up); - // }) - // .on('mouseout', event => { - // this.setSelectionBox(false); - // }); - // // down - // this.down = new PIXI.Sprite(this.selectedPointTexture); - // this.down.anchor.set(0.5); - // this.down.x = this.image.x; - // this.down.y = this.image.y + (this.image.height / 2); - // this.addChild(this.down); - // this.down.interactive = true; - // this.down - // .on('mousedown', event => { - // event.stopPropagation(); - // const pt = this.toGlobal(new PIXI.Point(this.down.x, this.down.y)); - // const pt2 = this.workingArea.backgroundImage.toLocal(pt); - // this.paintingPipeline(pt2.x, pt2.y); - // }) - // .on('mouseover', event => { - // this.setSelectionBox(true, this.down); - // }) - // .on('mouseout', event => { - // this.setSelectionBox(false); - // }); - // // left - // this.left = new PIXI.Sprite(this.selectedPointTexture); - // this.left.anchor.set(0.5); - // this.left.x = this.image.x - (this.image.width / 2); - // this.left.y = this.image.y; - // this.addChild(this.left); - // this.left.interactive = true; - // this.left - // .on('mousedown', event => { - // event.stopPropagation(); - // const pt = this.toGlobal(new PIXI.Point(this.left.x, this.left.y)); - // const pt2 = this.workingArea.backgroundImage.toLocal(pt); - // this.paintingPipeline(pt2.x, pt2.y); - // }) - // .on('mouseover', event => { - // this.setSelectionBox(true, this.left); - // }) - // .on('mouseout', event => { - // this.setSelectionBox(false); - // }); - // // right - // this.right = new PIXI.Sprite(this.selectedPointTexture); - // this.right.anchor.set(0.5); - // this.right.x = this.image.x + (this.image.width / 2); - // this.right.y = this.image.y; - // this.addChild(this.right); - // this.right.interactive = true; - // this.right - // .on('mousedown', event => { - // event.stopPropagation(); - // const pt = this.toGlobal(new PIXI.Point(this.right.x, this.right.y)); - // const pt2 = this.workingArea.backgroundImage.toLocal(pt); - // this.paintingPipeline(pt2.x, pt2.y); - // }) - // .on('mouseover', event => { - // this.setSelectionBox(true, this.right); - // }) - // .on('mouseout', event => { - // this.setSelectionBox(false); - // }); - // // up-left - // this.upLeft = new PIXI.Sprite(this.selectedPointTexture); - // this.upLeft.anchor.set(0.5); - // this.upLeft.x = this.image.x - (this.image.width / 2); - // this.upLeft.y = this.image.y - (this.image.height / 2); - // this.addChild(this.upLeft); - // this.upLeft.interactive = true; - // this.upLeft - // .on('mousedown', event => { - // event.stopPropagation(); - // const pt = this.toGlobal(new PIXI.Point(this.upLeft.x, this.upLeft.y)); - // const pt2 = this.workingArea.backgroundImage.toLocal(pt); - // this.paintingPipeline(pt2.x, pt2.y); - // }) - // .on('mouseover', event => { - // this.setSelectionBox(true, this.upLeft); - // }) - // .on('mouseout', event => { - // this.setSelectionBox(false); - // }); - // // up-right - // this.upRight = new PIXI.Sprite(this.selectedPointTexture); - // this.upRight.anchor.set(0.5); - // this.upRight.x = this.image.x + (this.image.width / 2); - // this.upRight.y = this.image.y - (this.image.height / 2); - // this.addChild(this.upRight); - // this.upRight.interactive = true; - // this.upRight - // .on('mousedown', event => { - // event.stopPropagation(); - // const pt = this.toGlobal(new PIXI.Point(this.upRight.x, this.upRight.y)); - // const pt2 = this.workingArea.backgroundImage.toLocal(pt); - // this.paintingPipeline(pt2.x, pt2.y); - // }) - // .on('mouseover', event => { - // this.setSelectionBox(true, this.upRight); - // }) - // .on('mouseout', event => { - // this.setSelectionBox(false); - // }); - - // // down-left - // this.downLeft = new PIXI.Sprite(this.selectedPointTexture); - // this.downLeft.anchor.set(0.5); - // this.downLeft.x = this.image.x - (this.image.width / 2); - // this.downLeft.y = this.image.y + (this.image.height / 2); - // this.addChild(this.downLeft); - // this.downLeft.interactive = true; - // this.downLeft - // .on('mousedown', event => { - // event.stopPropagation(); - // const pt = this.toGlobal(new PIXI.Point(this.downLeft.x, this.downLeft.y)); - // const pt2 = this.workingArea.backgroundImage.toLocal(pt); - // this.paintingPipeline(pt2.x, pt2.y); - // }) - // .on('mouseover', event => { - // this.setSelectionBox(true, this.downLeft); - // }) - // .on('mouseout', event => { - // this.setSelectionBox(false); - // }); - // // down-right - // this.downRight = new PIXI.Sprite(this.selectedPointTexture); - // this.downRight.anchor.set(0.5); - // this.downRight.x = this.image.x + (this.image.width / 2); - // this.downRight.y = this.image.y + (this.image.height / 2); - // this.addChild(this.downRight); - // this.downRight.interactive = true; - // this.downRight - // .on('mousedown', event => { - // event.stopPropagation(); - // const pt = this.toGlobal(new PIXI.Point(this.downRight.x, this.downRight.y)); - // const pt2 = this.workingArea.backgroundImage.toLocal(pt); - // this.paintingPipeline(pt2.x, pt2.y); - // }) - // .on('mouseover', event => { - // this.setSelectionBox(true, this.downRight); - // }) - // .on('mouseout', event => { - // this.setSelectionBox(false); - // }); - + }); this.showConnectionPoint(false); } + this.setItemScale(1 / this.workingArea.backgroundImage.scale.x); } // 璁剧疆閫夋嫨妗 public setSelectionBox(b: boolean, sprite?: PIXI.Sprite) { @@ -337,14 +128,6 @@ export class AxImageShape extends AxShape { this.selectionBox.lineStyle(2, 0x00EB00, 1); this.selectionBox.position = sprite.position; this.selectionBox.drawRect(- sprite.width / 2, - sprite.height / 2, sprite.width, sprite.height); - // const p0 = new PIXI.Point(- sprite.width / 2, - sprite.height / 2); - // const pe = new PIXI.Point(sprite.width / 2, sprite.height / 2); - // const pw = new PIXI.Point(p0.x + sprite.width, p0.y); - // const ph = new PIXI.Point(p0.x, p0.y + sprite.height); - // this.drawDashedLine(this.selectionBox, p0, pw, 0x1234ff); - // this.drawDashedLine(this.selectionBox, p0, ph, 0x1234ff); - // this.drawDashedLine(this.selectionBox, pe, pw, 0x1234ff); - // this.drawDashedLine(this.selectionBox, pe, ph, 0x1234ff); } else { this.selectionBox.clear(); } @@ -358,14 +141,56 @@ export class AxImageShape extends AxShape { // 鏄剧ず杩炴帴鐐 public showConnectionPoint(b: boolean) { this.connectPoint.visible = b; - // this.up.visible = b; - // this.down.visible = b; - // this.left.visible = b; - // this.right.visible = b; - // this.upLeft.visible = b; - // this.downLeft.visible = b; - // this.upRight.visible = b; - // this.downRight.visible = b; + } + /** + * 璁剧疆鐐规樉绀虹姸鎬 + * @param value 鏄剧ず鐘舵 + */ + public setPointVisiable(value: boolean) { + let rect = this.getLocalBounds(); + this.upLeft.x = rect.left; + this.upLeft.y = rect.top; + this.upRight.x = rect.right; + this.upRight.y = rect.top; + this.downLeft.x = rect.left; + this.downLeft.y = rect.bottom; + this.downRight.x = rect.right; + this.downRight.y = rect.bottom; + this.upLeft.visible = value; + this.upRight.visible = value; + this.downLeft.visible = value; + this.downRight.visible = value; + } + /** + * + * @param scale 缁樺埗杈规 + */ + public drawBorder(scale: number) { + let visible = this.upLeft.visible; + this.setPointVisiable(false); + + super.drawBorder(scale); + let rect = this.getLocalBounds(); + this.upLeft.x = rect.left; + this.upLeft.y = rect.top; + this.upRight.x = rect.right; + this.upRight.y = rect.top; + this.downLeft.x = rect.left; + this.downLeft.y = rect.bottom; + this.downRight.x = rect.right; + this.downRight.y = rect.bottom; + this.setPointVisiable(visible); + } + public setItemScale(scale: number) { + if (this.assetData.FixedSize) { + this.scale.set(scale); + } else { + this.text.scale.set(scale); + this.upLeft.scale.set(scale); + this.upRight.scale.set(scale); + this.downLeft.scale.set(scale); + this.downRight.scale.set(scale); + } } paintingPipeline(x: number, y: number) { if (this.assetData.CanConnect) { @@ -407,6 +232,7 @@ export class AxImageShape extends AxShape { IsFromBuilding : this.workingArea.canvasData.selectTemplateData.isFromBuilding, GameMode: this.workingArea.canvasData.gameMode, LinkedObjects: new Array(this.assetData.Id), + Tag: this.workingArea.canvasData.selectTemplateData.tag }; this.workingArea.paintingShape = new AxArrowConnector(tempData, this.workingArea,false,true); this.assetData.Pipelines.push(this.workingArea.paintingShape.assetData.Id); diff --git a/src/app/working-area/model/axLegend.ts b/src/app/working-area/model/axLegend.ts new file mode 100644 index 0000000..af86e70 --- /dev/null +++ b/src/app/working-area/model/axLegend.ts @@ -0,0 +1,116 @@ +import { Constructor } from '@angular/material/core/common-behaviors/constructor'; +import { Sprite, Texture,Text, Graphics, Point } from 'pixi.js'; +import { WorkingAreaComponent } from '../working-area.component'; +import { AxShape } from './axShape'; + +/** + * 瀹変俊鍥句緥褰㈢姸 + */ +export class AxLegend extends AxShape { + // 鏁版嵁 + public shapeMap: Map = new Map(); + pen: Graphics = new Graphics(); + /** + * + */ + constructor(assetData: any, workingArea: WorkingAreaComponent,shapeMap:Map) { + super(assetData, workingArea); + this.name = this.assetData.Id; + this.shapeMap = shapeMap; + this.refresh(); + } + // 娣诲姞鏁版嵁 + public addItem(item:Legend) { + if (this.shapeMap.has(item.Name)) { + this.shapeMap.get(item.Name).Count++; + } else { + this.shapeMap.set(item.Name, item); + } + this.refresh(); + } + // 鍒犻櫎鏁版嵁 + public deleteItem(item: Legend) { + if (this.shapeMap.has(item.Name)) { + this.shapeMap.get(item.Name).Count--; + if (this.shapeMap.get(item.Name).Count === 0) { + this.shapeMap.delete(item.Name); + } + } + this.refresh(); + } + // 鍒锋柊 + refresh() { + this.removeChildren(); + let index = 1; + let offset = 50; + let number = 2; + let width = 450; + let height = 100; + for (let i = 0; i < number; i++){ + if (i >= this.shapeMap.size) break; + let x = width * i; + var textImage = new Text('鍥句緥',{ + fontSize: 36, + fill: ['#0000ff'], + }); + textImage.anchor.set(0.5) + textImage.x = x; + textImage.y = 0; + this.addChild(textImage); + + var textName = new Text("鍚嶇О"+' 銆愭暟閲忋',{ + fontSize: 36, + fill: ['#0000ff'], + }); + textName.anchor.set(0,0.5); + textName.x = x + 32 + offset; + textName.y = 0; + this.addChild(textName); + } + for (let item of this.shapeMap.values()) { + let x = index % number === 0 ? (number -1) * width : (index % number - 1) * width; + let y = Math.ceil(index / number) * height; + let image: Sprite = Sprite.from(item.ImageUrl); + image.width = 64; + image.height = 64; + image.anchor.set(0.5); + image.x = x; + image.y = y; + this.addChild(image); + + var textName = new Text(item.Name+' 銆'+item.Count.toString()+'銆'); + textName.anchor.set(0,0.5); + textName.x = x + image.width/2 + offset; + textName.y = y; + this.addChild(textName); + index++; + } + if (this.shapeMap.size > 0) { + let rect = this.getLocalBounds(); + this.pen.clear(); + this.pen.beginFill(0xffffff,0.01); + this.pen.lineStyle(5, 0x000000); + this.pen.moveTo(rect.left-offset, rect.top-offset); + this.pen.lineTo(rect.right+offset, rect.top-offset); + this.pen.lineTo(rect.right+offset, rect.bottom+offset); + this.pen.lineTo(rect.left - offset, rect.bottom + offset); + this.pen.closePath(); + this.pen.endFill(); + } + this.addChild(this.pen); + } +} + +export class Legend{ + public Name: string; + public ImageUrl: string; + public Count: number; + /** + * + */ + constructor(name:string,imageUrl:string,count:number) { + this.Name = name; + this.ImageUrl = imageUrl; + this.Count = count; + } +} diff --git a/src/app/working-area/model/axPreviewImageShape.ts b/src/app/working-area/model/axPreviewImageShape.ts index 623b2d7..8d0cd5d 100644 --- a/src/app/working-area/model/axPreviewImageShape.ts +++ b/src/app/working-area/model/axPreviewImageShape.ts @@ -24,4 +24,13 @@ export class AxPreviewImageShape extends AxShape { setImageUrl(url: string) { this.image.texture = Texture.from(url); } + public setItemScale(scale: number) { + this.scale.set(scale); + } + /** + * + * @param rect 鐢昏竟妗 + */ + public drawBorder(scale: number) { + } } diff --git a/src/app/working-area/model/axShape.ts b/src/app/working-area/model/axShape.ts index 9ff01a6..7e784b3 100644 --- a/src/app/working-area/model/axShape.ts +++ b/src/app/working-area/model/axShape.ts @@ -8,21 +8,31 @@ import { WorkingAreaComponent } from '../working-area.component'; */ export class AxShape extends Container { assetData: any; + pointTexture: PIXI.Texture = PIXI.Texture.from('assets/images/handle-main.png') workingArea: WorkingAreaComponent; // 鍙互琚Щ鍔ㄧ殑 moveable = true; // 鍙互琚変腑鐨 selectable = true; - + // 鍏佽缂栬緫 + allowEdit = true; + // 鏄惁鏄剧ず鍚嶇О + showName = true; + // 杈规 + border: PIXI.Graphics = new PIXI.Graphics(); + constructor(assetData: any, workingArea: WorkingAreaComponent) { super(); + this.border.visible = false; + this.addChild(this.border); this.assetData = assetData; this.workingArea = workingArea; this.workingArea.backgroundImage.addChild(this); + this.zIndex = 200; this.interactive = true; this.buttonMode = true; - this.on('mousedown', event => { - console.log(this.assetData); + this + .on('pointerdown', event => { event.stopPropagation(); if (this.selectable) { this.workingArea.selection.selectOne(this); @@ -37,23 +47,34 @@ export class AxShape extends Container { event.currentTarget.dragPoint.y -= event.currentTarget.y; } }) - .on('mouseup', event => { + .on('pointerup', event => { if (event.currentTarget.dragging) { event.currentTarget.alpha = 1; event.currentTarget.dragging = false; event.currentTarget.data = null; } }) - .on('mouseupoutside', event => { + .on('pointerupoutside', event => { if (event.currentTarget.dragging) { event.currentTarget.alpha = 1; event.currentTarget.dragging = false; event.currentTarget.data = null; } }) - .on('mousemove', event => { + .on('pointermove', event => { if (event.currentTarget.dragging) { const newPosition = event.currentTarget.data.getLocalPosition(event.currentTarget.parent); + + // const offsetX = newPosition.x - event.currentTarget.dragPoint.x; + // const offsetY = newPosition.y - event.currentTarget.dragPoint.y; + // const offset = this.workingArea.backgroundImage.toLocal(new Point(offsetX, offsetY)); + // event.currentTarget.position += offset; + // // this.workingArea.selection.objects.forEach(shpae => { + // // shpae.x = newPosition.x - event.currentTarget.dragPoint.x; + // // shpae.y = newPosition.y - event.currentTarget.dragPoint.y; + // // shpae.assetData.Point = new PIXI.Point(this.x, this.y); + // // this.workingArea.canvasData.isChange = true; + // // }) event.currentTarget.x = newPosition.x - event.currentTarget.dragPoint.x; event.currentTarget.y = newPosition.y - event.currentTarget.dragPoint.y; this.assetData.Point = new PIXI.Point(this.x, this.y); @@ -61,12 +82,12 @@ export class AxShape extends Container { } }) .on('rightclick', event => { - + this.border.visible = false; }) - .on('mouseover', event => { + .on('pointerover', event => { event.stopPropagation(); }) - .on('mouseout', event => { + .on('pointerout', event => { event.stopPropagation(); }); } @@ -77,4 +98,124 @@ export class AxShape extends Container { refresh(): void{ } + public setItemScale(scale: number) { + + } + /** + * 鏄剧ず杈规 + */ + public showBorder() { + if (this.assetData.FixedSize) { + this.drawBorder(1); + } + else { + this.drawBorder(1/this.workingArea.backgroundImage.scale.x); + } + this.border.visible = true; + } + /** + * 闅愯棌杈规 + */ + public hideBorder() { + this.border.clear(); + this.border.visible = false; + } + /** + * 璁剧疆鐐规樉绀虹姸鎬 + * @param value 鏄剧ず鐘舵 + */ + public setPointVisiable(value: boolean) { + + } + /** + * + * @param rect 鐢昏竟妗 + */ + public drawBorder(scale: number) { + scale = this.assetData.FixedSize ? 1 : scale; + this.border.clear(); + const rect = this.getLocalBounds(); + const p1 = new PIXI.Point(rect.left, rect.top); + const p2 = new PIXI.Point(rect.right, rect.top); + const p3 = new PIXI.Point(rect.right, rect.bottom); + const p4 = new PIXI.Point(rect.left, rect.bottom); + + this.border.lineStyle(scale * 1, 0x00a8ff); + + var spaceLength = scale * 1; + var lineLenght = rect.width + 0.5 + 0.5; + var dashLength = scale*( lineLenght +spaceLength - Math.floor((rect.width + rect.height)/2 / 4.1))/Math.floor((rect.width + rect.height)/2 / 4.1); + this.drawDash(this.border, p1.x -0.5*scale, p1.y, p2.x + 0.5*scale, p2.y,dashLength,spaceLength); + this.drawDash(this.border, p2.x, p2.y -0.5*scale, p3.x, p3.y + 0.5*scale, dashLength, spaceLength); + this.drawDash(this.border, p3.x+0.5*scale, p3.y, p4.x - 0.5*scale, p4.y, dashLength, spaceLength); + this.drawDash(this.border, p4.x, p4.y + 0.5*scale, p1.x, p1.y - 0.5*scale, dashLength, spaceLength); + + this.border.lineStyle(0, 0x0000ff); + this.border.beginFill(0x00ff00,0.1); + this.border.moveTo(p1.x, p1.y); + this.border.lineTo(p2.x, p2.y); + this.border.lineTo(p3.x, p4.y); + this.border.lineTo(p4.x, p4.y); + this.border.closePath(); + this.border.endFill(); + } + // 鐢昏櫄绾 + drawDash(target, x1, y1, x2, y2,dashLength = 5, spaceLength = 1) { + let x = x2 - x1; + let y = y2 - y1; + let hyp = Math.sqrt((x) * (x) + (y) * (y)); + let units = hyp / (dashLength + spaceLength); + let dashSpaceRatio = dashLength / (dashLength + spaceLength); + let dashX = (x / units) * dashSpaceRatio; + let spaceX = (x / units) - dashX; + let dashY = (y / units) * dashSpaceRatio; + let spaceY = (y / units) - dashY; + + target.moveTo(x1, y1); + + while (hyp > 0) { + x1 += dashX; + y1 += dashY; + hyp -= dashLength; + if (hyp < 0) { + x1 = x2; + y1 = y2; + } + target.lineTo(x1, y1); + x1 += spaceX; + y1 += spaceY; + target.moveTo(x1, y1); + hyp -= spaceLength; + } + target.moveTo(x2, y2); + } + // 璁$畻澶氳竟褰㈤噸蹇 + public calculatePolygonGravityCenter(points: PIXI.Point[]) { + let area = 0.0; // 澶氳竟褰㈤潰绉 + let gravityLat = 0.0; // 閲嶅績鐐 latitude + let gravityLng = 0.0; // 閲嶅績鐐 longitude + points.forEach((item, index) => { + // 1 + const lat = item.x; + const lng = item.y; + const nextLat = points[(index + 1) % points.length].x; + const nextLng = points[(index + 1) % points.length].y; + // 2 + const tempArea = (nextLat * lng - nextLng * lat) / 2.0; + // 3 + area += tempArea; + // 4 + gravityLat += tempArea * (lat + nextLat) / 3; + gravityLng += tempArea * (lng + nextLng) / 3; + }); + // 5 + gravityLat = gravityLat / area; + gravityLng = gravityLng / area; + + return new PIXI.Point(gravityLat, gravityLng); + } + // 璁$畻绾挎涓偣鍧愭爣 + public getLineCenter(point1:PIXI.Point,point2:PIXI.Point) { + return new PIXI.Point((point1.x+point2.x)/2,(point1.y+point2.y)/2) + } } diff --git a/src/app/working-area/model/gameMode.ts b/src/app/working-area/model/gameMode.ts index feabdbb..d656a7f 100644 --- a/src/app/working-area/model/gameMode.ts +++ b/src/app/working-area/model/gameMode.ts @@ -3,5 +3,6 @@ */ export enum GameMode { BasicInformation, - Assignment + Assignment, + Examinee } \ No newline at end of file diff --git a/src/app/working-area/model/legend.ts b/src/app/working-area/model/legend.ts deleted file mode 100644 index e7592db..0000000 --- a/src/app/working-area/model/legend.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { Graphics, Sprite, Text } from "pixi.js"; -import { WorkingAreaComponent } from "../working-area.component"; -import { AxArrowConnector } from "./axArrowConnector"; -import { AxImageShape } from "./axImageShape"; -import { AxShape } from "./axShape"; -import { MultipointIcon } from "./multipointIcon"; -import { PolygonIcon } from "./polygonIcon"; - - -export class Legend extends AxShape{ - background: Graphics = null; - data:Map = new Map() - /** - * - */ - constructor(workingArea: WorkingAreaComponent) { - super(null, workingArea); - this.draw(); - } - - getData() { - this.workingArea.backgroundImage.children.forEach(item => { - if (item instanceof AxImageShape|| item instanceof AxArrowConnector || item instanceof PolygonIcon || item instanceof MultipointIcon) { - if (!this.data.has(item.assetData.Name)) { - this.data[item.assetData.Name] = item.assetData.ImageUrl; - } - } - }) - } - - draw() { - this.getData(); - this.background = new Graphics(); - this.background.lineStyle(1, 0xff0000); - this.background.beginFill(0xffffff); - this.background.drawRect(0, 0, 200, 300); - this.background.endFill(); - this.background.x = -(this.parent.width/2/ this.parent.scale.x); - this.background.y = -(this.parent.height/2/ this.parent.scale.x); - this.addChild(this.background); - var showName: Text = new Text('鍥句緥'); - showName.x = 0; - showName.y = 0; - this.background.addChild(showName); - var showDescrption: Text = new Text('璇存槑') - showDescrption.x = 100; - showDescrption.y = 0; - this.background.addChild(showDescrption); - let index = 1; - this.data.forEach((value, key) => { - var image: Sprite = Sprite.from(value); - image.width = 32; - image.height = 32; - image.x = 0; - image.y = index * 32; - this.background.addChild(image); - var description = new Text(key); - description.x = 100; - description.y = index * 32; - this.background.addChild(description); - index++; - }) - } - redraw() { - this.background.destroy(); - this.draw(); - } -} \ No newline at end of file diff --git a/src/app/working-area/model/multipointIcon.ts b/src/app/working-area/model/multipointIcon.ts index e60b148..2416956 100644 --- a/src/app/working-area/model/multipointIcon.ts +++ b/src/app/working-area/model/multipointIcon.ts @@ -8,7 +8,7 @@ import { AxShape } from './axShape'; */ export class MultipointIcon extends AxShape { public pointsData: PIXI.Point[]; - public pointsGraphics: PIXI.Graphics[] = []; + public pointsGraphics: PIXI.Sprite[] = []; public iconsTilingSprite: PIXI.TilingSprite[] = []; style = new PIXI.TextStyle({ fontFamily: 'Arial', @@ -42,6 +42,11 @@ export class MultipointIcon extends AxShape { this.x = this.assetData.Point.x; this.y = this.assetData.Point.y; this.workingArea.backgroundImage.addChild(this); + + this.text.anchor.set(0.5,0.5); + // this.text.position = this.getLineCenter(this.pointsData[0], this.pointsData[1]); + this.text.visible = this.showName; + this.addChild(this.text); // 鐢荤嚎鍥炬爣 for (let i = 0, count = this.pointsData.length - 1; i < count; i++) { const pointA = this.pointsData[i]; @@ -60,22 +65,16 @@ export class MultipointIcon extends AxShape { // icon.height = this.assetData.Thickness === 0 ? 32 : this.assetData.Thickness; this.iconsTilingSprite.push(icon); this.addChild(icon); - if (i === 0) { - this.text.anchor.set(0.5); - this.text.position = icon.position; - this.text.y -= this.assetData.Height; - this.addChild(this.text); - } + this.text.position = this.getLineCenter(this.pointsData[0], this.pointsData[1]); } + this.sortableChildren = true; + this.text.zIndex = this.pointsData.length; // 鐢荤偣 this.pointsData.forEach((item, index, array) => { - const iconPoint = new PIXI.Graphics(); - iconPoint.lineStyle(1, 0xFFBD01, 1); - iconPoint.beginFill(0xFFFFFF, 1); - iconPoint.drawCircle(0, 0, 15); + const iconPoint = PIXI.Sprite.from(this.pointTexture); + iconPoint.anchor.set(0.5); iconPoint.x = item.x; iconPoint.y = item.y; - iconPoint.endFill(); iconPoint.visible = false; this.pointsGraphics.push(iconPoint); this.addChild(iconPoint); @@ -83,7 +82,7 @@ export class MultipointIcon extends AxShape { // 娣诲姞鍦嗙偣浜嬩欢 this.pointsGraphics.forEach((item, index, array) => { item.interactive = true; - item.on('mousedown', event => { + item.on('pointerdown', event => { event.stopPropagation(); if (this.workingArea.allowEdit && this.assetData.GameMode === this.workingArea.canvasData.gameMode) { event.currentTarget.data = event.data; @@ -91,21 +90,21 @@ export class MultipointIcon extends AxShape { event.currentTarget.dragging = true; } }) - .on('mouseup', event => { + .on('pointerup', event => { if (event.currentTarget.dragging) { event.currentTarget.alpha = 1; event.currentTarget.dragging = false; event.currentTarget.data = null; } }) - .on('mouseupoutside', event => { + .on('pointerupoutside', event => { if (event.currentTarget.dragging) { event.currentTarget.alpha = 1; event.currentTarget.dragging = false; event.currentTarget.data = null; } }) - .on('mousemove', event => { + .on('pointermove', event => { if (event.currentTarget.dragging) { const newPosition = event.currentTarget.data.getLocalPosition(event.currentTarget.parent); event.currentTarget.x = newPosition.x; @@ -128,9 +127,6 @@ export class MultipointIcon extends AxShape { const distance = Math.sqrt(a * a + b * b); this.iconsTilingSprite[index].angle = angle; this.iconsTilingSprite[index].width = distance; - - this.text.position = this.iconsTilingSprite[index].position; - this.text.y -= this.assetData.Height; } else if (index < array.length - 1) {// 涓嶆槸绗竴涓偣锛屼篃涓嶆槸鏈鍚庝竴涓偣 this.iconsTilingSprite[index].x = newPosition.x; this.iconsTilingSprite[index].y = newPosition.y; @@ -163,61 +159,13 @@ export class MultipointIcon extends AxShape { this.iconsTilingSprite[index - 1].angle = angleC; this.iconsTilingSprite[index - 1].width = distanceC; } + this.drawBorder(1 / this.workingArea.backgroundImage.scale.x); + this.text.position = this.getLineCenter(this.pointsData[0], this.pointsData[1]); } }) .on('rightclick', event => { }); }); - // // 缂╂斁 - // this.workingArea.on('backgroundScale', data => { - // const scale = 1 / data; - // this.text.scale.set(scale); - // }); - // 娣诲姞閫変腑浜嬩欢 - // this.iconsTilingSprite.forEach((item, index, array) => { - // item.interactive = true; - // item.buttonMode = true; - // item.on('mousedown', event => { - // event.stopPropagation(); - // this.workingArea.selection.selectOne(this); - // if (this.workingArea.allowEdit && this.assetData.GameMode === this.workingArea.canvasData.gameMode) { - // event.currentTarget.parent.data = event.data; - // event.currentTarget.parent.alpha = 0.5; - // event.currentTarget.parent.dragging = true; - - // event.currentTarget.parent.dragPoint = event.data.getLocalPosition(event.currentTarget.parent.parent); - // event.currentTarget.parent.dragPoint.x -= event.currentTarget.parent.x; - // event.currentTarget.parent.dragPoint.y -= event.currentTarget.parent.y; - // } - // }) - // .on('mouseup', event => { - // if (event.currentTarget.parent.dragging) { - // event.currentTarget.parent.alpha = 1; - // event.currentTarget.parent.dragging = false; - // event.currentTarget.parent.data = null; - // } - // }) - // .on('mouseupoutside', event => { - // if (event.currentTarget.parent.dragging) { - // event.currentTarget.parent.alpha = 1; - // event.currentTarget.parent.dragging = false; - // event.currentTarget.parent.data = null; - // } - // }) - // .on('mousemove', event => { - // if (event.currentTarget.parent.dragging) { - // const newPosition = event.currentTarget.parent.data.getLocalPosition(event.currentTarget.parent.parent); - // event.currentTarget.parent.x = newPosition.x - event.currentTarget.parent.dragPoint.x; - // event.currentTarget.parent.y = newPosition.y - event.currentTarget.parent.dragPoint.y; - - // this.assetData.Point = new PIXI.Point(this.x, this.y); - // this.workingArea.canvasData.isChange = true; - // } - // }) - // .on('rightclick', event => { - - // }); - // }); } /** * 璁剧疆鐐规樉绀虹姸鎬 @@ -234,6 +182,13 @@ export class MultipointIcon extends AxShape { this.text.visible = value; } } + // 璁剧疆缂╂斁 + public setItemScale(scale: number) { + this.text.scale.set(scale); + this.pointsGraphics.forEach((item, index, array) => { + item.scale.set(scale); + }); + } // 鍒锋柊鏁版嵁 public refresh() { // console.log(this.assetData); diff --git a/src/app/working-area/model/polygonIcon.ts b/src/app/working-area/model/polygonIcon.ts index 20a4a5d..1bf4f42 100644 --- a/src/app/working-area/model/polygonIcon.ts +++ b/src/app/working-area/model/polygonIcon.ts @@ -9,9 +9,9 @@ import { AxShape } from './axShape'; */ export class PolygonIcon extends AxShape { public pointsData: PIXI.Point[]; - public pointsGraphics: PIXI.Graphics[] = []; + public pointsGraphics: PIXI.Sprite[] = []; public polygonGraphics: PIXI.Graphics = new PIXI.Graphics(); - public polygonLineGraphics: PIXI.Graphics = new PIXI.Graphics(); + // public polygonLineGraphics: PIXI.Graphics = new PIXI.Graphics(); style = new PIXI.TextStyle({ fontFamily: 'Arial', fontSize: 18, @@ -46,13 +46,14 @@ export class PolygonIcon extends AxShape { this.sortableChildren = true; // 鐢荤偣 this.pointsData.forEach((item, index, array) => { - const iconPoint = new PIXI.Graphics(); - iconPoint.lineStyle(1, 0xFFBD01, 1); - iconPoint.beginFill(0xFFFFFF, 1); - iconPoint.drawCircle(0, 0, 15); + const iconPoint = PIXI.Sprite.from(this.pointTexture); + // iconPoint.lineStyle(1, 0xFFBD01, 1); + // iconPoint.beginFill(0xFFFFFF, 1); + // iconPoint.drawCircle(0, 0, 15); + iconPoint.anchor.set(0.5); iconPoint.x = item.x; iconPoint.y = item.y; - iconPoint.endFill(); + // iconPoint.endFill(); iconPoint.visible = false; this.pointsGraphics.push(iconPoint); this.addChild(iconPoint); @@ -66,13 +67,14 @@ export class PolygonIcon extends AxShape { this.polygonGraphics.endFill(); this.addChild(this.polygonGraphics); // 鐢诲杈瑰舰 - this.polygonLineGraphics.lineStyle(5, 0xFFBD01, 1); - this.polygonLineGraphics.drawPolygon(this.getPoints()); - this.polygonLineGraphics.closePath(); - this.addChild(this.polygonLineGraphics); + // this.polygonLineGraphics.lineStyle(5, 0xFFBD01, 1); + // this.polygonLineGraphics.drawPolygon(this.getPoints()); + // this.polygonLineGraphics.closePath(); + // this.addChild(this.polygonLineGraphics); this.text.anchor.set(0.5); this.text.position = this.calculatePolygonGravityCenter(this.pointsData); + this.text.visible = this.showName; // console.log(this.calculatePolygonGravityCenter(this.pointsData)); this.polygonGraphics.addChild(this.text); // 娣诲姞鍦嗙偣浜嬩欢 @@ -80,7 +82,7 @@ export class PolygonIcon extends AxShape { item.interactive = true; item.buttonMode = true; item.zIndex = 1; - item.on('mousedown', event => { + item.on('pointerdown', event => { event.stopPropagation(); if (this.workingArea.allowEdit && this.assetData.GameMode === this.workingArea.canvasData.gameMode) { event.currentTarget.data = event.data; @@ -88,21 +90,21 @@ export class PolygonIcon extends AxShape { event.currentTarget.dragging = true; } }) - .on('mouseup', event => { + .on('pointerup', event => { if (event.currentTarget.dragging) { event.currentTarget.alpha = 1; event.currentTarget.dragging = false; event.currentTarget.data = null; } }) - .on('mouseupoutside', event => { + .on('pointerupoutside', event => { if (event.currentTarget.dragging) { event.currentTarget.alpha = 1; event.currentTarget.dragging = false; event.currentTarget.data = null; } }) - .on('mousemove', event => { + .on('pointermove', event => { if (event.currentTarget.dragging) { const newPosition = event.currentTarget.data.getLocalPosition(event.currentTarget.parent); event.currentTarget.x = newPosition.x; @@ -116,13 +118,14 @@ export class PolygonIcon extends AxShape { this.polygonGraphics.beginFill(color, angle); this.polygonGraphics.drawPolygon(this.getPoints()); this.polygonGraphics.endFill(); - // 鐢诲杈瑰舰 - this.polygonLineGraphics.clear(); - this.polygonLineGraphics.lineStyle(5, 0xFFBD01, 1); - this.polygonLineGraphics.drawPolygon(this.getPoints()); - this.polygonLineGraphics.closePath(); + // // 鐢诲杈瑰舰 + // this.polygonLineGraphics.clear(); + // this.polygonLineGraphics.lineStyle(5, 0xFFBD01, 1); + // this.polygonLineGraphics.drawPolygon(this.getPoints()); + // this.polygonLineGraphics.closePath(); this.text.position = this.calculatePolygonGravityCenter(this.pointsData); + this.drawBorder(1 / this.workingArea.backgroundImage.scale.x); } }) .on('rightclick', event => { @@ -133,7 +136,7 @@ export class PolygonIcon extends AxShape { this.workingArea.previewImage.visible = false; } }) - .on('mouseout', event => { + .on('pointerout', event => { event.stopPropagation(); if (this.workingArea.previewImage !== null && this.workingArea.getPaintMode() === PaintMode.singlePointIcon) { @@ -141,64 +144,6 @@ export class PolygonIcon extends AxShape { } }); }); - // // 娣诲姞閫変腑浜嬩欢 - // this.polygonGraphics.interactive = true; - // this.polygonGraphics.buttonMode = true; - // this.polygonGraphics - // .on('mousedown', event => { - // event.stopPropagation(); - // this.workingArea.selection.selectOne(this); - // if (this.workingArea.allowEdit && this.assetData.GameMode === this.workingArea.canvasData.gameMode) { - // event.currentTarget.parent.data = event.data; - // event.currentTarget.parent.alpha = 0.5; - // event.currentTarget.parent.dragging = true; - - // event.currentTarget.parent.dragPoint = event.data.getLocalPosition(event.currentTarget.parent.parent); - // event.currentTarget.parent.dragPoint.x -= event.currentTarget.parent.x; - // event.currentTarget.parent.dragPoint.y -= event.currentTarget.parent.y; - // } - // }) - // .on('mouseup', event => { - // if (event.currentTarget.parent.dragging) { - // event.currentTarget.parent.alpha = 1; - // event.currentTarget.parent.dragging = false; - // event.currentTarget.parent.data = null; - // } - // }) - // .on('mouseupoutside', event => { - // if (event.currentTarget.parent.dragging) { - // event.currentTarget.parent.alpha = 1; - // event.currentTarget.parent.dragging = false; - // event.currentTarget.parent.data = null; - // } - // }) - // .on('mousemove', event => { - // if (event.currentTarget.parent.dragging) { - // const newPosition = event.currentTarget.parent.data.getLocalPosition(event.currentTarget.parent.parent); - // event.currentTarget.parent.x = newPosition.x - event.currentTarget.parent.dragPoint.x; - // event.currentTarget.parent.y = newPosition.y - event.currentTarget.parent.dragPoint.y; - - // this.assetData.Point = new PIXI.Point(this.x, this.y); - // this.workingArea.canvasData.isChange = true; - // } - // }) - // .on('rightclick', event => { - // // this.workingArea.selection.deselectAll(); - // }) - // .on('mouseover', event => { - // event.stopPropagation(); - // if (this.workingArea.previewImage !== null - // && this.workingArea.getPaintMode() === PaintMode.singlePointIcon) { - // this.workingArea.previewImage.visible = false; - // } - // }) - // .on('mouseout', event => { - // event.stopPropagation(); - // if (this.workingArea.previewImage !== null - // && this.workingArea.getPaintMode() === PaintMode.singlePointIcon) { - // this.workingArea.previewImage.visible = true; - // } - // }); } /** * 璁剧疆鐐规樉绀虹姸鎬 @@ -209,31 +154,14 @@ export class PolygonIcon extends AxShape { item.visible = value; }); } - - public calculatePolygonGravityCenter(points: PIXI.Point[]) { - let area = 0.0; // 澶氳竟褰㈤潰绉 - let gravityLat = 0.0; // 閲嶅績鐐 latitude - let gravityLng = 0.0; // 閲嶅績鐐 longitude - points.forEach((item, index) => { - // 1 - const lat = item.x; - const lng = item.y; - const nextLat = points[(index + 1) % points.length].x; - const nextLng = points[(index + 1) % points.length].y; - // 2 - const tempArea = (nextLat * lng - nextLng * lat) / 2.0; - // 3 - area += tempArea; - // 4 - gravityLat += tempArea * (lat + nextLat) / 3; - gravityLng += tempArea * (lng + nextLng) / 3; + // 璁剧疆缂╂斁 + public setItemScale(scale: number) { + this.text.scale.set(scale); + this.pointsGraphics.forEach(point => { + point.scale.set(scale); }); - // 5 - gravityLat = gravityLat / area; - gravityLng = gravityLng / area; - - return new PIXI.Point(gravityLat, gravityLng); } + /** * 鑾峰彇鐐归泦鍚 */ diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 0718adf..907ce3e 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, ElementRef, ViewChild, AfterViewInit, Input } from ' import * as PIXI from 'pixi.js'; import { EventEmitter } from 'events'; import { EventManager } from '@angular/platform-browser'; -import { OutlineFilter } from 'pixi-filters'; +// import { OutlineFilter } from 'pixi-filters'; import { AssetData, CanvasShareDataService, DisposalNodeData, FloorNodeData } from '../canvas-share-data.service'; import * as ObjectID from 'bson-objectid'; import { Charm } from './charm'; @@ -15,7 +15,8 @@ import { AxShape } from './model/axShape'; import { PropertyInfo } from './model/PropertyInfo'; import { AxPreviewImageShape } from './model/axPreviewImageShape'; import { AxArrowConnector } from './model/axArrowConnector'; -import { Legend } from './model/legend'; +import { AxLegend, Legend } from './model/axLegend'; +import { NullTemplateVisitor } from '@angular/compiler'; @Component({ @@ -97,7 +98,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV /** * 缁胯壊鎻忚竟 */ - public outlineFilterGreen = new OutlineFilter(2, 0x00ff00); + // public outlineFilterGreen = new OutlineFilter(2, 0x00ff00); /** * 鎷疯礉绱犳潗鏁版嵁 */ @@ -135,10 +136,18 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV public carData: Map = new Map(); // 褰撳墠閫夋嫨鐨勮溅杈唅d public selectCar: any = null; + // 鏈蒋浠剁増鏈彿鐢卞洓閮ㄥ垎缁勬垚锛<涓荤増鏈彿><娆$増鏈彿><淇鐗堟湰鍙><鏃ユ湡鍔犲笇鑵婂瓧姣嶇増鏈彿> 渚嬪锛1.0.0.20210105_beta + // Alpha鐗: 姝ょ増鏈〃绀鸿杞欢鍦ㄦ闃舵涓昏鏄互瀹炵幇杞欢鍔熻兘涓轰富锛岄氬父鍙湪杞欢寮鍙戣呭唴閮ㄤ氦娴侊紝涓鑸岃█锛岃鐗堟湰杞欢鐨凚ug杈冨锛岄渶瑕佺户缁慨鏀广 + // Beta鐗: 璇ョ増鏈浉瀵逛簬伪鐗堝凡鏈変簡寰堝ぇ鐨勬敼杩涳紝娑堥櫎浜嗕弗閲嶇殑閿欒锛屼絾杩樻槸瀛樺湪鐫涓浜涚己闄凤紝闇瑕佺粡杩囧娆℃祴璇曟潵杩涗竴姝ユ秷闄わ紝姝ょ増鏈富瑕佺殑淇敼瀵瑰儚鏄蒋浠剁殑UI銆 + // RC鐗: 璇ョ増鏈凡缁忕浉褰撴垚鐔熶簡锛屽熀鏈笂涓嶅瓨鍦ㄥ鑷撮敊璇殑BUG锛屼笌鍗冲皢鍙戣鐨勬寮忕増鐩稿樊鏃犲嚑銆 + // Release鐗: 璇ョ増鏈剰鍛斥滄渶缁堢増鏈濓紝鍦ㄥ墠闈㈢増鏈殑涓绯诲垪娴嬭瘯鐗堜箣鍚庯紝缁堝綊浼氭湁涓涓寮忕増鏈紝鏄渶缁堜氦浠樼敤鎴蜂娇鐢ㄧ殑涓涓増鏈傝鐗堟湰鏈夋椂涔熺О涓烘爣鍑嗙増銆備竴鑸儏鍐典笅锛孯elease涓嶄細浠ュ崟璇嶅舰寮忓嚭鐜板湪杞欢灏侀潰涓婏紝鍙栬屼唬涔嬬殑鏄鍙仿 + public VERSION = '1.0.0.20210107_beta'; /** * 鏁版嵁鍒濆鍖 */ ngOnInit(): void { + PIXI.utils.skipHello() + this.sayHello(); this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => { if (event.keyCode === 17) { this.selection.isMultiselection = true; @@ -152,40 +161,51 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV } // 鎸塂el閿垹闄ら変腑鐨勫浘鏍 if (event.keyCode === 46) { - this.selection.objects.forEach(item => { - if (this.allowEdit - && this.canvasData.gameMode === item.assetData.GameMode) { - switch (this.canvasData.gameMode) { - case 0: - // 鍒犻櫎妤煎眰鏁版嵁 - delete this.canvasData.originaleveryStoreyData.data[item.assetData.Id]; - // 鍒犻櫎寤虹瓚鏁版嵁 - delete this.canvasData.originalcompanyBuildingData.data[item.assetData.Id]; - // 鍙栨秷娓叉煋 - this.backgroundImage.removeChild(this.backgroundImage.getChildByName(item.assetData.Id)); - // 鏁版嵁鏇存敼 - this.canvasData.isChange = true; - break; - case 1: - delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[item.assetData.Id]; - delete this.canvasData.selectPanelPoint.Data.Increment[item.assetData.Id]; - delete this.canvasData.selectPanelPoint.Data.Stock[item.assetData.Id]; - this.backgroundImage.removeChild(this.backgroundImage.getChildByName(item.assetData.Id)); - this.canvasData.isChange = true; - break; - } - } - }); - this.selection.deselectAll(); - this.emit('deleteIcon'); + this.deleteSelectedShape(); } }); } + /** + * 鍒犻櫎閫変腑鐨勫浘鏍 + */ + public deleteSelectedShape() { + this.selection.objects.forEach(item => { + this.deleteShape(item); + }); + this.selection.deselectAll(); + } + /** + * + * @param obj 鍒犻櫎涓涓舰鐘 + */ + public deleteShape(shape) { + if (this.allowEdit && this.canvasData.gameMode === shape.assetData.GameMode) { + this.emit('deleteIcon',shape); + } + } + /** + * 鎵撴嫑鍛 + */ + sayHello() { + var _a; + if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) { + var args = [ + "\n %c 鐗堟湰鍙 - " + this.VERSION + "\n", + 'color: #ff66a5; background: #000000; padding:5px 0;', + ]; + (_a = window.console).log.apply(_a, args); + } + else if (window.console) { + window.console.log("\n %c 鐗堟湰鍙 - " + this.VERSION + "\n"); + } +} /** * 椤甸潰鍒濆鍖 */ ngAfterViewInit(): void { - this.createCanvas(); + setTimeout(() => { + this.createCanvas(); + }); window.onresize = () => { this.resetCanvas(); }; @@ -203,7 +223,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV if (this.backgroundImage.scale.x >= 32) { this.backgroundImage.scale.x = 32; this.backgroundImage.scale.y = 32; - this.emit('backgroundScale', this.backgroundImage.scale.x); + this.resizeItem(1/this.backgroundImage.scale.x) return; } this.backgroundImage.pivot.set(pivot.x, pivot.y); @@ -217,7 +237,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV if (this.backgroundImage.scale.x <= 0.1) { this.backgroundImage.scale.x = 0.1; this.backgroundImage.scale.y = 0.1; - this.emit('backgroundScale', this.backgroundImage.scale.x); + this.resizeItem(1/this.backgroundImage.scale.x) return; } this.backgroundImage.pivot.set(pivot.x, pivot.y); @@ -228,7 +248,16 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.backgroundImage.position.x += delX; this.backgroundImage.position.y += delY; } - this.emit('backgroundScale', this.backgroundImage.scale.x); + this.resizeItem(1/this.backgroundImage.scale.x) + } + // 閲嶇疆鍥惧舰缂╂斁 + public resizeItem(size:number) { + this.backgroundImage.children.forEach(item => { + if (item instanceof AxShape) { + item.setItemScale(size); + item.drawBorder(size); + } + }); } /** * @@ -268,19 +297,21 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV backgroundColor: 0xE9FAFF }); this.content.nativeElement.appendChild(this.app.view); + this.app.view.style.border = '1px dashed blue'; this.animator = new Charm(PIXI); - + this.createBackgroundImage(); this.app.ticker.add((delta) => { this.animator.update(); this.mousePosition = this.app.renderer.plugins.interaction.mouse.global; // 棰勮鍥剧墖 - if (this.previewImage !== null) { + if (this.previewImage !== undefined && this.previewImage !== null) { this.previewImage.position = this.backgroundImage.toLocal(this.mousePosition); } - if (this.backgroundImage !== null) { + if (this.circleShadow !== undefined && this.circleShadow !== null) { this.circleShadow.position = this.backgroundImage.toLocal(this.mousePosition); this.refreshPreviewLineSegment(this.currentClickPoint.position, this.circleShadow.position); + this.refreshPreviewPoint(); } /** * 鏄剧ず妗嗛 @@ -308,101 +339,87 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV /** * 閫変腑浜嬩欢 */ - this.on('select', obj => { - if (this.allowEdit) { - if (obj instanceof AxArrowConnector) { - obj.setPointsVisible(true); - } - else if (obj instanceof MultipointIcon) { - if (obj.assetData.GameMode === this.canvasData.gameMode) { - obj.setPointVisiable(true); - } else { - obj.filters = [this.outlineFilterGreen]; - } - } else if (obj instanceof PolygonIcon) { - if (obj.assetData.GameMode === this.canvasData.gameMode) { - obj.setPointVisiable(true); - } else { - obj.filters = [this.outlineFilterGreen]; - } - } else { - obj.filters = [this.outlineFilterGreen]; - } - } else { - obj.filters = [this.outlineFilterGreen]; - } + this.on('select', (axShape:AxShape)=> { + axShape.showBorder(); + axShape.setPointVisiable(this.allowEdit); }); /** * 鍙栨秷閫変腑浜嬩欢 */ - this.on('deselect', obj => { - if (this.allowEdit) { - if (obj instanceof AxArrowConnector) { - obj.setPointsVisible(false); - } - else if (obj instanceof MultipointIcon) { - obj.setPointVisiable(false); - } else if (obj instanceof PolygonIcon) { - obj.filters = []; - obj.setPointVisiable(false); - } else { - obj.filters = []; - } - } else { - obj.filters = []; - } - }); - /** - * 鏍规嵁鑳屾櫙缂╂斁浜嬩欢 - */ - this.on('backgroundScale', scale => { - this.backgroundImage?.children.forEach(item => { - if (item instanceof AxImageShape) { - if (item.assetData.FixedSize) { - const data = 1 / scale; - item.scale.set(data); - } else { - const data = 1 / scale; - item.text.scale.set(data); - } - } else if (item instanceof MultipointIcon) { - const data = 1 / scale; - item.text.scale.set(data); - } else if (item instanceof PolygonIcon) { - const data = 1 / scale; - item.text.scale.set(data); - item.pointsGraphics.forEach(point => { - point.scale.set(data); - }); - } else if (item instanceof AxPreviewImageShape) { - const data = 1 / scale; - item.scale.set(data); - }else if (item instanceof AxArrowConnector) { - const data = 1 / scale; - item.text.scale.set(data); - item.pointSprites.forEach(point => { - point.scale.set(data); - }); - } - }); - + this.on('deselect', (axShape:AxShape)=> { + axShape.hideBorder(); + axShape.setPointVisiable(false); }); /** - * 鍒涘缓鍥炬爣浜嬩欢 + * 鍒涘缓鍥炬爣浜嬩欢锛堟暟鎹鐞嗭級 */ - this.on('createIcon', obj => { - if (obj.assetData.GameMode === GameMode.BasicInformation) { + this.on('createIcon', (axShape:AxShape)=> { + if (axShape.assetData.GameMode === GameMode.BasicInformation) { // 鍩烘湰淇℃伅 // 娣诲姞妤煎眰鏁版嵁 - this.canvasData.originaleveryStoreyData.data[obj.assetData.Id] = obj.assetData; + this.canvasData.originaleveryStoreyData.data[axShape.assetData.Id] = axShape.assetData; // 娣诲姞寤虹瓚鏁版嵁 - this.canvasData.originalcompanyBuildingData.data[obj.assetData.Id] = obj.assetData; - } else { + this.canvasData.originalcompanyBuildingData.data[axShape.assetData.Id] = axShape.assetData; + } else if (axShape.assetData.GameMode === GameMode.Assignment) { // 澶勭疆棰勬 if (this.canvasData.selectPanelPoint.Data === undefined - || this.canvasData.selectPanelPoint.Data === null) { + || this.canvasData.selectPanelPoint.Data === null) { this.canvasData.selectPanelPoint.Data = new FloorNodeData(); } - this.canvasData.selectPanelPoint.Data.Stock[obj.assetData.Id] = obj.assetData; + this.canvasData.selectPanelPoint.Data.Stock[axShape.assetData.Id] = axShape.assetData; + } + // else if (obj.assetData.GameMode === GameMode.Examinee) { // 鑰冪敓鑰冭瘯 + // if (obj.assetData.Tag === 1) { + // this.canvasData.examOriginaleveryStoreyData.data[obj.assetData.Id] = obj.assetData; + // } else { + // if (this.canvasData.selectPanelPoint.Data === undefined + // || this.canvasData.selectPanelPoint.Data === null) { + // this.canvasData.selectPanelPoint.Data = new FloorNodeData(); + // } + // this.canvasData.selectPanelPoint.Data.Stock[obj.assetData.Id] = obj.assetData; + // } + // } + var temp = this.backgroundImage.getChildByName("鍥句緥") as AxLegend; + if ( temp !== undefined + && temp !== null) { + var itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1); + temp.addItem(itemLegend); + } + this.canvasData.isChange = true; + }); + /** + * 鍒犻櫎鍥炬爣浜嬩欢(鏁版嵁澶勭悊) + */ + this.on('deleteIcon', (axShape:AxShape)=>{ + // 鍒犻櫎鍥句緥瀵硅薄 + var temp = this.backgroundImage.getChildByName("鍥句緥") as AxLegend; + if ( temp !== undefined + && temp !== null) { + var itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1); + temp.deleteItem(itemLegend); } + + + if (axShape.assetData.GameMode === GameMode.BasicInformation) { // 鍩烘湰淇℃伅 + // 鍒犻櫎妤煎眰鏁版嵁 + delete this.canvasData.originaleveryStoreyData.data[axShape.assetData.Id]; + // 鍒犻櫎寤虹瓚鏁版嵁 + delete this.canvasData.originalcompanyBuildingData.data[axShape.assetData.Id]; + } else if (axShape.assetData.GameMode === GameMode.Assignment) { // 澶勭疆棰勬 + delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[axShape.assetData.Id]; + delete this.canvasData.selectPanelPoint.Data.Increment[axShape.assetData.Id]; + delete this.canvasData.selectPanelPoint.Data.Stock[axShape.assetData.Id]; + } + // else if (assetData.GameMode === GameMode.Examinee) { // 鑰冪敓鑰冭瘯 + // if (assetData.Tag === 1) { + // // 鍒犻櫎妤煎眰鏁版嵁 + // delete this.canvasData.examOriginaleveryStoreyData.data[assetData.Id]; + // } else { + // delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[assetData.Id]; + // delete this.canvasData.selectPanelPoint.Data.Increment[assetData.Id]; + // delete this.canvasData.selectPanelPoint.Data.Stock[assetData.Id]; + // } + + // } + this.backgroundImage.removeChild(axShape); this.canvasData.isChange = true; }); } @@ -474,29 +491,22 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.selection.select(obj); }); } - /** - * 鍒锋柊宸ヤ綔鍖 - */ - public async refresh() { - this.setPaintMode(PaintMode.endPaint); - this.resetCanvas(); - this.destroyBackgroundImage(); - if (!this.canvasData.selectStorey.imageUrl) { - return; - } - - await this.createBackgroundImage(this.canvasData.selectStorey.imageUrl); - this.createFloorShape(); - if (this.canvasData.gameMode === GameMode.Assignment) { - this.createWorkNode(); - } - this.emit('backgroundScale', this.backgroundImage.scale.x); - } + // /** + // * 鍒涘缓鑳屾櫙鍥 + // */ + // public createBackground(imageUrl:string,imageAngle:number) { + // if (this.backgroundImage !== null) { + // this.backgroundImage.destroy(); + // this.backgroundImage = null; + // } + // this.createBackgroundImage() + // this.refreshBackgroundImage(imageUrl,imageAngle); + // } /** * 鍒涘缓妤煎眰鍥惧舰 */ - private createFloorShape() { - const floorData = this.canvasData.originaleveryStoreyData.data; + public createFloorShape(floorData: any) { + if (floorData === undefined || floorData === null) return; Object.keys(floorData).forEach((key) => { switch (floorData[key].InteractiveMode) { case 0: @@ -511,22 +521,24 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV break; case 3: if (floorData[key].Name === '姘村甫') { - const distance = new AxArrowConnector(floorData[key], this,false,true); + const distance = new AxArrowConnector(floorData[key], this, false, true); } else if(floorData[key].Name === '璺濈'){ - const distance = new AxArrowConnector(floorData[key], this,true,true); + const distance = new AxArrowConnector(floorData[key], this, true, true); }else if(floorData[key].Name === '鏅氬' || floorData[key].Name === '鎵块噸澧'){ - const wall = new AxArrowConnector(floorData[key], this,false,false); + const wall = new AxArrowConnector(floorData[key], this, false, false); } break; } }); + // this.emit('backgroundScale', this.backgroundImage.scale.x); } - - private createWorkNode() { - // 鍔犺浇澶勭疆鑺傜偣鏁版嵁 - const nodeData = this.canvasData.selectPanelPoint.Data; + /** + * 鍒涘缓鑺傜偣鍥惧舰 + */ + public createNodeShape(nodeData: any) { if (nodeData !== undefined && nodeData !== null) { Object.keys(nodeData).forEach((key) => { + if (nodeData[key] === undefined || nodeData[key] === null) { return;} Object.keys(nodeData[key]).forEach((tempKey) => { switch (nodeData[key][tempKey].InteractiveMode) { case 0: @@ -546,55 +558,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV }); }); } + // this.emit('backgroundScale', this.backgroundImage.scale.x); } - /** - * - * @param id 鍥炬爣ID - * @param b 鏄剧ず/闅愯棌 - */ - public setIconVisible(ids: string[], b: boolean) { - ids.forEach(item => { - this.backgroundImage.getChildByName(item).visible = b; - }); - } - // /** - // * 鐗堟湰妫鏌 - // */ - // public versionChecking(): void { - // const floorData = this.canvasData.originaleveryStoreyData; - // const buildingData = this.canvasData.originalcompanyBuildingData; - // const nodeData = this.canvasData.selectPanelPoint; - // if (floorData.version && floorData.version === '1.0') { - // floorData.version = '2.0'; - // Object.keys(floorData.data).forEach(item => { - // floorData.data[item].Point.y *= -1; - // floorData.data[item].MultiPoint?.forEach(element => { - // element.y *= -1; - // }); - // }); - // } - // if (buildingData.version && buildingData.version === '1.0') { - // buildingData.version = '2.0'; - // Object.keys(buildingData.data).forEach(item => { - // buildingData.data[item].Point.y *= -1; - // buildingData.data[item].MultiPoint?.forEach(element => { - // element.y *= -1; - // }); - // }); - // } - // if (nodeData.Version && nodeData.Version === '1.0') { - // nodeData.Version = '2.0'; - // console.log(this.canvasData.selectPanelPoint.Version); - // Object.keys(nodeData.Data).forEach((key) => { - // Object.keys(nodeData.Data[key]).forEach((tempKey) => { - // nodeData.Data[key][tempKey].Point.y *= -1; - // nodeData.Data[key][tempKey].MultiPoint?.forEach(element => { - // element.y *= -1; - // }); - // }); - // }); - // } - // } /** * 鍒涘缓纭缁樺埗缁撴潫鎸夐挳 */ @@ -606,7 +571,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.enterPaintEndButton.interactive = true; this.enterPaintEndButton.buttonMode = true; this.enterPaintEndButton - .on('mousedown', event => { + .on('pointerdown', event => { event.stopPropagation(); this.enterPaint(); }); @@ -617,33 +582,31 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV /** * 鍒涘缓鑳屾櫙鍥 */ - private async createBackgroundImage(imageUrl: string): Promise { - const image = await PIXI.Texture.fromURL(imageUrl); - this.backgroundImage = new PIXI.Sprite(image); + public createBackgroundImage(){ + this.backgroundImage = PIXI.Sprite.from('assets/images/noImg.png') this.backgroundImage.anchor.set(0.5); - this.backgroundImage.x = this.app.view.width / 2; - this.backgroundImage.y = this.app.view.height / 2; + // this.backgroundImage.x = this.app.view.width / 2; + // this.backgroundImage.y = this.app.view.height / 2; this.backgroundImage.interactive = true; this.backgroundImage.name = 'background'; - this.backgroundImage.angle = this.canvasData.selectStorey.imageAngle; - // const left = this.init.element.nativeElement.querySelector('.functionalDomainLeft').clientWidth; - // const right = this.init.element.nativeElement.querySelector('.functionalDomainRight').clientWidth; - const imageWidth = this.backgroundImage.texture.width; - const imageHeight = this.backgroundImage.texture.height; - const appWidth = this.app.view.width - 470; - const appHeight = this.app.view.height; + // this.backgroundImage.angle = this.canvasData.selectStorey.imageAngle; + // const imageWidth = 665; + // const imageHeight = 530; + // const appWidth = this.app.view.width - 470; + // const appHeight = this.app.view.height; - const wScale = appWidth / imageWidth; - const hScale = appHeight / imageHeight; + // const wScale = appWidth / imageWidth; + // const hScale = appHeight / imageHeight; - const scale = wScale < hScale - ? wScale - : hScale; - this.backgroundImage.scale.set(scale); + // const scale = wScale < hScale + // ? wScale + // : hScale; + // this.backgroundImage.scale.set(scale); this.backgroundImage.sortableChildren = true; this.backgroundImage - .on('mousedown', event => { + .on('pointerdown', event => { if (!event.currentTarget.dragging && this.selection.isMultiselection === false) { + this.selection.deselectAll(); event.currentTarget.data = event.data; event.currentTarget.dragging = true; event.currentTarget.dragPoint = event.data.getLocalPosition(event.currentTarget.parent); @@ -651,7 +614,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV event.currentTarget.dragPoint.y -= event.currentTarget.y; switch (this.paintMode) { case PaintMode.endPaint: - console.log(this.backgroundImage.toLocal(this.mousePosition)); break; case PaintMode.singlePointIcon: const json = JSON.parse(JSON.stringify(this.canvasData.selectTemplateData.propertyInfos)); @@ -685,11 +647,12 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV DrawMode : this.canvasData.selectTemplateData.drawMode, Thickness : this.canvasData.selectTemplateData.thickness, IsFromBuilding : this.canvasData.selectTemplateData.isFromBuilding, - GameMode : this.canvasData.gameMode + GameMode: this.canvasData.gameMode, + Tag: this.canvasData.selectTemplateData.tag }; const singleIcon = new AxImageShape(assetData, this); this.emit('createIcon', singleIcon); - this.emit('backgroundScale', this.backgroundImage.scale.x); + // this.emit('backgroundScale', this.backgroundImage.scale.x); break; case PaintMode.lineIcon: this.previewLineSegment.visible = true; @@ -732,7 +695,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV DrawMode: this.canvasData.selectTemplateData.drawMode, Thickness: this.canvasData.selectTemplateData.thickness, IsFromBuilding: this.canvasData.selectTemplateData.isFromBuilding, - GameMode: this.canvasData.gameMode + GameMode: this.canvasData.gameMode, + Tag: this.canvasData.selectTemplateData.tag }; // const assetData1 = { // ImageUrl: this.canvasData.selectTemplateData.imageUrl, @@ -745,7 +709,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.paintingIcon = new MultipointIcon(assetData1, this); // this.paintingIcon = new MultipointIcon(this.previewSinglePointIcon.texture, new PIXI.Point(0, 0), this.paintPoints, this, // this.canvasData.selectTemplateData.name); - this.emit('backgroundScale', this.backgroundImage.scale.x); + // this.emit('backgroundScale', this.backgroundImage.scale.x); break; case PaintMode.polygonIcon: this.previewLineSegment.visible = true; @@ -817,7 +781,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV DrawMode: this.canvasData.selectTemplateData.drawMode, Thickness: this.canvasData.selectTemplateData.thickness, IsFromBuilding: this.canvasData.selectTemplateData.isFromBuilding, - GameMode: this.canvasData.gameMode + GameMode: this.canvasData.gameMode, + Tag: this.canvasData.selectTemplateData.tag }; if (this.canvasData.selectTemplateData.name === '璺濈') { this.paintingShape = new AxArrowConnector(assetData2, this,true,true); @@ -829,7 +794,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.paintingShape.redraw(); } } - this.emit('backgroundScale', this.backgroundImage.scale.x); + // this.emit('backgroundScale', this.backgroundImage.scale.x); break; } } else if (!event.currentTarget.dragging && this.selection.isMultiselection === true) { @@ -839,7 +804,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.finalScreenMousePos = this.backgroundImage.toLocal(this.mousePosition); } }) - .on('mouseup', event => { + .on('pointerup', event => { if (event.currentTarget.dragging) { event.currentTarget.dragging = false; event.currentTarget.data = null; @@ -862,13 +827,13 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.rectToolGraphics.visible = false; } }) - .on('mouseupoutside', event => { + .on('pointerupoutside', event => { if (event.currentTarget.dragging) { event.currentTarget.dragging = false; event.currentTarget.data = null; } }) - .on('mousemove', event => { + .on('pointermove', event => { if (event.currentTarget.dragging && this.selection.isMultiselection === false) { const newPosition = event.currentTarget.data.getLocalPosition(event.currentTarget.parent); event.currentTarget.x = newPosition.x - event.currentTarget.dragPoint.x; @@ -921,37 +886,123 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV /** * 鍒锋柊鑳屾櫙鍥 */ - public refreshBackgroundImage(): void { - if (!this.canvasData.selectStorey.imageUrl) { + public async refreshBackgroundImage(imageUrl:string = this.canvasData.selectStorey.imageUrl,imageAngle:number = this.canvasData.selectStorey.imageAngle): Promise { + if (!imageUrl) { this.backgroundImage.visible = false; } else { - // this.backgroundImage.texture = PIXI.Texture.from(this.canvasData.selectStorey.imageUrl); - // this.backgroundImage.angle = this.canvasData.selectStorey.imageAngle; - // this.backgroundImage.visible = true; - this.refresh(); + this.backgroundImage.visible = false; + this.backgroundImage.scale.set(1); + this.backgroundImage.pivot.set(0); + this.backgroundImage.x = this.app.view.width / 2; + this.backgroundImage.y = this.app.view.height / 2; + this.backgroundImage.texture = await PIXI.Texture.fromURL(imageUrl); + this.backgroundImage.angle = imageAngle; + // 绛夊緟鍥剧墖鍔犺浇瀹屾垚 + let imageWidth = this.backgroundImage.texture.width; + let imageHeight = this.backgroundImage.texture.height; + let appWidth = this.app.view.width - 470; + let appHeight = this.app.view.height; + let wScale = appWidth / imageWidth; + let hScale = appHeight / imageHeight; + let scale = wScale < hScale ? wScale : hScale; + // 璁剧疆鍥剧墖缂╂斁 + this.backgroundImage.scale.set(scale); } } /** - * 娓呯┖鐢诲竷 + * 鍒锋柊 + * @param imageUrl + * @param imageAngle */ - public destroyBackgroundImage(): void { - this.app.stage.removeChild(this.backgroundImage); + public async refresh(imageUrl: string = this.canvasData.selectStorey.imageUrl, imageAngle: number = this.canvasData.selectStorey.imageAngle): Promise { + this.backgroundImage.visible = false; + this.backgroundImage.scale.set(1); + this.backgroundImage.pivot.set(0); + this.backgroundImage.x = this.app.view.width / 2; + this.backgroundImage.y = this.app.view.height / 2; + this.backgroundImage.texture = await PIXI.Texture.fromURL(imageUrl); + this.backgroundImage.angle = imageAngle; + // 绛夊緟鍥剧墖鍔犺浇瀹屾垚 + let imageWidth = this.backgroundImage.texture.width; + let imageHeight = this.backgroundImage.texture.height; + let appWidth = this.app.view.width - 470; + let appHeight = this.app.view.height; + let wScale = appWidth / imageWidth; + let hScale = appHeight / imageHeight; + let scale = wScale < hScale ? wScale : hScale; + // 璁剧疆鍥剧墖缂╂斁 + this.backgroundImage.scale.set(scale); + // 娓呯┖鎵鏈夊浘褰 + this.selection.deselectAll(); + let itemList = []; + this.backgroundImage.children.forEach(item => { + if (item instanceof AxShape && item instanceof AxPreviewImageShape===false) { + itemList.push(item.name); + } + }); + + itemList.forEach(item => { + this.backgroundImage.getChildByName(item).destroy(); + // let child = this.backgroundImage.getChildByName(item); + // this.backgroundImage.removeChild(child); + }) + //鍔犺浇褰撳墠鏁版嵁 + this.createFloorShape(this.canvasData.originaleveryStoreyData.data); + // 鍒涘缓澶勭疆棰勬鍥惧舰 + this.createNodeShape(this.canvasData.selectPanelPoint.Data); + this.createAxLegend(); + this.backgroundImage.visible = true; } /** - * 璁剧疆鑳屾櫙鍥剧缉鏀 - * @param scale 缂╂斁绯绘暟 + * 鍒涘缓瀹変俊鍥句緥 */ - public setBackgroundScale(scale: number): void { - this.backgroundImage?.scale.set(scale); - this.emit('backgroundScale', this.backgroundImage?.scale.x); + public createAxLegend() { + const tempAssetData = { + Id: "鍥句緥",//ObjectID.default.generate() + Color: "#066EED80", + PropertyInfos:[] + }; + let shapeMap: Map = new Map(); + + for (let item in this.canvasData.originaleveryStoreyData.data) { + if (shapeMap.has(this.canvasData.originaleveryStoreyData.data[item].Name)) { + shapeMap.get(this.canvasData.originaleveryStoreyData.data[item].Name).Count++; + } else { + shapeMap.set(this.canvasData.originaleveryStoreyData.data[item].Name, new Legend( + this.canvasData.originaleveryStoreyData.data[item].Name, + this.canvasData.originaleveryStoreyData.data[item].ImageUrl, + 1 + )); + } + } + var axLegend = new AxLegend(tempAssetData, this, shapeMap); + var rect = this.backgroundImage.getLocalBounds(); + var itemRect = axLegend.getLocalBounds(); + axLegend.x = rect.right - itemRect.right; + axLegend.y = rect.bottom - itemRect.bottom; } + // /** + // * 娓呯┖鐢诲竷 + // */ + // public destroyBackgroundImage(): void { + // this.app.stage.removeChild(this.backgroundImage); + // this.backgroundImage = null; + // } /** - * 璁剧疆鑳屾櫙鍥捐搴 - * @param imageAngle 瑙掑害鍊 - */ - public setBackgroundAngle(imageAngle: number) { - this.backgroundImage.angle = imageAngle; - } + // // * 璁剧疆鑳屾櫙鍥剧缉鏀 + // // * @param scale 缂╂斁绯绘暟 + // // */ + // public setBackgroundScale(scale: number): void { + // this.backgroundImage?.scale.set(scale); + // this.emit('backgroundScale', this.backgroundImage?.scale.x); + // } + // /** + // * 璁剧疆鑳屾櫙鍥捐搴 + // * @param imageAngle 瑙掑害鍊 + // */ + // public setBackgroundAngle(imageAngle: number) { + // this.backgroundImage.angle = imageAngle; + // } /** * 鍒涘缓棰勮鍗曠偣鍥炬爣 */ @@ -986,7 +1037,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV */ private refreshPreviewLineSegment(pointA: PIXI.Point, pointB: PIXI.Point) { this.previewLineSegment.clear(); - this.previewLineSegment.lineStyle(5, 0x00ff00, 1); + this.previewLineSegment.lineStyle(1/this.backgroundImage.scale.x, 0x00ff00, 1); this.previewLineSegment.moveTo(pointA.x, pointA.y); this.previewLineSegment.lineTo(pointB.x, pointB.y ); } @@ -995,12 +1046,21 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * @param x 鍗婂緞 */ private createCircleShadow(): void { - this.circleShadow.beginFill(0xFFCC5A); - this.circleShadow.drawCircle(0, 0, 10); - this.circleShadow.endFill(); + // this.circleShadow.beginFill(0xFFCC5A); + // this.circleShadow.drawCircle(0, 0, 10); + // this.circleShadow.endFill(); this.circleShadow.visible = false; this.backgroundImage.addChild(this.circleShadow); } + /** + * 鍒锋柊棰勮鐐 + */ + private refreshPreviewPoint() { + this.circleShadow.clear(); + this.circleShadow.beginFill(0x00ff00); + this.circleShadow.drawCircle(0, 0, 5/this.backgroundImage.scale.x); + this.circleShadow.endFill(); + } showConnectionPoint(b: boolean) { this.backgroundImage?.children.forEach(item => { if (item instanceof AxImageShape) { @@ -1014,6 +1074,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * 寮濮嬬粯鍒 */ public beginPaint() { + console.log(this.canvasData.selectTemplateData); this.selection.deselectAll(); this.setPaintMode(PaintMode.endPaint); this.setPaintMode(this.canvasData.selectTemplateData.interactiveMode); @@ -1170,7 +1231,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV break; } this.paintPoints.splice(0, this.paintPoints.length); - this.emit('backgroundScale', this.backgroundImage.scale.x); + // this.emit('backgroundScale', this.backgroundImage.scale.x); } /** * 澶嶅埗 @@ -1219,9 +1280,111 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV } this.selection.select(this.backgroundImage.getChildByName(newData.Id)); }); - this.emit('backgroundScale', this.backgroundImage.scale.x); + // this.emit('backgroundScale', this.backgroundImage.scale.x); } + ////////////////////////////////////////////////////////////////////////閫氱敤///////////////////////////////////////////////////////////////////////////// + /** + * + * @param id 鍥炬爣ID + * @param b 鏄剧ず/闅愯棌 + */ + public setIconVisible(ids: string[], b: boolean) { + ids.forEach(item => { + this.backgroundImage.getChildByName(item).visible = b; + }); + } + ////////////////////////////////////////////////////////////////////////閲囬泦骞冲彴鍔犺浇閫昏緫/////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////缂栧埗骞冲彴鍔犺浇閫昏緫/////////////////////////////////////////////////////////////////////// + + ////////////////////////////////////////////////////////////////////////鑰冭瘯绯荤粺鍔犺浇閫昏緫/////////////////////////////////////////////////////////////////////// + /** + * 鑰冪敓鐐瑰嚮妤煎眰 + */ + public async onExamineeClickFloor() { + // this.backgroundImage.visible = false; + // this.backgroundImage.scale.set(1); + // this.backgroundImage.pivot.set(0); + // this.backgroundImage.x = this.app.view.width / 2; + // this.backgroundImage.y = this.app.view.height / 2; + // this.backgroundImage.texture = await PIXI.Texture.fromURL(imageUrl); + // this.backgroundImage.angle = imageAngle; + // // 绛夊緟鍥剧墖鍔犺浇瀹屾垚 + // let imageWidth = this.backgroundImage.texture.width; + // let imageHeight = this.backgroundImage.texture.height; + // let appWidth = this.app.view.width - 470; + // let appHeight = this.app.view.height; + // let wScale = appWidth / imageWidth; + // let hScale = appHeight / imageHeight; + // let scale = wScale < hScale ? wScale : hScale; + // // 璁剧疆鍥剧墖缂╂斁 + // this.backgroundImage.scale.set(scale); + // // 娓呯┖鎵鏈夊浘褰 + // this.selection.deselectAll(); + // let itemList = []; + // this.backgroundImage.children.forEach(item => { + // if (item instanceof AxShape && item instanceof AxPreviewImageShape===false) { + // itemList.push(item.name); + // } + // }); + + // itemList.forEach(item => { + // this.backgroundImage.getChildByName(item).destroy(); + // }) + // // 鍒涘缓妤煎眰鍥惧舰 + // this.createFloorShape(this.canvasData.examOriginaleveryStoreyData.data); + // // 鍒涘缓妤煎眰鍥惧舰 + // this.createFloorShape(this.canvasData.originaleveryStoreyData.data); + // // 鍒涘缓澶勭疆棰勬鍥惧舰 + // this.createNodeShape(this.canvasData.selectPanelPoint.Data); + // // 闅愯棌鍥炬爣 + // this.setIconVisible(this.canvasData.hiddenBasicInfoFacilities, false); + // this.backgroundImage.visible = true; + } + + /** + * 鑰冨畼鐐瑰嚮妤煎眰 + */ + public async onExaminerClickFloor() { + // this.backgroundImage.visible = false; + // this.backgroundImage.scale.set(1); + // this.backgroundImage.pivot.set(0); + // this.backgroundImage.x = this.app.view.width / 2; + // this.backgroundImage.y = this.app.view.height / 2; + // this.backgroundImage.texture = await PIXI.Texture.fromURL(imageUrl); + // this.backgroundImage.angle = imageAngle; + // // 绛夊緟鍥剧墖鍔犺浇瀹屾垚 + // let imageWidth = this.backgroundImage.texture.width; + // let imageHeight = this.backgroundImage.texture.height; + // let appWidth = this.app.view.width - 470; + // let appHeight = this.app.view.height; + // let wScale = appWidth / imageWidth; + // let hScale = appHeight / imageHeight; + // let scale = wScale < hScale ? wScale : hScale; + // // 璁剧疆鍥剧墖缂╂斁 + // this.backgroundImage.scale.set(scale); + // // 娓呯┖鎵鏈夊浘褰 + // this.selection.deselectAll(); + // let itemList = []; + // this.backgroundImage.children.forEach(item => { + // if (item instanceof AxShape && item instanceof AxPreviewImageShape===false) { + // itemList.push(item.name); + // } + // }); + + // itemList.forEach(item => { + // this.backgroundImage.getChildByName(item).destroy(); + // }) + // // 鍒涘缓妤煎眰鍥惧舰 + // this.createFloorShape(this.canvasData.examOriginaleveryStoreyData.data); + // // 鍒涘缓妤煎眰鍥惧舰 + // this.createFloorShape(this.canvasData.originaleveryStoreyData.data); + // // 鍒涘缓澶勭疆棰勬鍥惧舰 + // this.createNodeShape(this.canvasData.selectPanelPoint.Data); + // // 闅愯棌鍥炬爣 + // this.setIconVisible(this.canvasData.hiddenBasicInfoFacilities, false); + // this.backgroundImage.visible = true; + } } /** From 599bea074e3769c65284688654fab03a826ad17b Mon Sep 17 00:00:00 2001 From: chenjingyu Date: Fri, 8 Jan 2021 09:54:54 +0800 Subject: [PATCH 02/13] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E5=90=84=E7=BA=A7?= =?UTF-8?q?=E9=A2=84=E6=A1=88=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../onetwo-entry-plan.component.html | 48 +++++++++--------- .../onetwo-entry-plan.component.ts | 49 ++++++++++++------- .../plan-management/type-plan/newunit.html | 9 +++- .../plan-management/type-plan/newunit.scss | 21 +++++++- .../type-plan/type-plan.component.html | 1 + .../type-plan/type-plan.component.ts | 9 +++- 6 files changed, 91 insertions(+), 46 deletions(-) diff --git a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html index c05a228..ca64906 100644 --- a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html +++ b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html @@ -4,11 +4,11 @@ * @Author: sueRimn * @Date: 2020-12-24 14:15:10 * @LastEditors: sueRimn - * @LastEditTime: 2021-01-06 10:37:08 + * @LastEditTime: 2021-01-08 09:47:51 -->
-
+
@@ -19,35 +19,32 @@
-
- - - - 鈪犵骇 - 鈪$骇 - - -
+
- +
- + 馃爦 - +
- - + + + 鍗$墖棰勬 + 浜岀淮棰勬 + 涓夌淮棰勬 + 鍏朵粬棰勬 +
@@ -86,12 +83,13 @@
+
- + @@ -99,33 +97,35 @@ - + - + - + - + - + - + - diff --git a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts index 77b6370..34e21aa 100644 --- a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts +++ b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-24 14:15:10 * @LastEditors: sueRimn - * @LastEditTime: 2021-01-06 10:39:07 + * @LastEditTime: 2021-01-08 09:48:06 */ import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import { HttpClient } from '@angular/common/http' @@ -19,20 +19,7 @@ import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { TreeService } from '../../http-interceptors/tree.service' import { ConstantPool } from '@angular/compiler'; import { MatTableDataSource } from '@angular/material/table'; -export interface PeriodicElement { - unitname: string; - level: string; - addname: string; - addtime: string; - unittype: string; - unitstate: string; - isopen: string; - projectlevel: string; -} -const ELEMENT_DATA=[ - {unitname:"鎶楁椽鎶㈤櫓鏁戞彺搴旀ユ晳鎻撮妗",level:"鈪犵骇",addname:"寮犱笁",addtime:"2020-12-16",plantype:"娲稘",passstate:"瀹℃牳閫氳繃",isopen:"鏈叕寮",projectlevel:"鎬婚槦"}, - {unitname:"娉ョ煶娴佸簲鎬ユ晳鎻撮妗",level:"鈪犵骇",addname:"闊╀俊",addtime:"2020-12-16",plantype:"娉ョ煶娴",passstate:"瀹℃牳涓",isopen:"鏈叕寮",projectlevel:"鏀槦"} -] + @Component({ selector: 'app-onetwo-entry-plan', @@ -72,18 +59,20 @@ export class OnetwoEntryPlanComponent implements OnInit { ] } this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length) + this.getAlltabledate() } url preparelevels:any plcheck:boolean //缂栧埗绾у埆鍕鹃夋 displayedColumns: string[] = ['unitname','level','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation']; - tabledataSource=ELEMENT_DATA + tabledataSource unitname//棰勬鍚嶇О level//棰勬绾у埆 addname//娣诲姞浜 addtime//娣诲姞鏃堕棿 - unittype//棰勬绫诲瀷 + endtime//缁撴潫鏃堕棿 + reservePlanType//棰勬绫诲瀷 unitstate//瀹℃牳鐘舵 projectlevel//缂栧埗绾у埆 //鍒嗛〉 @@ -112,17 +101,41 @@ export class OnetwoEntryPlanComponent implements OnInit { }) } + //鑾峰彇琛ㄦ牸鏁版嵁 + getAlltabledate(){ + let paramsdata:any = { + PlanCategory:this.url=='2'?2:1, + PlanType:this.projectlevel||'', + AuditStatus:this.unitstate|| '', + PageNumber: this.PageNumber || '1', + PageSize: this.pageSizeOptions[0], + + } + this.http.get("/api/PlanComponentsMajor",{params:paramsdata}).subscribe((data:any)=>{ + this.length = data.totalCount + this.tabledataSource = data.items + console.log(this.tabledataSource) + }) + } + //閲嶇疆 reset(){ this.unitname='' this.level='' this.addname='' this.addtime='' - this.unittype='' + //this.unittype='' this.unitstate='' this.projectlevel='' } + //鏌ヨ + onSubmit (value) { + this.PageNumber = 1 + this.pageEvent.pageIndex = 0 + this.getAlltabledate(); + } + //鏂板棰勬寮圭獥 addunit(){ const dialogRef = this.dialog.open(newunitComponent, { diff --git a/src/app/plan-management/type-plan/newunit.html b/src/app/plan-management/type-plan/newunit.html index cd632ec..4953720 100644 --- a/src/app/plan-management/type-plan/newunit.html +++ b/src/app/plan-management/type-plan/newunit.html @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-24 16:26:16 * @LastEditors: sueRimn - * @LastEditTime: 2021-01-06 10:15:18 + * @LastEditTime: 2021-01-06 15:16:50 -->
@@ -18,7 +18,12 @@
- + + +
diff --git a/src/app/plan-management/type-plan/newunit.scss b/src/app/plan-management/type-plan/newunit.scss index 7e78e9c..880da22 100644 --- a/src/app/plan-management/type-plan/newunit.scss +++ b/src/app/plan-management/type-plan/newunit.scss @@ -32,4 +32,23 @@ height: 36px; font-size: 16px; } - } \ No newline at end of file + } + .fileinput-button { + width: 148px; + height: 36px; + top: 10px; + position: relative; + display: inline-block; + overflow: hidden; + background-color: #2196F3; + color: #FFFFFF; + font-size: 16px; +} + +.fileinput-button input{ + position: absolute; + right: 0px; + top: 0px; + opacity: 0; + -ms-filter: 'alpha(opacity=0)'; +} diff --git a/src/app/plan-management/type-plan/type-plan.component.html b/src/app/plan-management/type-plan/type-plan.component.html index ab8c247..67109d3 100644 --- a/src/app/plan-management/type-plan/type-plan.component.html +++ b/src/app/plan-management/type-plan/type-plan.component.html @@ -63,6 +63,7 @@
+
棰勬鍚嶇О{{element.unitname}}{{element.name}} 棰勬绾у埆 娣诲姞浜{{element.addname}}{{element.creatorName}} 娣诲姞鏃堕棿{{element.addtime}}{{element.creationTime|date:'yyyy-MM-dd'}} 棰勬绫诲瀷{{element.plantype}}{{element.planType=='1'?'浜岀淮棰勬':element.planType=='2'?'涓夌淮棰勬':element.planType=='4'?'鍏朵粬棰勬':'鍗$墖棰勬'}} 瀹℃牳鐘舵{{element.passstate}}{{element.auditStatus=='8'?'鏈彁浜ゅ鏍':element.auditStatus=='1'?'瀹℃牳涓':element.auditStatus=='2'?'瀹℃牳閫氳繃':'瀹℃牳閫鍥'}} 鏄惁鍏紑{{element.isopen}}{{element.openRange}} 缂栧埗绾у埆{{element.projectlevel}}{{element.planLevel=='0'?'鎬婚槦':element.planLevel=='1'?'鏀槦':element.planLevel=='2'?'澶ч槦':'涓槦'}} 鎿嶄綔 + 鏌ョ湅棰勬 + 涓嬭浇 + 鍒犻櫎
diff --git a/src/app/plan-management/type-plan/type-plan.component.ts b/src/app/plan-management/type-plan/type-plan.component.ts index 9c36971..e579495 100644 --- a/src/app/plan-management/type-plan/type-plan.component.ts +++ b/src/app/plan-management/type-plan/type-plan.component.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2021-01-06 09:47:43 * @LastEditors: sueRimn - * @LastEditTime: 2021-01-06 10:27:09 + * @LastEditTime: 2021-01-06 15:12:30 */ import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import { HttpClient } from '@angular/common/http' @@ -115,4 +115,11 @@ export class newunitType{ close(){ this.dialogRef.close(); } + //涓婁紶 + upload(){ + document.getElementById('up').click() + } + upchange(e){ + console.log(e) + } } From 47143497e1cb27d66e75e40067456b9cfce41d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=8C=AF=E5=8D=87?= <359059686@qq.com> Date: Fri, 8 Jan 2021 10:19:26 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=88=B01.0.1.20210108=5Fbeta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../working-area/working-area.component.ts | 27 +++++-------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 907ce3e..33876f2 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -141,7 +141,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // Beta鐗: 璇ョ増鏈浉瀵逛簬伪鐗堝凡鏈変簡寰堝ぇ鐨勬敼杩涳紝娑堥櫎浜嗕弗閲嶇殑閿欒锛屼絾杩樻槸瀛樺湪鐫涓浜涚己闄凤紝闇瑕佺粡杩囧娆℃祴璇曟潵杩涗竴姝ユ秷闄わ紝姝ょ増鏈富瑕佺殑淇敼瀵瑰儚鏄蒋浠剁殑UI銆 // RC鐗: 璇ョ増鏈凡缁忕浉褰撴垚鐔熶簡锛屽熀鏈笂涓嶅瓨鍦ㄥ鑷撮敊璇殑BUG锛屼笌鍗冲皢鍙戣鐨勬寮忕増鐩稿樊鏃犲嚑銆 // Release鐗: 璇ョ増鏈剰鍛斥滄渶缁堢増鏈濓紝鍦ㄥ墠闈㈢増鏈殑涓绯诲垪娴嬭瘯鐗堜箣鍚庯紝缁堝綊浼氭湁涓涓寮忕増鏈紝鏄渶缁堜氦浠樼敤鎴蜂娇鐢ㄧ殑涓涓増鏈傝鐗堟湰鏈夋椂涔熺О涓烘爣鍑嗙増銆備竴鑸儏鍐典笅锛孯elease涓嶄細浠ュ崟璇嶅舰寮忓嚭鐜板湪杞欢灏侀潰涓婏紝鍙栬屼唬涔嬬殑鏄鍙仿 - public VERSION = '1.0.0.20210107_beta'; + public VERSION = '1.0.1.20210108_beta'; /** * 鏁版嵁鍒濆鍖 */ @@ -887,7 +887,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * 鍒锋柊鑳屾櫙鍥 */ public async refreshBackgroundImage(imageUrl:string = this.canvasData.selectStorey.imageUrl,imageAngle:number = this.canvasData.selectStorey.imageAngle): Promise { - if (!imageUrl) { + if (imageUrl === undefined || imageUrl === null || imageUrl === "") { this.backgroundImage.visible = false; } else { this.backgroundImage.visible = false; @@ -907,6 +907,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV let scale = wScale < hScale ? wScale : hScale; // 璁剧疆鍥剧墖缂╂斁 this.backgroundImage.scale.set(scale); + this.backgroundImage.visible = true; } } /** @@ -915,23 +916,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * @param imageAngle */ public async refresh(imageUrl: string = this.canvasData.selectStorey.imageUrl, imageAngle: number = this.canvasData.selectStorey.imageAngle): Promise { - this.backgroundImage.visible = false; - this.backgroundImage.scale.set(1); - this.backgroundImage.pivot.set(0); - this.backgroundImage.x = this.app.view.width / 2; - this.backgroundImage.y = this.app.view.height / 2; - this.backgroundImage.texture = await PIXI.Texture.fromURL(imageUrl); - this.backgroundImage.angle = imageAngle; - // 绛夊緟鍥剧墖鍔犺浇瀹屾垚 - let imageWidth = this.backgroundImage.texture.width; - let imageHeight = this.backgroundImage.texture.height; - let appWidth = this.app.view.width - 470; - let appHeight = this.app.view.height; - let wScale = appWidth / imageWidth; - let hScale = appHeight / imageHeight; - let scale = wScale < hScale ? wScale : hScale; - // 璁剧疆鍥剧墖缂╂斁 - this.backgroundImage.scale.set(scale); + await this.refreshBackgroundImage(); + // 娓呯┖鎵鏈夊浘褰 this.selection.deselectAll(); let itemList = []; @@ -946,12 +932,11 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // let child = this.backgroundImage.getChildByName(item); // this.backgroundImage.removeChild(child); }) - //鍔犺浇褰撳墠鏁版嵁 + //鍔犺浇褰撳墠鏁版嵁 this.createFloorShape(this.canvasData.originaleveryStoreyData.data); // 鍒涘缓澶勭疆棰勬鍥惧舰 this.createNodeShape(this.canvasData.selectPanelPoint.Data); this.createAxLegend(); - this.backgroundImage.visible = true; } /** * 鍒涘缓瀹変俊鍥句緥 From 54de159a2eeb79396d2f25add931961a2745bde9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=8C=AF=E5=8D=87?= <359059686@qq.com> Date: Fri, 8 Jan 2021 17:47:04 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=EF=BC=9A1.0.2.20210108=5Fbeta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../working-area/model/axArrowConnector.ts | 2 ++ src/app/working-area/model/axImageShape.ts | 2 ++ src/app/working-area/model/axLegend.ts | 22 +++++++++++-------- src/app/working-area/model/multipointIcon.ts | 4 +++- src/app/working-area/model/polygonIcon.ts | 2 ++ .../working-area/working-area.component.ts | 18 +++++---------- 6 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/app/working-area/model/axArrowConnector.ts b/src/app/working-area/model/axArrowConnector.ts index 68b2828..cacc7d5 100644 --- a/src/app/working-area/model/axArrowConnector.ts +++ b/src/app/working-area/model/axArrowConnector.ts @@ -50,6 +50,7 @@ export class AxArrowConnector extends AxShape { this.sortableChildren = true; this.text.zIndex = this.children.length; this.text.visible = this.showName; + this.text.angle = -this.workingArea.backgroundImage.angle; } public drawPoints() { @@ -359,6 +360,7 @@ export class AxArrowConnector extends AxShape { // c.end(); // } // } + this.text.angle = -this.workingArea.backgroundImage.angle; } paintMarker(c: PIXI.Graphics, ptX: number, ptY: number, nx: number, ny: number, size: number, arrowWidth: number, edgeWidth: number, spacing: number, initialMove: boolean) { diff --git a/src/app/working-area/model/axImageShape.ts b/src/app/working-area/model/axImageShape.ts index f496619..48b23ff 100644 --- a/src/app/working-area/model/axImageShape.ts +++ b/src/app/working-area/model/axImageShape.ts @@ -50,6 +50,7 @@ export class AxImageShape extends AxShape { downRight: PIXI.Sprite; constructor(assetData: any, workingArea: WorkingAreaComponent) { super(assetData, workingArea); + this.angle = -this.workingArea.backgroundImage.angle; this.x = this.assetData.Point.x; this.y = this.assetData.Point.y; this.name = this.assetData.Id; @@ -265,5 +266,6 @@ export class AxImageShape extends AxShape { + this.assetData.PropertyInfos?.find(item => item.PropertyName === '鍚嶇О/缂栧彿')?.PropertyValue; this.text.x = this.image.x; this.text.y = this.image.y - this.image.height / 2; + this.angle = -this.workingArea.backgroundImage.angle; } } diff --git a/src/app/working-area/model/axLegend.ts b/src/app/working-area/model/axLegend.ts index af86e70..55359cf 100644 --- a/src/app/working-area/model/axLegend.ts +++ b/src/app/working-area/model/axLegend.ts @@ -15,6 +15,7 @@ export class AxLegend extends AxShape { */ constructor(assetData: any, workingArea: WorkingAreaComponent,shapeMap:Map) { super(assetData, workingArea); + this.angle = -this.workingArea.backgroundImage.angle; this.name = this.assetData.Id; this.shapeMap = shapeMap; this.refresh(); @@ -42,15 +43,15 @@ export class AxLegend extends AxShape { refresh() { this.removeChildren(); let index = 1; - let offset = 50; + let offset = 25; let number = 2; - let width = 450; - let height = 100; + let width = 300; + let height = 50; for (let i = 0; i < number; i++){ if (i >= this.shapeMap.size) break; let x = width * i; var textImage = new Text('鍥句緥',{ - fontSize: 36, + fontSize: 20, fill: ['#0000ff'], }); textImage.anchor.set(0.5) @@ -59,7 +60,7 @@ export class AxLegend extends AxShape { this.addChild(textImage); var textName = new Text("鍚嶇О"+' 銆愭暟閲忋',{ - fontSize: 36, + fontSize: 20, fill: ['#0000ff'], }); textName.anchor.set(0,0.5); @@ -71,14 +72,16 @@ export class AxLegend extends AxShape { let x = index % number === 0 ? (number -1) * width : (index % number - 1) * width; let y = Math.ceil(index / number) * height; let image: Sprite = Sprite.from(item.ImageUrl); - image.width = 64; - image.height = 64; + image.width = 32; + image.height = 32; image.anchor.set(0.5); image.x = x; image.y = y; this.addChild(image); - var textName = new Text(item.Name+' 銆'+item.Count.toString()+'銆'); + var textName = new Text(item.Name+' 銆'+item.Count.toString()+'銆',{ + fontSize: 20, + }); textName.anchor.set(0,0.5); textName.x = x + image.width/2 + offset; textName.y = y; @@ -89,7 +92,7 @@ export class AxLegend extends AxShape { let rect = this.getLocalBounds(); this.pen.clear(); this.pen.beginFill(0xffffff,0.01); - this.pen.lineStyle(5, 0x000000); + this.pen.lineStyle(3, 0x000000); this.pen.moveTo(rect.left-offset, rect.top-offset); this.pen.lineTo(rect.right+offset, rect.top-offset); this.pen.lineTo(rect.right+offset, rect.bottom+offset); @@ -98,6 +101,7 @@ export class AxLegend extends AxShape { this.pen.endFill(); } this.addChild(this.pen); + this.angle = -this.workingArea.backgroundImage.angle; } } diff --git a/src/app/working-area/model/multipointIcon.ts b/src/app/working-area/model/multipointIcon.ts index 2416956..a8bd056 100644 --- a/src/app/working-area/model/multipointIcon.ts +++ b/src/app/working-area/model/multipointIcon.ts @@ -36,7 +36,7 @@ export class MultipointIcon extends AxShape { * @param points 鐐归泦鍚 */ constructor(assetData: any,workingArea: WorkingAreaComponent) { - super(assetData,workingArea); + super(assetData, workingArea); this.name = this.assetData.Id; this.pointsData = this.assetData.MultiPoint; this.x = this.assetData.Point.x; @@ -46,6 +46,7 @@ export class MultipointIcon extends AxShape { this.text.anchor.set(0.5,0.5); // this.text.position = this.getLineCenter(this.pointsData[0], this.pointsData[1]); this.text.visible = this.showName; + this.text.angle = -this.workingArea.backgroundImage.angle; this.addChild(this.text); // 鐢荤嚎鍥炬爣 for (let i = 0, count = this.pointsData.length - 1; i < count; i++) { @@ -198,5 +199,6 @@ export class MultipointIcon extends AxShape { this.text.text = this.assetData.Name + '\r\n' + this.assetData.PropertyInfos.find(item => item.PropertyName === '鍚嶇О/缂栧彿')?.PropertyValue; + this.text.angle = -this.workingArea.backgroundImage.angle; } } diff --git a/src/app/working-area/model/polygonIcon.ts b/src/app/working-area/model/polygonIcon.ts index 1bf4f42..7aa9a40 100644 --- a/src/app/working-area/model/polygonIcon.ts +++ b/src/app/working-area/model/polygonIcon.ts @@ -75,6 +75,7 @@ export class PolygonIcon extends AxShape { this.text.anchor.set(0.5); this.text.position = this.calculatePolygonGravityCenter(this.pointsData); this.text.visible = this.showName; + this.text.angle = -this.workingArea.backgroundImage.angle; // console.log(this.calculatePolygonGravityCenter(this.pointsData)); this.polygonGraphics.addChild(this.text); // 娣诲姞鍦嗙偣浜嬩欢 @@ -194,5 +195,6 @@ export class PolygonIcon extends AxShape { this.polygonGraphics.beginFill(color, angle); this.polygonGraphics.drawPolygon(this.getPoints()); this.polygonGraphics.endFill(); + this.text.angle = -this.workingArea.backgroundImage.angle; } } diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 33876f2..d7344f1 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -141,7 +141,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // Beta鐗: 璇ョ増鏈浉瀵逛簬伪鐗堝凡鏈変簡寰堝ぇ鐨勬敼杩涳紝娑堥櫎浜嗕弗閲嶇殑閿欒锛屼絾杩樻槸瀛樺湪鐫涓浜涚己闄凤紝闇瑕佺粡杩囧娆℃祴璇曟潵杩涗竴姝ユ秷闄わ紝姝ょ増鏈富瑕佺殑淇敼瀵瑰儚鏄蒋浠剁殑UI銆 // RC鐗: 璇ョ増鏈凡缁忕浉褰撴垚鐔熶簡锛屽熀鏈笂涓嶅瓨鍦ㄥ鑷撮敊璇殑BUG锛屼笌鍗冲皢鍙戣鐨勬寮忕増鐩稿樊鏃犲嚑銆 // Release鐗: 璇ョ増鏈剰鍛斥滄渶缁堢増鏈濓紝鍦ㄥ墠闈㈢増鏈殑涓绯诲垪娴嬭瘯鐗堜箣鍚庯紝缁堝綊浼氭湁涓涓寮忕増鏈紝鏄渶缁堜氦浠樼敤鎴蜂娇鐢ㄧ殑涓涓増鏈傝鐗堟湰鏈夋椂涔熺О涓烘爣鍑嗙増銆備竴鑸儏鍐典笅锛孯elease涓嶄細浠ュ崟璇嶅舰寮忓嚭鐜板湪杞欢灏侀潰涓婏紝鍙栬屼唬涔嬬殑鏄鍙仿 - public VERSION = '1.0.1.20210108_beta'; + public VERSION = '1.0.2.20210108_beta'; /** * 鏁版嵁鍒濆鍖 */ @@ -491,17 +491,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.selection.select(obj); }); } - // /** - // * 鍒涘缓鑳屾櫙鍥 - // */ - // public createBackground(imageUrl:string,imageAngle:number) { - // if (this.backgroundImage !== null) { - // this.backgroundImage.destroy(); - // this.backgroundImage = null; - // } - // this.createBackgroundImage() - // this.refreshBackgroundImage(imageUrl,imageAngle); - // } /** * 鍒涘缓妤煎眰鍥惧舰 */ @@ -908,6 +897,11 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // 璁剧疆鍥剧墖缂╂斁 this.backgroundImage.scale.set(scale); this.backgroundImage.visible = true; + this.backgroundImage.children.forEach((item) => { + if (item instanceof AxShape) { + item.refresh(); + } + }) } } /** From 60b221e568adb887f801a7b028f753b66320a67f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=8C=AF=E5=8D=87?= <359059686@qq.com> Date: Sat, 9 Jan 2021 10:23:42 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC1.0.3?= =?UTF-8?q?.20210109b?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/working-area/model/axArrowConnector.ts | 8 +++++++- src/app/working-area/model/axImageShape.ts | 2 +- src/app/working-area/model/axPreviewImageShape.ts | 3 +++ src/app/working-area/model/multipointIcon.ts | 2 +- src/app/working-area/model/polygonIcon.ts | 2 +- src/app/working-area/working-area.component.ts | 8 +++++++- 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/app/working-area/model/axArrowConnector.ts b/src/app/working-area/model/axArrowConnector.ts index cacc7d5..6ed0dd9 100644 --- a/src/app/working-area/model/axArrowConnector.ts +++ b/src/app/working-area/model/axArrowConnector.ts @@ -2,6 +2,7 @@ import { WorkingAreaComponent } from '../working-area.component'; import * as PIXI from 'pixi.js'; import { AxShape } from './axShape'; import { Sprite } from 'pixi.js'; +import { GameMode } from './gameMode'; /** * 杩炴帴绠ご @@ -116,11 +117,16 @@ export class AxArrowConnector extends AxShape { } // 璁剧疆缂╂斁 public setItemScale(scale: number) { - this.text.scale.set(scale); + // this.text.scale.set(scale); this.pointSprites.forEach(point => { point.scale.set(scale); }); } + public setNameVisible(value: boolean, mode: GameMode) { + if (this.assetData.GameMode === mode) { + this.text.visible = value; + } + } /** * 鍒锋柊褰㈢姸 */ diff --git a/src/app/working-area/model/axImageShape.ts b/src/app/working-area/model/axImageShape.ts index 48b23ff..d12ae3c 100644 --- a/src/app/working-area/model/axImageShape.ts +++ b/src/app/working-area/model/axImageShape.ts @@ -186,7 +186,7 @@ export class AxImageShape extends AxShape { if (this.assetData.FixedSize) { this.scale.set(scale); } else { - this.text.scale.set(scale); + // this.text.scale.set(scale); this.upLeft.scale.set(scale); this.upRight.scale.set(scale); this.downLeft.scale.set(scale); diff --git a/src/app/working-area/model/axPreviewImageShape.ts b/src/app/working-area/model/axPreviewImageShape.ts index 8d0cd5d..7f66812 100644 --- a/src/app/working-area/model/axPreviewImageShape.ts +++ b/src/app/working-area/model/axPreviewImageShape.ts @@ -33,4 +33,7 @@ export class AxPreviewImageShape extends AxShape { */ public drawBorder(scale: number) { } + public refresh() { + this.angle = -this.workingArea.backgroundImage.angle; + } } diff --git a/src/app/working-area/model/multipointIcon.ts b/src/app/working-area/model/multipointIcon.ts index a8bd056..395afd1 100644 --- a/src/app/working-area/model/multipointIcon.ts +++ b/src/app/working-area/model/multipointIcon.ts @@ -185,7 +185,7 @@ export class MultipointIcon extends AxShape { } // 璁剧疆缂╂斁 public setItemScale(scale: number) { - this.text.scale.set(scale); + // this.text.scale.set(scale); this.pointsGraphics.forEach((item, index, array) => { item.scale.set(scale); }); diff --git a/src/app/working-area/model/polygonIcon.ts b/src/app/working-area/model/polygonIcon.ts index 7aa9a40..2494748 100644 --- a/src/app/working-area/model/polygonIcon.ts +++ b/src/app/working-area/model/polygonIcon.ts @@ -157,7 +157,7 @@ export class PolygonIcon extends AxShape { } // 璁剧疆缂╂斁 public setItemScale(scale: number) { - this.text.scale.set(scale); + // this.text.scale.set(scale); this.pointsGraphics.forEach(point => { point.scale.set(scale); }); diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index d7344f1..f010069 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -141,7 +141,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // Beta鐗: 璇ョ増鏈浉瀵逛簬伪鐗堝凡鏈変簡寰堝ぇ鐨勬敼杩涳紝娑堥櫎浜嗕弗閲嶇殑閿欒锛屼絾杩樻槸瀛樺湪鐫涓浜涚己闄凤紝闇瑕佺粡杩囧娆℃祴璇曟潵杩涗竴姝ユ秷闄わ紝姝ょ増鏈富瑕佺殑淇敼瀵瑰儚鏄蒋浠剁殑UI銆 // RC鐗: 璇ョ増鏈凡缁忕浉褰撴垚鐔熶簡锛屽熀鏈笂涓嶅瓨鍦ㄥ鑷撮敊璇殑BUG锛屼笌鍗冲皢鍙戣鐨勬寮忕増鐩稿樊鏃犲嚑銆 // Release鐗: 璇ョ増鏈剰鍛斥滄渶缁堢増鏈濓紝鍦ㄥ墠闈㈢増鏈殑涓绯诲垪娴嬭瘯鐗堜箣鍚庯紝缁堝綊浼氭湁涓涓寮忕増鏈紝鏄渶缁堜氦浠樼敤鎴蜂娇鐢ㄧ殑涓涓増鏈傝鐗堟湰鏈夋椂涔熺О涓烘爣鍑嗙増銆備竴鑸儏鍐典笅锛孯elease涓嶄細浠ュ崟璇嶅舰寮忓嚭鐜板湪杞欢灏侀潰涓婏紝鍙栬屼唬涔嬬殑鏄鍙仿 - public VERSION = '1.0.2.20210108_beta'; + public VERSION = '1.0.3.20210109_beta'; /** * 鏁版嵁鍒濆鍖 */ @@ -442,6 +442,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV item.setNameVisible(value, mode); } else if (item instanceof PolygonIcon) { item.setNameVisible(value, mode); + } else if (item instanceof AxArrowConnector) { + item.setNameVisible(value, mode); } }); } @@ -594,6 +596,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.backgroundImage.sortableChildren = true; this.backgroundImage .on('pointerdown', event => { + if (event.data.button !== 0) return; if (!event.currentTarget.dragging && this.selection.isMultiselection === false) { this.selection.deselectAll(); event.currentTarget.data = event.data; @@ -651,6 +654,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV if (this.paintPoints.length >= 2) { this.enterPaintEndButton.position = this.circleShadow.position; this.enterPaintEndButton.visible = true; + this.enterPaintEndButton.zIndex = this.backgroundImage.children.length; } if (this.paintingIcon !== null) { @@ -708,6 +712,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.enterPaintEndButton.position = this.circleShadow.position; } else if (this.paintPoints.length >= 3) { this.enterPaintEndButton.visible = true; + this.enterPaintEndButton.zIndex = this.backgroundImage.children.length; } this.paintPoints.forEach((value, index, array) => { if (index === 0) { @@ -736,6 +741,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.previewLineSegment.visible = true; this.enterPaintEndButton.position = this.circleShadow.position; this.enterPaintEndButton.visible = true; + this.enterPaintEndButton.zIndex = this.backgroundImage.children.length; this.currentClickPoint.position = new PIXI.Point(this.circleShadow.x, this.circleShadow.y); this.paintPoints.push(new PIXI.Point(this.circleShadow.x, this.circleShadow.y)); if (this.paintPoints.length < 2) { From a894797f5cff0bd9e465bc65b21482941b53a280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=8C=AF=E5=8D=87?= <359059686@qq.com> Date: Sat, 9 Jan 2021 11:55:27 +0800 Subject: [PATCH 06/13] 1.0.4.20210109b --- src/app/working-area/model/axLegend.ts | 2 +- .../working-area/working-area.component.ts | 25 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/app/working-area/model/axLegend.ts b/src/app/working-area/model/axLegend.ts index 55359cf..55f4d8f 100644 --- a/src/app/working-area/model/axLegend.ts +++ b/src/app/working-area/model/axLegend.ts @@ -44,7 +44,7 @@ export class AxLegend extends AxShape { this.removeChildren(); let index = 1; let offset = 25; - let number = 2; + let number = this.assetData.PropertyInfos[0].PropertyValue; let width = 300; let height = 50; for (let i = 0; i < number; i++){ diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index f010069..28bcfcd 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -141,7 +141,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // Beta鐗: 璇ョ増鏈浉瀵逛簬伪鐗堝凡鏈変簡寰堝ぇ鐨勬敼杩涳紝娑堥櫎浜嗕弗閲嶇殑閿欒锛屼絾杩樻槸瀛樺湪鐫涓浜涚己闄凤紝闇瑕佺粡杩囧娆℃祴璇曟潵杩涗竴姝ユ秷闄わ紝姝ょ増鏈富瑕佺殑淇敼瀵瑰儚鏄蒋浠剁殑UI銆 // RC鐗: 璇ョ増鏈凡缁忕浉褰撴垚鐔熶簡锛屽熀鏈笂涓嶅瓨鍦ㄥ鑷撮敊璇殑BUG锛屼笌鍗冲皢鍙戣鐨勬寮忕増鐩稿樊鏃犲嚑銆 // Release鐗: 璇ョ増鏈剰鍛斥滄渶缁堢増鏈濓紝鍦ㄥ墠闈㈢増鏈殑涓绯诲垪娴嬭瘯鐗堜箣鍚庯紝缁堝綊浼氭湁涓涓寮忕増鏈紝鏄渶缁堜氦浠樼敤鎴蜂娇鐢ㄧ殑涓涓増鏈傝鐗堟湰鏈夋椂涔熺О涓烘爣鍑嗙増銆備竴鑸儏鍐典笅锛孯elease涓嶄細浠ュ崟璇嶅舰寮忓嚭鐜板湪杞欢灏侀潰涓婏紝鍙栬屼唬涔嬬殑鏄鍙仿 - public VERSION = '1.0.3.20210109_beta'; + public VERSION = '1.0.4.20210109_beta'; /** * 鏁版嵁鍒濆鍖 */ @@ -353,7 +353,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV /** * 鍒涘缓鍥炬爣浜嬩欢锛堟暟鎹鐞嗭級 */ - this.on('createIcon', (axShape:AxShape)=> { + this.on('createIcon', (axShape: AxShape) => { + console.log("鏂板鍥炬爣锛"+axShape.assetData.Name); if (axShape.assetData.GameMode === GameMode.BasicInformation) { // 鍩烘湰淇℃伅 // 娣诲姞妤煎眰鏁版嵁 this.canvasData.originaleveryStoreyData.data[axShape.assetData.Id] = axShape.assetData; @@ -383,6 +384,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV var itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1); temp.addItem(itemLegend); } + this.emit('canvasDataChanged'); this.canvasData.isChange = true; }); /** @@ -420,6 +422,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // } this.backgroundImage.removeChild(axShape); + this.emit('canvasDataChanged'); this.canvasData.isChange = true; }); } @@ -462,6 +465,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV icon.refresh(); } else if (icon instanceof AxArrowConnector) { icon.redraw(); + } else if (icon instanceof AxLegend) { + icon.refresh(); } } /** @@ -945,7 +950,21 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV const tempAssetData = { Id: "鍥句緥",//ObjectID.default.generate() Color: "#066EED80", - PropertyInfos:[] + PropertyInfos: [ + { + Tag : '', + Order : 0, + Enabled : true, + Visible : true, + Required : false, + RuleName : "", + RuleValue : "", + PhysicalUnit : "", + PropertyName : "鍒", + PropertyType : 2, + PropertyValue : 2, + }, + ] }; let shapeMap: Map = new Map(); From a3417973935dfe9c21a2533e489869e3e40b6832 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Mon, 11 Jan 2021 14:31:31 +0800 Subject: [PATCH 07/13] =?UTF-8?q?[=E4=BF=AE=E6=AD=A3]=20=E5=B9=BF=E8=A5=BF?= =?UTF-8?q?BUG=E2=86=92=E4=B8=8A=E6=B5=B7=E5=90=8C=E6=AD=A5BUG=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20=20=20[=E5=AE=8C=E5=96=84]=20=E6=89=80=E6=9C=89?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=AB=98=E5=BA=A6=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app-routing.module.ts | 16 +- src/app/canvas-share-data.service.ts | 1 - .../gis-labeling/gis-labeling.component.ts | 2 +- .../allaround/allaround.component.scss | 3 +- .../edit-plan-info.component.html | 16 +- .../edit-unit-info.component.html | 20 +- .../fire-fighting-device.component.scss | 2 +- .../fire-fighting-device.component.scss | 2 +- .../function-division.component.scss | 2 +- .../function-division.component.scss | 2 +- .../key-site-look/key-site.component.scss | 2 +- .../key-unit/key-site/key-site.component.scss | 2 +- .../realistic-picture.component.scss | 2 +- .../realistic-picture.component.scss | 2 +- .../uploading-cad.component.html | 122 ++++--- .../uploading-cad.component.html | 125 +++---- .../view-unit-details-plan.component.html | 23 +- .../view-unit-details.component.html | 18 +- src/app/navigation/navigation.component.ts | 5 +- .../detachment-level.component.html | 312 ++++++++-------- .../detachment-level.component.ts | 2 +- .../plan-audit/plan-audit.component.html | 336 +++++++++--------- .../plan-audit/plan-audit.component.ts | 2 +- .../plan-pass/plan-pass.component.html | 65 ++-- .../plan-pass/plan-pass.component.ts | 27 +- .../open-plan/open-plan.component.ts | 6 +- .../pass-plan/pass-plan.component.ts | 6 +- .../add-unit-one/add-unit-one.component.scss | 2 +- .../add-unit-three-bar-details.component.scss | 2 +- ...add-unit-three-line-details.component.scss | 2 +- .../add-unit-two-time.component.scss | 2 +- .../add-unit-two-type-details.component.scss | 2 +- ...dd-unit-two-type-statistics.component.scss | 2 +- .../building-type-one.component.html | 2 +- ...building-type-three-details.component.scss | 2 +- .../building-type-two-forward.component.scss | 2 +- .../building-type-two-reverse.component.scss | 2 +- .../delete-one/delete-one.component.html | 2 +- .../delete-there-line-details.component.scss | 2 +- .../delete-there/delete-there.component.scss | 2 +- .../delete-two-newadd.component.scss | 2 +- .../delete-two/delete-two.component.scss | 2 +- .../scheduled-updates.component.scss | 2 +- .../state/page-one/page-one.component.html | 2 +- .../page-there-year.component.scss | 2 +- .../page-there/page-there.component.scss | 2 +- .../page-two-time.component.scss | 2 +- src/app/ui/authority/authority.component.html | 2 +- ...ighting-facilities-formwork.component.scss | 2 +- .../fire-protection-elements.component.scss | 2 +- .../material-bank.component.scss | 2 +- src/app/ui/navmenus/navmenus.component.html | 2 +- src/app/ui/role/role.component.html | 2 +- .../unit-information.component.scss | 2 +- src/assets/css/newStyle.css | 2 +- 55 files changed, 573 insertions(+), 606 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 66ed8d5..a704b1f 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -2,7 +2,6 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { LoginComponent } from './pages/login/login.component'; import { NavigationComponent } from './navigation/navigation.component'; -import { LockscreenComponent } from './pages/lockscreen/lockscreen.component'; import {HomeComponent} from './home/home.component' //璺敱瀹堝崼 @@ -11,13 +10,10 @@ import {MTokenK1Component} from './m-token-k1/m-token-k1.component' //K1绉橀挜 - const routes: Routes = [ {path:'',redirectTo:'login',pathMatch:'full'}, { - path:'', - component:NavigationComponent, - canActivate: [AuthGuard],//瀹堝崼楠岃瘉 + path:'',component:NavigationComponent,canActivate: [AuthGuard],//瀹堝崼楠岃瘉 children:[ {path:'ui',loadChildren:() => import('./ui/ui.module').then(m => m.UiModule)}, {path:'keyUnit',loadChildren:() => import('./key-unit/key-unit.module').then(m => m.KeyUnitModule)}, @@ -30,15 +26,9 @@ const routes: Routes = [ {path:'dataCollection',loadChildren:() => import('./data-collection/data-collection.module').then(m => m.DataCollectionModule)}, ] }, - {path:'login', - component:LoginComponent}, - - {path:'getNoMToken', - component:MTokenK1Component, canActivate: [AuthGuard],}, //K1绉橀挜楠岃瘉澶辫触鏄烦杞〉闈 - {path:'lockscreen', - component:LockscreenComponent, - canActivate: [AuthGuard]}//瀹堝崼楠岃瘉 + {path:'login',component:LoginComponent}, + {path:'getNoMToken',component:MTokenK1Component, canActivate: [AuthGuard],}, //K1绉橀挜楠岃瘉澶辫触鏄烦杞〉闈 ]; @NgModule({ diff --git a/src/app/canvas-share-data.service.ts b/src/app/canvas-share-data.service.ts index 62c8cc0..b69d6c5 100644 --- a/src/app/canvas-share-data.service.ts +++ b/src/app/canvas-share-data.service.ts @@ -8,7 +8,6 @@ import { GameMode } from './working-area/model/gameMode'; export class CanvasShareDataService { constructor() { } private _sendMessage: ReplaySubject = new ReplaySubject(1); - GameMode: any; isChange = false; // 鏁版嵁 鏄惁鏀瑰姩 diff --git a/src/app/gis-management/gis-labeling/gis-labeling.component.ts b/src/app/gis-management/gis-labeling/gis-labeling.component.ts index 90d0e05..f2438e7 100644 --- a/src/app/gis-management/gis-labeling/gis-labeling.component.ts +++ b/src/app/gis-management/gis-labeling/gis-labeling.component.ts @@ -285,7 +285,7 @@ export class GisLabelingComponent implements OnInit { `
${item.name}
-
鍗曚綅鎬ц川:
+
鍗曚綅鎬ц川:
娑堥槻璐熻矗浜:
diff --git a/src/app/key-unit/allaround/allaround.component.scss b/src/app/key-unit/allaround/allaround.component.scss index 3f723b9..4ac5e3b 100644 --- a/src/app/key-unit/allaround/allaround.component.scss +++ b/src/app/key-unit/allaround/allaround.component.scss @@ -1,7 +1,8 @@ .content { width: 100%; - height: 90%; + height: 100%; padding: 10px; + box-sizing: border-box; overflow-y: auto; } diff --git a/src/app/key-unit/edit-plan-info/edit-plan-info.component.html b/src/app/key-unit/edit-plan-info/edit-plan-info.component.html index f05cd1d..53f811f 100644 --- a/src/app/key-unit/edit-plan-info/edit-plan-info.component.html +++ b/src/app/key-unit/edit-plan-info/edit-plan-info.component.html @@ -10,7 +10,6 @@ - @@ -43,15 +42,10 @@ - - - - - - - - 鍔熻兘寮鍙戜腑~~ - - + diff --git a/src/app/key-unit/edit-unit-info/edit-unit-info.component.html b/src/app/key-unit/edit-unit-info/edit-unit-info.component.html index e0d9853..1a48832 100644 --- a/src/app/key-unit/edit-unit-info/edit-unit-info.component.html +++ b/src/app/key-unit/edit-unit-info/edit-unit-info.component.html @@ -41,20 +41,14 @@ - + - 鍔熻兘寮鍙戜腑~~ - - - - - 鍔熻兘寮鍙戜腑~~ - - - - - - + + diff --git a/src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.scss b/src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.scss index 3ea1f32..7248739 100644 --- a/src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.scss +++ b/src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.scss @@ -1,6 +1,6 @@ .content { width: 100%; - height: 90%; + height: 100%; padding: 10px; overflow-y: auto; .contentBox { diff --git a/src/app/key-unit/fire-fighting-device/fire-fighting-device.component.scss b/src/app/key-unit/fire-fighting-device/fire-fighting-device.component.scss index 3ea1f32..7248739 100644 --- a/src/app/key-unit/fire-fighting-device/fire-fighting-device.component.scss +++ b/src/app/key-unit/fire-fighting-device/fire-fighting-device.component.scss @@ -1,6 +1,6 @@ .content { width: 100%; - height: 90%; + height: 100%; padding: 10px; overflow-y: auto; .contentBox { diff --git a/src/app/key-unit/function-division-look/function-division.component.scss b/src/app/key-unit/function-division-look/function-division.component.scss index e74bcf1..0fa0a04 100644 --- a/src/app/key-unit/function-division-look/function-division.component.scss +++ b/src/app/key-unit/function-division-look/function-division.component.scss @@ -1,6 +1,6 @@ .content { width: 100%; - height: 90%; + height: 100%; overflow-y: auto; padding: 10px 0 0 10px; display: flex; diff --git a/src/app/key-unit/function-division/function-division.component.scss b/src/app/key-unit/function-division/function-division.component.scss index e74bcf1..0fa0a04 100644 --- a/src/app/key-unit/function-division/function-division.component.scss +++ b/src/app/key-unit/function-division/function-division.component.scss @@ -1,6 +1,6 @@ .content { width: 100%; - height: 90%; + height: 100%; overflow-y: auto; padding: 10px 0 0 10px; display: flex; diff --git a/src/app/key-unit/key-site-look/key-site.component.scss b/src/app/key-unit/key-site-look/key-site.component.scss index 3fbf2eb..08d9639 100644 --- a/src/app/key-unit/key-site-look/key-site.component.scss +++ b/src/app/key-unit/key-site-look/key-site.component.scss @@ -1,6 +1,6 @@ .content { width: 100%; - height: 90%; + height: 100%; padding: 10px; overflow-y: auto; .contentBox{ diff --git a/src/app/key-unit/key-site/key-site.component.scss b/src/app/key-unit/key-site/key-site.component.scss index 3fbf2eb..08d9639 100644 --- a/src/app/key-unit/key-site/key-site.component.scss +++ b/src/app/key-unit/key-site/key-site.component.scss @@ -1,6 +1,6 @@ .content { width: 100%; - height: 90%; + height: 100%; padding: 10px; overflow-y: auto; .contentBox{ diff --git a/src/app/key-unit/realistic-picture-look/realistic-picture.component.scss b/src/app/key-unit/realistic-picture-look/realistic-picture.component.scss index cfbc003..075375c 100644 --- a/src/app/key-unit/realistic-picture-look/realistic-picture.component.scss +++ b/src/app/key-unit/realistic-picture-look/realistic-picture.component.scss @@ -1,7 +1,7 @@ .content { margin: 0 0 0 10px; width: 100%; - height: 90%; + height: 100%; overflow-y: auto; display: flex; .leftBox { diff --git a/src/app/key-unit/realistic-picture/realistic-picture.component.scss b/src/app/key-unit/realistic-picture/realistic-picture.component.scss index cfbc003..075375c 100644 --- a/src/app/key-unit/realistic-picture/realistic-picture.component.scss +++ b/src/app/key-unit/realistic-picture/realistic-picture.component.scss @@ -1,7 +1,7 @@ .content { margin: 0 0 0 10px; width: 100%; - height: 90%; + height: 100%; overflow-y: auto; display: flex; .leftBox { diff --git a/src/app/key-unit/uploading-cad-look/uploading-cad.component.html b/src/app/key-unit/uploading-cad-look/uploading-cad.component.html index 166f0de..25c3f1a 100644 --- a/src/app/key-unit/uploading-cad-look/uploading-cad.component.html +++ b/src/app/key-unit/uploading-cad-look/uploading-cad.component.html @@ -1,64 +1,62 @@ -
- - -
- - 涓婁紶涓... - +
+
+
+ + 涓婁紶涓... + +
+ +
+ + 涓嬭浇涓... + +
+
- -
- - 涓嬭浇涓... - + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + 鍚嶇О + insert_drive_file{{element.name}} + 鏃堕棿 + {{element.creationTime|date:'yyyy-MM-dd'}} + 鐘舵 + + + 澶у皬 + {{element.fileLength}}MB +
+

鏆傛棤鏁版嵁

- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 鍚嶇О - insert_drive_file{{element.name}} - 鏃堕棿 - {{element.creationTime|date:'yyyy-MM-dd'}} - 鐘舵 - - - 澶у皬 - {{element.fileLength}}MB -
-

鏆傛棤鏁版嵁

-
+ +
\ No newline at end of file diff --git a/src/app/key-unit/uploading-cad/uploading-cad.component.html b/src/app/key-unit/uploading-cad/uploading-cad.component.html index 6909127..e9d77a5 100644 --- a/src/app/key-unit/uploading-cad/uploading-cad.component.html +++ b/src/app/key-unit/uploading-cad/uploading-cad.component.html @@ -1,64 +1,67 @@ -
- - - - - -
- - 涓婁紶涓... - +
+
+ + + + + +
+ + 涓婁紶涓... + +
+ +
+ + 涓嬭浇涓... + +
+
- -
- - 涓嬭浇涓... - + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + 鍚嶇О + insert_drive_file{{element.name}} + 鏃堕棿 + {{element.creationTime|date:'yyyy-MM-dd'}} + 鐘舵 + + + 澶у皬 + {{element.fileLength}}MB +
+

鏆傛棤鏁版嵁

-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 鍚嶇О - insert_drive_file{{element.name}} - 鏃堕棿 - {{element.creationTime|date:'yyyy-MM-dd'}} - 鐘舵 - - - 澶у皬 - {{element.fileLength}}MB -
-

鏆傛棤鏁版嵁

-
+
\ No newline at end of file diff --git a/src/app/key-unit/view-unit-details-plan/view-unit-details-plan.component.html b/src/app/key-unit/view-unit-details-plan/view-unit-details-plan.component.html index 8e8a67a..c9b0b24 100644 --- a/src/app/key-unit/view-unit-details-plan/view-unit-details-plan.component.html +++ b/src/app/key-unit/view-unit-details-plan/view-unit-details-plan.component.html @@ -1,4 +1,4 @@ - + @@ -34,21 +34,16 @@ - - - 鍔熻兘寮鍙戜腑~~ - - - - - 鍔熻兘寮鍙戜腑~~ - - - + - - + + diff --git a/src/app/key-unit/view-unit-details/view-unit-details.component.html b/src/app/key-unit/view-unit-details/view-unit-details.component.html index 3822365..8e0a997 100644 --- a/src/app/key-unit/view-unit-details/view-unit-details.component.html +++ b/src/app/key-unit/view-unit-details/view-unit-details.component.html @@ -1,4 +1,4 @@ - + @@ -6,7 +6,6 @@ - @@ -40,15 +39,10 @@ - - - - - - - - 鍔熻兘寮鍙戜腑~~ - - + diff --git a/src/app/navigation/navigation.component.ts b/src/app/navigation/navigation.component.ts index 3f3ffca..41f64a4 100644 --- a/src/app/navigation/navigation.component.ts +++ b/src/app/navigation/navigation.component.ts @@ -51,10 +51,7 @@ export class NavigationComponent implements OnInit { redtheme(){ this.darktheme = true } - toGis(){ - // console.log(123) - window.open(`http://39.106.78.171:8000`); - } + } diff --git a/src/app/plan-audit/detachment-level/detachment-level.component.html b/src/app/plan-audit/detachment-level/detachment-level.component.html index 4552c25..6cfb3e6 100644 --- a/src/app/plan-audit/detachment-level/detachment-level.component.html +++ b/src/app/plan-audit/detachment-level/detachment-level.component.html @@ -1,161 +1,163 @@ -
- -
-
- - - - -
- -
- - - - - 鍖呭惈涓嬬骇 - -
-
clear
- - - -
  • {{node.name}}
  • -
    - - -
  • {{node.name}}
  • -
    -
    +
    +
    + +
    +
    + + + +
    - -
    - -
    - - - - - {{unit.name}} - - - -
    - -
    - - - - - {{plan.name}} - - - + +
    + + + + + 鍖呭惈涓嬬骇 + +
    +
    clear
    + + + +
  • {{node.name}}
  • +
    + + +
  • {{node.name}}
  • +
    +
    +
    + +
    + +
    + + + + + {{unit.name}} + + + +
    + +
    + + + + + {{plan.name}} + + + +
    + +
    + + + + + {{state.name}} + + + +
    +
    - -
    - - - - - {{state.name}} - - - + +
    + +
    - -
    - -
    - - + +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    鍗曚綅鍚嶇О{{element.companyName}}棰勬鍚嶇О{{element.name}}娣诲姞浜{{element.creatorName}}娣诲姞鏃堕棿 + {{element.creationTime|date:'yyyy-MM-dd'}} + 棰勬绫诲瀷 + + + + + 瀹℃牳鐘舵 + + + + + 鏄惁鍏紑{{element.openRange}}缂栧埗绾у埆 + + + + + 鎿嶄綔 + + + + +
    + +
    - -
    - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    鍗曚綅鍚嶇О{{element.companyName}}棰勬鍚嶇О{{element.name}}娣诲姞浜{{element.creatorName}}娣诲姞鏃堕棿 - {{element.creationTime|date:'yyyy-MM-dd'}} - 棰勬绫诲瀷 - - - - - 瀹℃牳鐘舵 - - - - - 鏄惁鍏紑{{element.openRange}}缂栧埗绾у埆 - - - - - 鎿嶄綔 - - - - -
    - -
    \ No newline at end of file diff --git a/src/app/plan-audit/detachment-level/detachment-level.component.ts b/src/app/plan-audit/detachment-level/detachment-level.component.ts index 6973614..3bb27c1 100644 --- a/src/app/plan-audit/detachment-level/detachment-level.component.ts +++ b/src/app/plan-audit/detachment-level/detachment-level.component.ts @@ -199,7 +199,7 @@ export class DetachmentLevelComponent implements OnInit { //棰勬瀹℃牳 toExamine (e) { - window.open(`/planAudit/planpass?id=${e.companyId}&companyName=${e.companyName}&auditPlanId=${e.id}&auditStatus=${e.auditStatus}`); + window.open(`/planAudit/planpass?id=${e.companyId}&companyName=${e.companyName}&auditPlanId=${e.id}&auditStatus=${e.auditStatus}&planType=1`); } //棰勬鍏紑 diff --git a/src/app/plan-audit/plan-audit/plan-audit.component.html b/src/app/plan-audit/plan-audit/plan-audit.component.html index c8cd10f..77d664b 100644 --- a/src/app/plan-audit/plan-audit/plan-audit.component.html +++ b/src/app/plan-audit/plan-audit/plan-audit.component.html @@ -1,173 +1,175 @@ -
    -
    -
    -
    - - - - -
    - -
    - - - - - 鍖呭惈涓嬬骇 - -
    -
    clear
    - - - -
  • {{node.name}}
  • -
    - - -
  • {{node.name}}
  • -
    -
    +
    +
    + +
    +
    + + + +
    - -
    - -
    - - - - - {{unit.name}} - - - -
    - -
    - - - - - {{plan.name}} - - - -
    - -
    - - - - - {{state.name}} - - - + +
    + + + + + 鍖呭惈涓嬬骇 + +
    +
    clear
    + + + +
  • {{node.name}}
  • +
    + + +
  • {{node.name}}
  • +
    +
    +
    + +
    + +
    + + + + + {{unit.name}} + + + +
    + +
    + + + + + {{plan.name}} + + + +
    + +
    + + + + + {{state.name}} + + + +
    + +
    + + + + + {{level.name}} + + + + 鍖呭惈涓嬬骇 +
    +
    - -
    - - - - - {{level.name}} - - - - 鍖呭惈涓嬬骇 + +
    + +
    - -
    - -
    - - + +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    鍗曚綅鍚嶇О{{element.companyName}}棰勬鍚嶇О{{element.name}}娣诲姞浜{{element.creatorName}}娣诲姞鏃堕棿 + {{element.creationTime|date:'yyyy-MM-dd'}} + 棰勬绫诲瀷 + + + + + 瀹℃牳鐘舵 + + + + + 鏄惁鍏紑{{element.openRange}}缂栧埗绾у埆 + + + + + 鎿嶄綔 + + + + +
    + +
    - -
    - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    鍗曚綅鍚嶇О{{element.companyName}}棰勬鍚嶇О{{element.name}}娣诲姞浜{{element.creatorName}}娣诲姞鏃堕棿 - {{element.creationTime|date:'yyyy-MM-dd'}} - 棰勬绫诲瀷 - - - - - 瀹℃牳鐘舵 - - - - - 鏄惁鍏紑{{element.openRange}}缂栧埗绾у埆 - - - - - 鎿嶄綔 - - - - -
    - -
    \ No newline at end of file diff --git a/src/app/plan-audit/plan-audit/plan-audit.component.ts b/src/app/plan-audit/plan-audit/plan-audit.component.ts index fa9e7e9..81ce0ae 100644 --- a/src/app/plan-audit/plan-audit/plan-audit.component.ts +++ b/src/app/plan-audit/plan-audit/plan-audit.component.ts @@ -224,7 +224,7 @@ export class PlanAuditComponent implements OnInit { //棰勬瀹℃牳 toExamine (e) { - window.open(`/planAudit/planpass?id=${e.companyId}&companyName=${e.companyName}&auditPlanId=${e.id}&auditStatus=${e.auditStatus}`); + window.open(`/planAudit/planpass?id=${e.companyId}&companyName=${e.companyName}&auditPlanId=${e.id}&auditStatus=${e.auditStatus}&planType=1`); } //棰勬鍏紑 diff --git a/src/app/plan-audit/plan-pass/plan-pass.component.html b/src/app/plan-audit/plan-pass/plan-pass.component.html index f37ffb1..4f94c8a 100644 --- a/src/app/plan-audit/plan-pass/plan-pass.component.html +++ b/src/app/plan-audit/plan-pass/plan-pass.component.html @@ -1,4 +1,5 @@ - +
    + @@ -10,7 +11,7 @@
    娑堥槻鏁戞彺绔: - {{compantData.organizationName?compantData.organizationName : '鏆傛棤鏁版嵁'}} + {{organizationName}}
    鍗曚綅绫诲瀷: @@ -29,37 +30,39 @@ -
    +
    -
    - +
    +
    - - - - - - - - - - - - + + + + + + + + + + + + + + + +
    鏂囦欢鍚嶇О{{element.fileName?element.fileName : compantData.name}}涓婁紶鏃堕棿{{element.lastModified | date:'yyyy-MM-dd'}}鎿嶄綔 - - - - 鏂囦欢鍚嶇О{{element.fileName?element.fileName : compantData.name}}涓婁紶鏃堕棿{{element.lastModified | date:'yyyy-MM-dd'}}鎿嶄綔 + + + +
    +
    +
    + +
    +
    + +
    - - - -
    -
    - -
    -
    -
    -
    +
    \ No newline at end of file diff --git a/src/app/plan-audit/plan-pass/plan-pass.component.ts b/src/app/plan-audit/plan-pass/plan-pass.component.ts index f853fdb..5ce008f 100644 --- a/src/app/plan-audit/plan-pass/plan-pass.component.ts +++ b/src/app/plan-audit/plan-pass/plan-pass.component.ts @@ -30,28 +30,22 @@ export class PlanPassComponent implements OnInit { constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog, public snackBar: MatSnackBar,private sanitizer: DomSanitizer) { } - type:any //瀹℃牳鎸夐挳鏄惁鍑虹幇 ngOnInit(): void { - this.type = this.route.snapshot.queryParams.type + this.type = this.route.snapshot.queryParams.type this.getCompanyData() this.getPlanData() } + type:any //瀹℃牳鎸夐挳鏄惁鍑虹幇 displayedColumns: string[] = ['filename','addtime','operation']; //琛ㄥご compantData:any = {name:'',organizationName: '', buildingTypes:[{name:''}], address:''}; //褰撳墠鍗曚綅淇℃伅 + organizationName:any = ''; //缁勭粐鏈烘瀯鍚嶇О planData:any; //瀹℃牳棰勬淇℃伅 //鑾峰彇褰撳墠鍗曚綅淇℃伅 getCompanyData () { - let header = { - CompanyName: this.route.snapshot.queryParams.companyName || '', - PageSize: '100'} - this.http.get('/api/Plans',{params:header}).subscribe((data:any)=>{ - data.items.forEach(element => { - if (element.companyId===this.route.snapshot.queryParams.id) { - this.compantData = element.company - return } }); - + this.http.get(`/api/Plans/${this.route.snapshot.queryParams.id}`).subscribe((data:any)=>{ + data && data.company? this.compantData = data.company : null }) } @@ -62,19 +56,24 @@ export class PlanPassComponent implements OnInit { AuditStatus: this.route.snapshot.queryParams.auditStatus || '', PageSize: '100', } - this.http.get('/api/PlanAudits',{params:header}).subscribe((data:any)=>{ + let api + this.route.snapshot.queryParams.planType == 1? api = '/api/PlanAudits' : api = '/api/PublicPlans' //1=棰勬瀹℃牳 2=鍏紑棰勬 + this.http.get(api,{params:header}).subscribe((data:any)=>{ data.items.forEach(element => { if (element.id===this.route.snapshot.queryParams.auditPlanId) { this.planData = element + this.organizationName = element.committerOrganizationName this.handleData() - return } }); - + return + } + }); }) } planType:any; //灞曠ず棰勬绫诲瀷 allFile:any = []; //绫诲瀷=0鏃舵墍鏈夋枃浠 thirdPartyURL:any; //绫诲瀷=3鏃剁綉鍧 + handleData () { this.planType = this.planData.planMode let data = this.planData diff --git a/src/app/plan-management/open-plan/open-plan.component.ts b/src/app/plan-management/open-plan/open-plan.component.ts index c7e4e3c..bb8ce5e 100644 --- a/src/app/plan-management/open-plan/open-plan.component.ts +++ b/src/app/plan-management/open-plan/open-plan.component.ts @@ -160,12 +160,10 @@ export class OpenPlanComponent implements OnInit { } ) } - //璺宠浆鏌ョ湅棰勬椤甸潰 + //璺宠浆鏌ョ湅棰勬椤甸潰 鍏紑棰勬 routerTo(element){ sessionStorage.setItem("companyName",element.companyName) - // window.open(`/planManagement/entryPlandetail?unitId=${element.company.id}&unitTypeId=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].id}&operation=false&pagetype=openplan&unitName=${element.company.name}&orName=${element.company.organizationName}&unitType=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].name}&unitAdd=${element.company.address}`); - window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6`); - + window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6&planType=2`); } //鍒嗛〉浜嬩欢 chagePage(e){ diff --git a/src/app/plan-management/pass-plan/pass-plan.component.ts b/src/app/plan-management/pass-plan/pass-plan.component.ts index 45a4ec8..6a3bf37 100644 --- a/src/app/plan-management/pass-plan/pass-plan.component.ts +++ b/src/app/plan-management/pass-plan/pass-plan.component.ts @@ -169,12 +169,10 @@ export class PassPlanComponent implements OnInit { } ) } - //璺宠浆鏌ョ湅棰勬椤甸潰 + //璺宠浆鏌ョ湅棰勬椤甸潰 瀹℃牳閫氳繃棰勬 routerTo(element){ sessionStorage.setItem("companyName",element.companyName) - // window.open(`/planManagement/entryPlandetail?unitId=${element.company.id}&unitTypeId=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].id}&operation=false&pagetype=passplan&unitName=${element.company.name}&orName=${element.company.organizationName}&unitType=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].name}&unitAdd=${element.company.address}`); - window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6`); - + window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6&planType=1`); } //鍒嗛〉浜嬩欢 chagePage(e){ diff --git a/src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.scss b/src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.scss index a627a23..8ec7d96 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.scss +++ b/src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.scss @@ -8,7 +8,7 @@ } #indexBzt{ width: 100%; - height: 93%; + height: 100%; padding-top: 3%; display: flex; flex-direction: row; diff --git a/src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.scss b/src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.scss index 5bedfb2..fdf24f1 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.scss +++ b/src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.scss @@ -1,6 +1,6 @@ .box{ width: 100%; - height: 92%; + height: 100%; display: flex; flex-direction: column; overflow: hidden; diff --git a/src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.scss b/src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.scss index 3140fa4..61f60d6 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.scss +++ b/src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.scss @@ -1,6 +1,6 @@ .box{ width: 100%; - height: 92%; + height: 100%; display: flex; flex-direction: column; overflow: hidden; diff --git a/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.scss b/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.scss index b2a431d..6904ade 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.scss +++ b/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.scss @@ -1,6 +1,6 @@ .box{ width: 100%; - height: 92%; + height: 100%; display: flex; flex-direction: column; overflow: hidden; diff --git a/src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.scss b/src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.scss index 067157b..b6bb35f 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.scss +++ b/src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.scss @@ -1,6 +1,6 @@ .box{ width: 100%; - height: 92%; + height: 100%; display: flex; flex-direction: column; overflow: hidden; diff --git a/src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.scss b/src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.scss index efabe3c..79ae2c8 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.scss +++ b/src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.scss @@ -1,6 +1,6 @@ .box{ width: 100%; - height: 92%; + height: 100%; display: flex; flex-direction: column; overflow: hidden; diff --git a/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.html b/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.html index 744683f..b560d1b 100644 --- a/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.html +++ b/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.html @@ -1,4 +1,4 @@ -
    +
    \ No newline at end of file diff --git a/src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.scss b/src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.scss index 9a84115..890c20d 100644 --- a/src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.scss +++ b/src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.scss @@ -1,6 +1,6 @@ .box{ width: 100%; - height: 92%; + height: 100%; display: flex; flex-direction: column; overflow: hidden; diff --git a/src/app/statistic-analysis/buildingType/building-type-two-forward/building-type-two-forward.component.scss b/src/app/statistic-analysis/buildingType/building-type-two-forward/building-type-two-forward.component.scss index d6b322f..74dd847 100644 --- a/src/app/statistic-analysis/buildingType/building-type-two-forward/building-type-two-forward.component.scss +++ b/src/app/statistic-analysis/buildingType/building-type-two-forward/building-type-two-forward.component.scss @@ -1,6 +1,6 @@ .box{ width: 100%; - height: 92%; + height: 100%; display: flex; flex-direction: column; overflow: hidden; diff --git a/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.scss b/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.scss index aa420af..b0d4e4b 100644 --- a/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.scss +++ b/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.scss @@ -1,6 +1,6 @@ .box{ width: 100%; - height: 92%; + height: 100%; display: flex; flex-direction: column; overflow: hidden; diff --git a/src/app/statistic-analysis/deleteUnit/delete-one/delete-one.component.html b/src/app/statistic-analysis/deleteUnit/delete-one/delete-one.component.html index ebe06cc..58b9669 100644 --- a/src/app/statistic-analysis/deleteUnit/delete-one/delete-one.component.html +++ b/src/app/statistic-analysis/deleteUnit/delete-one/delete-one.component.html @@ -6,4 +6,4 @@ * @LastEditors: sueRimn * @LastEditTime: 2020-09-05 11:28:26 --> -
    +
    diff --git a/src/app/statistic-analysis/deleteUnit/delete-there-line-details/delete-there-line-details.component.scss b/src/app/statistic-analysis/deleteUnit/delete-there-line-details/delete-there-line-details.component.scss index 0520f0f..4d7c76c 100644 --- a/src/app/statistic-analysis/deleteUnit/delete-there-line-details/delete-there-line-details.component.scss +++ b/src/app/statistic-analysis/deleteUnit/delete-there-line-details/delete-there-line-details.component.scss @@ -1,6 +1,6 @@ .box{ width: 100%; - height: 92%; + height: 100%; display: flex; flex-direction: column; overflow: hidden; diff --git a/src/app/statistic-analysis/deleteUnit/delete-there/delete-there.component.scss b/src/app/statistic-analysis/deleteUnit/delete-there/delete-there.component.scss index e8fd8e2..3cc5c76 100644 --- a/src/app/statistic-analysis/deleteUnit/delete-there/delete-there.component.scss +++ b/src/app/statistic-analysis/deleteUnit/delete-there/delete-there.component.scss @@ -1,6 +1,6 @@ .box{ width: 100%; - height: 92%; + height: 100%; display: flex; flex-direction: column; overflow: hidden; diff --git a/src/app/statistic-analysis/deleteUnit/delete-two-newadd/delete-two-newadd.component.scss b/src/app/statistic-analysis/deleteUnit/delete-two-newadd/delete-two-newadd.component.scss index 72f849e..f7639ce 100644 --- a/src/app/statistic-analysis/deleteUnit/delete-two-newadd/delete-two-newadd.component.scss +++ b/src/app/statistic-analysis/deleteUnit/delete-two-newadd/delete-two-newadd.component.scss @@ -1,6 +1,6 @@ .box{ width: 100%; - height: 92%; + height: 100%; display: flex; flex-direction: column; overflow: hidden; diff --git a/src/app/statistic-analysis/deleteUnit/delete-two/delete-two.component.scss b/src/app/statistic-analysis/deleteUnit/delete-two/delete-two.component.scss index 2eef948..973695b 100644 --- a/src/app/statistic-analysis/deleteUnit/delete-two/delete-two.component.scss +++ b/src/app/statistic-analysis/deleteUnit/delete-two/delete-two.component.scss @@ -1,6 +1,6 @@ .box{ width: 100%; - height: 92%; + height: 100%; display: flex; flex-direction: column; overflow: hidden; diff --git a/src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.scss b/src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.scss index a700a8f..88b7758 100644 --- a/src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.scss +++ b/src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.scss @@ -27,7 +27,7 @@ } .box{ width: 100%; - height: 92%; + height: 100%; display: flex; flex-direction: column; overflow: hidden; diff --git a/src/app/statistic-analysis/state/page-one/page-one.component.html b/src/app/statistic-analysis/state/page-one/page-one.component.html index 3332b70..9ac3386 100644 --- a/src/app/statistic-analysis/state/page-one/page-one.component.html +++ b/src/app/statistic-analysis/state/page-one/page-one.component.html @@ -9,7 +9,7 @@ -
    +
    diff --git a/src/app/statistic-analysis/state/page-there-year/page-there-year.component.scss b/src/app/statistic-analysis/state/page-there-year/page-there-year.component.scss index 0520f0f..4d7c76c 100644 --- a/src/app/statistic-analysis/state/page-there-year/page-there-year.component.scss +++ b/src/app/statistic-analysis/state/page-there-year/page-there-year.component.scss @@ -1,6 +1,6 @@ .box{ width: 100%; - height: 92%; + height: 100%; display: flex; flex-direction: column; overflow: hidden; diff --git a/src/app/statistic-analysis/state/page-there/page-there.component.scss b/src/app/statistic-analysis/state/page-there/page-there.component.scss index 3387989..fb3b6d7 100644 --- a/src/app/statistic-analysis/state/page-there/page-there.component.scss +++ b/src/app/statistic-analysis/state/page-there/page-there.component.scss @@ -1,6 +1,6 @@ .box{ width: 100%; - height: 92%; + height: 100%; display: flex; flex-direction: column; overflow: hidden; diff --git a/src/app/statistic-analysis/state/page-two-time/page-two-time.component.scss b/src/app/statistic-analysis/state/page-two-time/page-two-time.component.scss index b8b9d20..bc02d59 100644 --- a/src/app/statistic-analysis/state/page-two-time/page-two-time.component.scss +++ b/src/app/statistic-analysis/state/page-two-time/page-two-time.component.scss @@ -1,6 +1,6 @@ .content { width: 100%; - height: 93%; + height: 100%; display: flex; flex-direction: column; overflow: hidden; diff --git a/src/app/ui/authority/authority.component.html b/src/app/ui/authority/authority.component.html index 8acc302..2425551 100644 --- a/src/app/ui/authority/authority.component.html +++ b/src/app/ui/authority/authority.component.html @@ -1,4 +1,4 @@ -
    +
    diff --git a/src/app/ui/fire-fighting-facilities-formwork/fire-fighting-facilities-formwork.component.scss b/src/app/ui/fire-fighting-facilities-formwork/fire-fighting-facilities-formwork.component.scss index 5ca7442..c6959ff 100644 --- a/src/app/ui/fire-fighting-facilities-formwork/fire-fighting-facilities-formwork.component.scss +++ b/src/app/ui/fire-fighting-facilities-formwork/fire-fighting-facilities-formwork.component.scss @@ -1,7 +1,7 @@ .content { margin: 0 0 0 10px; width: 100%; - height: 90%; + height: 100%; overflow-y: auto; display: flex; .leftBox { diff --git a/src/app/ui/fire-protection-elements/fire-protection-elements.component.scss b/src/app/ui/fire-protection-elements/fire-protection-elements.component.scss index 12c709e..f1995a2 100644 --- a/src/app/ui/fire-protection-elements/fire-protection-elements.component.scss +++ b/src/app/ui/fire-protection-elements/fire-protection-elements.component.scss @@ -6,7 +6,7 @@ .Box { width: 100%; - height: 90%; + height: 100%; overflow-y: auto; display: flex; padding-left: 10px; diff --git a/src/app/ui/material-bank/material-bank.component.scss b/src/app/ui/material-bank/material-bank.component.scss index a42d67c..5bdbccb 100644 --- a/src/app/ui/material-bank/material-bank.component.scss +++ b/src/app/ui/material-bank/material-bank.component.scss @@ -1,7 +1,7 @@ .content { padding: 0 0 0 10px; width: 100%; - height: 90%; + height: 100%; overflow-x: hidden; overflow-y: auto; display: flex; diff --git a/src/app/ui/navmenus/navmenus.component.html b/src/app/ui/navmenus/navmenus.component.html index 967468b..a4b6735 100644 --- a/src/app/ui/navmenus/navmenus.component.html +++ b/src/app/ui/navmenus/navmenus.component.html @@ -1,4 +1,4 @@ -
    +
    diff --git a/src/app/ui/role/role.component.html b/src/app/ui/role/role.component.html index 3eeef51..ee1c85d 100644 --- a/src/app/ui/role/role.component.html +++ b/src/app/ui/role/role.component.html @@ -1,4 +1,4 @@ -
    +
    diff --git a/src/app/ui/unit-information/unit-information.component.scss b/src/app/ui/unit-information/unit-information.component.scss index fd0abd5..6131605 100644 --- a/src/app/ui/unit-information/unit-information.component.scss +++ b/src/app/ui/unit-information/unit-information.component.scss @@ -1,7 +1,7 @@ .content { margin: 0 0 0 10px; width: 100%; - height: 90%; + height: 100%; overflow-x: hidden; overflow-y: auto; display: flex; diff --git a/src/assets/css/newStyle.css b/src/assets/css/newStyle.css index 843324d..0ac2d32 100644 --- a/src/assets/css/newStyle.css +++ b/src/assets/css/newStyle.css @@ -367,7 +367,7 @@ iframe { display: block; } .num-item .num-text { color: #93FCFF; font-weight: 500; font-family: 'digiface'; font-size: 50px; line-height: 62px; letter-spacing: 0.1em; } .num-item .num-text .unit { font-size: 34px; margin-left: 10px; } -.main { display: flex; flex-direction: column; padding: 0 30px 10px; height: 93%; } +.main { display: flex; flex-direction: column; padding: 0 30px 10px; height: 100%; } .main-top { flex: 2; display: flex; padding: 30px 0 0; max-height: 699px; } From 0e3d3b647620682c3495855070ea522958b4f74e Mon Sep 17 00:00:00 2001 From: chenjingyu Date: Mon, 11 Jan 2021 14:47:54 +0800 Subject: [PATCH 08/13] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E4=B8=80=E5=88=B0?= =?UTF-8?q?=E4=BA=94=E7=BA=A7=E9=A2=84=E6=A1=88=E5=BD=95=E5=85=A5=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../meet-plan/meet-plan.component.html | 63 ++-- .../meet-plan/meet-plan.component.scss | 3 + .../meet-plan/meet-plan.component.ts | 357 +++++++++++++++++- .../plan-management/meet-plan/newunit.html | 32 +- .../plan-management/meet-plan/newunit.scss | 2 +- .../onetwo-entry-plan/newunit.html | 34 +- .../onetwo-entry-plan/newunit.scss | 2 +- .../onetwo-entry-plan.component.html | 32 +- .../onetwo-entry-plan.component.scss | 3 + .../onetwo-entry-plan.component.ts | 357 ++++++++++++++++-- .../plan-management/type-plan/newunit.html | 42 ++- .../plan-management/type-plan/newunit.scss | 4 +- .../type-plan/type-plan.component.html | 42 ++- .../type-plan/type-plan.component.scss | 3 + .../type-plan/type-plan.component.ts | 341 ++++++++++++++++- 15 files changed, 1155 insertions(+), 162 deletions(-) diff --git a/src/app/plan-management/meet-plan/meet-plan.component.html b/src/app/plan-management/meet-plan/meet-plan.component.html index 5a47d5f..97682f5 100644 --- a/src/app/plan-management/meet-plan/meet-plan.component.html +++ b/src/app/plan-management/meet-plan/meet-plan.component.html @@ -1,6 +1,6 @@
    -
    +
    @@ -14,32 +14,37 @@
    - - 鈪犵骇 - 鈪$骇 + + 鍥藉绾 + 甯傜骇
    - +
    - + 馃爦 - +
    - - + + + 鍗$墖棰勬 + 浜岀淮棰勬 + 涓夌淮棰勬 + 鍏朵粬棰勬 +
    @@ -82,42 +87,44 @@
    - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + diff --git a/src/app/plan-management/meet-plan/meet-plan.component.scss b/src/app/plan-management/meet-plan/meet-plan.component.scss index 95d2d38..d963db0 100644 --- a/src/app/plan-management/meet-plan/meet-plan.component.scss +++ b/src/app/plan-management/meet-plan/meet-plan.component.scss @@ -114,5 +114,8 @@ .mat-column-jurisdictionsquadron{ width: 10%; } + span:hover{ + text-decoration:underline + } } } \ No newline at end of file diff --git a/src/app/plan-management/meet-plan/meet-plan.component.ts b/src/app/plan-management/meet-plan/meet-plan.component.ts index ba3f1ed..12cc226 100644 --- a/src/app/plan-management/meet-plan/meet-plan.component.ts +++ b/src/app/plan-management/meet-plan/meet-plan.component.ts @@ -47,10 +47,9 @@ export class MeetPlanComponent implements OnInit { {name:"涓槦",value:"8"} ] } - this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length) + this.getAlltabledate() } - url preparelevels:any plcheck:boolean //缂栧埗绾у埆鍕鹃夋 displayedColumns: string[] = ['unitname','level','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation']; @@ -59,6 +58,8 @@ export class MeetPlanComponent implements OnInit { level//棰勬绾у埆 addname//娣诲姞浜 addtime//娣诲姞鏃堕棿 + endtime + reservePlanType//棰勬绫诲瀷 unittype//棰勬绫诲瀷 unitstate//瀹℃牳鐘舵 projectlevel//缂栧埗绾у埆 @@ -71,21 +72,162 @@ export class MeetPlanComponent implements OnInit { pageSizeOptions: number[] = [10] //璁剧疆姣忛〉鏉℃暟 PageNumber:any; //绗嚑椤 - //鑾峰緱鎵鏈夐妗堜俊鎭 - getAllPlanInfo(){ + + + //鑾峰彇琛ㄦ牸鏁版嵁 + getAlltabledate(){ + let reservePlanType + this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = '' + if(this.reservePlanType && this.reservePlanType.length != 0){ + reservePlanType = eval(this.reservePlanType.join("|")) + } let paramsdata:any = { - HasChildrenPlanLevel: this.plcheck || '', + Name:this.unitname||'', + planCategories:this.level||[6,7], + PlanType:reservePlanType||'', + CreatorName:this.addname||'', + AuditStatus:this.unitstate|| '', + QueryStartTime:this.addtime||'', + QueryEndTime:this.endtime||'', + PlanLevel:this.projectlevel||'', + HasChildrenPlanLevel:this.plcheck||'', PageNumber: this.PageNumber || '1', PageSize: this.pageSizeOptions[0], + } - this.http.get("/api/Plans",{params:paramsdata}).subscribe((data:any)=>{ - + this.http.get("/api/PlanComponentsMajor",{params:paramsdata}).subscribe((data:any)=>{ this.length = data.totalCount - //this.allPlanInfo = data - - //this.tabledataSource = new MatTableDataSource(data.items) - console.log(this.tabledataSource) + this.tabledataSource = data.items + }) + } + + //鏌ヨ + onSubmit (value) { + if(this.endtime!=undefined&&this.addtime>this.endtime){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('寮濮嬫椂闂翠笉鑳藉ぇ浜庣粨鏉熸椂闂!','纭畾',config); + }else{ + this.PageNumber = 1 + this.pageEvent.pageIndex = 0 + this.getAlltabledate(); + } + + } + //鍒犻櫎棰勬 + deletePlan(id){ + let isTrue = confirm('鎮ㄧ‘瀹氳鍒犻櫎鍚') + if(isTrue){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data=>{ + this.snackBar.open('鍒犻櫎鎴愬姛!','纭畾',config); + this.getAlltabledate() + },err => { + this.snackBar.open(err,'纭畾',config); }) + } + + } + + //涓嬭浇鈫 + selectDownloadFile:any; //閫夋嫨涓嬭浇鐨勬枃浠 + download:any; //涓嬭浇鏂囦欢鍏冩暟鎹 + downloadisLoading:boolean = false; //杩涘害鏉oading鍔犺浇 + downloadProgress:number=0; //杩涘害鏉¤繘搴 + downloadFileName:any + fileUrls:any //褰撳墠棰勬闄勪欢鍦板潃 + fileDatas:any = [] + selectedFileIndex : any = 0 + selectedFileData : any + + uploadFileLonging:any + //璇诲彇涓嬭浇鏂囦欢淇℃伅 + readFile (element) { + this.uploadFileLonging = element + element.attachmentUrls.forEach(item=>{ + this.http.get('/api/ObjectMetadata/PlanPlatform/'+item).subscribe((data:any)=>{ + data.filePige = (data.fileLength / (1024*1024)).toFixed(2) + this.download = data + this.downloadFile() + }) + }) + + } + + //鍒濆鍖栦笅杞 + downloadFile () { + this.downloadProgress = 0 + let file = this.download + let fileSize = file.fileLength//涓嬭浇鏂囦欢鐨勬诲ぇ灏 + let shardSize = 10 * 1024 * 1024 //鏂囦欢澶у皬鏄惁澶т簬10MB + + if (file && fileSize<=shardSize) { //<=10MB鏃剁洿鎺ヤ笅杞 + this.downloadisLoading = true + // this.setFileLoading() + this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{responseType: 'blob'},).subscribe(data=>{ + + let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL鍒涘缓涓涓笅杞紹lob鐨剈rl鍦板潃 + let link = document.createElement("a"); + link.style.display = "none"; + link.href = url; + + let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; + link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); + document.body.appendChild(link); + link.click(); + this.downloadisLoading = false + // this.setFileLoading() + }) + } else if (file && fileSize > shardSize) { //>10MB鏃跺垎鍧椾笅杞 + this.blockingDownload() //鍒嗘涓嬭浇 + this.downloadisLoading = true + // this.setFileLoading() + } + + } + + //鍒嗘涓嬭浇骞跺悎骞 + async blockingDownload () { + let file = this.download + let fileSize = file.fileLength //涓嬭浇鏂囦欢鐨勬诲ぇ灏 + let shardSize = 3 * 1024 * 1024 //3MB涓涓垎鐗 + let allSlice = Math.ceil(fileSize / shardSize) //鎬绘枃浠/3MB===鍏卞垎澶氬皯娈 + let allFile:any = [] //鎵鏈夌殑file鍒嗘 + + for (let i=0;i{ + this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{ + result(data) }) + }) + allFile.push(result) + this.downloadProgress = Number((i/allSlice).toFixed(2))*100 + + if (allFile.length === allSlice) { //鍚堝苟鏂囦欢杈撳嚭缁欐祻瑙堝櫒 + let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL鍒涘缓涓涓笅杞紹lob鐨剈rl鍦板潃 + let link = document.createElement("a"); + link.style.display = "none"; + link.href = url; + let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; + link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); + document.body.appendChild(link); + link.click(); + // this.downloadProgress = 0 + this.downloadisLoading = false + // this.setFileLoading() + } + + } //for寰幆 + + } + + //鍙栨秷鍒嗗潡涓嬭浇 + cancelDowload () { } //閲嶇疆 @@ -94,17 +236,24 @@ export class MeetPlanComponent implements OnInit { this.level='' this.addname='' this.addtime='' - this.unittype='' + this.endtime='' + this.reservePlanType='' this.unitstate='' this.projectlevel='' + this.plcheck=false + this.getAlltabledate() } //鏂板棰勬寮圭獥 addunit(){ const dialogRef = this.dialog.open(newunitMeet, { width: '340px', - height:'430px' + height:'505px' //data: paperDataInfo }); + dialogRef.afterClosed().subscribe(result => { + this.getAlltabledate() + } + ); } } @@ -119,9 +268,189 @@ export class newunitMeet{ level//棰勬绾у埆 addname//娣诲姞浜 addtime//娣诲姞鏃堕棿 - unittype//棰勬绫诲瀷 + reservePlanType//棰勬绫诲瀷 unitstate//瀹℃牳鐘舵 projectlevel//缂栧埗绾у埆 + + //涓婁紶鏂囦欢鈫 + file:any; //涓婁紶鐨勬枃浠 + fileName:any; //涓婁紶鏂囦欢name + uploadisLoading:boolean = false; //杩涘害鏉oading鍔犺浇 + uploadProgress:number=0; //杩涘害鏉¤繘搴 + objectName:any; //涓婁紶瀵硅薄鍚 + uploadId:any; //涓婁紶鍒嗗潡涓婁紶浜嬩欢缂栧彿 + uploadover:any = false //涓婁紶瀹屾垚涔嬪悗鎻愮ず + selectedPLanType:any//鎵閫夐妗堢被鍨 + selectedPLanName:any//鎵閫夐妗堝悕绉 + localup:boolean = false //鏈湴涓婁紶 + defaultisshow = '0' //榛樿鏄剧ず涓婁紶input妗 + + //涓婁紶 + upload(){ + document.getElementById('up').click() + } +//涓婁紶鏂囦欢input + filechange(e){ + this.file = e.target.files[0] || null //涓婁紶鐨勬枃浠 + //console.log(this.file) + } + + //涓婁紶鏂囦欢 + startUploading (planType) { + let file = this.file || null //鑾峰彇涓婁紶鐨勬枃浠 + let fileSize = file.size || null //涓婁紶鏂囦欢鐨勬诲ぇ灏 + let shardSize = 5 * 1024 * 1024 //5MB涓涓垎鐗 + + if (file && fileSize<=shardSize) { //涓婁紶鏂囦欢<=5MB鏃 + let formData = new FormData() + formData.append("file",file) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.http.post('/api/Objects/PlanPlatform/meetClass',formData).subscribe((data:any)=>{ + this.objectName = data.objectName + //this.snackBar.open('涓婁紶鎴愬姛!','纭畾',config); + + let body:any = { + Name:this.unitname||'', + PlanCategory:Number(this.level)||'', + PlanType: Number(this.reservePlanType), + PlanLevel:1, + PlanMode:1, + attachmentUrls:[`${this.objectName}`] + } + this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ + this.snackBar.open('鍒涘缓鎴愬姛!','纭畾',config); + //console.log(data) + this.dialogRef.close(); + },err=>{ + this.snackBar.open('鍒涘缓澶辫触!','纭畾',config); + }) + },err=>{ + this.snackBar.open('涓婁紶澶辫触!','纭畾',config); + }) + } else if (file && fileSize>shardSize) { //涓婁紶鏂囦欢>5MB鏃,鍒嗗潡涓婁紶 + let data = {filename: file.name} + this.uploadisLoading = true + this.http.post('/api/NewMultipartUpload/PlanPlatform/meetClass',{},{params:data}).subscribe((data:any)=>{ //鍒濆鍖栧垎娈典笂浼 + this.objectName = data.objectName + this.uploadId = data.uploadId + this.subsectionUploading(planType) + }) + } + + } + PartNumberETag:any=[]; //姣忔杩斿洖闇瑕佷繚瀛樼殑淇℃伅 + //寮濮嬪垎娈典笂浼 + async subsectionUploading (planType) { + let file = this.file || null //鑾峰彇涓婁紶鐨勬枃浠 + let fileSize = file.size || null //涓婁紶鏂囦欢鐨勬诲ぇ灏 + let shardSize = 5 * 1024 * 1024 //5MB涓涓垎鐗 + let allSlice = Math.ceil(fileSize / shardSize) //鎬绘枃浠/5MB===鍏卞垎澶氬皯娈 鍚戜笂鍙栨暣 + + for (let i = 0;i < allSlice;i++) { //寰幆鍒嗘涓婁紶 + let start = i * shardSize //鍒囧壊鏂囦欢寮濮嬩綅缃 + let end = Math.min(fileSize, start + shardSize); //鍒囧壊鏂囦欢缁撴潫浣嶇疆 锛堝姣斿彇灏忔暟锛 + let formData = new FormData() + formData.append("file",file.slice(start, end)) + + //鍚屾鍐欐硶瀹炵幇寮傛璋冪敤 + let result = await new Promise((resolve, reject) => { + // await 闇瑕佸悗闈㈣繑鍥炰竴涓 promise 瀵硅薄 + this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{ + let msg = { + "partNumber":data.partNumber || null, + "eTag": data.eTag || null} + resolve(msg) // 璋冪敤 promise 鍐呯疆鏂规硶澶勭悊鎴愬姛 + }) + }); + this.PartNumberETag.push(result) + this.uploadProgress = Number((i/allSlice).toFixed(2))*100 + + if (this.PartNumberETag.length === allSlice) { + this.uploadProgress = 100 + this.endUploading(planType)} + }//for寰幆 + + } + + //瀹屾垚鍒嗗潡涓婁紶 + endUploading (planType) { + let data = this.PartNumberETag + let paramsData = {uploadId:this.uploadId} + this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + //this.snackBar.open('涓婁紶鎴愬姛!','纭畾',config); + this.uploadProgress = 0; + this.uploadisLoading = false + this.PartNumberETag =[] //娓呯┖淇濆瓨杩斿洖鐨勪俊鎭 + this.uploadover = true + + let body:any = { + Name:this.unitname||'', + PlanCategory:Number(this.level)||'', + PlanType: Number(this.reservePlanType), + PlanLevel:1, + PlanMode:1, + attachmentUrls:[`${this.objectName}`] + } + this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ + this.snackBar.open('鍒涘缓鎴愬姛!','纭畾',config); + this.dialogRef.close(); + },err=>{ + this.snackBar.open('鍒涘缓澶辫触!','纭畾',config); + }) + }) + } + + //鍙栨秷鍒嗗潡涓婁紶 + cancel () { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000; + this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data=>{ + this.uploadProgress = 0; + this.uploadisLoading= false; + (document.getElementById('up')).value = null + this.PartNumberETag =[] //娓呯┖淇濆瓨杩斿洖鐨勪俊鎭 + this.snackBar.open('鍙栨秷涓婁紶鎴愬姛!','纭畾',config); + this.uploadover = false + this.file = null + }) + } + + + //鍒涘缓棰勬 + newplan(){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if(this.unitname==undefined||this.unitname==''){ + this.snackBar.open('璇疯緭鍏ラ妗堝悕绉!','纭畾',config); + } + else if(this.reservePlanType==undefined||this.reservePlanType==''){ + this.snackBar.open('璇疯緭鍏ラ妗堢被鍨!','纭畾',config); + } + else if(this.level==undefined||this.level==''){ + this.snackBar.open('璇疯緭鍏ラ妗堢骇鍒!','纭畾',config); + } + else if(this.file==undefined){ + this.snackBar.open('璇峰厛涓婁紶鏂囦欢!','纭畾',config); + } + else{ + if(this.reservePlanType!='1'){ + this.startUploading("闈炰簩缁") + } + else{this.startUploading("浜岀淮")} + + + } + + + } + //鍙栨秷 close(){ this.dialogRef.close(); } diff --git a/src/app/plan-management/meet-plan/newunit.html b/src/app/plan-management/meet-plan/newunit.html index c770a48..65e54f7 100644 --- a/src/app/plan-management/meet-plan/newunit.html +++ b/src/app/plan-management/meet-plan/newunit.html @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-24 16:26:16 * @LastEditors: sueRimn - * @LastEditTime: 2021-01-06 09:34:26 + * @LastEditTime: 2021-01-11 13:56:29 -->
    @@ -13,30 +13,42 @@
    - +
    - - + + + 鍗$墖棰勬 + 浜岀淮棰勬 + 涓夌淮棰勬 + 鍏朵粬棰勬 +
    - - 鍥藉绾 - 甯傜骇 + + 鍥藉绾 + 甯傜骇
    - - + + + +
    +
    + 涓婁紶涓... + +
    +
    - +
    \ No newline at end of file diff --git a/src/app/plan-management/meet-plan/newunit.scss b/src/app/plan-management/meet-plan/newunit.scss index 7e78e9c..b99389b 100644 --- a/src/app/plan-management/meet-plan/newunit.scss +++ b/src/app/plan-management/meet-plan/newunit.scss @@ -7,7 +7,7 @@ .queryField { margin: 3px 5px; input { - width: 50px; + width: 100%; height: 18px; line-height: 18px; border-radius: 3px;} diff --git a/src/app/plan-management/onetwo-entry-plan/newunit.html b/src/app/plan-management/onetwo-entry-plan/newunit.html index 356b5e6..47919d3 100644 --- a/src/app/plan-management/onetwo-entry-plan/newunit.html +++ b/src/app/plan-management/onetwo-entry-plan/newunit.html @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-24 16:26:16 * @LastEditors: sueRimn - * @LastEditTime: 2020-12-28 11:47:01 + * @LastEditTime: 2021-01-11 13:55:40 -->
    @@ -13,30 +13,34 @@
    - +
    - - + + + 鍗$墖棰勬 + 浜岀淮棰勬 + 涓夌淮棰勬 + 鍏朵粬棰勬 +
    +
    - - - - 鈪犵骇 - 鈪$骇 - - -
    -
    - + + +
    +
    + 涓婁紶涓... + + +
    - +
    \ No newline at end of file diff --git a/src/app/plan-management/onetwo-entry-plan/newunit.scss b/src/app/plan-management/onetwo-entry-plan/newunit.scss index 7e78e9c..b99389b 100644 --- a/src/app/plan-management/onetwo-entry-plan/newunit.scss +++ b/src/app/plan-management/onetwo-entry-plan/newunit.scss @@ -7,7 +7,7 @@ .queryField { margin: 3px 5px; input { - width: 50px; + width: 100%; height: 18px; line-height: 18px; border-radius: 3px;} diff --git a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html index ca64906..0c01d45 100644 --- a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html +++ b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-24 14:15:10 * @LastEditors: sueRimn - * @LastEditTime: 2021-01-08 09:47:51 + * @LastEditTime: 2021-01-09 10:37:36 -->
    @@ -39,7 +39,7 @@
    - + 鍗$墖棰勬 浜岀淮棰勬 涓夌淮棰勬 @@ -88,44 +88,44 @@
    棰勬鍚嶇О{{element.unitname}}棰勬鍚嶇О{{element.name}} 棰勬绾у埆{{url=='2'?'鈪$骇':'鈪犵骇'}}棰勬绾у埆{{element.planCategory=='6'?'鍥藉绾':'甯傜骇'}} 娣诲姞浜{{element.addname}}娣诲姞浜{{element.creatorName}} 娣诲姞鏃堕棿{{element.addtime}}娣诲姞鏃堕棿{{element.creationTime|date:'yyyy-MM-dd'}} 棰勬绫诲瀷{{element.plantype}}棰勬绫诲瀷{{element.planType=='1'?'浜岀淮棰勬':element.planType=='2'?'涓夌淮棰勬':element.planType=='4'?'鍏朵粬棰勬':'鍗$墖棰勬'}} 瀹℃牳鐘舵{{element.passstate}}瀹℃牳鐘舵{{element.auditStatus=='8'?'鏈彁浜ゅ鏍':element.auditStatus=='1'?'瀹℃牳涓':element.auditStatus=='2'?'瀹℃牳閫氳繃':'瀹℃牳閫鍥'}} 鏄惁鍏紑{{element.isopen}}鏄惁鍏紑{{element.openRange}} 缂栧埗绾у埆{{element.projectlevel}}缂栧埗绾у埆{{element.planLevel=='1'?'鎬婚槦':element.planLevel=='2'?'鏀槦':element.planLevel=='4'?'澶ч槦':'涓槦'}} 鎿嶄綔 - 鏌ョ湅棰勬 + 鎿嶄綔 + 鏌ョ湅棰勬 + 涓嬭浇 + 鍒犻櫎
    - + - + - + - + - + - + - + - - + + - - + diff --git a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.scss b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.scss index 95d2d38..d963db0 100644 --- a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.scss +++ b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.scss @@ -114,5 +114,8 @@ .mat-column-jurisdictionsquadron{ width: 10%; } + span:hover{ + text-decoration:underline + } } } \ No newline at end of file diff --git a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts index 34e21aa..7a0debf 100644 --- a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts +++ b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-24 14:15:10 * @LastEditors: sueRimn - * @LastEditTime: 2021-01-08 09:48:06 + * @LastEditTime: 2021-01-11 14:04:49 */ import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import { HttpClient } from '@angular/common/http' @@ -84,29 +84,23 @@ export class OnetwoEntryPlanComponent implements OnInit { pageSizeOptions: number[] = [10] //璁剧疆姣忛〉鏉℃暟 PageNumber:any; //绗嚑椤 - //鑾峰緱鎵鏈夐妗堜俊鎭 - getAllPlanInfo(){ - let paramsdata:any = { - HasChildrenPlanLevel: this.plcheck || '', - PageNumber: this.PageNumber || '1', - PageSize: this.pageSizeOptions[0], - } - this.http.get("/api/Plans",{params:paramsdata}).subscribe((data:any)=>{ - - this.length = data.totalCount - //this.allPlanInfo = data - - //this.tabledataSource = new MatTableDataSource(data.items) - console.log(this.tabledataSource) - }) - } - //鑾峰彇琛ㄦ牸鏁版嵁 getAlltabledate(){ + let reservePlanType + this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = '' + if(this.reservePlanType && this.reservePlanType.length != 0){ + reservePlanType = eval(this.reservePlanType.join("|")) + } let paramsdata:any = { - PlanCategory:this.url=='2'?2:1, - PlanType:this.projectlevel||'', + Name:this.unitname||'', + planCategories:this.url=='2'?2:1, + PlanType:reservePlanType||'', + CreatorName:this.addname||'', AuditStatus:this.unitstate|| '', + QueryStartTime:this.addtime||'', + QueryEndTime:this.endtime||'', + PlanLevel:this.projectlevel||'', + HasChildrenPlanLevel:this.plcheck||'', PageNumber: this.PageNumber || '1', PageSize: this.pageSizeOptions[0], @@ -114,7 +108,6 @@ export class OnetwoEntryPlanComponent implements OnInit { this.http.get("/api/PlanComponentsMajor",{params:paramsdata}).subscribe((data:any)=>{ this.length = data.totalCount this.tabledataSource = data.items - console.log(this.tabledataSource) }) } @@ -124,29 +117,160 @@ export class OnetwoEntryPlanComponent implements OnInit { this.level='' this.addname='' this.addtime='' - //this.unittype='' + this.endtime='' + this.reservePlanType='' this.unitstate='' this.projectlevel='' + this.plcheck=false + this.getAlltabledate() } //鏌ヨ onSubmit (value) { - this.PageNumber = 1 - this.pageEvent.pageIndex = 0 - this.getAlltabledate(); + //console.log(value) + if(this.endtime!=undefined&&this.addtime>this.endtime){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('寮濮嬫椂闂翠笉鑳藉ぇ浜庣粨鏉熸椂闂!','纭畾',config); + }else{ + this.PageNumber = 1 + this.pageEvent.pageIndex = 0 + this.getAlltabledate(); + } + + } + //鍒犻櫎棰勬 + deletePlan(id){ + let isTrue = confirm('鎮ㄧ‘瀹氳鍒犻櫎鍚') + if(isTrue){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data=>{ + this.snackBar.open('鍒犻櫎鎴愬姛!','纭畾',config); + this.getAlltabledate() + },err => { + this.snackBar.open(err,'纭畾',config); + }) + } + } //鏂板棰勬寮圭獥 addunit(){ const dialogRef = this.dialog.open(newunitComponent, { width: '340px', - height:'430px' + height:'440px' //data: paperDataInfo }); + dialogRef.afterClosed().subscribe(result => { + this.getAlltabledate() + } + ); + } + //涓嬭浇鈫 + selectDownloadFile:any; //閫夋嫨涓嬭浇鐨勬枃浠 + download:any; //涓嬭浇鏂囦欢鍏冩暟鎹 + downloadisLoading:boolean = false; //杩涘害鏉oading鍔犺浇 + downloadProgress:number=0; //杩涘害鏉¤繘搴 + downloadFileName:any + fileUrls:any //褰撳墠棰勬闄勪欢鍦板潃 + fileDatas:any = [] + selectedFileIndex : any = 0 + selectedFileData : any + + uploadFileLonging:any + //璇诲彇涓嬭浇鏂囦欢淇℃伅 + readFile (element) { + this.uploadFileLonging = element + element.attachmentUrls.forEach(item=>{ + this.http.get('/api/ObjectMetadata/PlanPlatform/'+item).subscribe((data:any)=>{ + data.filePige = (data.fileLength / (1024*1024)).toFixed(2) + //console.log(data) + this.download = data + this.downloadFile() + }) + }) + } + + //鍒濆鍖栦笅杞 + downloadFile () { + this.downloadProgress = 0 + let file = this.download + let fileSize = file.fileLength//涓嬭浇鏂囦欢鐨勬诲ぇ灏 + let shardSize = 10 * 1024 * 1024 //鏂囦欢澶у皬鏄惁澶т簬10MB + + if (file && fileSize<=shardSize) { //<=10MB鏃剁洿鎺ヤ笅杞 + this.downloadisLoading = true + // this.setFileLoading() + this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{responseType: 'blob'},).subscribe(data=>{ + + let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL鍒涘缓涓涓笅杞紹lob鐨剈rl鍦板潃 + let link = document.createElement("a"); + link.style.display = "none"; + link.href = url; + + let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; + link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); + document.body.appendChild(link); + link.click(); + this.downloadisLoading = false + // this.setFileLoading() + }) + } else if (file && fileSize > shardSize) { //>10MB鏃跺垎鍧椾笅杞 + this.blockingDownload() //鍒嗘涓嬭浇 + this.downloadisLoading = true + // this.setFileLoading() + } + + } + + //鍒嗘涓嬭浇骞跺悎骞 + async blockingDownload () { + let file = this.download + let fileSize = file.fileLength //涓嬭浇鏂囦欢鐨勬诲ぇ灏 + let shardSize = 3 * 1024 * 1024 //3MB涓涓垎鐗 + let allSlice = Math.ceil(fileSize / shardSize) //鎬绘枃浠/3MB===鍏卞垎澶氬皯娈 + let allFile:any = [] //鎵鏈夌殑file鍒嗘 + + for (let i=0;i{ + this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{ + result(data) }) + }) + allFile.push(result) + this.downloadProgress = Number((i/allSlice).toFixed(2))*100 + + if (allFile.length === allSlice) { //鍚堝苟鏂囦欢杈撳嚭缁欐祻瑙堝櫒 + let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL鍒涘缓涓涓笅杞紹lob鐨剈rl鍦板潃 + let link = document.createElement("a"); + link.style.display = "none"; + link.href = url; + let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; + link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); + document.body.appendChild(link); + link.click(); + // this.downloadProgress = 0 + this.downloadisLoading = false + // this.setFileLoading() + } + + } //for寰幆 + + } + + //鍙栨秷鍒嗗潡涓嬭浇 + cancelDowload () { + } + + //鏌ョ湅棰勬鎸夐挳璺宠浆 routerTo(element){ - console.log(element) sessionStorage.setItem("companyName",element.unitname) window.open(`/planManagement/entryPlandetail?unitId=${element.company.id}&unitTypeId=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].id}&operation=true&pagetype=entryplan&unitName=${element.company.name}&orName=${element.company.organizationName}&unitType=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].name}&unitAdd=${element.company.address}`); } @@ -160,13 +284,190 @@ export class OnetwoEntryPlanComponent implements OnInit { }) export class newunitComponent{ constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} + ngOnInit(): void { + this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length) + } + url unitname//棰勬鍚嶇О level//棰勬绾у埆 addname//娣诲姞浜 addtime//娣诲姞鏃堕棿 - unittype//棰勬绫诲瀷 + reservePlanType//棰勬绫诲瀷 unitstate//瀹℃牳鐘舵 projectlevel//缂栧埗绾у埆 + + //涓婁紶鏂囦欢鈫 + file:any; //涓婁紶鐨勬枃浠 + fileName:any; //涓婁紶鏂囦欢name + uploadisLoading:boolean = false; //杩涘害鏉oading鍔犺浇 + uploadProgress:number=0; //杩涘害鏉¤繘搴 + objectName:any; //涓婁紶瀵硅薄鍚 + uploadId:any; //涓婁紶鍒嗗潡涓婁紶浜嬩欢缂栧彿 + uploadover:any = false //涓婁紶瀹屾垚涔嬪悗鎻愮ず + selectedPLanType:any//鎵閫夐妗堢被鍨 + selectedPLanName:any//鎵閫夐妗堝悕绉 + localup:boolean = false //鏈湴涓婁紶 + defaultisshow = '0' //榛樿鏄剧ず涓婁紶input妗 + + //涓婁紶 + upload(){ + document.getElementById('up').click() + } +//涓婁紶鏂囦欢input + filechange(e){ + this.file = e.target.files[0] || null //涓婁紶鐨勬枃浠 + } + + //涓婁紶鏂囦欢 + startUploading (planType) { + let file = this.file || null //鑾峰彇涓婁紶鐨勬枃浠 + let fileSize = file.size || null //涓婁紶鏂囦欢鐨勬诲ぇ灏 + let shardSize = 5 * 1024 * 1024 //5MB涓涓垎鐗 + + if (file && fileSize<=shardSize) { //涓婁紶鏂囦欢<=5MB鏃 + let formData = new FormData() + formData.append("file",file) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.http.post(this.url=='2'?`/api/Objects/PlanPlatform/twoClass`:'/api/Objects/PlanPlatform/oneClass',formData).subscribe((data:any)=>{ + this.objectName = data.objectName + //this.snackBar.open('涓婁紶鎴愬姛!','纭畾',config); + + let body:any = { + Name:this.unitname||'', + PlanCategory:this.url=='2'?2:1, + PlanType: Number(this.reservePlanType), + PlanLevel:1, + PlanMode:1, + attachmentUrls:[`${this.objectName}`] + } + this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ + this.snackBar.open('鍒涘缓鎴愬姛!','纭畾',config); + this.dialogRef.close(); + },err=>{ + this.snackBar.open('鍒涘缓澶辫触!','纭畾',config); + }) + },err=>{ + this.snackBar.open('涓婁紶澶辫触!','纭畾',config); + }) + } else if (file && fileSize>shardSize) { //涓婁紶鏂囦欢>5MB鏃,鍒嗗潡涓婁紶 + let data = {filename: file.name} + this.uploadisLoading = true + this.http.post(this.url=='2'?`/api/NewMultipartUpload/PlanPlatform/twoClass`:'/api/NewMultipartUpload/PlanPlatform/oneClass',{},{params:data}).subscribe((data:any)=>{ //鍒濆鍖栧垎娈典笂浼 + this.objectName = data.objectName + this.uploadId = data.uploadId + this.subsectionUploading(planType) + }) + } + + } + PartNumberETag:any=[]; //姣忔杩斿洖闇瑕佷繚瀛樼殑淇℃伅 + //寮濮嬪垎娈典笂浼 + async subsectionUploading (planType) { + let file = this.file || null //鑾峰彇涓婁紶鐨勬枃浠 + let fileSize = file.size || null //涓婁紶鏂囦欢鐨勬诲ぇ灏 + let shardSize = 5 * 1024 * 1024 //5MB涓涓垎鐗 + let allSlice = Math.ceil(fileSize / shardSize) //鎬绘枃浠/5MB===鍏卞垎澶氬皯娈 鍚戜笂鍙栨暣 + + for (let i = 0;i < allSlice;i++) { //寰幆鍒嗘涓婁紶 + let start = i * shardSize //鍒囧壊鏂囦欢寮濮嬩綅缃 + let end = Math.min(fileSize, start + shardSize); //鍒囧壊鏂囦欢缁撴潫浣嶇疆 锛堝姣斿彇灏忔暟锛 + let formData = new FormData() + formData.append("file",file.slice(start, end)) + + //鍚屾鍐欐硶瀹炵幇寮傛璋冪敤 + let result = await new Promise((resolve, reject) => { + // await 闇瑕佸悗闈㈣繑鍥炰竴涓 promise 瀵硅薄 + this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{ + let msg = { + "partNumber":data.partNumber || null, + "eTag": data.eTag || null} + resolve(msg) // 璋冪敤 promise 鍐呯疆鏂规硶澶勭悊鎴愬姛 + }) + }); + this.PartNumberETag.push(result) + this.uploadProgress = Number((i/allSlice).toFixed(2))*100 + + if (this.PartNumberETag.length === allSlice) { + this.uploadProgress = 100 + this.endUploading(planType)} + }//for寰幆 + + } + + //瀹屾垚鍒嗗潡涓婁紶 + endUploading (planType) { + let data = this.PartNumberETag + let paramsData = {uploadId:this.uploadId} + this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + //this.snackBar.open('涓婁紶鎴愬姛!','纭畾',config); + this.uploadProgress = 0; + this.uploadisLoading = false + this.PartNumberETag =[] //娓呯┖淇濆瓨杩斿洖鐨勪俊鎭 + this.uploadover = true + + let body:any = { + Name:this.unitname||'', + PlanCategory:this.url=='2'?2:1, + PlanType: Number(this.reservePlanType), + PlanLevel:1, + PlanMode:1, + attachmentUrls:[`${this.objectName}`] + } + + this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ + this.snackBar.open('鍒涘缓鎴愬姛!','纭畾',config); + this.dialogRef.close(); + },err=>{ + this.snackBar.open('鍒涘缓澶辫触!','纭畾',config); + }) + }) + } + + //鍙栨秷鍒嗗潡涓婁紶 + cancel () { + this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data=>{ + this.uploadProgress = 0; + this.uploadisLoading= false; + (document.getElementById('up')).value = null + this.PartNumberETag =[] //娓呯┖淇濆瓨杩斿洖鐨勪俊鎭 + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鍙栨秷涓婁紶鎴愬姛!','纭畾',config); + this.uploadover = false + this.file = null + }) + } + + + //鍒涘缓棰勬 + newplan(){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if(this.unitname==undefined||this.reservePlanType==undefined){ + this.snackBar.open('璇疯緭鍏ラ妗堝悕绉版垨绫诲瀷!','纭畾',config); + } + else if(this.file==undefined){ + this.snackBar.open('璇峰厛涓婁紶鏂囦欢!','纭畾',config); + } + else{ + if(this.reservePlanType!='1'){ + this.startUploading("闈炰簩缁") + } + else{this.startUploading("浜岀淮")} + + + } + + + } + //鍙栨秷鎸夐挳 close(){ this.dialogRef.close(); } diff --git a/src/app/plan-management/type-plan/newunit.html b/src/app/plan-management/type-plan/newunit.html index 4953720..519b63d 100644 --- a/src/app/plan-management/type-plan/newunit.html +++ b/src/app/plan-management/type-plan/newunit.html @@ -4,29 +4,33 @@ * @Author: sueRimn * @Date: 2020-12-24 16:26:16 * @LastEditors: sueRimn - * @LastEditTime: 2021-01-06 15:16:50 + * @LastEditTime: 2021-01-11 13:57:06 -->
    -
    - 鏂板棰勬 +
    + 鏂板棰勬 +
    +
    + + + +
    + +
    - - - - + + + +
    +
    + 涓婁紶涓... + +
    -
    - - - - -
    -
    - -
    +
    + + +
    \ No newline at end of file diff --git a/src/app/plan-management/type-plan/newunit.scss b/src/app/plan-management/type-plan/newunit.scss index 880da22..42ff2b4 100644 --- a/src/app/plan-management/type-plan/newunit.scss +++ b/src/app/plan-management/type-plan/newunit.scss @@ -7,7 +7,7 @@ .queryField { margin: 3px 5px; input { - width: 50px; + width: 100%; height: 18px; line-height: 18px; border-radius: 3px;} @@ -26,7 +26,7 @@ } } .bottom{ - margin: 30px 30px; + margin: 10% 30px; button{ width: 80px; height: 36px; diff --git a/src/app/plan-management/type-plan/type-plan.component.html b/src/app/plan-management/type-plan/type-plan.component.html index 67109d3..5982abd 100644 --- a/src/app/plan-management/type-plan/type-plan.component.html +++ b/src/app/plan-management/type-plan/type-plan.component.html @@ -1,6 +1,6 @@
    - +
    @@ -13,17 +13,17 @@
    - +
    - + 馃爦 - +
    @@ -68,39 +68,41 @@
    棰勬鍚嶇О棰勬鍚嶇О {{element.name}} 棰勬绾у埆棰勬绾у埆 {{url=='2'?'鈪$骇':'鈪犵骇'}} 娣诲姞浜娣诲姞浜 {{element.creatorName}} 娣诲姞鏃堕棿娣诲姞鏃堕棿 {{element.creationTime|date:'yyyy-MM-dd'}} 棰勬绫诲瀷棰勬绫诲瀷 {{element.planType=='1'?'浜岀淮棰勬':element.planType=='2'?'涓夌淮棰勬':element.planType=='4'?'鍏朵粬棰勬':'鍗$墖棰勬'}} 瀹℃牳鐘舵瀹℃牳鐘舵 {{element.auditStatus=='8'?'鏈彁浜ゅ鏍':element.auditStatus=='1'?'瀹℃牳涓':element.auditStatus=='2'?'瀹℃牳閫氳繃':'瀹℃牳閫鍥'}} 鏄惁鍏紑鏄惁鍏紑 {{element.openRange}} 缂栧埗绾у埆{{element.planLevel=='0'?'鎬婚槦':element.planLevel=='1'?'鏀槦':element.planLevel=='2'?'澶ч槦':'涓槦'}}缂栧埗绾у埆{{element.planLevel=='1'?'鎬婚槦':element.planLevel=='2'?'鏀槦':element.planLevel=='4'?'澶ч槦':'涓槦'}} 鎿嶄綔 - 鏌ョ湅棰勬 - 涓嬭浇 - 鍒犻櫎 + 鎿嶄綔 + 鏌ョ湅棰勬 + 涓嬭浇 + 鍒犻櫎
    - - + + - - + + - - + + - + - - + + - - + + - - + + - - + diff --git a/src/app/plan-management/type-plan/type-plan.component.scss b/src/app/plan-management/type-plan/type-plan.component.scss index 95d2d38..d963db0 100644 --- a/src/app/plan-management/type-plan/type-plan.component.scss +++ b/src/app/plan-management/type-plan/type-plan.component.scss @@ -114,5 +114,8 @@ .mat-column-jurisdictionsquadron{ width: 10%; } + span:hover{ + text-decoration:underline + } } } \ No newline at end of file diff --git a/src/app/plan-management/type-plan/type-plan.component.ts b/src/app/plan-management/type-plan/type-plan.component.ts index e579495..9e104cc 100644 --- a/src/app/plan-management/type-plan/type-plan.component.ts +++ b/src/app/plan-management/type-plan/type-plan.component.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2021-01-06 09:47:43 * @LastEditors: sueRimn - * @LastEditTime: 2021-01-06 15:12:30 + * @LastEditTime: 2021-01-11 14:01:30 */ import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import { HttpClient } from '@angular/common/http' @@ -55,6 +55,7 @@ export class TypePlanComponent implements OnInit { {name:"涓槦",value:"8"} ] } + this.getAlltabledate() } preparelevels:any @@ -65,6 +66,7 @@ export class TypePlanComponent implements OnInit { level//棰勬绾у埆 addname//娣诲姞浜 addtime//娣诲姞鏃堕棿 + endtime unittype//棰勬绫诲瀷 unitstate//瀹℃牳鐘舵 projectlevel//缂栧埗绾у埆 @@ -77,23 +79,183 @@ export class TypePlanComponent implements OnInit { pageSizeOptions: number[] = [10] //璁剧疆姣忛〉鏉℃暟 PageNumber:any; //绗嚑椤 + //鑾峰彇琛ㄦ牸鏁版嵁 + getAlltabledate(){ + let paramsdata:any = { + Name:this.unitname||'', + planCategories:8, + CreatorName:this.addname||'', + AuditStatus:this.unitstate|| '', + QueryStartTime:this.addtime||'', + QueryEndTime:this.endtime||'', + PlanLevel:this.projectlevel||'', + HasChildrenPlanLevel:this.plcheck||'', + PageNumber: this.PageNumber || '1', + PageSize: this.pageSizeOptions[0], + + } + this.http.get("/api/PlanComponentsMajor",{params:paramsdata}).subscribe((data:any)=>{ + this.length = data.totalCount + this.tabledataSource = data.items + }) + } + //閲嶇疆 reset(){ this.unitname='' this.level='' this.addname='' this.addtime='' - this.unittype='' + this.endtime='' this.unitstate='' this.projectlevel='' + this.plcheck=false + this.getAlltabledate() + } + + //鏌ヨ + onSubmit (value) { + if(this.endtime!=undefined&&this.addtime>this.endtime){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('寮濮嬫椂闂翠笉鑳藉ぇ浜庣粨鏉熸椂闂!','纭畾',config); + }else{ + this.PageNumber = 1 + this.pageEvent.pageIndex = 0 + this.getAlltabledate(); + } + } + + //鍒犻櫎棰勬 + deletePlan(id){ + let isTrue = confirm('鎮ㄧ‘瀹氳鍒犻櫎鍚') + if(isTrue){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data=>{ + this.snackBar.open('鍒犻櫎鎴愬姛!','纭畾',config); + this.getAlltabledate() + },err => { + this.snackBar.open(err,'纭畾',config); + }) + } + + } + //鏂板棰勬寮圭獥 addunit(){ const dialogRef = this.dialog.open(newunitType, { width: '340px', - height:'300px' + height:'370px' //data: paperDataInfo }); + dialogRef.afterClosed().subscribe(result => { + this.getAlltabledate() + } + ); + + } + + //涓嬭浇鈫 + selectDownloadFile:any; //閫夋嫨涓嬭浇鐨勬枃浠 + download:any; //涓嬭浇鏂囦欢鍏冩暟鎹 + downloadisLoading:boolean = false; //杩涘害鏉oading鍔犺浇 + downloadProgress:number=0; //杩涘害鏉¤繘搴 + downloadFileName:any + fileUrls:any //褰撳墠棰勬闄勪欢鍦板潃 + fileDatas:any = [] + selectedFileIndex : any = 0 + selectedFileData : any + + uploadFileLonging:any + //璇诲彇涓嬭浇鏂囦欢淇℃伅 + readFile (element) { + this.uploadFileLonging = element + element.attachmentUrls.forEach(item=>{ + this.http.get('/api/ObjectMetadata/PlanPlatform/'+item).subscribe((data:any)=>{ + data.filePige = (data.fileLength / (1024*1024)).toFixed(2) + //console.log(data) + this.download = data + this.downloadFile() + }) + }) + + } + + //鍒濆鍖栦笅杞 + downloadFile () { + this.downloadProgress = 0 + let file = this.download + let fileSize = file.fileLength//涓嬭浇鏂囦欢鐨勬诲ぇ灏 + let shardSize = 10 * 1024 * 1024 //鏂囦欢澶у皬鏄惁澶т簬10MB + + if (file && fileSize<=shardSize) { //<=10MB鏃剁洿鎺ヤ笅杞 + this.downloadisLoading = true + // this.setFileLoading() + this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{responseType: 'blob'},).subscribe(data=>{ + + let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL鍒涘缓涓涓笅杞紹lob鐨剈rl鍦板潃 + let link = document.createElement("a"); + link.style.display = "none"; + link.href = url; + + let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; + link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); + document.body.appendChild(link); + link.click(); + this.downloadisLoading = false + // this.setFileLoading() + }) + } else if (file && fileSize > shardSize) { //>10MB鏃跺垎鍧椾笅杞 + this.blockingDownload() //鍒嗘涓嬭浇 + this.downloadisLoading = true + // this.setFileLoading() + } + + } + + //鍒嗘涓嬭浇骞跺悎骞 + async blockingDownload () { + let file = this.download + let fileSize = file.fileLength //涓嬭浇鏂囦欢鐨勬诲ぇ灏 + let shardSize = 3 * 1024 * 1024 //3MB涓涓垎鐗 + let allSlice = Math.ceil(fileSize / shardSize) //鎬绘枃浠/3MB===鍏卞垎澶氬皯娈 + let allFile:any = [] //鎵鏈夌殑file鍒嗘 + + for (let i=0;i{ + this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{ + result(data) }) + }) + allFile.push(result) + this.downloadProgress = Number((i/allSlice).toFixed(2))*100 + + if (allFile.length === allSlice) { //鍚堝苟鏂囦欢杈撳嚭缁欐祻瑙堝櫒 + let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL鍒涘缓涓涓笅杞紹lob鐨剈rl鍦板潃 + let link = document.createElement("a"); + link.style.display = "none"; + link.href = url; + let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; + link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); + document.body.appendChild(link); + link.click(); + // this.downloadProgress = 0 + this.downloadisLoading = false + // this.setFileLoading() + } + + } //for寰幆 + + } + + //鍙栨秷鍒嗗潡涓嬭浇 + cancelDowload () { } } @@ -112,14 +274,177 @@ export class newunitType{ unittype//棰勬绫诲瀷 unitstate//瀹℃牳鐘舵 projectlevel//缂栧埗绾у埆 - close(){ - this.dialogRef.close(); - } + reservePlanType//棰勬绫诲瀷 //涓婁紶 upload(){ document.getElementById('up').click() } - upchange(e){ - console.log(e) + + //涓婁紶鏂囦欢鈫 + file:any; //涓婁紶鐨勬枃浠 + fileName:any; //涓婁紶鏂囦欢name + uploadisLoading:boolean = false; //杩涘害鏉oading鍔犺浇 + uploadProgress:number=0; //杩涘害鏉¤繘搴 + objectName:any; //涓婁紶瀵硅薄鍚 + uploadId:any; //涓婁紶鍒嗗潡涓婁紶浜嬩欢缂栧彿 + uploadover:any = false //涓婁紶瀹屾垚涔嬪悗鎻愮ず + selectedPLanType:any//鎵閫夐妗堢被鍨 + selectedPLanName:any//鎵閫夐妗堝悕绉 + localup:boolean = false //鏈湴涓婁紶 + defaultisshow = '0' //榛樿鏄剧ず涓婁紶input妗 + //涓婁紶鏂囦欢input + filechange(e){ + this.file = e.target.files[0] || null //涓婁紶鐨勬枃浠 + } + + //涓婁紶鏂囦欢 + startUploading (planType) { + let file = this.file || null //鑾峰彇涓婁紶鐨勬枃浠 + let fileSize = file.size || null //涓婁紶鏂囦欢鐨勬诲ぇ灏 + let shardSize = 5 * 1024 * 1024 //5MB涓涓垎鐗 + + if (file && fileSize<=shardSize) { //涓婁紶鏂囦欢<=5MB鏃 + let formData = new FormData() + formData.append("file",file) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.http.post(`/api/Objects/PlanPlatform/typeClass`,formData).subscribe((data:any)=>{ + this.objectName = data.objectName + //console.log('涓婁紶鎴愬姛') + + let body:any = { + Name:this.unitname||'', + PlanCategory:8, + PlanLevel:1, + PlanMode:1, + attachmentUrls:[`${this.objectName}`] + } + this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ + this.snackBar.open('鍒涘缓鎴愬姛!','纭畾',config); + this.dialogRef.close(); + },err=>{ + this.snackBar.open('鍒涘缓澶辫触!','纭畾',config); + }) + },err=>{ + this.snackBar.open('涓婁紶澶辫触!','纭畾',config); + }) + } else if (file && fileSize>shardSize) { //涓婁紶鏂囦欢>5MB鏃,鍒嗗潡涓婁紶 + let data = {filename: file.name} + this.uploadisLoading = true + this.http.post(`/api/NewMultipartUpload/PlanPlatform/typeClass`,{},{params:data}).subscribe((data:any)=>{ //鍒濆鍖栧垎娈典笂浼 + this.objectName = data.objectName + this.uploadId = data.uploadId + this.subsectionUploading(planType) + }) + } + + } + PartNumberETag:any=[]; //姣忔杩斿洖闇瑕佷繚瀛樼殑淇℃伅 + //寮濮嬪垎娈典笂浼 + async subsectionUploading (planType) { + let file = this.file || null //鑾峰彇涓婁紶鐨勬枃浠 + let fileSize = file.size || null //涓婁紶鏂囦欢鐨勬诲ぇ灏 + let shardSize = 5 * 1024 * 1024 //5MB涓涓垎鐗 + let allSlice = Math.ceil(fileSize / shardSize) //鎬绘枃浠/5MB===鍏卞垎澶氬皯娈 鍚戜笂鍙栨暣 + + for (let i = 0;i < allSlice;i++) { //寰幆鍒嗘涓婁紶 + let start = i * shardSize //鍒囧壊鏂囦欢寮濮嬩綅缃 + let end = Math.min(fileSize, start + shardSize); //鍒囧壊鏂囦欢缁撴潫浣嶇疆 锛堝姣斿彇灏忔暟锛 + let formData = new FormData() + formData.append("file",file.slice(start, end)) + + //鍚屾鍐欐硶瀹炵幇寮傛璋冪敤 + let result = await new Promise((resolve, reject) => { + // await 闇瑕佸悗闈㈣繑鍥炰竴涓 promise 瀵硅薄 + this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{ + let msg = { + "partNumber":data.partNumber || null, + "eTag": data.eTag || null} + resolve(msg) // 璋冪敤 promise 鍐呯疆鏂规硶澶勭悊鎴愬姛 + }) + }); + this.PartNumberETag.push(result) + this.uploadProgress = Number((i/allSlice).toFixed(2))*100 + + if (this.PartNumberETag.length === allSlice) { + this.uploadProgress = 100 + this.endUploading(planType)} + }//for寰幆 + + } + + //瀹屾垚鍒嗗潡涓婁紶 + endUploading (planType) { + let data = this.PartNumberETag + let paramsData = {uploadId:this.uploadId} + this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + //console.log('鍒涘缓鎴愬姛') + this.uploadProgress = 0; + this.uploadisLoading = false + this.PartNumberETag =[] //娓呯┖淇濆瓨杩斿洖鐨勪俊鎭 + this.uploadover = true + + let body:any = { + Name:this.unitname||'', + PlanCategory:8, + PlanLevel:1, + PlanMode:1, + attachmentUrls:[`${this.objectName}`] + } + + this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ + this.snackBar.open('鍒涘缓鎴愬姛!','纭畾',config); + this.dialogRef.close(); + },err=>{ + this.snackBar.open('鍒涘缓澶辫触!','纭畾',config); + }) + }) + } + + //鍙栨秷鍒嗗潡涓婁紶 + cancel () { + this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data=>{ + this.uploadProgress = 0; + this.uploadisLoading= false; + (document.getElementById('up')).value = null + this.PartNumberETag =[] //娓呯┖淇濆瓨杩斿洖鐨勪俊鎭 + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鍙栨秷涓婁紶鎴愬姛!','纭畾',config); + this.uploadover = false + this.file = null + }) + } + + //鍒涘缓棰勬 + newplan(){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if(this.unitname==undefined||this.unitname==''){ + this.snackBar.open('璇疯緭鍏ラ妗堝悕绉!','纭畾',config); + } + else if(this.file==undefined){ + this.snackBar.open('璇峰厛涓婁紶鏂囦欢!','纭畾',config); + } + else{ + if(this.reservePlanType!='1'){ + this.startUploading("闈炰簩缁") + } + else{this.startUploading("浜岀淮")} + + + } + + + } + //鍙栨秷鎸夐挳 + close(){ + this.dialogRef.close(); } } From c33414874717573529d9f30c6c87fb4760998351 Mon Sep 17 00:00:00 2001 From: chenjingyu Date: Mon, 11 Jan 2021 14:55:32 +0800 Subject: [PATCH 09/13] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E4=B8=89=E5=9B=9B?= =?UTF-8?q?=E4=BA=94=E7=BA=A7=E9=A2=84=E6=A1=88=E6=9F=A5=E7=9C=8B=E9=A2=84?= =?UTF-8?q?=E6=A1=88=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/plan-management/entry-plan/entry-plan.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/plan-management/entry-plan/entry-plan.component.html b/src/app/plan-management/entry-plan/entry-plan.component.html index 81cd56c..713e8d4 100644 --- a/src/app/plan-management/entry-plan/entry-plan.component.html +++ b/src/app/plan-management/entry-plan/entry-plan.component.html @@ -254,7 +254,7 @@ From e170e86d46d47ea7ec70db60b1d5e20a41875b66 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Mon, 11 Jan 2021 15:45:50 +0800 Subject: [PATCH 10/13] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=20GIS=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gis-labeling/gis-labeling.component.scss | 6 ++--- .../gis-labeling/gis-labeling.component.ts | 25 ++++--------------- .../plan-pass/plan-pass.component.html | 4 +-- src/styles.scss | 5 ++-- 4 files changed, 13 insertions(+), 27 deletions(-) diff --git a/src/app/gis-management/gis-labeling/gis-labeling.component.scss b/src/app/gis-management/gis-labeling/gis-labeling.component.scss index c234832..f117852 100644 --- a/src/app/gis-management/gis-labeling/gis-labeling.component.scss +++ b/src/app/gis-management/gis-labeling/gis-labeling.component.scss @@ -219,7 +219,7 @@ //鍙充笂瑙抎iv .rightTopBox{ - width: 480px; + width: 400px; position: absolute; right: 30px; top: 15px; @@ -277,7 +277,7 @@ cursor: pointer; } .submit{ - width: 68px; + width: 60px; height: 30px; text-align: center; border: 0; @@ -287,7 +287,7 @@ color: #fff; } .cancel{ - width: 96px; + width: 70px; height: 30px; background: #EEF1F5; opacity: 1; diff --git a/src/app/gis-management/gis-labeling/gis-labeling.component.ts b/src/app/gis-management/gis-labeling/gis-labeling.component.ts index f2438e7..e037abc 100644 --- a/src/app/gis-management/gis-labeling/gis-labeling.component.ts +++ b/src/app/gis-management/gis-labeling/gis-labeling.component.ts @@ -19,9 +19,9 @@ export class GisLabelingComponent implements OnInit { selectedTitle:number titleList = [ {name:'閲嶇偣鍗曚綅',iconImg:'/assets/images/uniticon.png'}, {name:'姘存簮',iconImg:'/assets/images/watericon.png'}, - {name:'娴嬮噺宸ュ叿',iconImg:'/assets/images/distanceicon.png'}, - /* {name:'娴嬮潰绉',iconImg:'/assets/images/areaicon.png'}, */ - {name:'鍥惧眰閫夋嫨',iconImg:'/assets/images/coverageicon.png'}] + // {name:'娴嬮噺宸ュ叿',iconImg:'/assets/images/distanceicon.png'}, + // {name:'鍥惧眰閫夋嫨',iconImg:'/assets/images/coverageicon.png'} + ] keyUnitList:any = [] waterList = [ {id:'0',name:'娑堢伀鏍',selected:false}, @@ -310,10 +310,7 @@ export class GisLabelingComponent implements OnInit {
    鍩烘湰淇℃伅
    瀵艰埅
    -
    鍏ㄦ櫙婕父
    -
    涓夌淮鍦烘櫙
    -
    鏌ョ湅棰勬
    -
    鍒嗕韩
    +
    涓夌淮鍦烘櫙缂栧埗
    ` // 鍒涘缓涓涓嚜瀹氫箟鍐呭鐨 infowindow 瀹炰緥 @@ -325,10 +322,7 @@ export class GisLabelingComponent implements OnInit { this.infoWindow.open(this.map); this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'),'click',(event)=>{ this.baseInformation(item) })//鍩烘湰淇℃伅鐐瑰嚮浜嬩欢 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(item) })//瀵艰埅鐐瑰嚮浜嬩欢 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(item) })//鍏ㄦ櫙婕父鐐瑰嚮浜嬩欢 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(item) })//涓夌淮鍦烘櫙鐐瑰嚮浜嬩欢 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(item) })//鏌ョ湅棰勬鐐瑰嚮浜嬩欢 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(item) })//鍒嗕韩鐐瑰嚮浜嬩欢 }); markerArr.push(labelMarker) }) @@ -737,10 +731,7 @@ export class GisLabelingComponent implements OnInit {
    鍩烘湰淇℃伅
    瀵艰埅
    -
    鍏ㄦ櫙婕父
    -
    涓夌淮鍦烘櫙
    -
    鏌ョ湅棰勬
    -
    鍒嗕韩
    +
    涓夌淮鍦烘櫙缂栧埗
    ` // 鍒涘缓涓涓嚜瀹氫箟鍐呭鐨 infowindow 瀹炰緥 @@ -752,10 +743,7 @@ export class GisLabelingComponent implements OnInit { this.infoWindow.open(this.map); this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'),'click',(event)=>{ this.baseInformation(e) })//鍩烘湰淇℃伅鐐瑰嚮浜嬩欢 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(e) })//瀵艰埅鐐瑰嚮浜嬩欢 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(e) })//鍏ㄦ櫙婕父鐐瑰嚮浜嬩欢 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(e) })//涓夌淮鍦烘櫙鐐瑰嚮浜嬩欢 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(e) })//鏌ョ湅棰勬鐐瑰嚮浜嬩欢 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(e) })//鍒嗕韩鐐瑰嚮浜嬩欢 marker.on('click', (ev) => { //marker鐐瑰嚮浜嬩欢 this.infoWindow = new AMap.InfoWindow({ position: [e.location.x,e.location.y], @@ -765,10 +753,7 @@ export class GisLabelingComponent implements OnInit { this.infoWindow.open(this.map); this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'),'click',(event)=>{ this.baseInformation(e) })//鍩烘湰淇℃伅鐐瑰嚮浜嬩欢 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(e) })//瀵艰埅鐐瑰嚮浜嬩欢 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(e) })//鍏ㄦ櫙婕父鐐瑰嚮浜嬩欢 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(e) })//涓夌淮鍦烘櫙鐐瑰嚮浜嬩欢 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(e) })//鏌ョ湅棰勬鐐瑰嚮浜嬩欢 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(e) })//鍒嗕韩鐐瑰嚮浜嬩欢 }) this.map.setZoomAndCenter(13,marker._position); //璁剧疆鍦板浘涓績鐐 diff --git a/src/app/plan-audit/plan-pass/plan-pass.component.html b/src/app/plan-audit/plan-pass/plan-pass.component.html index 4f94c8a..c6cad7e 100644 --- a/src/app/plan-audit/plan-pass/plan-pass.component.html +++ b/src/app/plan-audit/plan-pass/plan-pass.component.html @@ -1,4 +1,4 @@ -
    +
    @@ -30,7 +30,7 @@ -
    +
    棰勬鍚嶇О{{element.unitname}}棰勬鍚嶇О{{element.name}} 娣诲姞浜{{element.addname}}娣诲姞浜{{element.creatorName}} 娣诲姞鏃堕棿{{element.addtime}}娣诲姞鏃堕棿{{element.creationTime|date:'yyyy-MM-dd'}} 棰勬绫诲瀷棰勬绫诲瀷 绫诲瀷棰勬 瀹℃牳鐘舵{{element.passstate}}瀹℃牳鐘舵{{element.auditStatus=='8'?'鏈彁浜ゅ鏍':element.auditStatus=='1'?'瀹℃牳涓':element.auditStatus=='2'?'瀹℃牳閫氳繃':'瀹℃牳閫鍥'}} 鏄惁鍏紑{{element.isopen}}鏄惁鍏紑{{element.openRange}} 缂栧埗绾у埆{{element.projectlevel}}缂栧埗绾у埆{{element.planLevel=='1'?'鎬婚槦':element.planLevel=='2'?'鏀槦':element.planLevel=='4'?'澶ч槦':'涓槦'}} 鎿嶄綔 - 鏌ョ湅棰勬 + 鎿嶄綔 + 鏌ョ湅棰勬 + 涓嬭浇 + 鍒犻櫎
    鎿嶄綔 - 鏌ョ湅棰勬 + 鏌ョ湅棰勬
    diff --git a/src/styles.scss b/src/styles.scss index d04eb3b..f58f984 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -5,7 +5,8 @@ html,body{ width: 100%; height: 100%; margin:0 auto; - padding:0; + padding:0; + overflow: hidden; } ul,ol,dl,li,dt,dd,p,form,input,h1,h2,h3,h4,h5,h6,section,article,aside,header,footer,nav,figure,time,mark,main,canvas{ margin:0; @@ -110,7 +111,7 @@ table td.mat-footer-cell:last-of-type{ //gis鏍囩偣寮瑰嚭妗嗘牱寮 #gispopupbox{ .btn{ - width: 92px; + width: 130px; height: 36px; background: #FFFFFF; border: 1px solid #EEF1F5; From b352c5a1f196cbe890da09efeb1b0f169ccb643b Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Wed, 13 Jan 2021 09:49:36 +0800 Subject: [PATCH 11/13] =?UTF-8?q?[=E5=9B=9E=E9=80=80]=20GIS=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E7=89=88=E6=9C=AC=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gis-labeling/gis-labeling.component.ts | 15 ++--- .../plan-pass/plan-pass.component.html | 58 +++++++++---------- src/styles.scss | 5 +- 3 files changed, 36 insertions(+), 42 deletions(-) diff --git a/src/app/gis-management/gis-labeling/gis-labeling.component.ts b/src/app/gis-management/gis-labeling/gis-labeling.component.ts index f2438e7..a0623cd 100644 --- a/src/app/gis-management/gis-labeling/gis-labeling.component.ts +++ b/src/app/gis-management/gis-labeling/gis-labeling.component.ts @@ -712,7 +712,7 @@ export class GisLabelingComponent implements OnInit { let markerContent = `
    ${e.name}
    -
    鍗曚綅鎬ц川:
    +
    鍗曚綅鎬ц川:
    娑堥槻璐熻矗浜:
    @@ -793,7 +793,6 @@ export class GisLabelingComponent implements OnInit { this.leftDivState = false this.showLeftDiv = false this.isShowRouteGIS = true - // console.log(1,e) this.routeEnd = e.name this.endCoordinate = new AMap.LngLat(e.location.x, e.location.y) } @@ -868,20 +867,18 @@ export class GisLabelingComponent implements OnInit { var autoComplete = new AMap.Autocomplete(autoOptions); autoComplete.search(keywords, function(status, result) { if (result && result.tips && result.tips.length) { //鎼滅储鍒版暟鎹椂 + that._ngZone.run(()=>{ if(e == 0){ that.routeStartList = result.tips - - that.startCoordinate = new AMap.LngLat(result.tips[0].location.lng, result.tips[0].location.lat) - // console.log(666,result) }else{ that.routeEndList = result.tips that.endCoordinate = new AMap.LngLat(result.tips[0].location.lng, result.tips[0].location.lat) } }); - } + } //if }) }) }); //鑾峰彇褰撳墠 city @@ -912,7 +909,6 @@ export class GisLabelingComponent implements OnInit { this.endCoordinate = null this.routeGIS? this.routeGIS.clear() : null this.routes = { distance: 0, time: 0, steps: [], } - // console.log(this.selectedUnit) this.map.setZoomAndCenter(13,[this.selectedUnit.location.x,this.selectedUnit.location.y]); //璁剧疆鍦板浘涓績鐐 } @@ -941,10 +937,7 @@ export class GisLabelingComponent implements OnInit { this.routeGIS? this.routeGIS.clear() : null this.routeGIS = new AMap.Driving({ map: this.map, - }); - // console.log(1,this.startCoordinate) - // console.log(2,this.endCoordinate) - // 鏍规嵁璧风粓鐐瑰悕绉拌鍒掗┚杞﹀鑸矾绾 + }); this.routeGIS.search(this.startCoordinate,this.endCoordinate, function(status, result) { if (status === 'complete') { diff --git a/src/app/plan-audit/plan-pass/plan-pass.component.html b/src/app/plan-audit/plan-pass/plan-pass.component.html index 4f94c8a..1d7588e 100644 --- a/src/app/plan-audit/plan-pass/plan-pass.component.html +++ b/src/app/plan-audit/plan-pass/plan-pass.component.html @@ -1,36 +1,36 @@ -
    +
    - - - -
    + + + +
    -
    - 鍗曚綅鍚嶇О: - {{compantData.name?compantData.name : '鏆傛棤鏁版嵁'}} +
    + 鍗曚綅鍚嶇О: + {{compantData.name?compantData.name : '鏆傛棤鏁版嵁'}} +
    +
    + 娑堥槻鏁戞彺绔: + {{organizationName}} +
    +
    + 鍗曚綅绫诲瀷: + {{compantData.buildingTypes.length?compantData.buildingTypes[0].name : '鏆傛棤鏁版嵁'}} +
    +
    + 鍗曚綅鍦板潃: + {{compantData.address?compantData.address : '鏆傛棤鏁版嵁'}} +
    +
    + +
    +
    -
    - 娑堥槻鏁戞彺绔: - {{organizationName}} -
    -
    - 鍗曚綅绫诲瀷: - {{compantData.buildingTypes.length?compantData.buildingTypes[0].name : '鏆傛棤鏁版嵁'}} -
    -
    - 鍗曚綅鍦板潃: - {{compantData.address?compantData.address : '鏆傛棤鏁版嵁'}} -
    -
    - -
    - -
    -
    -
    -
    + + + -
    +
    diff --git a/src/styles.scss b/src/styles.scss index d04eb3b..75c3abf 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -5,7 +5,8 @@ html,body{ width: 100%; height: 100%; margin:0 auto; - padding:0; + padding:0; + overflow: hidden; } ul,ol,dl,li,dt,dd,p,form,input,h1,h2,h3,h4,h5,h6,section,article,aside,header,footer,nav,figure,time,mark,main,canvas{ margin:0; @@ -171,7 +172,7 @@ table td.mat-footer-cell:last-of-type{ cursor: pointer; } } - + .custom-content-marker .close-btn:hover{ background: #666; } From dd38481e0aa73f8c1a55b279946a8c6fc8704c1e Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Wed, 13 Jan 2021 10:41:06 +0800 Subject: [PATCH 12/13] =?UTF-8?q?[=E5=9B=9E=E9=80=80]=20GIS=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gis-labeling/gis-labeling.component.scss | 6 ++--- .../gis-labeling/gis-labeling.component.ts | 23 +++++++++++++++---- src/styles.scss | 2 +- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/app/gis-management/gis-labeling/gis-labeling.component.scss b/src/app/gis-management/gis-labeling/gis-labeling.component.scss index f117852..c234832 100644 --- a/src/app/gis-management/gis-labeling/gis-labeling.component.scss +++ b/src/app/gis-management/gis-labeling/gis-labeling.component.scss @@ -219,7 +219,7 @@ //鍙充笂瑙抎iv .rightTopBox{ - width: 400px; + width: 480px; position: absolute; right: 30px; top: 15px; @@ -277,7 +277,7 @@ cursor: pointer; } .submit{ - width: 60px; + width: 68px; height: 30px; text-align: center; border: 0; @@ -287,7 +287,7 @@ color: #fff; } .cancel{ - width: 70px; + width: 96px; height: 30px; background: #EEF1F5; opacity: 1; diff --git a/src/app/gis-management/gis-labeling/gis-labeling.component.ts b/src/app/gis-management/gis-labeling/gis-labeling.component.ts index 0d49be6..faa2a67 100644 --- a/src/app/gis-management/gis-labeling/gis-labeling.component.ts +++ b/src/app/gis-management/gis-labeling/gis-labeling.component.ts @@ -19,8 +19,8 @@ export class GisLabelingComponent implements OnInit { selectedTitle:number titleList = [ {name:'閲嶇偣鍗曚綅',iconImg:'/assets/images/uniticon.png'}, {name:'姘存簮',iconImg:'/assets/images/watericon.png'}, - // {name:'娴嬮噺宸ュ叿',iconImg:'/assets/images/distanceicon.png'}, - // {name:'鍥惧眰閫夋嫨',iconImg:'/assets/images/coverageicon.png'} + {name:'娴嬮噺宸ュ叿',iconImg:'/assets/images/distanceicon.png'}, + {name:'鍥惧眰閫夋嫨',iconImg:'/assets/images/coverageicon.png'} ] keyUnitList:any = [] waterList = [ @@ -310,7 +310,10 @@ export class GisLabelingComponent implements OnInit {
    鍩烘湰淇℃伅
    瀵艰埅
    -
    涓夌淮鍦烘櫙缂栧埗
    +
    鍏ㄦ櫙婕父
    +
    涓夌淮鍦烘櫙
    +
    鏌ョ湅棰勬
    +
    鍒嗕韩
    ` // 鍒涘缓涓涓嚜瀹氫箟鍐呭鐨 infowindow 瀹炰緥 @@ -322,7 +325,10 @@ export class GisLabelingComponent implements OnInit { this.infoWindow.open(this.map); this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'),'click',(event)=>{ this.baseInformation(item) })//鍩烘湰淇℃伅鐐瑰嚮浜嬩欢 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(item) })//瀵艰埅鐐瑰嚮浜嬩欢 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(item) })//鍏ㄦ櫙婕父鐐瑰嚮浜嬩欢 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(item) })//涓夌淮鍦烘櫙鐐瑰嚮浜嬩欢 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(item) })//鏌ョ湅棰勬鐐瑰嚮浜嬩欢 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(item) })//鍒嗕韩鐐瑰嚮浜嬩欢 }); markerArr.push(labelMarker) }) @@ -731,7 +737,10 @@ export class GisLabelingComponent implements OnInit {
    鍩烘湰淇℃伅
    瀵艰埅
    -
    涓夌淮鍦烘櫙缂栧埗
    +
    鍏ㄦ櫙婕父
    +
    涓夌淮鍦烘櫙
    +
    鏌ョ湅棰勬
    +
    鍒嗕韩
    ` // 鍒涘缓涓涓嚜瀹氫箟鍐呭鐨 infowindow 瀹炰緥 @@ -743,7 +752,10 @@ export class GisLabelingComponent implements OnInit { this.infoWindow.open(this.map); this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'),'click',(event)=>{ this.baseInformation(e) })//鍩烘湰淇℃伅鐐瑰嚮浜嬩欢 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(e) })//瀵艰埅鐐瑰嚮浜嬩欢 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(e) })//鍏ㄦ櫙婕父鐐瑰嚮浜嬩欢 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(e) })//涓夌淮鍦烘櫙鐐瑰嚮浜嬩欢 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(e) })//鏌ョ湅棰勬鐐瑰嚮浜嬩欢 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(e) })//鍒嗕韩鐐瑰嚮浜嬩欢 marker.on('click', (ev) => { //marker鐐瑰嚮浜嬩欢 this.infoWindow = new AMap.InfoWindow({ position: [e.location.x,e.location.y], @@ -753,7 +765,10 @@ export class GisLabelingComponent implements OnInit { this.infoWindow.open(this.map); this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'),'click',(event)=>{ this.baseInformation(e) })//鍩烘湰淇℃伅鐐瑰嚮浜嬩欢 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(e) })//瀵艰埅鐐瑰嚮浜嬩欢 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(e) })//鍏ㄦ櫙婕父鐐瑰嚮浜嬩欢 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(e) })//涓夌淮鍦烘櫙鐐瑰嚮浜嬩欢 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(e) })//鏌ョ湅棰勬鐐瑰嚮浜嬩欢 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(e) })//鍒嗕韩鐐瑰嚮浜嬩欢 }) this.map.setZoomAndCenter(13,marker._position); //璁剧疆鍦板浘涓績鐐 diff --git a/src/styles.scss b/src/styles.scss index dc99e18..75c3abf 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -111,7 +111,7 @@ table td.mat-footer-cell:last-of-type{ //gis鏍囩偣寮瑰嚭妗嗘牱寮 #gispopupbox{ .btn{ - width: 130px; + width: 92px; height: 36px; background: #FFFFFF; border: 1px solid #EEF1F5; From b2fa1215d819f621e436feb0a3a7b38efc74846f Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Wed, 13 Jan 2021 14:34:52 +0800 Subject: [PATCH 13/13] =?UTF-8?q?[=E5=88=A0=E9=99=A4]=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=99=A4H5=E5=B7=A5=E5=85=B7=E4=B9=8B=E5=A4=96=20=E6=80=BB?= =?UTF-8?q?=E5=B9=B3=E5=9B=BE=E6=A8=A1=E5=9D=97=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../allaround/allaround.component.html | 37 -------- .../key-unit/allaround/allaround.component.ts | 9 +- .../fire-fighting-device.component.html | 94 ------------------- .../fire-fighting-device.component.ts | 10 +- .../fire-fighting-device.component.html | 94 ------------------- .../fire-fighting-device.component.ts | 10 +- .../function-division.component.html | 53 ----------- .../function-division.component.ts | 6 +- .../function-division.component.html | 51 +--------- .../function-division.component.ts | 7 +- .../key-site-look/key-site.component.html | 57 ----------- .../key-site-look/key-site.component.ts | 7 +- .../key-unit/key-site/key-site.component.html | 57 ----------- .../key-unit/key-site/key-site.component.ts | 7 +- 14 files changed, 44 insertions(+), 455 deletions(-) diff --git a/src/app/key-unit/allaround/allaround.component.html b/src/app/key-unit/allaround/allaround.component.html index 9d94ca3..fd54eb2 100644 --- a/src/app/key-unit/allaround/allaround.component.html +++ b/src/app/key-unit/allaround/allaround.component.html @@ -1,42 +1,5 @@
    - -
    - -
    -
    - -
    -
    - -
    -
    - - -
    -
    - - -
    -
    - - - -
    -
    - -

    鏆傛棤鏁版嵁,璇峰墠寰骞抽潰鍥捐繘琛岀浉鍏虫暟鎹綍鍏

    -
    -
    diff --git a/src/app/key-unit/allaround/allaround.component.ts b/src/app/key-unit/allaround/allaround.component.ts index 4702938..27693f8 100644 --- a/src/app/key-unit/allaround/allaround.component.ts +++ b/src/app/key-unit/allaround/allaround.component.ts @@ -17,7 +17,6 @@ export class AllaroundComponent implements OnInit { constructor(private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private route:ActivatedRoute,) { } ngOnInit(): void { - this.getAllCompany() this.getAllBuilding() } @@ -42,7 +41,13 @@ export class AllaroundComponent implements OnInit { this.AllBuilding.forEach(element => { element.allImgs = [] }); - this.getAllArchitecture()} + this.getAllArchitecture() + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鏆傛棤寤虹瓚鏁版嵁','纭畾',config); + } }) } diff --git a/src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.html b/src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.html index 44661db..ee701d0 100644 --- a/src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.html +++ b/src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.html @@ -1,99 +1,5 @@
    - -
    - -

    鏆傛棤鏁版嵁,璇峰畬鍠勫崟浣嶅熀鏈俊鎭

    -
    -

    {{item.name}}

    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - - - - - - -
    {{header}}
    {{body[header]? body[header] : '鏆傛棤鏁版嵁'}}
    -
    -
    -

    妤煎眰/鍖哄煙鍚嶇О: {{tableMsg.name? tableMsg.name: '鏆傛棤鍚嶇О'}}

    - - - - - - - -
    {{header}}
    {{body[header]? body[header] : '鏆傛棤鏁版嵁'}}
    -
    -
    - - - -
    -
    - -
    - - - - -

    {{item.name}}

    - -
    -
    - - - - - - - {{radio.name}} - -
    -
    - -
    -
    - -
    -
    diff --git a/src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.ts b/src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.ts index ddaae08..ce55913 100644 --- a/src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.ts +++ b/src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.ts @@ -21,7 +21,6 @@ export class FireFightingDeviceLookComponent implements OnInit { constructor(private router:Router,private route:ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { } ngOnInit(): void { - this.getCompanyInformation() this.getAllBuilding() } @@ -234,7 +233,14 @@ export class FireFightingDeviceLookComponent implements OnInit { companyId:companyId }}).subscribe((data:any)=>{ this.allBuildingGrouping = data - if (this.allBuildingGrouping.length) { this.getAllBuildingFacilities() } + if (this.allBuildingGrouping.length) { + this.getAllBuildingFacilities() + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鏆傛棤寤虹瓚鏁版嵁','纭畾',config); + } }) } diff --git a/src/app/key-unit/fire-fighting-device/fire-fighting-device.component.html b/src/app/key-unit/fire-fighting-device/fire-fighting-device.component.html index 1bf4c41..2ccf727 100644 --- a/src/app/key-unit/fire-fighting-device/fire-fighting-device.component.html +++ b/src/app/key-unit/fire-fighting-device/fire-fighting-device.component.html @@ -1,99 +1,5 @@
    - -
    - -

    鏆傛棤鏁版嵁,璇峰畬鍠勫崟浣嶅熀鏈俊鎭

    -
    -

    {{item.name}}

    -
    - add_circle_outline - description - delete -
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - -
    {{header}}
    {{body[header]? body[header] : '鏆傛棤鏁版嵁'}}
    -
    -
    -

    妤煎眰/鍖哄煙鍚嶇О: {{tableMsg.name? tableMsg.name: '鏆傛棤鍚嶇О'}}

    - - - - - - - -
    {{header}}
    {{body[header]? body[header] : '鏆傛棤鏁版嵁'}}
    -
    -
    -
    - -
    -
    -
    - -
    - - - - -

    {{item.name}}

    - description -
    -
    - - - - - - - {{radio.name}} - -
    -
    - -
    -
    - -
    -
    diff --git a/src/app/key-unit/fire-fighting-device/fire-fighting-device.component.ts b/src/app/key-unit/fire-fighting-device/fire-fighting-device.component.ts index a3be170..8393abf 100644 --- a/src/app/key-unit/fire-fighting-device/fire-fighting-device.component.ts +++ b/src/app/key-unit/fire-fighting-device/fire-fighting-device.component.ts @@ -22,7 +22,6 @@ export class FireFightingDeviceComponent implements OnInit { constructor(private tabbarService: TabbarAndScoreService,private router:Router,private route:ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { } ngOnInit(): void { - this.getCompanyInformation() this.getAllBuilding() } @@ -233,7 +232,14 @@ export class FireFightingDeviceComponent implements OnInit { companyId:companyId }}).subscribe((data:any)=>{ this.allBuildingGrouping = data - if (this.allBuildingGrouping.length) { this.getAllBuildingFacilities() } + if (this.allBuildingGrouping.length) { + this.getAllBuildingFacilities() + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鏆傛棤寤虹瓚鏁版嵁','纭畾',config); + } }) } diff --git a/src/app/key-unit/function-division-look/function-division.component.html b/src/app/key-unit/function-division-look/function-division.component.html index 21de153..93cde75 100644 --- a/src/app/key-unit/function-division-look/function-division.component.html +++ b/src/app/key-unit/function-division-look/function-division.component.html @@ -1,59 +1,6 @@
    -
    - -
    - - -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - 鍖哄煙 - - - - 闈㈢Н - - - - - 鍩烘湰鎯呭喌 - -
    -

    鏆傛棤鏁版嵁

    -
    -
    -
    diff --git a/src/app/key-unit/function-division-look/function-division.component.ts b/src/app/key-unit/function-division-look/function-division.component.ts index 372b02b..c9e0ccc 100644 --- a/src/app/key-unit/function-division-look/function-division.component.ts +++ b/src/app/key-unit/function-division-look/function-division.component.ts @@ -16,7 +16,6 @@ export class FunctionDivisionLookComponent implements OnInit { ngOnInit(): void { this.companyId = this.route.snapshot.queryParams.id - this.getAllCompany() this.getAllBuilding() } @@ -121,6 +120,11 @@ export class FunctionDivisionLookComponent implements OnInit { element.functionalZoning = null }); this.getAllBuildingFunctionalZoning() + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鏆傛棤寤虹瓚鏁版嵁','纭畾',config); } }) } diff --git a/src/app/key-unit/function-division/function-division.component.html b/src/app/key-unit/function-division/function-division.component.html index ce618bf..9e50317 100644 --- a/src/app/key-unit/function-division/function-division.component.html +++ b/src/app/key-unit/function-division/function-division.component.html @@ -1,59 +1,10 @@
    -
    +
    add_circle_outline
    - -
    -
    - add_circle_outline - description - delete -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - 鍖哄煙 - - - - 闈㈢Н - - - - - 鍩烘湰鎯呭喌 - -
    -

    鏆傛棤鏁版嵁

    -
    -
    -
    diff --git a/src/app/key-unit/function-division/function-division.component.ts b/src/app/key-unit/function-division/function-division.component.ts index 7da8809..2611f5e 100644 --- a/src/app/key-unit/function-division/function-division.component.ts +++ b/src/app/key-unit/function-division/function-division.component.ts @@ -17,7 +17,6 @@ export class FunctionDivisionComponent implements OnInit { ngOnInit(): void { this.companyId = this.route.snapshot.queryParams.id - this.getAllCompany() this.getAllBuilding() } @@ -49,7 +48,6 @@ export class FunctionDivisionComponent implements OnInit { //淇濆瓨鍗曚綅鍔熻兘鍒嗗尯灞炴 preservation () { let companyId = this.route.snapshot.queryParams.id - // console.log(123,companyId) if (this.companyFunctionalZoning.length) { this.http.post('/api/CompanyFunctionalDivisions/Batch',this.companyFunctionalZoning,{params:{ companyId:companyId @@ -124,6 +122,11 @@ export class FunctionDivisionComponent implements OnInit { element.functionalZoning = null }); this.getAllBuildingFunctionalZoning() + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鏆傛棤寤虹瓚鏁版嵁','纭畾',config); } }) } diff --git a/src/app/key-unit/key-site-look/key-site.component.html b/src/app/key-unit/key-site-look/key-site.component.html index 8af5827..bdb2718 100644 --- a/src/app/key-unit/key-site-look/key-site.component.html +++ b/src/app/key-unit/key-site-look/key-site.component.html @@ -1,62 +1,5 @@
    - -
    - -
    -

    閲嶇偣閮ㄤ綅鎯呭喌

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    閲嶇偣閮ㄤ綅鍚嶇О - {{element.name}} - 閲嶇偣閮ㄤ綅鎵鍦ㄤ綅缃 - {{element.position}} - 寤虹瓚缁撴瀯 - {{element.structure}} - 浣跨敤鎬ц川 - {{element.nature}} - 涓昏鍗遍櫓鎬 - {{element.hazards}} - 鍥剧墖 - 鏌ョ湅鍥剧墖 -
    -

    鏆傛棤鏁版嵁,璇峰墠寰骞抽潰鍥捐繘琛岀浉鍏虫暟鎹綍鍏

    -
    -
    -

    閲嶇偣鎻愮ず

    - -

    - -

    -
    - -
    -
    diff --git a/src/app/key-unit/key-site-look/key-site.component.ts b/src/app/key-unit/key-site-look/key-site.component.ts index ba659df..053dc20 100644 --- a/src/app/key-unit/key-site-look/key-site.component.ts +++ b/src/app/key-unit/key-site-look/key-site.component.ts @@ -19,8 +19,6 @@ export class KeySiteLookComponent implements OnInit { displayedColumns: string[] = ['mainname', 'position', 'construction', 'nature', 'danger', 'img']; ngOnInit(): void { - this.getCompanyPostion() - this.getCompanyTips() this.getAllBuilding() } @@ -59,6 +57,11 @@ export class KeySiteLookComponent implements OnInit { element.companyInput = null }) //寤虹瓚閲嶇偣鎻愮ず鏁版嵁 this.getAllBuildingPositon() this.getAllBuildingTips() + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鏆傛棤寤虹瓚鏁版嵁','纭畾',config); } }) } diff --git a/src/app/key-unit/key-site/key-site.component.html b/src/app/key-unit/key-site/key-site.component.html index 4adf51d..c79f635 100644 --- a/src/app/key-unit/key-site/key-site.component.html +++ b/src/app/key-unit/key-site/key-site.component.html @@ -1,62 +1,5 @@
    - -
    - -
    -

    閲嶇偣閮ㄤ綅鎯呭喌

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    閲嶇偣閮ㄤ綅鍚嶇О - {{element.name}} - 閲嶇偣閮ㄤ綅鎵鍦ㄤ綅缃 - {{element.position}} - 寤虹瓚缁撴瀯 - {{element.structure}} - 浣跨敤鎬ц川 - {{element.nature}} - 涓昏鍗遍櫓鎬 - {{element.hazards}} - 鍥剧墖 - 鏌ョ湅鍥剧墖 -
    -

    鏆傛棤鏁版嵁,璇峰墠寰骞抽潰鍥捐繘琛岀浉鍏虫暟鎹綍鍏

    -
    -
    -

    閲嶇偣鎻愮ず

    - description -

    - -

    -
    - -
    -
    diff --git a/src/app/key-unit/key-site/key-site.component.ts b/src/app/key-unit/key-site/key-site.component.ts index df76261..b72badc 100644 --- a/src/app/key-unit/key-site/key-site.component.ts +++ b/src/app/key-unit/key-site/key-site.component.ts @@ -20,8 +20,6 @@ export class KeySiteComponent implements OnInit { displayedColumns: string[] = ['mainname', 'position', 'construction', 'nature', 'danger', 'img']; ngOnInit(): void { - this.getCompanyPostion() - this.getCompanyTips() this.getAllBuilding() } @@ -60,6 +58,11 @@ export class KeySiteComponent implements OnInit { element.companyInput = null }) //寤虹瓚閲嶇偣鎻愮ず鏁版嵁 this.getAllBuildingPositon() this.getAllBuildingTips() + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鏆傛棤寤虹瓚鏁版嵁','纭畾',config); } }) }