Browse Source

[新增]linksPlan页面增加unitId查询

master
邵佳豪 1 year ago
parent
commit
3b3d841de0
  1. 2
      package.json
  2. 2
      src/app/app-routing.module.ts
  3. 8
      src/app/external-links-plan/external-links-plan.component.html
  4. 24
      src/app/external-links-plan/external-links-plan.component.ts

2
package.json

@ -3,7 +3,7 @@
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.config.json --open --port 51423 --host 192.168.1.82",
"start": "ng serve --proxy-config proxy.config.json --open",
"build": "ng build",
"build-prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --prod",
"publish": "ng build --prod --verbose",

2
src/app/app-routing.module.ts

@ -41,7 +41,7 @@ const routes: Routes = [
{path:'keyUnit/viewunitinfoplans', component:ViewUnitDetailsPlanComponent,canActivate: [AuthGuard],},
{path:'getNoMToken',component:MTokenK1Component, canActivate: [AuthGuard],}, //K1秘钥验证失败是跳转页面
{path:'planAudit/planpass', component: PlanPassComponent , canActivate: [AuthGuard]},
{path:'test', component: TestComponent },
// {path:'test', component: TestComponent },
{path:'linksPlan', component: ExternalLinksPlanComponent },
{path:'CreatePlanOnlineFive',component:CreatePlanOnlineFiveComponent},
{path:'exportExcel',component:ExportExcelComponent, canActivate: [AuthGuard]},

8
src/app/external-links-plan/external-links-plan.component.html

@ -1,4 +1,4 @@
<mat-tab-group selectedIndex="10" style="height: 99%;">
<mat-tab-group *ngIf="planId" selectedIndex="10" style="height: 99%;">
<mat-tab label="1.基本信息">
<ng-template matTabContent>
<app-basicinfo-look></app-basicinfo-look>
@ -68,6 +68,6 @@
</mat-tab-group>
<!-- 株洲项目:传入预案id显示相应预案 -->
<div *ngIf="unitId">
<app-basicinfo-look></app-basicinfo-look>
</div>

24
src/app/external-links-plan/external-links-plan.component.ts

@ -25,9 +25,11 @@ export class ExternalLinksPlanComponent implements OnInit {
showType; //预案类型 1:全景图
planData; //预案信息
unitId;
async ngOnInit(): Promise<void> {
await this.login(); //登录存储token
this.route.queryParams.subscribe((paramsData) => {
if (paramsData.planId) {
this.planId = paramsData.planId;
this.http
.get(`/api/PlanComponents/${this.planId}`)
@ -103,6 +105,28 @@ export class ExternalLinksPlanComponent implements OnInit {
this.handleData();
}
});
} else if (paramsData.unitId) {
this.http
.get(`/api/Companies/${paramsData.unitId}`)
.subscribe((data: any) => {
console.log("单位信息", data);
sessionStorage.setItem("editable", "0");
sessionStorage.setItem("companyName", data.name);
sessionStorage.setItem("companyId", data.id);
sessionStorage.setItem(
data.id,
JSON.stringify(data.companyIntegrityScore)
);
let queryParams = {
id: data.id,
usci: data.usci,
};
this.unitId = paramsData.unitId;
this.router.navigate([`/linksPlan`], {
queryParams: queryParams,
});
});
}
});
}

Loading…
Cancel
Save