diff --git a/src/app/ui/plan-assistance/plan-assistance.component.html b/src/app/ui/plan-assistance/plan-assistance.component.html index 3b92400..8c77164 100644 --- a/src/app/ui/plan-assistance/plan-assistance.component.html +++ b/src/app/ui/plan-assistance/plan-assistance.component.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/app/ui/plan-assistance/plan-assistance.component.ts b/src/app/ui/plan-assistance/plan-assistance.component.ts index be069d7..e0f413c 100644 --- a/src/app/ui/plan-assistance/plan-assistance.component.ts +++ b/src/app/ui/plan-assistance/plan-assistance.component.ts @@ -1,15 +1,1376 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, AfterViewInit, ViewChild } from '@angular/core'; +import { WorkingAreaComponent } from 'src/app/working-area/working-area.component'; @Component({ selector: 'app-plan-assistance', templateUrl: './plan-assistance.component.html', styleUrls: ['./plan-assistance.component.scss'] }) -export class PlanAssistanceComponent implements OnInit { - +export class PlanAssistanceComponent implements OnInit, AfterViewInit { constructor() { } + @ViewChild('workingArea') + workingArea: WorkingAreaComponent; + + + demoData = [ + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048cae9d', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1295, + y: 1237 + }, + Name: '地上消火栓0', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048cae9e', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 2117, + y: 981 + }, + Name: '地上消火栓1', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048cae9f', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 2117, + y: 607 + }, + Name: '地上消火栓2', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caea0', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 2117, + y: 66 + }, + Name: '地上消火栓3', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caea1', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 2117, + y: -230 + }, + Name: '地上消火栓4', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caea2', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1450, + y: -410 + }, + Name: '地上消火栓5', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caea3', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1149, + y: 19 + }, + Name: '地上消火栓6', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caea4', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1149, + y: 779 + }, + Name: '地上消火栓7', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caea5', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 991, + y: 1345 + }, + Name: '地上消火栓8', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caea6', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 580, + y: 1345 + }, + Name: '地上消火栓9', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caea7', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: -14, + y: 1507 + }, + Name: '地上消火栓10', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caea8', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: -443, + y: 1507 + }, + Name: '地上消火栓11', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caea9', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: -519, + y: 1014 + }, + Name: '地上消火栓12', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeaa', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: -196, + y: 1014 + }, + Name: '地上消火栓13', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeab', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 136, + y: 1014 + }, + Name: '地上消火栓14', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeac', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 544, + y: 404 + }, + Name: '地上消火栓15', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caead', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 86, + y: 404 + }, + Name: '地上消火栓16', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeae', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: -555, + y: 404 + }, + Name: '地上消火栓17', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeaf', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: -1542, + y: 702 + }, + Name: '地上消火栓18', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeb0', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: -1542, + y: 1662 + }, + Name: '地上消火栓19', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeb1', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 130, + y: -147 + }, + Name: '地上消火栓20', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeb2', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 904, + y: -375 + }, + Name: '地上消火栓21', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeb3', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1137, + y: -674 + }, + Name: '地上消火栓22', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeb4', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 2922, + y: -349 + }, + Name: '地上消火栓23', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeb5', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 2922, + y: 187 + }, + Name: '地上消火栓24', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeb6', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1931, + y: 289 + }, + Name: '地上消火栓25', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeb7', + ImageUrl: './assets/images/地上消火栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 87, + y: -432 + }, + Name: '地上消火栓26', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeb8', + ImageUrl: './assets/images/泡沫栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1361, + y: 1212 + }, + Name: '泡沫栓0', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeb9', + ImageUrl: './assets/images/泡沫栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1943, + y: 1212 + }, + Name: '泡沫栓1', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeba', + ImageUrl: './assets/images/泡沫栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 2047, + y: -420 + }, + Name: '泡沫栓2', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caebb', + ImageUrl: './assets/images/泡沫栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1517, + y: -390 + }, + Name: '泡沫栓3', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caebc', + ImageUrl: './assets/images/泡沫栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1187, + y: -11 + }, + Name: '泡沫栓4', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caebd', + ImageUrl: './assets/images/泡沫栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1187, + y: 815 + }, + Name: '泡沫栓5', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caebe', + ImageUrl: './assets/images/泡沫栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 504, + y: 437 + }, + Name: '泡沫栓6', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caebf', + ImageUrl: './assets/images/泡沫栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: -1532, + y: 746 + }, + Name: '泡沫栓7', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caec0', + ImageUrl: './assets/images/泡沫栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: -1532, + y: 1703 + }, + Name: '泡沫栓8', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caec1', + ImageUrl: './assets/images/泡沫栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1081, + y: -690 + }, + Name: '泡沫栓9', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caec2', + ImageUrl: './assets/images/泡沫栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 2875, + y: -389 + }, + Name: '泡沫栓10', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caec3', + ImageUrl: './assets/images/泡沫栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 2875, + y: 233 + }, + Name: '泡沫栓11', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caec4', + ImageUrl: './assets/images/泡沫栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1981, + y: 265 + }, + Name: '泡沫栓12', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caec5', + ImageUrl: './assets/images/泡沫栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1570, + y: 265 + }, + Name: '泡沫栓13', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caec6', + ImageUrl: './assets/images/泡沫栓.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 93, + y: -362 + }, + Name: '泡沫栓14', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caec7', + ImageUrl: './assets/images/固定水泡.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1892, + y: 1237 + }, + Name: '固定水泡0', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caec8', + ImageUrl: './assets/images/固定水泡.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1993, + y: -452 + }, + Name: '固定水泡1', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caec9', + ImageUrl: './assets/images/固定水泡.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: -536, + y: 1014 + }, + Name: '固定水泡2', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caeca', + ImageUrl: './assets/images/固定水泡.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: -354, + y: 1014 + }, + Name: '固定水泡3', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caecb', + ImageUrl: './assets/images/固定水泡.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: -22, + y: 1014 + }, + Name: '固定水泡4', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caecc', + ImageUrl: './assets/images/固定水泡.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 41, + y: 437 + }, + Name: '固定水泡5', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caecd', + ImageUrl: './assets/images/固定水泡.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: -592, + y: 437 + }, + Name: '固定水泡6', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + }, + { + TemplateId: null, + FloorId: null, + Angle: 0, + Color: 0, + Enabled: true, + FillMode: 0, + FireElementId: 0, + FixedSize: true, + Height: 32, + Width: 32, + Id: '5f67f92238f13cd2048caece', + ImageUrl: './assets/images/固定水泡.png', + InteractiveMode: 0, + MultiPoint: null, + Point: { + x: 1363, + y: 289 + }, + Name: '固定水泡7', + PropertyInfos: null, + Border: null, + DrawMode: null, + Thickness: 0, + IsFromBuilding: false, + GameMode: 0 + } + ]; + ngOnInit(): void { + } + ngAfterViewInit(): void { + this.workingArea.loadDemoScene(this.demoData); + } } diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index c66c293..d49eb87 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -168,14 +168,13 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.eventManager.addGlobalEventListener('window', 'keypress', (event: any) => { }); - setTimeout(() => { - this.createCanvas(); - this.loadDemoScene(); - }, 0); + // setTimeout(() => { + // this.createCanvas(); + // }, 0); } ngAfterViewInit(): void { - + this.createCanvas(); } /** * @@ -258,6 +257,22 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV obj.filters = []; } }); + this.on('backgroundScale', scale => { + this.backgroundImage.children.forEach(item => { + if (item instanceof SinglePointIcon) { + if (item.assetData.FixedSize) { + const data = 1 / scale; + item.scale.set(data); + } + } else if (item instanceof MultipointIcon) { + const data = 1 / scale; + item.text.scale.set(scale); + } else if (item instanceof PolygonIcon) { + const data = 1 / scale; + item.text.scale.set(scale); + } + }); + }); this.app.ticker.add((delta) => { this.mousePosition = this.app.renderer.plugins.interaction.mouse.global; @@ -382,1227 +397,13 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV /** * 加载测试界面 */ - public loadDemoScene() { + public loadDemoScene(list: any[]) { this.backgroundImage.texture = PIXI.Texture.from('./assets/images/demo.jpg'); - setTimeout(() => { - const list = [ - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5295 - (this.backgroundImage.texture.width / 2), 4067 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓0', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(6117 - (this.backgroundImage.texture.width / 2), 3811 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓1', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(6117 - (this.backgroundImage.texture.width / 2), 3437 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓2', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(6117 - (this.backgroundImage.texture.width / 2), 2896 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓3', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(6117 - (this.backgroundImage.texture.width / 2), 2600 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓4', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5450 - (this.backgroundImage.texture.width / 2), 2420 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓5', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5149 - (this.backgroundImage.texture.width / 2), 2849 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓6', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5149 - (this.backgroundImage.texture.width / 2), 3609 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓7', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(4991 - (this.backgroundImage.texture.width / 2), 4175 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓8', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(4580 - (this.backgroundImage.texture.width / 2), 4175 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓9', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(3986 - (this.backgroundImage.texture.width / 2), 4337 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓10', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(3557 - (this.backgroundImage.texture.width / 2), 4337 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓11', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(3481 - (this.backgroundImage.texture.width / 2), 3844 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓12', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(3804 - (this.backgroundImage.texture.width / 2), 3844 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓13', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(4136 - (this.backgroundImage.texture.width / 2), 3844 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓14', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(4544 - (this.backgroundImage.texture.width / 2), 3234 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓15', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(4086 - (this.backgroundImage.texture.width / 2), 3234 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓16', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(3445 - (this.backgroundImage.texture.width / 2), 3234 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓17', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(2458 - (this.backgroundImage.texture.width / 2), 3532 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓18', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(2458 - (this.backgroundImage.texture.width / 2), 4492 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓19', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(4130 - (this.backgroundImage.texture.width / 2), 2683 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓20', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(4904 - (this.backgroundImage.texture.width / 2), 2455 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓21', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5137 - (this.backgroundImage.texture.width / 2), 2156 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓22', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(6922 - (this.backgroundImage.texture.width / 2), 2481 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓23', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(6922 - (this.backgroundImage.texture.width / 2), 3017 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓24', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5931 - (this.backgroundImage.texture.width / 2), 3119 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓25', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/地上消火栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(4087 - (this.backgroundImage.texture.width / 2), 2398 - (this.backgroundImage.texture.height / 2)), - Name: '地上消火栓26', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/泡沫栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5361 - (this.backgroundImage.texture.width / 2), 4042 - (this.backgroundImage.texture.height / 2)), - Name: '泡沫栓0', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/泡沫栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5943 - (this.backgroundImage.texture.width / 2), 4042 - (this.backgroundImage.texture.height / 2)), - Name: '泡沫栓1', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/泡沫栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(6047 - (this.backgroundImage.texture.width / 2), 2410 - (this.backgroundImage.texture.height / 2)), - Name: '泡沫栓2', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/泡沫栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5517 - (this.backgroundImage.texture.width / 2), 2440 - (this.backgroundImage.texture.height / 2)), - Name: '泡沫栓3', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/泡沫栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5187 - (this.backgroundImage.texture.width / 2), 2819 - (this.backgroundImage.texture.height / 2)), - Name: '泡沫栓4', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/泡沫栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5187 - (this.backgroundImage.texture.width / 2), 3645 - (this.backgroundImage.texture.height / 2)), - Name: '泡沫栓5', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/泡沫栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(4504 - (this.backgroundImage.texture.width / 2), 3267 - (this.backgroundImage.texture.height / 2)), - Name: '泡沫栓6', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/泡沫栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(2468 - (this.backgroundImage.texture.width / 2), 3576 - (this.backgroundImage.texture.height / 2)), - Name: '泡沫栓7', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/泡沫栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(2468 - (this.backgroundImage.texture.width / 2), 4533 - (this.backgroundImage.texture.height / 2)), - Name: '泡沫栓8', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/泡沫栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5081 - (this.backgroundImage.texture.width / 2), 2140 - (this.backgroundImage.texture.height / 2)), - Name: '泡沫栓9', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/泡沫栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(6875 - (this.backgroundImage.texture.width / 2), 2441 - (this.backgroundImage.texture.height / 2)), - Name: '泡沫栓10', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/泡沫栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(6875 - (this.backgroundImage.texture.width / 2), 3063 - (this.backgroundImage.texture.height / 2)), - Name: '泡沫栓11', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/泡沫栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5981 - (this.backgroundImage.texture.width / 2), 3095 - (this.backgroundImage.texture.height / 2)), - Name: '泡沫栓12', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/泡沫栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5570 - (this.backgroundImage.texture.width / 2), 3095 - (this.backgroundImage.texture.height / 2)), - Name: '泡沫栓13', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/泡沫栓.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(4093 - (this.backgroundImage.texture.width / 2), 2468 - (this.backgroundImage.texture.height / 2)), - Name: '泡沫栓14', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/固定水泡.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5892 - (this.backgroundImage.texture.width / 2), 4067 - (this.backgroundImage.texture.height / 2)), - Name: '固定水泡0', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/固定水泡.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5993 - (this.backgroundImage.texture.width / 2), 2378 - (this.backgroundImage.texture.height / 2)), - Name: '固定水泡1', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/固定水泡.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(3464 - (this.backgroundImage.texture.width / 2), 3844 - (this.backgroundImage.texture.height / 2)), - Name: '固定水泡2', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/固定水泡.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(3646 - (this.backgroundImage.texture.width / 2), 3844 - (this.backgroundImage.texture.height / 2)), - Name: '固定水泡3', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/固定水泡.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(3978 - (this.backgroundImage.texture.width / 2), 3844 - (this.backgroundImage.texture.height / 2)), - Name: '固定水泡4', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/固定水泡.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(4041 - (this.backgroundImage.texture.width / 2), 3267 - (this.backgroundImage.texture.height / 2)), - Name: '固定水泡5', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/固定水泡.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(3408 - (this.backgroundImage.texture.width / 2), 3267 - (this.backgroundImage.texture.height / 2)), - Name: '固定水泡6', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - }, - { - TemplateId: null, - FloorId: null, - Angle: 0, - Color: 0, - Enabled: true, - FillMode: 0, - FireElementId: 0, - FixedSize: true, - Height: 32, - Width: 32, - Id: ObjectID.default.generate(), - ImageUrl: './assets/images/固定水泡.png', - InteractiveMode: 0, - MultiPoint: null, - Point: new PIXI.Point(5363 - (this.backgroundImage.texture.width / 2), 3119 - (this.backgroundImage.texture.height / 2)), - Name: '固定水泡7', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: GameMode.BasicInformation - } - ]; - - console.log(JSON.stringify(list)); - - - - list.forEach(element => { - const single = new SinglePointIcon(element, this); - }); - - // const single = new SinglePointIcon(assetData0, this); - - - this.setNameVisible(false, GameMode.BasicInformation); - - this.allowEdit = false; - }, 100); + list.forEach(element => { + const single = new SinglePointIcon(element, this); + }); + this.setNameVisible(false, GameMode.BasicInformation); + this.allowEdit = false; } /** * @@ -2223,12 +1024,12 @@ export class SinglePointIcon extends PIXI.Container { }); - this.workingArea.on('backgroundScale', data => { - if (this.assetData.FixedSize) { - const scale = 1 / data; - this.scale.set(scale); - } - }); + // 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; @@ -2279,7 +1080,7 @@ export class MultipointIcon extends PIXI.Container { wordWrapWidth: 100, }); - private text = new PIXI.Text(this.assetData.Name + public text = new PIXI.Text(this.assetData.Name + '\r\n' + this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue, this.style); /** @@ -2422,11 +1223,11 @@ export class MultipointIcon extends PIXI.Container { }); }); - // 缩放 - this.workingArea.on('backgroundScale', data => { - const scale = 1 / data; - this.text.scale.set(scale); - }); + // // 缩放 + // this.workingArea.on('backgroundScale', data => { + // const scale = 1 / data; + // this.text.scale.set(scale); + // }); // 添加选中事件 this.iconsTilingSprite.forEach((item, index, array) => { item.interactive = true; @@ -2519,7 +1320,7 @@ export class PolygonIcon extends PIXI.Container { wordWrapWidth: 100, }); - private text = new PIXI.Text(this.assetData.Name + public text = new PIXI.Text(this.assetData.Name + '\r\n' + this.assetData.PropertyInfos.find(item => item.PropertyName === '名称/编号')?.PropertyValue, this.style); /** @@ -2660,11 +1461,11 @@ export class PolygonIcon extends PIXI.Container { .on('rightclick', event => { // this.workingArea.selection.deselectAll(); }); - // 缩放 - this.workingArea.on('backgroundScale', data => { - const scale = 1 / data; - this.text.scale.set(scale); - }); + // // 缩放 + // this.workingArea.on('backgroundScale', data => { + // const scale = 1 / data; + // this.text.scale.set(scale); + // }); } /** * 设置点显示状态