diff --git a/src/app/key-unit/key-unit-management/key-unit-management.component.html b/src/app/key-unit/key-unit-management/key-unit-management.component.html index dc23fa7..26dffd3 100644 --- a/src/app/key-unit/key-unit-management/key-unit-management.component.html +++ b/src/app/key-unit/key-unit-management/key-unit-management.component.html @@ -102,7 +102,7 @@ {{element.name}} - + 辖区中队 diff --git a/src/app/key-unit/key-unit-management/key-unit-management.component.ts b/src/app/key-unit/key-unit-management/key-unit-management.component.ts index 59861c7..3bfbf45 100644 --- a/src/app/key-unit/key-unit-management/key-unit-management.component.ts +++ b/src/app/key-unit/key-unit-management/key-unit-management.component.ts @@ -46,7 +46,7 @@ export class KeyUnitManagementComponent implements OnInit { pageSizeOptions: number[] = [10] //设置每页条数 PageNumber:any //第几页 - displayedColumns: string[] = ['checked','Follow','unitname','jurisdictionsquadron', 'unittype','scc', 'time','operation']; + displayedColumns: string[] = ['checked','Follow','unitname','integrity','jurisdictionsquadron', 'unittype','scc', 'time','operation']; tabledataSource:any allorganizations:any diff --git a/src/app/tabbar/tabbar.component.html b/src/app/tabbar/tabbar.component.html index ba6911e..40a45da 100644 --- a/src/app/tabbar/tabbar.component.html +++ b/src/app/tabbar/tabbar.component.html @@ -3,9 +3,9 @@

{{title}} : {{planName}}

- +
指挥员指挥能力考评系统(练习版)
diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index f61f770..50b2f12 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -52,20 +52,20 @@ [ngClass]="{'buildingbtnchecked': checkedBuildingIndex==-1}"> 总平面图 - - - - + + + + - - - - +
diff --git a/src/app/working-area/model/singlePointIcon.ts b/src/app/working-area/model/singlePointIcon.ts index 7ce170a..f180e0d 100644 --- a/src/app/working-area/model/singlePointIcon.ts +++ b/src/app/working-area/model/singlePointIcon.ts @@ -4,6 +4,7 @@ import { GameMode } from './gameMode'; import { Pipeline } from './pipeline'; import { PaintMode } from './paintModel'; import * as PIXI from 'pixi.js'; +import { throwMatDialogContentAlreadyAttachedError } from '@angular/material/dialog'; /** * 单点图标 @@ -29,7 +30,17 @@ export class SinglePointIcon extends PIXI.Container { public text = new PIXI.Text(this.assetData.Name + '\r\n' + this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue, this.style); + + /** + * 选中圆点 + */ + public selectedPointTexture = PIXI.Texture.from('assets/images/handle-main.png'); private image = PIXI.Sprite.from(this.assetData.ImageUrl); + public graphics = new PIXI.Graphics(); + public connectionPoint = new PIXI.Graphics(); + + // 显示连接点 + public showConnectionPoint = false; constructor(public assetData: any, private workingArea: WorkingAreaComponent) { super(); @@ -50,7 +61,7 @@ export class SinglePointIcon extends PIXI.Container { this.image.interactive = true; this.image .on('mousedown', event => { - console.log(this.workingArea.canvasData.selectPanelPoint.Data); + console.log(this.workingArea.canvasData.selectPanelPoint); event.stopPropagation(); this.workingArea.selection.selectOne(this); if (this.assetData.CanConnection && this.parent === this.workingArea.backgroundImage) { @@ -126,16 +137,13 @@ export class SinglePointIcon extends PIXI.Container { }) .on('mouseover', event => { - + // this.connectionPoint.visible = true; + this.setSelectionBox(true); + }) + .on('mouseout', event => { + // this.connectionPoint.visible = false; + this.setSelectionBox(false); }); - - // this.workingArea.on('backgroundScale', data => { - // if (this.assetData.FixedSize) { - // const scale = 1 / data; - // this.scale.set(scale); - // } - // }); - this.text.x = this.image.x; this.text.y = this.image.y - this.image.height / 2; this.text.anchor.set(0.5, 1); @@ -144,8 +152,83 @@ export class SinglePointIcon extends PIXI.Container { this.text.visible = false; } + this.connectionPoint.beginFill(); + this.connectionPoint.drawCircle(0, 0, 5); + this.connectionPoint.endFill(); + this.connectionPoint.visible = true; + this.connectionPoint.interactive = true; + this.connectionPoint + .on('mouseover', event => { + console.log('b'); + this.graphics.lineStyle(2, 0x00EB00, 1); + this.graphics.drawRect(- this.connectionPoint.width / 2, - this.connectionPoint.width / 2, + this.connectionPoint.width, this.connectionPoint.width); + }) + .on('mouseout', event => { + this.graphics.clear(); + }); this.addChild(this.text); this.addChild(this.image); + this.addChild(this.graphics); + // this.addChild(this.connectionPoint); + + // // up + // const up = new PIXI.Sprite(this.selectedPointTexture); + // up.anchor.set(0.5); + // up.x = this.image.x; + // up.y = this.image.y - (this.image.height / 2); + // this.addChild(up); + // // up-left + // const upLeft = new PIXI.Sprite(this.selectedPointTexture); + // upLeft.anchor.set(0.5); + // upLeft.x = this.image.x - (this.image.width / 2); + // upLeft.y = this.image.y - (this.image.height / 2); + // this.addChild(upLeft); + // // up-right + // const upRight = new PIXI.Sprite(this.selectedPointTexture); + // upRight.anchor.set(0.5); + // upRight.x = this.image.x + (this.image.width / 2); + // upRight.y = this.image.y - (this.image.height / 2); + // this.addChild(upRight); + // // down + // const down = new PIXI.Sprite(this.selectedPointTexture); + // down.anchor.set(0.5); + // down.x = this.image.x; + // down.y = this.image.y + (this.image.height / 2); + // this.addChild(down); + // // down-left + // const downLeft = new PIXI.Sprite(this.selectedPointTexture); + // downLeft.anchor.set(0.5); + // downLeft.x = this.image.x - (this.image.width / 2); + // downLeft.y = this.image.y + (this.image.height / 2); + // this.addChild(downLeft); + // // down-right + // const downRight = new PIXI.Sprite(this.selectedPointTexture); + // downRight.anchor.set(0.5); + // downRight.x = this.image.x + (this.image.width / 2); + // downRight.y = this.image.y + (this.image.height / 2); + // this.addChild(downRight); + // // left + // const left = new PIXI.Sprite(this.selectedPointTexture); + // left.anchor.set(0.5); + // left.x = this.image.x - (this.image.width / 2); + // left.y = this.image.y; + // this.addChild(left); + // // right + // const right = new PIXI.Sprite(this.selectedPointTexture); + // right.anchor.set(0.5); + // right.x = this.image.x + (this.image.width / 2); + // right.y = this.image.y; + // this.addChild(right); + } + // 设置选择框 + public setSelectionBox(b: boolean) { + if (b) { + this.graphics.lineStyle(2, 0x00EB00, 1); + this.graphics.drawRect(- this.image.width / 2, - this.image.height / 2, this.image.width, this.image.height); + } else { + this.graphics.clear(); + } } // 设置名称 public setNameVisible(value: boolean, mode: GameMode) { diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 2f1eb47..a6b89cd 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -3,7 +3,7 @@ import * as PIXI from 'pixi.js'; import { EventEmitter } from 'events'; import { EventManager } from '@angular/platform-browser'; import { OutlineFilter, OldFilmFilter } from 'pixi-filters'; -import { CanvasShareDataService } from '../canvas-share-data.service'; +import { CanvasShareDataService, DisposalNodeData, FloorNodeData } from '../canvas-share-data.service'; import * as ObjectID from 'bson-objectid'; import { Charm } from './charm'; import { SinglePointIcon } from './model/singlePointIcon'; @@ -339,6 +339,11 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.canvasData.originaleveryStoreyData.data[obj.assetData.Id] = obj.assetData; } } else { + console.log(); + 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; } this.canvasData.isChange = true; @@ -421,8 +426,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV const floorData = this.canvasData.originaleveryStoreyData.data; - const buildingData = this.canvasData.originalcompanyBuildingData.data; - const floor = this.canvasData.selectStorey; + // const buildingData = this.canvasData.originalcompanyBuildingData.data; + // const floor = this.canvasData.selectStorey; // // key=>属性名 data[key]=>属性值 Object.keys(floorData).forEach((key) => { @@ -438,25 +443,25 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV break; } }); - Object.keys(buildingData).forEach((key) => { - if (buildingData[key].FloorId === floor.id) { - switch (buildingData[key].InteractiveMode) { - case 0: - const singleIcon = new SinglePointIcon(buildingData[key], this); - break; - case 1: - const icon = new MultipointIcon(buildingData[key], this); - break; - case 2: - const polygonIcon = new PolygonIcon(buildingData[key], this); - break; - } - } - }); - + // Object.keys(buildingData).forEach((key) => { + // if (buildingData[key].FloorId === floor.id) { + // switch (buildingData[key].InteractiveMode) { + // case 0: + // const singleIcon = new SinglePointIcon(buildingData[key], this); + // break; + // case 1: + // const icon = new MultipointIcon(buildingData[key], this); + // break; + // case 2: + // const polygonIcon = new PolygonIcon(buildingData[key], this); + // break; + // } + // } + // }); + // 加载处置节点数据 const nodeData = this.canvasData.selectPanelPoint.Data; - if (nodeData !== undefined) { + if (nodeData !== undefined && nodeData !== null) { Object.keys(nodeData).forEach((key) => { Object.keys(nodeData[key]).forEach((tempKey) => { switch (nodeData[key][tempKey].InteractiveMode) { @@ -510,8 +515,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV }); }); } + console.log(nodeData.Version); 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; @@ -804,7 +811,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV */ public destroyBackgroundImage(): void { this.app.stage.removeChild(this.backgroundImage); - // this.removeAllListeners('backgroundScale'); } /** * 设置背景图缩放 diff --git a/src/assets/images/handle-fixed.png b/src/assets/images/handle-fixed.png new file mode 100644 index 0000000..b4b600b Binary files /dev/null and b/src/assets/images/handle-fixed.png differ diff --git a/src/assets/images/handle-main.png b/src/assets/images/handle-main.png new file mode 100644 index 0000000..ee067ff Binary files /dev/null and b/src/assets/images/handle-main.png differ diff --git a/src/assets/images/handle-secondary.png b/src/assets/images/handle-secondary.png new file mode 100644 index 0000000..b4a3090 Binary files /dev/null and b/src/assets/images/handle-secondary.png differ diff --git a/src/assets/images/handle-terminal.png b/src/assets/images/handle-terminal.png new file mode 100644 index 0000000..ec03b31 Binary files /dev/null and b/src/assets/images/handle-terminal.png differ