Browse Source

[修正] 修正buildingType获取BUG

master
陈鹏飞 4 years ago
parent
commit
a193e21417
  1. 5
      src/app/app-routing.module.ts
  2. 6
      src/app/ui/collection-tools/collection-tools.component.ts
  3. 2
      src/app/ui/plan-assistance/plan-assistance.component.scss
  4. 4
      src/app/ui/plan/collection-tools.component.ts

5
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}, //平面图

6
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(); // 获取总平面图 数据

2
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;

4
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 { //未查询到结果时

Loading…
Cancel
Save