diff --git a/src/app/http-interceptors/base-interceptor.ts b/src/app/http-interceptors/base-interceptor.ts index 971bc44..76b39b8 100644 --- a/src/app/http-interceptors/base-interceptor.ts +++ b/src/app/http-interceptors/base-interceptor.ts @@ -47,6 +47,7 @@ export class BaseInterceptor implements HttpInterceptor { this.token.delete() sessionStorage.clear() window.localStorage.clear() + this.router.navigate(['ui/plan']) const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 diff --git a/src/app/http-interceptors/cache-token.service.ts b/src/app/http-interceptors/cache-token.service.ts index 3360241..ec040d3 100644 --- a/src/app/http-interceptors/cache-token.service.ts +++ b/src/app/http-interceptors/cache-token.service.ts @@ -15,9 +15,9 @@ export class CacheTokenService { login () { return new Promise ((resolve,reject)=>{ - sessionStorage.setItem("buildingTypeId",'5e7c9027a3050b1a840ed4b8'); //建筑类型 - sessionStorage.setItem("planId",'5f52fd529e91f4410005eac5'); //预案ID - sessionStorage.setItem("companyId",'5e9964caa760a059e84512e9'); //单位ID + sessionStorage.setItem("buildingTypeId",'5e7c9078a3050b1a840ed4ba'); //建筑类型 + sessionStorage.setItem("planId",''); //预案ID + sessionStorage.setItem("companyId",'5f67042b9e91f4410005f55c'); //单位ID this.http.post('/api/Account/SignIn',this.loginData).subscribe((data:any)=>{ sessionStorage.setItem("level",data.level); sessionStorage.setItem("token",data.token); diff --git a/src/app/navigation/navigation.component.html b/src/app/navigation/navigation.component.html index 24d0ee1..2518959 100644 --- a/src/app/navigation/navigation.component.html +++ b/src/app/navigation/navigation.component.html @@ -1,7 +1,7 @@
-
着火单位: 高科技创业园
+
着火单位: 贵港油库
{{item.name}}
diff --git a/src/app/navigation/navigation.component.scss b/src/app/navigation/navigation.component.scss index 138ec9f..8b66e7e 100644 --- a/src/app/navigation/navigation.component.scss +++ b/src/app/navigation/navigation.component.scss @@ -5,7 +5,7 @@ -moz-background-size:100% 100%; background-size:100% 100%; box-sizing: border-box; - padding: 5px 25px; + padding: 10px 38px 28px; overflow: hidden; display: flex; flex-direction: column; @@ -15,43 +15,42 @@ header { width: 100%; height: 80px; - border: 1px solid #30bbec; - border-top: none;; + border-bottom: 1px solid #30bbec; + overflow: hidden; .title { width: 100%; height: 25px; - line-height: 25px; text-align: center; - font-size: 18px; + font-size: 20px; font-weight: 550; color: red; } .router{ width: 100%; height: 55px; - outline: none; - .routerText { - display: inline-block; - margin: 7px 15px; - width: 150px; - height: 37px; - line-height: 37px; - font-size: 20px; - text-align: center; - border-top-left-radius: 15px; - border-bottom-right-radius: 15px; - cursor:pointer; - outline: none; - border: 2px solid #999; - color: #999; - } } } +//路由DIV +.routerText { + display: inline-block; + margin: 7px 15px; + width: 150px; + height: 37px; + line-height: 37px; + font-size: 20px; + text-align: center; + border-top-left-radius: 15px; + border-bottom-right-radius: 15px; + cursor:pointer; + outline: none; + border: 2px solid #fff; + color: #fff; +} //路由选中样式 .routerLinkActive { - background-color: rgba(240,136,14,0.3); - outline: none; + border: 2px solid rgb(248, 161, 62); + background-color: rgba(240,136,14,0.65); } //中间区域 diff --git a/src/app/ui/plan-assistance/plan-assistance.component.html b/src/app/ui/plan-assistance/plan-assistance.component.html index 4f08453..8c77164 100644 --- a/src/app/ui/plan-assistance/plan-assistance.component.html +++ b/src/app/ui/plan-assistance/plan-assistance.component.html @@ -1 +1 @@ -

plan-assistance works!

+ \ 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/ui/plan/collection-tools.component.ts b/src/app/ui/plan/collection-tools.component.ts index 9e35e3a..86eb500 100644 --- a/src/app/ui/plan/collection-tools.component.ts +++ b/src/app/ui/plan/collection-tools.component.ts @@ -639,24 +639,21 @@ export class planComponent implements OnInit { //计算 可视区域内宽度, 是否缩放背景图 backGroundScale () { let that = this - let dad = document.querySelector('.functionalDomainContent').clientWidth - let dadHeight = document.querySelector('.functionalDomainContent').clientHeight - let left = document.querySelector('.functionalDomainLeft').clientWidth - let right = document.querySelector('.functionalDomainRight').clientWidth - let imgWidth = dad - left - right//可视区域内 宽度 + let dadWidth = document.querySelector('.canvas').clientWidth + let dadHeight = document.querySelector('.canvas').clientHeight let img = new Image() img.src = this.selectingSitePlan.imageUrl; img.onload = function(){ - if (img.height > dadHeight && img.width > imgWidth) { - let width = imgWidth/img.width + if (img.height > dadHeight && img.width > dadWidth) { + let width = dadWidth/img.width let height = dadHeight/img.height that.canvas.setBackgroundScale((width>height? height : width)-0.005) return } else if (img.height > dadHeight) { that.canvas.setBackgroundScale((dadHeight/img.height)-0.005) return - } else if (img.width > imgWidth) { - that.canvas.setBackgroundScale((imgWidth/img.width)-0.005) + } else if (img.width > dadWidth) { + that.canvas.setBackgroundScale((dadWidth/img.width)-0.005) return } }; @@ -695,7 +692,7 @@ export class planComponent implements OnInit { //陈鹏飞↓↓↓ //陈鹏飞↓↓↓ //陈鹏飞↓↓↓ - params = {companyId: "5eaa261766f97891845a6caa"} + params = {companyId: sessionStorage.getItem('companyId')} allFireElements:any = []; //当前 单位/建筑 下的消防要素 isShowAttribute:boolean = true; //属性栏 是否显示 默认数据 diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index a32bf2d..a75b04b 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -4,7 +4,7 @@ import { EventEmitter } from 'events'; import { EventManager } from '@angular/platform-browser'; import { OutlineFilter } from 'pixi-filters'; import { CanvasShareDataService, GameMode } from '../canvas-share-data.service'; -import {CacheTokenService} from '../http-interceptors/cache-token.service' //引入自动登录 获取token服务 +import {CacheTokenService} from '../http-interceptors/cache-token.service'; // 引入自动登录 获取token服务 import * as ObjectID from 'bson-objectid'; import { Router } from '@angular/router'; @@ -17,7 +17,7 @@ import { Router } from '@angular/router'; export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterViewInit { - constructor(private eventManager: EventManager, public canvasData: CanvasShareDataService, public token: CacheTokenService,private router: Router,) { + constructor(private eventManager: EventManager, public canvasData: CanvasShareDataService, public token: CacheTokenService, private router: Router, ) { super(); } @@ -90,7 +90,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV /** * 确认绘制按钮 */ - private enterPaintEndButton = PIXI.Sprite.from('assets/images/enterPaintButton.jpg'); + private enterPaintEndButton = PIXI.Sprite.from('assets/images/enterPaintButton.png'); /** * 框选工具图形 */ @@ -110,26 +110,26 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // 根据ID 找到数据 - //是否登录 - public verificationURL = '/ui/plan' //验证url地址是否为验证页面 - isLogin () { - let token = sessionStorage.getItem('token') // 判断 是否登录状态 + // 是否登录 + public verificationURL = '/ui/plan'; // 验证url地址是否为验证页面 + isLogin() { + const token = sessionStorage.getItem('token'); // 判断 是否登录状态 if (token) { - this.init.getAllLibrary() - this.init.getAllBuildings() - this.init.getAllFirePlan() + // this.init.getAllLibrary() //获取素材库 + this.init.getAllBuildings() //获取所有建筑 + this.init.getAllFirePlan() //获取所有灾情 this.init.getSitePlan() //调用父组件 初始化方法 } else { this.token.login().then(res=>{ this.init.params.companyId = sessionStorage.getItem('companyId') - this.init.getAllLibrary() - this.init.getAllBuildings() - this.init.getAllFirePlan() + // this.init.getAllLibrary() //获取素材库 + this.init.getAllBuildings() //获取所有建筑 + this.init.getAllFirePlan() //获取所有灾情 this.init.getSitePlan() //调用父组件 初始化方法 }) } } - //是否登录 + // 是否登录 ngOnInit(): void { this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => { @@ -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(); } /** * @@ -230,8 +229,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV backgroundColor: 0xE9FAFF }); this.content.nativeElement.appendChild(this.app.view); - let url = this.router.url - url == this.verificationURL? this.isLogin() : null + const url = this.router.url; + // tslint:disable-next-line: no-unused-expression + url === this.verificationURL ? this.isLogin() : null; this.createBackgroundImage(); // this.createPreviewSinglePointIcon(); @@ -257,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; @@ -381,37 +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 assetData = { - 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: '', - PropertyInfos: null, - Border: null, - DrawMode: null, - Thickness: 0, - IsFromBuilding: false, - GameMode: 0 - }; - const single = new SinglePointIcon(assetData, this); - }, 100); - - // this.backgroundImage.anchor.set(0); + list.forEach(element => { + const single = new SinglePointIcon(element, this); + }); + this.setNameVisible(false, GameMode.BasicInformation); + this.allowEdit = false; } /** * @@ -993,6 +985,7 @@ export class SinglePointIcon extends PIXI.Container { this.image.interactive = true; this.image .on('mousedown', event => { + console.log(this.assetData.Name); event.stopPropagation(); this.workingArea.selection.selectOne(this); if (this.workingArea.allowEdit) { @@ -1031,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; @@ -1087,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); /** @@ -1230,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; @@ -1327,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); /** @@ -1468,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); + // }); } /** * 设置点显示状态 diff --git a/src/assets/images/enterPaintButton.jpg b/src/assets/images/enterPaintButton.jpg deleted file mode 100644 index 44b5faf..0000000 Binary files a/src/assets/images/enterPaintButton.jpg and /dev/null differ diff --git a/src/assets/images/enterPaintButton.png b/src/assets/images/enterPaintButton.png new file mode 100644 index 0000000..e6b99b7 Binary files /dev/null and b/src/assets/images/enterPaintButton.png differ diff --git a/src/assets/images/固定水泡.png b/src/assets/images/固定水泡.png new file mode 100644 index 0000000..d087c48 Binary files /dev/null and b/src/assets/images/固定水泡.png differ diff --git a/src/assets/images/地上消火栓.png b/src/assets/images/地上消火栓.png new file mode 100644 index 0000000..5828315 Binary files /dev/null and b/src/assets/images/地上消火栓.png differ diff --git a/src/assets/images/泡沫栓.png b/src/assets/images/泡沫栓.png new file mode 100644 index 0000000..73fb9d7 Binary files /dev/null and b/src/assets/images/泡沫栓.png differ