From a193e21417f8514f2521c6e2651f06562687afe8 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Wed, 30 Dec 2020 11:19:17 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=AD=A3]=20=E4=BF=AE=E6=AD=A3buildi?= =?UTF-8?q?ngType=E8=8E=B7=E5=8F=96BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app-routing.module.ts | 5 +---- src/app/ui/collection-tools/collection-tools.component.ts | 6 ++---- src/app/ui/plan-assistance/plan-assistance.component.scss | 2 ++ src/app/ui/plan/collection-tools.component.ts | 4 ++-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index e0a152c..23b12c6 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -16,14 +16,11 @@ import { CollectionToolsComponent } from './ui/collection-tools/collection-tools const routes: Routes = [ - {path:'',redirectTo:`/ui/plan`,pathMatch:'full',}, + {path:'',redirectTo:`/ui/plan/basicInfo`,pathMatch:'full',}, { path:'', component:NavigationComponent, // canActivate: [AuthGuard],//守卫验证 children:[ {path:'ui',loadChildren:() => import('./ui/ui.module').then(m => m.UiModule)}, - // {path:'home',loadChildren:() => import('./pages/pages.module').then(m => m.PagesModule)}, - // {path:'visualization',component: HomeComponent}, - // {path:'gis',loadChildren:() => import('./gis-management/gis-management.module').then(m => m.GISManagementModule)} ] }, {path:'plan', component:planComponent}, //平面图 diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index 0bcc978..4e7cb9c 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -528,8 +528,8 @@ export class CollectionToolsComponent implements OnInit { this.route.queryParams.subscribe(paramsData=>{ let params = {USCI: paramsData.usci || ''} this.http.get("/api/Companies",{params:params}).subscribe((data:any)=>{ - if (data.items.length) { //查询到结果时 - sessionStorage.setItem("buildingTypeId",data.items[0].buildingTypes[0].id || ''); //建筑类型 + if (data.items && data.items.length) { //查询到结果时 + data.items[0].buildingTypes[0]? sessionStorage.setItem("buildingTypeId",data.items[0].buildingTypes[0].id || '') : sessionStorage.setItem("buildingTypeId",'') //建筑类型 sessionStorage.setItem("companyId",data.items[0].id || ''); //单位ID sessionStorage.setItem("planId",paramsData.planComponentId || ''); //建筑类型 resolve('success') @@ -570,7 +570,6 @@ export class CollectionToolsComponent implements OnInit { const token = sessionStorage.getItem('token'); // 判断 是否登录状态 if (token) { this.queryCompanyData().then(res=>{ - // this.getAllLibrary() //获取素材库 this.getAllFirePlan(); // 获取所有灾情 this.getAllBuildings(); // 获取所有建筑 this.getSitePlan(); // 获取总平面图 数据 @@ -579,7 +578,6 @@ export class CollectionToolsComponent implements OnInit { this.token.login().then(res => { this.queryCompanyData().then(res=>{ this.params.companyId = sessionStorage.getItem('companyId'); - // this.getAllLibrary() //获取素材库 this.getAllFirePlan(); // 获取所有灾情 this.getAllBuildings(); // 获取所有建筑 this.getSitePlan(); // 获取总平面图 数据 diff --git a/src/app/ui/plan-assistance/plan-assistance.component.scss b/src/app/ui/plan-assistance/plan-assistance.component.scss index 27a5f0a..fbc5812 100644 --- a/src/app/ui/plan-assistance/plan-assistance.component.scss +++ b/src/app/ui/plan-assistance/plan-assistance.component.scss @@ -1,6 +1,8 @@ .content { width: 100%; height: 100%; + min-width: 1024px; + min-height: 768px; box-sizing: border-box; padding: 1px; overflow: hidden; diff --git a/src/app/ui/plan/collection-tools.component.ts b/src/app/ui/plan/collection-tools.component.ts index 3a6874b..fc5a09f 100644 --- a/src/app/ui/plan/collection-tools.component.ts +++ b/src/app/ui/plan/collection-tools.component.ts @@ -500,8 +500,8 @@ export class planComponent implements OnInit { this.route.queryParams.subscribe(paramsData=>{ let params = {USCI: paramsData.usci || ''} this.http.get("/api/Companies",{params:params}).subscribe((data:any)=>{ - if (data.items.length) { //查询到结果时 - sessionStorage.setItem("buildingTypeId",data.items[0].buildingTypes[0].id || ''); //建筑类型 + if (data.items && data.items.length) { //查询到结果时 + data.items[0].buildingTypes[0]? sessionStorage.setItem("buildingTypeId",data.items[0].buildingTypes[0].id || '') : sessionStorage.setItem("buildingTypeId",'') //建筑类型 sessionStorage.setItem("companyId",data.items[0].id || ''); //单位ID resolve('success') } else { //未查询到结果时