Browse Source

删除链接管线数据,增加火点,禁止删除车辆

develop
徐振升 4 years ago
parent
commit
9582c5b718
  1. 1
      src/app/canvas-share-data.service.ts
  2. 97
      src/app/ui/plan-assistance/plan-assistance.component.ts
  3. 42
      src/app/working-area/working-area.component.ts
  4. BIN
      src/assets/images/火点.png

1
src/app/canvas-share-data.service.ts

@ -71,6 +71,7 @@ export class CanvasShareDataService {
public getLinkCarName(car: any): any[] {
const linkCar = [];
car.assetData.Pipelines.forEach(pipeline => {
console.log(pipeline);
const icon = pipeline.assetData.LinkedObjects.find(i => i !== car);
if (icon) {
if (icon.assetData.Type === 1

97
src/app/ui/plan-assistance/plan-assistance.component.ts

@ -16,6 +16,103 @@ export class PlanAssistanceComponent implements OnInit, AfterViewInit {
workingArea: WorkingAreaComponent;
demoData = [
{
Id: '5f670ceae03abe3856d87d3e',
Name: '火灾',
Angle: 0,
Pipelines: [],
Type: 0,
Color: '80',
Point: {
x: 1787.576244496473,
y: 628.0452657124683
},
Width: 64,
Border: null,
Height: 64,
Enabled: true,
FloorId: '5f670bb79e91f4410005f564',
DrawMode: 0,
FillMode: 1,
GameMode: 0,
ImageUrl: 'assets/images/火点.png',
FixedSize: false,
CanConnection: true,
ConnectionObjs: [],
Thickness: 0,
MultiPoint: null,
TemplateId: '5e7c0ff961550e2754d461b9',
FireElementId: '5e7967a80814180f1c1ecaa4',
PropertyInfos: [
{
Tag: '',
Order: 0,
Enabled: true,
Visible: true,
Required: false,
RuleName: '',
RuleValue: '',
PhysicalUnit: '',
PropertyName: '名称/编号',
PropertyType: 0,
PropertyValue: ''
},
{
Tag: '',
Order: 0,
Enabled: true,
Visible: true,
Required: false,
RuleName: '',
RuleValue: '',
PhysicalUnit: '',
PropertyName: '位置',
PropertyType: 0,
PropertyValue: ''
},
{
Tag: '',
Order: 0,
Enabled: true,
Visible: true,
Required: false,
RuleName: '',
RuleValue: '',
PhysicalUnit: '张',
PropertyName: '图片',
PropertyType: 4,
PropertyValue: '5'
},
{
Tag: null,
Order: 0,
Enabled: false,
Visible: false,
Required: false,
RuleName: null,
RuleValue: null,
PhysicalUnit: null,
PropertyName: '图片',
PropertyType: 3,
PropertyValue: '/api/Objects/WebPlan2D/5f67042b9e91f4410005f55c/5f670d5c8db9a325049fa971.jpg'
},
{
Tag: null,
Order: 0,
Enabled: false,
Visible: false,
Required: false,
RuleName: null,
RuleValue: null,
PhysicalUnit: null,
PropertyName: '图片',
PropertyType: 3,
PropertyValue: '/api/Objects/WebPlan2D/5f67042b9e91f4410005f55c/5f670d638db9a325049fa972.jpg'
}
],
IsFromBuilding: true,
InteractiveMode: 0
},
{
Id: '5f670ceae03abe3856d87d3e',
Name: '消防泵房',

42
src/app/working-area/working-area.component.ts

@ -60,7 +60,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
/**
*
*/
private paintMode: PaintMode;
private paintMode: PaintMode = PaintMode.endPaint;
/**
*
*/
@ -169,21 +169,32 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.selection.objects.forEach(item => {
// 删除 选中的数据
if (item.assetData?.IsFromBuilding) {
// console.log(this.canvasData.originaleveryStoreyData.data[item.assetData.Id]);
delete this.canvasData.originalcompanyBuildingData?.data[item.assetData.Id];
// console.log(this.canvasData.originalcompanyBuildingData.data[item.assetData.Id]);
} else {
// console.log(this.canvasData.originaleveryStoreyData.data[item.assetData.Id]);
delete this.canvasData.originaleveryStoreyData?.data[item.assetData.Id];
// console.log(this.canvasData.originaleveryStoreyData.data[item.assetData.Id]);
}
// console.log(this.backgroundImage.getChildByName(item.assetData.Id));
// 删除选中的图标
this.backgroundImage.removeChild(this.backgroundImage.getChildByName(item.assetData.Id));
// 标记
this.canvasData.isChange = true;
if (item.assetData.Type !== 1
&& item.assetData.Type !== 2
&& item.assetData.Type !== 3
&& item.assetData.Type !== 4) {
// 删除选中的图标
let obj = this.backgroundImage.getChildByName(item.assetData.Id);
// this.backgroundImage.removeChild(obj);
// 找到ll
obj.destroy();
// 标记
this.canvasData.isChange = true;
this.emit('deleteIcon');
if (obj instanceof Pipeline) {
obj.assetData.LinkedObjects.forEach(element => {
let index = element.assetData.Pipelines.indexOf(obj);
if (index !== -1) {
element.assetData.Pipelines.splice(index, 1);
}
});
}
}
});
this.emit('deleteIcon');
}
});
// 测试代码
@ -258,7 +269,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
clearTimeout(this.animationTime);
this.animation?.pause();
this.animationIcon?.scale.set(1);
this.animation = this.c.breathe(icon, 5, 5, 30, true, 0);
this.animation = this.c.breathe(icon, 2, 2, 30, true, 0);
this.animationIcon = icon;
this.animationTime = setTimeout(() => {
this.animation?.pause();
@ -530,7 +541,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
list.forEach(element => {
const single = new SinglePointIcon(element, this);
});
/**
* x: 1787.576244496473
* y: 628.0452657124683
*/
const putCarAreaData = [
{
Id: '5f6719a4e03abe3856d87d7b',
@ -1682,6 +1696,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
event.currentTarget.dragPoint = event.data.getLocalPosition(event.currentTarget.parent);
event.currentTarget.dragPoint.x -= event.currentTarget.x;
event.currentTarget.dragPoint.y -= event.currentTarget.y;
console.log(this.backgroundImage.toLocal(this.mousePosition));
console.log(this.paintMode);
switch (this.paintMode) {
case PaintMode.endPaint:
console.log(this.backgroundImage.toLocal(this.mousePosition));

BIN
src/assets/images/火点.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Loading…
Cancel
Save