diff --git a/src/app/ui/collection-tools/collection-tools.component.scss b/src/app/ui/collection-tools/collection-tools.component.scss
index 5935847..8b34d62 100644
--- a/src/app/ui/collection-tools/collection-tools.component.scss
+++ b/src/app/ui/collection-tools/collection-tools.component.scss
@@ -110,6 +110,7 @@
}
.functionalDomain {
flex: 90%;
+ overflow: hidden;
.functionalDomainContent {
position: relative;
width: 100%;
diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts
index 7dd8618..3cf8178 100644
--- a/src/app/ui/collection-tools/collection-tools.component.ts
+++ b/src/app/ui/collection-tools/collection-tools.component.ts
@@ -6,7 +6,7 @@ import {leftFunctionalDomainComponent,editPlaneFigureComponent,editDisposalNodeC
import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree';
import {FlatTreeControl} from '@angular/cdk/tree';
import {WorkingAreaComponent} from '../../working-area/working-area.component'
-import {CanvasShareDataService} from '../../canvas-share-data.service' //引入服务
+import {CanvasShareDataService, DisposalNodeData} from '../../canvas-share-data.service' //引入服务
import Viewer from 'viewerjs';
import Swiper from 'swiper';
import { saveOneDialog } from './save';
@@ -157,8 +157,11 @@ export class CollectionToolsComponent implements OnInit {
if (!this.pattern) {
this.pattern = true
this.canvasData.gameMode = GameMode.BasicInformation
+ this.canvasData.selectPanelPoint = new DisposalNodeData();
this.mateDeleteCustomize()
this.getAllLibrary()
+ this.checkedBuildingIndex = -1
+ this.getSitePlan() //总平面图一层
}
}
@@ -1237,7 +1240,6 @@ export class CollectionToolsComponent implements OnInit {
isRefresh? await this.canvas.refresh() : null
this.canvas.setNameVisible(this.basicInfo,0)
this.canvas.setNameVisible(this.wantToWork,1)
- // this.canvasData.selectPanelPoint.Data = {}
isRefresh? this.canvasData.isChange = false : null //服务中 数据是否改动 改为false
isRefresh? this.isShowProperty = true : null
isRefresh? this.isShowAttribute = true : null
@@ -1413,7 +1415,7 @@ export class CollectionToolsComponent implements OnInit {
selectSitePlan (item,index) {
if (this.selectSitePlanIndex != index) {
-
+ this.canvasData.selectPanelPoint = new DisposalNodeData();
if (this.canvasData.isChange) { //true 数据被改动
let isTrue = confirm('是否保存当前编辑数据')
if (isTrue) { //先保存数据 在切换
@@ -1892,8 +1894,6 @@ export class CollectionToolsComponent implements OnInit {
}
sitePlanIcon = {fire:0,force:0} // 总平面图 火源/力量 图标 是否展示
- sitePlanBuildingID:string = ''; //选择 数据节点对应建筑 火源/力量图标
- storeyID:string = ''; //选择 数据节点对应楼层 火源/力量图标
//刷新 建筑楼层 匹配 火源/力量 图标
mateFireForce () {
@@ -1916,13 +1916,35 @@ export class CollectionToolsComponent implements OnInit {
data[key].forceCount != 0? this.sitePlanIcon.force=1 : this.sitePlanIcon.force=0
}
}
+
+ let buildingMSG = this.canvasData.allNodeMarkers.highlightMarkers || {}
+ for (let key in buildingMSG) {
+ if (key === this.canvasData.selectPanelPoint.DisposalNodeId) {
+ for (let keys in buildingMSG[key]) {
+ this.sitePlanData.forEach(element => { //楼层
+ if (element.id === keys) {
+ buildingMSG[key][keys].fireCount != 0? element.fire=2 : null
+ buildingMSG[key][keys].forceCount != 0? element.force=2 : null
+ }
+ });
+ this.allBuildings.forEach(element => { //建筑
+ if (element.id === keys) { // 相匹配时
+ buildingMSG[key][keys].fireCount != 0? element.fire=2 : null
+ buildingMSG[key][keys].forceCount != 0? element.force=2 : null
+ }
+ });
+ if (this.params.companyId === keys) { //总平面图时
+ buildingMSG[key][keys].fireCount != 0? this.sitePlanIcon.fire=2 : null
+ buildingMSG[key][keys].forceCount != 0? this.sitePlanIcon.force=2 : null
+ }
+ }
+ }
+ }
}
// 切换 基本信息时 刷新 删除 建筑楼层 自定义属性
mateDeleteCustomize () {
this.defaultExpandedKeys = []
- this.sitePlanBuildingID = ''
- this.storeyID = ''
this.sitePlanIcon = {fire:0,force:0}
this.sitePlanData.forEach(element => { //楼层
delete element.fire
@@ -1940,8 +1962,6 @@ export class CollectionToolsComponent implements OnInit {
let params = {disasterId: this.allFirePlan[0].id || ''}
this.http.get('/api/DisasterData/Diffs',{params:params}).subscribe(data=>{
this.canvasData.allNodeMarkers = data
- this.sitePlanBuildingID = ''
- this.storeyID = ''
this.mateFireForce()
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@@ -2034,10 +2054,8 @@ export class CollectionToolsComponent implements OnInit {
} else if (e.buildingAreaId || e.sitePlanId) { //当前节点 是 数据节点 时
let msg = this.canvasData.findDisposalNode(e.parentId)
this.canvasData.selectPanelPointBaseData = msg
-
- e.sitePlanId? this.sitePlanBuildingID = this.params.companyId : this.sitePlanBuildingID = e.buildingId //火源/力量图标高亮
- e.sitePlanId? this.storeyID = e.sitePlanId : this.storeyID = e.buildingAreaId //火源/力量图标高亮
this.selectDisposalNode = e.parentId //选中 节点
+
if (this.canvasData.selectPanelPoint.DisposalNodeId != e.id) { //选择节点 不是当前节点时
let params = {nodeId: e.id}
let parameter = { //查询 节点 对应 建筑/楼层 index,id
@@ -2045,8 +2063,7 @@ export class CollectionToolsComponent implements OnInit {
storeyId: e.sitePlanId? e.sitePlanId : e.buildingAreaId, //楼层id
}
this.http.get('/api/DisposalNodeData',{params:params}).subscribe(data=>{
- console.log(12121,data)
- this.canvasData.selectPanelPoint = this.canvasData.deserialize(JSON.stringify(data)) //选择 当前 节点
+ this.canvasData.selectPanelPoint = this.canvasData.deserialize(JSON.stringify(data || new DisposalNodeData())) //选择 当前 节点
this.canvasData.selectPanelPoint.Data = this.canvasData.deserialize(this.canvasData.selectPanelPoint.Data)
this.seekPanelPoint(parameter)
})
diff --git a/src/app/ui/organization/organization.component.html b/src/app/ui/organization/organization.component.html
index 6f963b9..b0f79ec 100644
--- a/src/app/ui/organization/organization.component.html
+++ b/src/app/ui/organization/organization.component.html
@@ -10,10 +10,8 @@
-
-
-
-
+
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