Compare commits
13 Commits
Author | SHA1 | Date |
---|---|---|
|
1c6d26e8a9 | 2 years ago |
|
944b176d47 | 2 years ago |
|
cd50d63171 | 2 years ago |
|
bdc4b6ced9 | 2 years ago |
|
f994b8c722 | 2 years ago |
|
6adb92365b | 2 years ago |
|
5325bac67c | 2 years ago |
|
26f71de134 | 2 years ago |
|
eb125121d1 | 2 years ago |
|
10bec5eb87 | 2 years ago |
|
acad95128e | 2 years ago |
|
6716f69161 | 2 years ago |
|
40f5bb9789 | 2 years ago |
121 changed files with 9659 additions and 13031 deletions
@ -1,54 +1,107 @@
|
||||
/* |
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Descripttion: |
||||
* @version: |
||||
* @Author: sueRimn |
||||
* @Date: 2021-01-11 14:48:03 |
||||
* @LastEditors: sueRimn |
||||
* @LastEditTime: 2021-07-29 10:26:58 |
||||
*/ |
||||
import { NgModule } from '@angular/core'; |
||||
import { Routes, RouterModule } from '@angular/router'; |
||||
import { LoginComponent } from './pages/login/login.component'; |
||||
import { NavigationComponent } from './navigation/navigation.component'; |
||||
import {HomeComponent} from './home/home.component' |
||||
import { PlanPassComponent } from '../app/plan-audit/plan-pass/plan-pass.component'; |
||||
import { NgModule } from "@angular/core"; |
||||
import { Routes, RouterModule } from "@angular/router"; |
||||
import { LoginComponent } from "./pages/login/login.component"; |
||||
import { NavigationComponent } from "./navigation/navigation.component"; |
||||
import { HomeComponent } from "./home/home.component"; |
||||
import { PlanPassComponent } from "../app/plan-audit/plan-pass/plan-pass.component"; |
||||
|
||||
//路由守卫
|
||||
import {AuthGuard} from './auth.guard' |
||||
import {MTokenK1Component} from './m-token-k1/m-token-k1.component' //K1秘钥
|
||||
import {ViewUnitDetailsPlanComponent} from './key-unit/view-unit-details-plan/view-unit-details-plan.component' |
||||
import { TestComponent } from './test/test.component'; |
||||
import { ExternalLinksPlanComponent } from './external-links-plan/external-links-plan.component'; |
||||
import { CreatePlanOnlineFiveComponent } from './plan-management/create-plan-online-five/create-plan-online-five.component' |
||||
import { ExportExcelComponent } from './export-excel/export-excel.component' |
||||
import { AuthGuard } from "./auth.guard"; |
||||
import { MTokenK1Component } from "./m-token-k1/m-token-k1.component"; //K1秘钥
|
||||
import { ViewUnitDetailsPlanComponent } from "./key-unit/view-unit-details-plan/view-unit-details-plan.component"; |
||||
import { ExternalLinksPlanComponent } from "./external-links-plan/external-links-plan.component"; |
||||
import { CreatePlanOnlineFiveComponent } from "./plan-management/create-plan-online-five/create-plan-online-five.component"; |
||||
import { ExportExcelComponent } from "./export-excel/export-excel.component"; |
||||
|
||||
const routes: Routes = [ |
||||
{path:'',redirectTo:'login',pathMatch:'full'}, |
||||
{ path: "", redirectTo: "login", pathMatch: "full" }, |
||||
{ |
||||
path:'',component:NavigationComponent,canActivate: [AuthGuard],//守卫验证
|
||||
children:[ |
||||
{path:'ui',loadChildren:() => import('./ui/ui.module').then(m => m.UiModule)}, |
||||
{path:'keyUnit',loadChildren:() => import('./key-unit/key-unit.module').then(m => m.KeyUnitModule)}, |
||||
{path:'planManagement',loadChildren:() => import('./plan-management/plan-management.module').then(m => m.PlanManagementModule)}, |
||||
{path:'planAudit',loadChildren:() => import('./plan-audit/plan-audit.module').then(m => m.PlanAuditModule)}, |
||||
{path:'visualization',component: HomeComponent}, |
||||
{path:'gis',loadChildren:() => import('./gis-management/gis-management.module').then(m => m.GISManagementModule)}, |
||||
{path:'statisticanalysis',loadChildren:() => import('./statistic-analysis/statistic-analysis.module').then(m => m.StatisticAnalysisModule)}, |
||||
{path:'dataCollection',loadChildren:() => import('./data-collection/data-collection.module').then(m => m.DataCollectionModule)}, |
||||
] |
||||
path: "", |
||||
component: NavigationComponent, |
||||
canActivate: [AuthGuard], //守卫验证
|
||||
children: [ |
||||
{ |
||||
path: "ui", |
||||
loadChildren: () => import("./ui/ui.module").then((m) => m.UiModule), |
||||
}, |
||||
{ |
||||
path: "keyUnit", |
||||
loadChildren: () => |
||||
import("./key-unit/key-unit.module").then((m) => m.KeyUnitModule), |
||||
}, |
||||
{ |
||||
path: "planManagement", |
||||
loadChildren: () => |
||||
import("./plan-management/plan-management.module").then( |
||||
(m) => m.PlanManagementModule |
||||
), |
||||
}, |
||||
{ |
||||
path: "planAudit", |
||||
loadChildren: () => |
||||
import("./plan-audit/plan-audit.module").then( |
||||
(m) => m.PlanAuditModule |
||||
), |
||||
}, |
||||
{ path: "visualization", component: HomeComponent }, |
||||
{ |
||||
path: "gis", |
||||
loadChildren: () => |
||||
import("./gis-management/gis-management.module").then( |
||||
(m) => m.GISManagementModule |
||||
), |
||||
}, |
||||
{ |
||||
path: "statisticanalysis", |
||||
loadChildren: () => |
||||
import("./statistic-analysis/statistic-analysis.module").then( |
||||
(m) => m.StatisticAnalysisModule |
||||
), |
||||
}, |
||||
{ |
||||
path: "dataCollection", |
||||
loadChildren: () => |
||||
import("./data-collection/data-collection.module").then( |
||||
(m) => m.DataCollectionModule |
||||
), |
||||
}, |
||||
], |
||||
}, |
||||
{ path: "login", component: LoginComponent }, |
||||
{ |
||||
path: "keyUnit/viewunitinfoplans", |
||||
component: ViewUnitDetailsPlanComponent, |
||||
canActivate: [AuthGuard], |
||||
}, |
||||
{ |
||||
path: "getNoMToken", |
||||
component: MTokenK1Component, |
||||
canActivate: [AuthGuard], |
||||
}, //K1秘钥验证失败是跳转页面
|
||||
{ |
||||
path: "planAudit/planpass", |
||||
component: PlanPassComponent, |
||||
canActivate: [AuthGuard], |
||||
}, |
||||
{ path: "linksPlan", component: ExternalLinksPlanComponent }, |
||||
{ path: "CreatePlanOnlineFive", component: CreatePlanOnlineFiveComponent }, |
||||
{ |
||||
path: "exportExcel", |
||||
component: ExportExcelComponent, |
||||
canActivate: [AuthGuard], |
||||
}, |
||||
{path:'login',component:LoginComponent}, |
||||
{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:'linksPlan', component: ExternalLinksPlanComponent }, |
||||
{path:'CreatePlanOnlineFive',component:CreatePlanOnlineFiveComponent}, |
||||
{path:'exportExcel',component:ExportExcelComponent, canActivate: [AuthGuard]}, |
||||
]; |
||||
|
||||
@NgModule({ |
||||
imports: [RouterModule.forRoot(routes)], |
||||
exports: [RouterModule] |
||||
exports: [RouterModule], |
||||
}) |
||||
export class AppRoutingModule { } |
||||
export class AppRoutingModule {} |
||||
|
@ -1,69 +1,60 @@
|
||||
import { BrowserModule } from "@angular/platform-browser"; |
||||
import { NgModule } from "@angular/core"; |
||||
import { AppRoutingModule } from "./app-routing.module"; |
||||
import { AppComponent } from "./app.component"; |
||||
import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; |
||||
import { MatButtonModule } from "@angular/material/button"; |
||||
import { MatCheckboxModule } from "@angular/material/checkbox"; |
||||
import { MatIconModule } from "@angular/material/icon"; |
||||
import { MatSidenavModule } from "@angular/material/sidenav"; |
||||
import { NavigationModule } from "./navigation/navigation.module"; |
||||
import { HomeComponent } from "./home/home.component"; |
||||
import { TabbarComponent } from "./tabbar/tabbar.component"; |
||||
import { PagesModule } from "./pages/pages.module"; |
||||
import { FormsModule } from "@angular/forms"; |
||||
import { UiModule } from "./ui/ui.module"; |
||||
import { HttpClientModule } from "@angular/common/http"; |
||||
import { httpInterceptorProviders } from "./http-interceptors/index"; |
||||
import { CacheTokenService } from "./http-interceptors/cache-token.service"; |
||||
import { TreeService } from "./http-interceptors/tree.service"; |
||||
import { MTokenK1Component } from "./m-token-k1/m-token-k1.component"; //K1秘钥
|
||||
import { CountdownModule } from "ngx-countdown"; //倒计时插件
|
||||
import { GISManagementModule } from "./gis-management/gis-management.module"; |
||||
import { DataCollectionModule } from "./data-collection/data-collection.module"; |
||||
import { MatProgressSpinnerModule } from "@angular/material/progress-spinner"; |
||||
import { TestComponent } from "./test/test.component"; |
||||
import { ExternalLinksPlanComponent } from "./external-links-plan/external-links-plan.component"; |
||||
import { SearchDownList } from "../modules/map/declare/component/SearchDownListPlugins/SearchDownList"; |
||||
import { ExportExcelComponent } from "./export-excel/export-excel.component"; |
||||
import { registerLocaleData } from "@angular/common"; |
||||
import zh from "@angular/common/locales/zh"; |
||||
import { KeyUnitModule } from "./key-unit/key-unit.module"; |
||||
import { MatTabsModule } from "@angular/material/tabs"; |
||||
import { PlanManagementModule } from "./plan-management/plan-management.module"; |
||||
import { BrowserModule } from '@angular/platform-browser'; |
||||
import { NgModule } from '@angular/core'; |
||||
import { AppRoutingModule } from './app-routing.module'; |
||||
import { AppComponent } from './app.component'; |
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; |
||||
import { MatButtonModule } from '@angular/material/button'; |
||||
import { MatCheckboxModule } from '@angular/material/checkbox'; |
||||
import { MatIconModule } from '@angular/material/icon'; |
||||
import { MatSidenavModule } from '@angular/material/sidenav'; |
||||
import { NavigationModule } from './navigation/navigation.module'; |
||||
import { HomeComponent } from './home/home.component'; |
||||
import { PagesModule } from './pages/pages.module'; |
||||
import { FormsModule } from '@angular/forms'; |
||||
import { UiModule } from './ui/ui.module'; |
||||
import { HttpClientModule } from '@angular/common/http'; |
||||
import { httpInterceptorProviders } from './http-interceptors/index' |
||||
import { CacheTokenService } from './http-interceptors/cache-token.service' |
||||
import { TreeService } from './http-interceptors/tree.service'; |
||||
import { MTokenK1Component } from './m-token-k1/m-token-k1.component' //K1秘钥
|
||||
import { CountdownModule } from 'ngx-countdown'; //倒计时插件
|
||||
import { GISManagementModule } from './gis-management/gis-management.module'; |
||||
import { DataCollectionModule } from './data-collection/data-collection.module'; |
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; |
||||
import { ExternalLinksPlanComponent } from './external-links-plan/external-links-plan.component'; |
||||
import { SearchDownList } from '../modules/map/declare/component/SearchDownListPlugins/SearchDownList'; |
||||
import { ExportExcelComponent } from './export-excel/export-excel.component'; |
||||
import { registerLocaleData } from '@angular/common'; |
||||
import zh from '@angular/common/locales/zh'; |
||||
registerLocaleData(zh); |
||||
@NgModule({ |
||||
declarations: [ |
||||
AppComponent, |
||||
HomeComponent, |
||||
MTokenK1Component, |
||||
TestComponent, |
||||
ExternalLinksPlanComponent, |
||||
SearchDownList, |
||||
ExportExcelComponent, |
||||
], |
||||
imports: [ |
||||
BrowserModule, |
||||
AppRoutingModule, |
||||
BrowserAnimationsModule, |
||||
MatButtonModule, |
||||
MatCheckboxModule, |
||||
MatSidenavModule, |
||||
NavigationModule, |
||||
MatIconModule, |
||||
PagesModule, |
||||
FormsModule, |
||||
HttpClientModule, |
||||
CountdownModule, |
||||
GISManagementModule, |
||||
DataCollectionModule, |
||||
MatProgressSpinnerModule, |
||||
UiModule, |
||||
KeyUnitModule, |
||||
MatTabsModule, |
||||
PlanManagementModule, |
||||
], |
||||
providers: [httpInterceptorProviders, CacheTokenService, TreeService], |
||||
bootstrap: [AppComponent], |
||||
declarations: [ |
||||
AppComponent, |
||||
HomeComponent, |
||||
MTokenK1Component, |
||||
ExternalLinksPlanComponent, |
||||
SearchDownList, |
||||
ExportExcelComponent |
||||
], |
||||
imports: [ |
||||
BrowserModule, |
||||
AppRoutingModule, |
||||
BrowserAnimationsModule, |
||||
MatButtonModule, |
||||
MatCheckboxModule, |
||||
MatSidenavModule, |
||||
NavigationModule, |
||||
MatIconModule, |
||||
PagesModule, |
||||
FormsModule, |
||||
HttpClientModule, |
||||
CountdownModule, |
||||
GISManagementModule, |
||||
DataCollectionModule, |
||||
MatProgressSpinnerModule, |
||||
UiModule |
||||
], |
||||
providers: [httpInterceptorProviders, CacheTokenService, TreeService], |
||||
bootstrap: [AppComponent] |
||||
}) |
||||
export class AppModule {} |
||||
export class AppModule { } |
||||
|
@ -1,70 +1,31 @@
|
||||
import { HttpClient } from "@angular/common/http"; |
||||
import { Injectable } from "@angular/core"; |
||||
import { |
||||
CanActivate, |
||||
ActivatedRouteSnapshot, |
||||
RouterStateSnapshot, |
||||
Router, |
||||
} from "@angular/router"; |
||||
import { Injectable } from '@angular/core'; |
||||
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; |
||||
|
||||
@Injectable({ |
||||
providedIn: "root", |
||||
providedIn: 'root' |
||||
}) |
||||
export class AuthGuard implements CanActivate { |
||||
constructor(private http: HttpClient, private router: Router) {} |
||||
|
||||
// 路由守卫
|
||||
async canActivate( |
||||
next: ActivatedRouteSnapshot, |
||||
state: RouterStateSnapshot |
||||
): Promise<boolean> { |
||||
console.log("next", next); |
||||
console.log("state", state); |
||||
constructor(private router: Router) { |
||||
|
||||
if ( |
||||
next.queryParams.singleSignOn && |
||||
next.queryParams.singleSignOn === "true" |
||||
) { |
||||
//执行自动登录逻辑
|
||||
await this.onSubmit(); |
||||
} |
||||
return this.checkLogin(); |
||||
} |
||||
|
||||
checkLogin(): boolean { |
||||
// 判断本地有没有token
|
||||
const token = sessionStorage.getItem("token"); |
||||
// 路由守卫
|
||||
canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { |
||||
|
||||
// 如果有token,允许访问
|
||||
if (token) { |
||||
return true; |
||||
return this.checkLogin(); |
||||
} |
||||
|
||||
//如果没有token,跳转登录页
|
||||
this.router.navigate(["/login"]); |
||||
return false; |
||||
} |
||||
checkLogin(): boolean { |
||||
|
||||
onSubmit() { |
||||
return new Promise<void>((resolve, reject) => { |
||||
this.http |
||||
.post("/api/Account/SignIn", { |
||||
name: "superadmin", |
||||
password: "SHya119!@", |
||||
}) |
||||
.subscribe( |
||||
(data: any) => { |
||||
sessionStorage.setItem("level", data.level); |
||||
sessionStorage.setItem("token", data.token); |
||||
sessionStorage.setItem("refreshToken", data.refreshToken); |
||||
sessionStorage.setItem("isDefaultPassword", data.isDefaultPassword); //是否需要修改默认密码
|
||||
sessionStorage.setItem("singleSignOn", "true"); //是否需要修改默认密码
|
||||
resolve(); |
||||
}, |
||||
(err) => { |
||||
reject(); |
||||
} |
||||
); |
||||
}); |
||||
} |
||||
// 判断本地有没有token
|
||||
const token = sessionStorage.getItem('token'); |
||||
|
||||
// 如果有token,允许访问
|
||||
if (token) { return true; } |
||||
|
||||
//如果没有token,跳转登录页
|
||||
this.router.navigate(['/login']); |
||||
return false; |
||||
} |
||||
} |
||||
|
@ -1,73 +1,11 @@
|
||||
<mat-tab-group *ngIf="planId" selectedIndex="10" style="height: 99%;"> |
||||
<mat-tab label="1.基本信息"> |
||||
<ng-template matTabContent> |
||||
<app-basicinfo-look></app-basicinfo-look> |
||||
</ng-template> |
||||
</mat-tab> |
||||
<mat-tab label="2.四周毗邻"> |
||||
<ng-template matTabContent> |
||||
<app-allaround></app-allaround> |
||||
</ng-template> |
||||
</mat-tab> |
||||
<mat-tab label="3.消防设施"> |
||||
<ng-template matTabContent> |
||||
<app-fire-fighting-device-look></app-fire-fighting-device-look> |
||||
</ng-template> |
||||
</mat-tab> |
||||
<mat-tab label="4.重点部位"> |
||||
<ng-template matTabContent> |
||||
<app-key-site-look></app-key-site-look> |
||||
</ng-template> |
||||
</mat-tab> |
||||
<mat-tab label="5.功能分区"> |
||||
<ng-template matTabContent> |
||||
<app-function-division-look></app-function-division-look> |
||||
</ng-template> |
||||
</mat-tab> |
||||
<mat-tab label="6.行车路线"> |
||||
<ng-template matTabContent> |
||||
<app-router-gis></app-router-gis> |
||||
</ng-template> |
||||
</mat-tab> |
||||
<mat-tab label="7.周边水源及力量"> |
||||
<ng-template matTabContent> |
||||
<app-water-road></app-water-road> |
||||
</ng-template> |
||||
</mat-tab> |
||||
<mat-tab label="8.实景图"> |
||||
<ng-template matTabContent> |
||||
<app-realistic-picture-look></app-realistic-picture-look> |
||||
</ng-template> |
||||
</mat-tab> |
||||
<mat-tab label="9.上传CAD"> |
||||
<ng-template matTabContent> |
||||
<app-uploading-cad-look></app-uploading-cad-look> |
||||
</ng-template> |
||||
</mat-tab> |
||||
<mat-tab label="10.特别警示"> |
||||
<ng-template matTabContent> |
||||
<app-special-warning></app-special-warning> |
||||
</ng-template> |
||||
</mat-tab> |
||||
<mat-tab label="11.作战部署"> |
||||
<ng-template matTabContent> |
||||
<div *ngIf="showType == 0"> |
||||
<iframe id="inneriframe" [src]='iframeSrc' frameborder="0" style="width: 100%;height: 100%;"></iframe> |
||||
</div> |
||||
<div *ngIf="showType == 1" id="viewer"></div> |
||||
<div *ngIf="showType == 3"> |
||||
<app-collection-tools></app-collection-tools> |
||||
</div> |
||||
|
||||
<!-- 在线编制预案 --> |
||||
<div *ngIf="showType == 2"> |
||||
<app-create-plan-online-five></app-create-plan-online-five> |
||||
</div> |
||||
</ng-template> |
||||
</mat-tab> |
||||
|
||||
</mat-tab-group> |
||||
|
||||
<div *ngIf="unitId"> |
||||
<app-basicinfo-look></app-basicinfo-look> |
||||
</div> |
||||
<!-- 株洲项目:传入预案id显示相应预案 --> |
||||
<div *ngIf="showType == 0"> |
||||
<iframe id="inneriframe" [src]='iframeSrc' frameborder="0" style="width: 100%;height: 100%;"></iframe> |
||||
</div> |
||||
<div *ngIf="showType == 1" id="viewer"></div> |
||||
<div *ngIf="showType == 2"> |
||||
<iframe id="inneriframe2" [src]='threedUrl' frameborder="0" style="width: 100%;height: 100%;"></iframe> |
||||
</div> |
||||
<div *ngIf="showType == 3"> |
||||
<app-collection-tools></app-collection-tools> |
||||
</div> |
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,188 +1,204 @@
|
||||
import { ApplicationRef, Component, ComponentFactoryResolver, Injector, OnInit } from '@angular/core'; |
||||
import { HttpClient } from '@angular/common/http' |
||||
import { Data } from '../../interface' |
||||
import { Router, ActivatedRoute } from '@angular/router' |
||||
import { CacheTokenService } from '../../http-interceptors/cache-token.service'//引入服务
|
||||
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
||||
import { MatDialog, MatDialogRef } from '@angular/material/dialog'; |
||||
import { |
||||
ApplicationRef, |
||||
Component, |
||||
ComponentFactoryResolver, |
||||
Injector, |
||||
OnInit, |
||||
} from "@angular/core"; |
||||
import { HttpClient } from "@angular/common/http"; |
||||
import { Data } from "../../interface"; |
||||
import { Router, ActivatedRoute } from "@angular/router"; |
||||
import { CacheTokenService } from "../../http-interceptors/cache-token.service"; //引入服务
|
||||
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar"; |
||||
import { MatDialog, MatDialogRef } from "@angular/material/dialog"; |
||||
|
||||
@Component({ |
||||
selector: 'app-login', |
||||
templateUrl: './login.component.html', |
||||
styleUrls: ['./login.component.scss'], |
||||
selector: "app-login", |
||||
templateUrl: "./login.component.html", |
||||
styleUrls: ["./login.component.scss"], |
||||
}) |
||||
export class LoginComponent implements OnInit { |
||||
constructor( |
||||
private http: HttpClient, |
||||
private router: Router, |
||||
private route: ActivatedRoute, |
||||
public token: CacheTokenService, |
||||
public snackBar: MatSnackBar, |
||||
public dialog: MatDialog |
||||
) {} |
||||
|
||||
ngOnInit() { |
||||
this.automaticLogin(); |
||||
} |
||||
|
||||
errmsg: string = ""; |
||||
|
||||
onSubmit(e) { |
||||
this.http |
||||
.post("/api/Account/SignIn", { |
||||
name: e.name, |
||||
password: e.password, |
||||
}) |
||||
.subscribe( |
||||
(data: Data) => { |
||||
sessionStorage.setItem("level", data.level); |
||||
sessionStorage.setItem("token", data.token); |
||||
sessionStorage.setItem("refreshToken", data.refreshToken); |
||||
sessionStorage.setItem("isDefaultPassword", data.isDefaultPassword); //是否需要修改默认密码
|
||||
this.http.get("/api/Account/NavMenus").subscribe((data: any) => { |
||||
console.log("菜单数据", data); |
||||
|
||||
let isHave = data.find((item) => { |
||||
return item.url == "/statisticanalysis/home"; |
||||
}); |
||||
let isHaveGis = data.find((item) => { |
||||
return item.url == "/gis"; |
||||
}); |
||||
let isKeyUnit = data.find((item) => { |
||||
return item.url == "/keyUnit"; |
||||
}); |
||||
|
||||
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService, public snackBar: MatSnackBar, public dialog: MatDialog) { |
||||
|
||||
} |
||||
|
||||
ngOnInit() { |
||||
this.automaticLogin() |
||||
} |
||||
|
||||
errmsg: string = '' |
||||
|
||||
onSubmit(e) { |
||||
this.http.post('/api/Account/SignIn', { |
||||
name: e.name, |
||||
password: e.password |
||||
}).subscribe((data: Data) => { |
||||
sessionStorage.setItem("level", data.level); |
||||
sessionStorage.setItem("token", data.token); |
||||
sessionStorage.setItem("refreshToken", data.refreshToken); |
||||
sessionStorage.setItem("isDefaultPassword", data.isDefaultPassword);//是否需要修改默认密码
|
||||
this.http.get('/api/Account/NavMenus').subscribe((data: any) => { |
||||
let isHave = data.find(item => { return item.url == "/statisticanalysis/home" }) |
||||
let isHaveGis = data.find(item => { return item.url == "/gis" }) |
||||
if (isHave) { |
||||
this.router.navigate([`/statisticanalysis/home`]) |
||||
this.dialogChangePassword() |
||||
return |
||||
} else if (isHaveGis) { |
||||
this.router.navigate([`/gis`]) |
||||
this.dialogChangePassword() |
||||
return |
||||
} else if (data.length != 0) { |
||||
this.router.navigate([`/keyUnit`]) |
||||
this.dialogChangePassword() |
||||
return |
||||
} else { |
||||
this.snackBar.open('该用户角色未分配任何菜单', '确定', { |
||||
duration: 3000 |
||||
}); |
||||
} |
||||
|
||||
}) |
||||
if (e.notlogin) { //7天免登录时
|
||||
localStorage.setItem("isnologin", "true") |
||||
localStorage.setItem("token", data.token) |
||||
localStorage.setItem("refreshToken", data.refreshToken) |
||||
let URL = data.find((item) => { |
||||
return item.url; |
||||
}); |
||||
console.log(URL); |
||||
if (isHave) { |
||||
this.router.navigate([`/statisticanalysis/home`]); |
||||
this.dialogChangePassword(); |
||||
return; |
||||
} else if (isHaveGis) { |
||||
this.router.navigate([`/gis`]); |
||||
this.dialogChangePassword(); |
||||
return; |
||||
} else if (isKeyUnit) { |
||||
this.router.navigate([`/keyUnit`]); |
||||
this.dialogChangePassword(); |
||||
return; |
||||
} else if (data.length != 0) { |
||||
this.router.navigate([URL.url]); |
||||
this.dialogChangePassword(); |
||||
return; |
||||
} else { |
||||
this.snackBar.open("该用户角色未分配任何菜单", "确定", { |
||||
duration: 3000, |
||||
}); |
||||
} |
||||
//调用服务中的function刷新token
|
||||
this.token.startUp() |
||||
}); |
||||
if (e.notlogin) { |
||||
//7天免登录时
|
||||
localStorage.setItem("isnologin", "true"); |
||||
localStorage.setItem("token", data.token); |
||||
localStorage.setItem("refreshToken", data.refreshToken); |
||||
} |
||||
//调用服务中的function刷新token
|
||||
this.token.startUp(); |
||||
}, |
||||
(err) => { this.errmsg = err } |
||||
) |
||||
} |
||||
|
||||
|
||||
dialogChangePassword() { |
||||
if (sessionStorage.getItem('isDefaultPassword') == 'true') { |
||||
let dialogRef = this.dialog.open(ChangepasswordComponent2, |
||||
{ width: '348px' }); |
||||
|
||||
dialogRef.afterClosed().subscribe((data) => { |
||||
sessionStorage.setItem('isDefaultPassword', 'false') |
||||
// this.lookUpdateData()
|
||||
}); |
||||
} else { |
||||
// this.lookUpdateData()
|
||||
(err) => { |
||||
this.errmsg = err; |
||||
} |
||||
); |
||||
} |
||||
|
||||
dialogChangePassword() { |
||||
if (sessionStorage.getItem("isDefaultPassword") == "true") { |
||||
let dialogRef = this.dialog.open(ChangepasswordComponent2, { |
||||
width: "348px", |
||||
}); |
||||
|
||||
dialogRef.afterClosed().subscribe((data) => { |
||||
sessionStorage.setItem("isDefaultPassword", "false"); |
||||
}); |
||||
} |
||||
|
||||
//查看更新内容
|
||||
lookUpdateData() { |
||||
|
||||
|
||||
|
||||
let dialogRef = this.dialog.open(lookUpdateDataComponent, |
||||
{ width: '668px' }); |
||||
|
||||
dialogRef.afterClosed().subscribe((data) => { |
||||
|
||||
}); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
//7天免登录自动登录
|
||||
automaticLogin() { |
||||
let isNoLogin = localStorage.getItem("isnologin") |
||||
if (isNoLogin) { //7天免登录时
|
||||
let token = localStorage.getItem("token"); |
||||
let refreshToken = localStorage.getItem("refreshToken"); |
||||
this.http.post('/api/Account/RefreshToken', { |
||||
token: token, |
||||
refreshToken: refreshToken |
||||
}).subscribe((data: any) => { |
||||
sessionStorage.setItem("level", data.level); |
||||
sessionStorage.setItem("token", data.token); |
||||
sessionStorage.setItem("refreshToken", data.refreshToken); |
||||
this.token.startUp() |
||||
this.router.navigate(['/keyUnit']) |
||||
this.snackBar.open('已自动登录', '确定', { duration: 3000 }); |
||||
}) |
||||
} //if
|
||||
|
||||
} |
||||
|
||||
//打开弹窗
|
||||
open() { |
||||
this.snackBar.open('请联系管理员', '确定', { |
||||
duration: 3000 |
||||
} |
||||
|
||||
//查看更新内容
|
||||
lookUpdateData() { |
||||
let dialogRef = this.dialog.open(lookUpdateDataComponent, { |
||||
width: "668px", |
||||
}); |
||||
|
||||
dialogRef.afterClosed().subscribe((data) => {}); |
||||
} |
||||
|
||||
//7天免登录自动登录
|
||||
automaticLogin() { |
||||
let isNoLogin = localStorage.getItem("isnologin"); |
||||
if (isNoLogin) { |
||||
//7天免登录时
|
||||
let token = localStorage.getItem("token"); |
||||
let refreshToken = localStorage.getItem("refreshToken"); |
||||
this.http |
||||
.post("/api/Account/RefreshToken", { |
||||
token: token, |
||||
refreshToken: refreshToken, |
||||
}) |
||||
.subscribe((data: any) => { |
||||
sessionStorage.setItem("level", data.level); |
||||
sessionStorage.setItem("token", data.token); |
||||
sessionStorage.setItem("refreshToken", data.refreshToken); |
||||
this.token.startUp(); |
||||
this.router.navigate(["/keyUnit"]); |
||||
this.snackBar.open("已自动登录", "确定", { duration: 3000 }); |
||||
}); |
||||
} |
||||
|
||||
|
||||
|
||||
} //if
|
||||
} |
||||
|
||||
//打开弹窗
|
||||
open() { |
||||
this.snackBar.open("请联系管理员", "确定", { |
||||
duration: 3000, |
||||
}); |
||||
} |
||||
} |
||||
|
||||
@Component({ |
||||
selector: 'app-changepassword', |
||||
templateUrl: './changePassword.html', |
||||
styleUrls: ['./changepassword.scss'] |
||||
selector: "app-changepassword", |
||||
templateUrl: "./changePassword.html", |
||||
styleUrls: ["./changepassword.scss"], |
||||
}) |
||||
|
||||
export class ChangepasswordComponent2 implements OnInit { |
||||
|
||||
constructor(private http: HttpClient, public snackBar: MatSnackBar, |
||||
public dialogRef: MatDialogRef<ChangepasswordComponent2>) { } |
||||
|
||||
ngOnInit() { |
||||
} |
||||
errmsg: string = '' |
||||
|
||||
onSubmit(e) { |
||||
this.http.put( |
||||
'/api/Account/Password', |
||||
{ |
||||
newPassword: e.newPassword, |
||||
password: 'SHya119!@' |
||||
} |
||||
).subscribe(data => { |
||||
this.dialogRef.close(data); |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = 'top'; |
||||
config.duration = 3000 |
||||
this.snackBar.open('密码修改成功', '确定', config); |
||||
}, (err) => { this.errmsg = err } |
||||
) |
||||
} |
||||
|
||||
|
||||
|
||||
constructor( |
||||
private http: HttpClient, |
||||
public snackBar: MatSnackBar, |
||||
public dialogRef: MatDialogRef<ChangepasswordComponent2> |
||||
) {} |
||||
|
||||
ngOnInit() {} |
||||
errmsg: string = ""; |
||||
|
||||
onSubmit(e) { |
||||
this.http |
||||
.put("/api/Account/Password", { |
||||
newPassword: e.newPassword, |
||||
password: "SHya119!@", |
||||
}) |
||||
.subscribe( |
||||
(data) => { |
||||
this.dialogRef.close(data); |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = "top"; |
||||
config.duration = 3000; |
||||
this.snackBar.open("密码修改成功", "确定", config); |
||||
}, |
||||
(err) => { |
||||
this.errmsg = err; |
||||
} |
||||
); |
||||
} |
||||
} |
||||
|
||||
|
||||
@Component({ |
||||
selector: 'app-lookUpdateData', |
||||
templateUrl: './lookUpdateData.html', |
||||
styleUrls: ['./lookUpdateData.scss'] |
||||
selector: "app-lookUpdateData", |
||||
templateUrl: "./lookUpdateData.html", |
||||
styleUrls: ["./lookUpdateData.scss"], |
||||
}) |
||||
|
||||
export class lookUpdateDataComponent implements OnInit { |
||||
|
||||
constructor(private http: HttpClient, public snackBar: MatSnackBar, |
||||
public dialogRef: MatDialogRef<lookUpdateDataComponent>) { } |
||||
|
||||
ngOnInit() { |
||||
} |
||||
onSubmit(e) { |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
} |
||||
constructor( |
||||
private http: HttpClient, |
||||
public snackBar: MatSnackBar, |
||||
public dialogRef: MatDialogRef<lookUpdateDataComponent> |
||||
) {} |
||||
|
||||
ngOnInit() {} |
||||
onSubmit(e) {} |
||||
} |
||||
|
@ -1,95 +1,83 @@
|
||||
import { Pipe, PipeTransform } from "@angular/core"; |
||||
import { |
||||
isno, |
||||
PlanTypeEnum, |
||||
AuditStatusEnum, |
||||
PlanLevelEnum, |
||||
PlanAuditStatusEnum, |
||||
} from "../interface"; |
||||
@Pipe({ name: "isno" }) |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
import { isno, PlanTypeEnum, AuditStatusEnum, PlanLevelEnum } from '../interface' |
||||
@Pipe({ name: 'isno' }) |
||||
export class IsnoPipe implements PipeTransform { |
||||
transform(value: boolean): string { |
||||
if (value) { |
||||
var x = 0; |
||||
} else { |
||||
x = 1; |
||||
transform(value: boolean): string { |
||||
if (value) { |
||||
var x = 0 |
||||
} else { |
||||
x = 1 |
||||
} |
||||
return isno[x] |
||||
} |
||||
return isno[x]; |
||||
} |
||||
} |
||||
@Pipe({ name: "plantype" }) |
||||
@Pipe({ name: 'plantype' }) |
||||
export class PlanType implements PipeTransform { |
||||
transform(value: number): string { |
||||
return PlanTypeEnum[value]; |
||||
} |
||||
transform(value: number): string { |
||||
return PlanTypeEnum[value] |
||||
} |
||||
} |
||||
|
||||
@Pipe({ name: "auditsatus" }) |
||||
@Pipe({ name: 'auditsatus' }) |
||||
export class AuditSatus implements PipeTransform { |
||||
transform(value: number): string { |
||||
return AuditStatusEnum[value]; |
||||
} |
||||
transform(value: number): string { |
||||
return AuditStatusEnum[value] |
||||
} |
||||
} |
||||
@Pipe({ name: "planlevel" }) |
||||
@Pipe({ name: 'planlevel' }) |
||||
export class PlanLevel implements PipeTransform { |
||||
transform(value: number): string { |
||||
return PlanLevelEnum[value]; |
||||
} |
||||
transform(value: number): string { |
||||
return PlanLevelEnum[value] |
||||
} |
||||
} |
||||
|
||||
@Pipe({ name: "state" }) |
||||
@Pipe({ name: 'state' }) |
||||
export class state implements PipeTransform { |
||||
transform(value: number): string { |
||||
if (value == 3) { |
||||
return "维护中"; |
||||
} else if (value == 4) { |
||||
return "维护通过审核"; |
||||
} else if (value == 5) { |
||||
return "维护驳回审核"; |
||||
} else { |
||||
return "未维护"; |
||||
transform(value: number): string { |
||||
if (value == 3) { |
||||
return '维护中' |
||||
} else if (value == 4) { |
||||
return '维护通过审核' |
||||
} else if (value == 5) { |
||||
return '维护驳回审核' |
||||
} else { |
||||
return '未维护' |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
@Pipe({ name: "auditState" }) |
||||
export class auditState implements PipeTransform { |
||||
transform(value: number): string { |
||||
return PlanAuditStatusEnum[value]; |
||||
} |
||||
} |
||||
|
||||
@Pipe({ name: "differentContentTitle" }) |
||||
@Pipe({ name: 'differentContentTitle' }) |
||||
export class differentContentTitle implements PipeTransform { |
||||
transform(value: string): string { |
||||
if (typeof value == "boolean" && value) { |
||||
return "是"; |
||||
} else if (typeof value == "boolean" && !value) { |
||||
return "否"; |
||||
} else if (JSON.stringify(value) == "{}") { |
||||
return "空"; |
||||
} else if (!value) { |
||||
return "空"; |
||||
} else { |
||||
return value; |
||||
transform(value: string): string { |
||||
if (typeof (value) == 'boolean' && value) { |
||||
return '是' |
||||
} else if (typeof (value) == 'boolean' && !value) { |
||||
return '否' |
||||
} else if (JSON.stringify(value) == "{}") { |
||||
return '空' |
||||
} else if (!value) { |
||||
return '空' |
||||
} else { |
||||
return value |
||||
} |
||||
|
||||
} |
||||
} |
||||
} |
||||
@Pipe({ name: "yuan" }) |
||||
@Pipe({ name: 'yuan' }) |
||||
export class yuan implements PipeTransform { |
||||
transform(value: string): string { |
||||
if (value == "LevelOne") { |
||||
return "一级预案"; |
||||
} else if (value == "LevelTwo") { |
||||
return "二级预案"; |
||||
} else if (value == "LevelThree") { |
||||
return "三级预案"; |
||||
} else if (value == "LevelFour") { |
||||
return "四级预案"; |
||||
} else if (value == "LevelFive") { |
||||
return "五级预案"; |
||||
} else if (value == "PlanText") { |
||||
return "文本预案"; |
||||
transform(value: string): string { |
||||
if (value == 'LevelOne') { |
||||
return '一级预案' |
||||
} else if (value == 'LevelTwo') { |
||||
return '二级预案' |
||||
} else if (value == 'LevelThree') { |
||||
return '三级预案' |
||||
}else if (value == 'LevelFour') { |
||||
return '四级预案' |
||||
}else if (value == 'LevelFive') { |
||||
return '五级预案' |
||||
}else if (value == 'PlanText') { |
||||
return '文本预案' |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,201 +1,190 @@
|
||||
<div style="height: 100%;overflow-y: auto;"> |
||||
<div class="header"> |
||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm"> |
||||
<div class="queryBox"> |
||||
|
||||
<div class="queryField"> |
||||
<label style="margin-right: 10px;">预案名称:</label> |
||||
<mat-form-field class="example-full-width"> |
||||
<input matInput placeholder="请输入预案名称" name="companyName" autocomplete="off" [(ngModel)]="unitname"> |
||||
</mat-form-field> |
||||
</div> |
||||
<div class="queryField"> |
||||
<label style="margin-right: 10px;">编制级别:</label> |
||||
<mat-form-field> |
||||
<mat-select name="preparelevel" placeholder='请选择编制级别' [(ngModel)]="projectlevel"> |
||||
<!-- <mat-option value="1">总队</mat-option> |
||||
<div class="header" > |
||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm"> |
||||
<div class="queryBox"> |
||||
|
||||
<div class="queryField"> |
||||
<label style="margin-right: 10px;">预案名称:</label> |
||||
<mat-form-field class="example-full-width"> |
||||
<input matInput placeholder="请输入预案名称" name="companyName" autocomplete="off" [(ngModel)]="unitname"> |
||||
</mat-form-field> |
||||
</div> |
||||
<div class="queryField" > |
||||
<label style="margin-right: 10px;">编制级别:</label> |
||||
<mat-form-field> |
||||
<mat-select name="preparelevel" placeholder='请选择编制级别' [(ngModel)]="projectlevel"> |
||||
<!-- <mat-option value="1">总队</mat-option> |
||||
<mat-option value="2">支队</mat-option> |
||||
<mat-option value="4">大队</mat-option> |
||||
<mat-option value="8">中队</mat-option> --> |
||||
<mat-option *ngFor="let item of preparelevels" [value]="item.value">{{item.name}}</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox> |
||||
<span *ngIf="padMore" style="margin-left: 20px; color: #0080FF;" (click)='padInfo()'>更多筛选条件<img |
||||
[src]='imgsrcopen' style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span> |
||||
<span *ngIf="padput" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>收起<img [src]='imgsrcdown' |
||||
style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span> |
||||
<mat-option *ngFor="let item of preparelevels" [value]="item.value">{{item.name}}</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox> |
||||
<span *ngIf="padMore" style="margin-left: 20px; color: #0080FF;" (click)='padInfo()'>更多筛选条件<img [src]='imgsrcopen'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span> |
||||
<span *ngIf="padput" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>收起<img [src]='imgsrcdown'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span> |
||||
</div> |
||||
|
||||
|
||||
<div class="queryField" *ngIf="!pcfind"> |
||||
<button mat-raised-button color="primary">查询</button> |
||||
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button> |
||||
</div> |
||||
<div class="queryField" *ngIf="!padMore"> |
||||
<label style="margin-right: 10px;">预案级别:</label> |
||||
<mat-form-field> |
||||
<mat-select placeholder='请选择预案级别' name="level" [(ngModel)]="level"> |
||||
<mat-option value="6">国家级</mat-option> |
||||
<mat-option value="7">市级</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
|
||||
</div> |
||||
<div class="queryField" *ngIf="!padMore"> |
||||
<label style="margin-right: 10px;">添加人:</label> |
||||
<mat-form-field class="example-full-width"> |
||||
<input matInput placeholder="请输入添加人" name="addname" autocomplete="off" [(ngModel)]="addname"> |
||||
</mat-form-field> |
||||
<span *ngIf="pcMore" style="margin-left: 15px; color: #0080FF; cursor: pointer;" (click)='pcInfo()'>更多筛选条件<img [src]='imgsrcopen'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span> |
||||
<span *ngIf="pcput" style="margin-left: 10px; color: #0080FF; cursor: pointer;" (click)='pcInfo()'>收起<img [src]='imgsrcdown'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span> |
||||
</div> |
||||
<div class="queryField" *ngIf="pcfind" > |
||||
<button mat-raised-button color="primary">查询</button> |
||||
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button> |
||||
</div> |
||||
<div class="queryField" *ngIf="!padMore&&!pcMore"> |
||||
<label style="margin-right: 10px;">添加时间:</label> |
||||
<mat-form-field class="example-full-width"> |
||||
<input type="date" matInput name="addtime" autocomplete="off" [(ngModel)]="addtime"> |
||||
</mat-form-field> |
||||
<!-- <mat-icon aria-hidden="false" style="position: relative;right: 120px;top: 5px;">arrow forward</mat-icon> --> |
||||
<mat-icon *ngIf="padjt" aria-hidden="false" style="position: relative;right: 120px;top: 5px;" id="padshow">arrow forward</mat-icon> |
||||
<span style="margin-left: 15px;" id="pcshow" *ngIf="!padMore&&!padjt">🠊</span> |
||||
<mat-form-field class="example-full-width" style="margin-left: 10px;"> |
||||
<input type="date" matInput name="endtime" autocomplete="off" [(ngModel)]="endtime"> |
||||
</mat-form-field> |
||||
|
||||
</div> |
||||
|
||||
|
||||
<div class="queryField" *ngIf="!pcfind"> |
||||
<button mat-raised-button color="primary">查询</button> |
||||
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button> |
||||
</div> |
||||
<div class="queryField" *ngIf="!padMore"> |
||||
<label style="margin-right: 10px;">预案级别:</label> |
||||
<mat-form-field> |
||||
<mat-select placeholder='请选择预案级别' name="level" [(ngModel)]="level"> |
||||
<mat-option value="6">国家级</mat-option> |
||||
<mat-option value="7">市级</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
|
||||
</div> |
||||
<div class="queryField" *ngIf="!padMore"> |
||||
<label style="margin-right: 10px;">添加人:</label> |
||||
<mat-form-field class="example-full-width"> |
||||
<input matInput placeholder="请输入添加人" name="addname" autocomplete="off" [(ngModel)]="addname"> |
||||
</mat-form-field> |
||||
<span *ngIf="pcMore" style="margin-left: 15px; color: #0080FF; cursor: pointer;" (click)='pcInfo()'>更多筛选条件<img |
||||
[src]='imgsrcopen' style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span> |
||||
<span *ngIf="pcput" style="margin-left: 10px; color: #0080FF; cursor: pointer;" (click)='pcInfo()'>收起<img |
||||
[src]='imgsrcdown' style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span> |
||||
</div> |
||||
<div class="queryField" *ngIf="pcfind"> |
||||
<button mat-raised-button color="primary">查询</button> |
||||
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button> |
||||
</div> |
||||
<div class="queryField" *ngIf="!padMore&&!pcMore"> |
||||
<label style="margin-right: 10px;">添加时间:</label> |
||||
<mat-form-field class="example-full-width"> |
||||
<input type="date" matInput name="addtime" autocomplete="off" [(ngModel)]="addtime"> |
||||
</mat-form-field> |
||||
<!-- <mat-icon aria-hidden="false" style="position: relative;right: 120px;top: 5px;">arrow forward</mat-icon> --> |
||||
<mat-icon *ngIf="padjt" aria-hidden="false" style="position: relative;right: 120px;top: 5px;" |
||||
id="padshow">arrow forward</mat-icon> |
||||
<span style="margin-left: 15px;" id="pcshow" *ngIf="!padMore&&!padjt">🠊</span> |
||||
<mat-form-field class="example-full-width" style="margin-left: 10px;"> |
||||
<input type="date" matInput name="endtime" autocomplete="off" [(ngModel)]="endtime"> |
||||
</mat-form-field> |
||||
|
||||
</div> |
||||
|
||||
|
||||
<div class="queryField" *ngIf="!padMore&&!pcMore"> |
||||
<label style="margin-right: 10px;">预案类型:</label> |
||||
<mat-form-field> |
||||
<input matInput placeholder="请输入预案类型" name="reservePlanType" autocomplete="off" [(ngModel)]="typePlan"> |
||||
</mat-form-field> |
||||
</div> |
||||
<div class="queryField" *ngIf="!padMore&&!pcMore"> |
||||
<label style="margin-right: 10px;">审核状态:</label> |
||||
<mat-form-field> |
||||
<mat-select name="toExamine" placeholder='请选择审核状态' [(ngModel)]="unitstate"> |
||||
<mat-option value="8">未提交审核</mat-option> |
||||
<mat-option value="1">审核中</mat-option> |
||||
<mat-option value="2">审核通过</mat-option> |
||||
<mat-option value="4">审核退回</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
</div> |
||||
<div class="queryField" *ngIf="!padMore&&!pcMore"> |
||||
<input type="radio" style="height: 16px;width: 16px;position: relative;top: 2px;" name="whgx" [value]='true' |
||||
[(ngModel)]="IsNewData"> |
||||
<label style="margin-right: 10px;margin-left: 2px;">新增</label> |
||||
<input type="radio" style="height: 16px;width: 16px;position: relative;top: 2px;" name="whgx" [value]='false' |
||||
[(ngModel)]="IsNewData"> |
||||
<label style="margin-right: 10px;margin-left: 2px;">维护更新</label> |
||||
</div> |
||||
|
||||
</div> |
||||
<!-- <div class="butclass" style="width: 100%;text-align: center;"> |
||||
|
||||
<div class="queryField" *ngIf="!padMore&&!pcMore"> |
||||
<label style="margin-right: 10px;">预案类型:</label> |
||||
<mat-form-field> |
||||
<input matInput placeholder="请输入预案类型" name="reservePlanType" autocomplete="off" [(ngModel)]="typePlan"> |
||||
</mat-form-field> |
||||
</div> |
||||
<div class="queryField" *ngIf="!padMore&&!pcMore"> |
||||
<label style="margin-right: 10px;">审核状态:</label> |
||||
<mat-form-field> |
||||
<mat-select name="toExamine" placeholder='请选择审核状态' [(ngModel)]="unitstate"> |
||||
<mat-option value="8">未提交审核</mat-option> |
||||
<mat-option value="1">审核中</mat-option> |
||||
<mat-option value="2">审核通过</mat-option> |
||||
<mat-option value="4">审核退回</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
</div> |
||||
<div class="queryField" *ngIf="!padMore&&!pcMore"> |
||||
<input type="radio" style="height: 16px;width: 16px;position: relative;top: 2px;" name="whgx" [value]='true' [(ngModel)]="IsNewData"> |
||||
<label style="margin-right: 10px;margin-left: 2px;">新增</label> |
||||
<input type="radio" style="height: 16px;width: 16px;position: relative;top: 2px;" name="whgx" [value]='false' [(ngModel)]="IsNewData"> |
||||
<label style="margin-right: 10px;margin-left: 2px;">维护更新</label> |
||||
</div> |
||||
|
||||
</div> |
||||
<!-- <div class="butclass" style="width: 100%;text-align: center;"> |
||||
<button mat-raised-button color="primary" type="submit">查询</button> |
||||
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button> |
||||
</div> --> |
||||
</form> |
||||
</div> |
||||
<!-- <mat-divider></mat-divider> --> |
||||
<div class="newadd"> |
||||
<div> |
||||
<button *ngIf="levels=='0'" mat-raised-button color="primary" (click)='addunit()'><img style="margin-bottom: 3px;" |
||||
src="../../../assets/images/newadd.png"> 新增</button> |
||||
<!-- <button mat-raised-button color="primary" (click)='word("table","ceshi.doc")'></button> --> |
||||
</form> |
||||
</div> |
||||
|
||||
<div class="progressBox" style="margin-left: 100px;" *ngIf="downloadisLoading"> |
||||
|
||||
<!-- <button mat-raised-button style="margin-right: 5px;" (click)="cancelDowload()">取消下载</button> --> |
||||
<span title="{{downloadFileName}}" style="font-size: 12px;" class="filename">{{downloadFileName}}</span> |
||||
<span style="font-size: 12px;position: absolute;margin-left: 8px;">下载中...</span> |
||||
<mat-progress-bar mode="determinate" [value]="downloadProgress" class="progress"></mat-progress-bar> |
||||
<!-- <mat-divider></mat-divider> --> |
||||
<div class="newadd"> |
||||
<div> |
||||
<button *ngIf="levels=='0'" mat-raised-button color="primary" (click)='addunit()'><img style="margin-bottom: 3px;" src="../../../assets/images/newadd.png"> 新增</button> |
||||
<!-- <button mat-raised-button color="primary" (click)='word("table","ceshi.doc")'></button> --> |
||||
</div> |
||||
|
||||
<div class="progressBox" style="margin-left: 100px;" *ngIf="downloadisLoading"> |
||||
|
||||
<!-- <button mat-raised-button style="margin-right: 5px;" (click)="cancelDowload()">取消下载</button> --> |
||||
<span title="{{downloadFileName}}" style="font-size: 12px;" class="filename">{{downloadFileName}}</span> |
||||
<span style="font-size: 12px;position: absolute;margin-left: 8px;">下载中...</span> |
||||
<mat-progress-bar mode="determinate" [value]="downloadProgress" class="progress"></mat-progress-bar> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="body"> |
||||
<div class="tablebox" id="table"> |
||||
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8"> |
||||
<ng-container matColumnDef="state"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">预案状态</th> |
||||
<td mat-cell *matCellDef="let element"> |
||||
<span class="add" *ngIf="element.isNewData">新增</span> |
||||
<span class="weihu" *ngIf="!element.isNewData">维护更新</span> |
||||
</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="unitname"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">预案名称</th> |
||||
<td mat-cell *matCellDef="let element">{{element.name}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="level"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">预案级别</th> |
||||
<td mat-cell *matCellDef="let element">{{element.planCategory=='6'?'国家级':'市级'}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="addname"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">添加人</th> |
||||
<td mat-cell *matCellDef="let element">{{element.creatorName}}</td> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="addtime"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">添加时间</th> |
||||
<td mat-cell *matCellDef="let element">{{element.creationTime|date:'yyyy-MM-dd'}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="plantype"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">预案类型</th> |
||||
<td mat-cell *matCellDef="let element">{{element.disasterType}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="passstate"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">新增审核</th> |
||||
<td mat-cell *matCellDef="let element"> |
||||
{{element.newVerifyState}} |
||||
<!-- {{element.auditStatus=='8'?'未提交审核':element.auditStatus=='1'?'审核中':element.auditStatus=='2'?'审核通过':element.auditStatus=='4'? |
||||
<div class="body"> |
||||
<div class="tablebox" id="table"> |
||||
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8"> |
||||
<ng-container matColumnDef="state"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">预案状态</th> |
||||
<td mat-cell *matCellDef="let element"> |
||||
<span class="add" *ngIf="element.isNewData">新增</span> |
||||
<span class="weihu" *ngIf="!element.isNewData">维护更新</span> |
||||
</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="unitname"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">预案名称</th> |
||||
<td mat-cell *matCellDef="let element">{{element.name}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="level"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">预案级别</th> |
||||
<td mat-cell *matCellDef="let element">{{element.planCategory=='6'?'国家级':'市级'}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="addname"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">添加人</th> |
||||
<td mat-cell *matCellDef="let element">{{element.creatorName}}</td> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="addtime"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">添加时间</th> |
||||
<td mat-cell *matCellDef="let element">{{element.creationTime|date:'yyyy-MM-dd'}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="plantype"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">预案类型</th> |
||||
<td mat-cell *matCellDef="let element">{{element.disasterType}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="passstate"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">新增审核</th> |
||||
<td mat-cell *matCellDef="let element"> |
||||
{{element.newVerifyState}} |
||||
<!-- {{element.auditStatus=='8'?'未提交审核':element.auditStatus=='1'?'审核中':element.auditStatus=='2'?'审核通过':element.auditStatus=='4'? |
||||
'审核退回':element.auditStatus=='16'?'初审通过':'初审驳回'}} --> |
||||
</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="isopen"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">是否公开</th> |
||||
<td mat-cell *matCellDef="let element">{{element.openRange}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="projectlevel"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">编制级别</th> |
||||
<td mat-cell *matCellDef="let element"> |
||||
{{element.planLevel=='1'?'总队':element.planLevel=='2'?'支队':element.planLevel=='4'?'大队':'中队'}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="auditstate"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">审核状态</th> |
||||
<td mat-cell *matCellDef="let element"> |
||||
{{element.auditStatus | auditState}} |
||||
</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="operation"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 20%;">操作</th> |
||||
<td mat-cell *matCellDef="let element" style="white-space: nowrap;cursor: pointer;"> |
||||
<span style="color: blue;" (click)='openPlan(element)'>查看预案</span> |
||||
<span style="color: blue;margin-left: 4px;" (click)="submitAudit(element)" |
||||
*ngIf="(element.isNewData && element.newVerifyState=='未提交审核')||(!element.isNewData&&(element.maintenanceVerifyState=='审核通过'||element.maintenanceVerifyState=='未提交审核'))">提交审核</span> |
||||
<span style="color: blue;margin-left: 4px;" (click)="cancelAudit(element)" |
||||
*ngIf="element.auditStatus == 1||element.auditStatus == 16">撤销审核</span> |
||||
<span style="color: blue;margin-left: 4px;" (click)="auditResult(element)">审批结果</span> |
||||
<span style="color: blue;margin-left: 4px;" (click)='readFile(element)'>下载</span> |
||||
<span style="color: red;margin-left: 4px" (click)='deletePlan(element.id)'> 删除</span> |
||||
</td> |
||||
</ng-container> |
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> |
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> |
||||
</table> |
||||
<mat-paginator pageEvent [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions" |
||||
(page)="changePage($event)"> |
||||
|
||||
</mat-paginator> |
||||
|
||||
</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="isopen"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">是否公开</th> |
||||
<td mat-cell *matCellDef="let element">{{element.openRange}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="projectlevel"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">编制级别</th> |
||||
<td mat-cell *matCellDef="let element">{{element.planLevel=='1'?'总队':element.planLevel=='2'?'支队':element.planLevel=='4'?'大队':'中队'}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="weihustate"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 8%;">维护审核</th> |
||||
<td mat-cell *matCellDef="let element">{{element.maintenanceVerifyState}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="operation"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 20%;">操作</th> |
||||
<td mat-cell *matCellDef="let element" style="white-space: nowrap;cursor: pointer;"> |
||||
<span style="color: blue;" (click)='openPlan(element)'>查看预案</span> |
||||
<span style="color: blue;margin-left: 4px;" (click)="submitAudit(element)" *ngIf="(element.isNewData && element.newVerifyState=='未提交审核')||(!element.isNewData&&(element.maintenanceVerifyState=='审核通过'||element.maintenanceVerifyState=='未提交审核'))">提交审核</span> |
||||
<span style="color: blue;margin-left: 4px;" (click)="cancelAudit(element)" *ngIf="element.auditStatus == 1||element.auditStatus == 16">撤销审核</span> |
||||
<span style="color: blue;margin-left: 4px;" (click)="auditResult(element)">审批结果</span> |
||||
<span style="color: blue;margin-left: 4px;" (click)='readFile(element)'>下载</span> |
||||
<span style="color: red;margin-left: 4px" (click)='deletePlan(element.id)' *ngIf="element.auditStatus == 8"> 删除</span> |
||||
</td> |
||||
</ng-container> |
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> |
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> |
||||
</table> |
||||
<mat-paginator pageEvent [length]="length" |
||||
[pageSize]="pageSize" |
||||
[pageSizeOptions]="pageSizeOptions" |
||||
(page)="changePage($event)"> |
||||
|
||||
</mat-paginator> |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,10 +0,0 @@
|
||||
<h3 mat-dialog-title>选择要公开的消防救援站</h3> |
||||
<div class="box"> |
||||
<nz-tree #nzTreeComponent [nzData]="nodes" nzCheckable nzCheckStrictly [nzCheckedKeys]="defaultCheckedKeys" |
||||
[nzExpandedKeys]="defaultExpandedKeys"> |
||||
</nz-tree> |
||||
</div> |
||||
<mat-dialog-actions align="end"> |
||||
<button mat-button mat-dialog-close [disabled]="isLoading">取消</button> |
||||
<button mat-button cdkFocusInitial (click)="save()" [disabled]="isLoading">确定</button> |
||||
</mat-dialog-actions> |
@ -1,4 +0,0 @@
|
||||
.box{ |
||||
max-height: 400px; |
||||
overflow-y: auto; |
||||
} |
@ -1,25 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { OpenOrComponent } from './open-or.component'; |
||||
|
||||
describe('OpenOrComponent', () => { |
||||
let component: OpenOrComponent; |
||||
let fixture: ComponentFixture<OpenOrComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ OpenOrComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(OpenOrComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -1,126 +0,0 @@
|
||||
import { HttpClient } from "@angular/common/http"; |
||||
import { |
||||
Component, |
||||
OnInit, |
||||
AfterViewInit, |
||||
ViewChild, |
||||
Inject, |
||||
} from "@angular/core"; |
||||
import { MatSnackBar } from "@angular/material/snack-bar"; |
||||
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog"; |
||||
import { |
||||
NzFormatEmitEvent, |
||||
NzTreeComponent, |
||||
NzTreeNodeOptions, |
||||
} from "ng-zorro-antd/tree"; |
||||
|
||||
@Component({ |
||||
selector: "app-open-or", |
||||
templateUrl: "./open-or.component.html", |
||||
styleUrls: ["./open-or.component.scss"], |
||||
}) |
||||
export class OpenOrComponent implements OnInit { |
||||
constructor( |
||||
private http: HttpClient, |
||||
public snackBar: MatSnackBar, |
||||
@Inject(MAT_DIALOG_DATA) public data: any, |
||||
public dialogRef: MatDialogRef<OpenOrComponent> |
||||
) {} |
||||
@ViewChild("nzTreeComponent", { static: false }) |
||||
nzTreeComponent!: NzTreeComponent; |
||||
defaultCheckedKeys = []; |
||||
defaultExpandedKeys = []; |
||||
isLoading = false; |
||||
nodes: NzTreeNodeOptions[] = []; |
||||
ngOnInit(): void { |
||||
this.getOrganizations(); |
||||
} |
||||
|
||||
//获得所有组织机构
|
||||
allorganizations = []; |
||||
getOrganizations() { |
||||
this.http.get("/api/Organizations").subscribe((data: any) => { |
||||
this.allorganizations = data; |
||||
this.getpresentOrganization(); |
||||
}); |
||||
} |
||||
//得到当前单位所在组织机构的tree型数据
|
||||
organizationName; |
||||
getpresentOrganization() { |
||||
let orData = JSON.parse(JSON.stringify(this.allorganizations)); |
||||
orData.forEach((item) => { |
||||
item.children = []; |
||||
orData.forEach((element) => { |
||||
if (element.parentId == item.id) { |
||||
item.children.push(element); |
||||
} |
||||
}); |
||||
}); |
||||
orData.forEach((item) => { |
||||
item.title = item.name; |
||||
item.key = item.id; |
||||
item.selectable = false; |
||||
if (item.children.length === 0) { |
||||
item.isLeaf = true; |
||||
} |
||||
}); |
||||
this.http.get("/api/Account/Profiles").subscribe((data: any) => { |
||||
this.organizationName = data.organizationName; |
||||
if (this.organizationName) { |
||||
orData.forEach((item) => { |
||||
if (item.name == this.organizationName) { |
||||
function lookForAllId(data = [], arr = []) { |
||||
for (let item of data) { |
||||
arr.push(item.id); |
||||
if (item.children && item.children.length) |
||||
lookForAllId(item.children, arr); |
||||
} |
||||
return arr; |
||||
} |
||||
|
||||
function lookForNode(data, id, node = []) { |
||||
for (let item of data) { |
||||
if (item.id === id) { |
||||
node.push(item); |
||||
} else { |
||||
if (item.children && item.children.length) { |
||||
lookForNode(item.children, id, node); |
||||
} |
||||
} |
||||
} |
||||
return node; |
||||
} |
||||
if (this.data.plan.publicOrganizationIds.length === 0) { |
||||
this.defaultCheckedKeys = [...lookForAllId([item])]; |
||||
} else { |
||||
this.defaultCheckedKeys = this.data.plan.publicOrganizationIds; |
||||
} |
||||
|
||||
this.nodes = [...[item]]; |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
save() { |
||||
let ids = |
||||
this.nzTreeComponent.getCheckedNodeList().map((item) => { |
||||
return item.key; |
||||
}) || []; |
||||
if (ids.length === 0) { |
||||
this.snackBar.open("至少选择一个队站公开", "确定", { |
||||
verticalPosition: "top", |
||||
duration: 3000, |
||||
}); |
||||
} |
||||
this.http |
||||
.put(`/api/PlanAudits/${this.data.plan.id}/Public`, ids) |
||||
.subscribe((data) => { |
||||
this.snackBar.open("预案已公开", "确定", { |
||||
verticalPosition: "top", |
||||
duration: 3000, |
||||
}); |
||||
this.dialogRef.close("公开成功"); |
||||
}); |
||||
} |
||||
} |
@ -1,296 +1,251 @@
|
||||
import { Component, OnInit, ViewChild, Inject } from "@angular/core"; |
||||
import { HttpClient } from "@angular/common/http"; |
||||
import { |
||||
MatTreeFlatDataSource, |
||||
MatTreeFlattener, |
||||
} from "@angular/material/tree"; |
||||
import { MatPaginator } from "@angular/material/paginator"; |
||||
import { FlatTreeControl } from "@angular/cdk/tree"; |
||||
import { FormControl } from "@angular/forms"; |
||||
import { Router, ActivatedRoute } from "@angular/router"; |
||||
import { PageEvent } from "@angular/material/paginator"; |
||||
import { |
||||
MatDialogRef, |
||||
MatDialog, |
||||
MAT_DIALOG_DATA, |
||||
} from "@angular/material/dialog"; |
||||
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar"; |
||||
import { TreeService } from "../../http-interceptors/tree.service"; |
||||
import { Viewer } from "photo-sphere-viewer"; |
||||
declare var CryptoJS; |
||||
import { Component, OnInit, ViewChild, Inject } from '@angular/core'; |
||||
import { HttpClient } from '@angular/common/http' |
||||
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'; |
||||
import { MatPaginator } from '@angular/material/paginator'; |
||||
import { FlatTreeControl } from '@angular/cdk/tree'; |
||||
import { FormControl } from '@angular/forms'; |
||||
import { Router,ActivatedRoute } from '@angular/router' |
||||
import { PageEvent } from '@angular/material/paginator'; |
||||
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
||||
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
||||
import { TreeService } from '../../http-interceptors/tree.service' |
||||
import { Viewer } from 'photo-sphere-viewer'; |
||||
declare var CryptoJS |
||||
@Component({ |
||||
selector: "app-reinforce-plan", |
||||
templateUrl: "./reinforce-plan.component.html", |
||||
styleUrls: ["./reinforce-plan.component.scss"], |
||||
selector: 'app-reinforce-plan', |
||||
templateUrl: './reinforce-plan.component.html', |
||||
styleUrls: ['./reinforce-plan.component.scss'] |
||||
}) |
||||
export class ReinforcePlanComponent implements OnInit { |
||||
constructor( |
||||
private http: HttpClient, |
||||
private router: Router, |
||||
private route: ActivatedRoute, |
||||
private tree: TreeService, |
||||
public dialog: MatDialog, |
||||
public snackBar: MatSnackBar |
||||
) {} |
||||
|
||||
private _transformer = (node, level: number) => { |
||||
//初始化tree
|
||||
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } |
||||
|
||||
private _transformer = (node, level: number) => { //初始化tree
|
||||
return { |
||||
expandable: !!node.children && node.children.length > 0, |
||||
name: node.name, |
||||
level: level, |
||||
id: node.id, |
||||
parentId: node.parentId, |
||||
children: node.children, |
||||
children: node.children |
||||
}; |
||||
}; |
||||
treeControl = new FlatTreeControl<any>( |
||||
(node) => node.level, |
||||
(node) => node.expandable |
||||
); |
||||
treeFlattener = new MatTreeFlattener( |
||||
this._transformer, |
||||
(node) => node.level, |
||||
(node) => node.expandable, |
||||
(node) => node.children |
||||
); |
||||
} |
||||
treeControl = new FlatTreeControl<any>(node => node.level, node => node.expandable); |
||||
treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children); |
||||
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); |
||||
myControl = new FormControl(); |
||||
hasChild = (_: number, node: any) => node.expandable; |
||||
//分页
|
||||
@ViewChild(MatPaginator, { static: true }) |
||||
//分页
|
||||
@ViewChild(MatPaginator, {static: true})
|
||||
pageEvent: PageEvent; |
||||
paginator: MatPaginator; |
||||
length: any; //共多少条数据
|
||||
pageSize: any; //每页条数
|
||||
pageSizeOptions: number[] = [10]; //设置每页条数
|
||||
PageNumber: any; //第几页
|
||||
length:any; //共多少条数据
|
||||
pageSize:any; //每页条数
|
||||
pageSizeOptions: number[] = [10] //设置每页条数
|
||||
PageNumber:any; //第几页
|
||||
|
||||
displayedColumns: string[] = [ |
||||
"state", |
||||
"unitname", |
||||
"planname", |
||||
"addpeople", |
||||
"level", |
||||
"addtime", |
||||
"plantype", |
||||
"auditstate", |
||||
"openRange", |
||||
"projectlevel", |
||||
"operation", |
||||
]; |
||||
allorganizations: any; //所有组织机构
|
||||
allunittype: any; //所有单位类型
|
||||
tabledataSource: any; //表格数据
|
||||
IsNewData = ""; //维护更新活新增
|
||||
displayedColumns: string[] = ['state','unitname','planname', 'addpeople','level','addtime','plantype','auditStatus','weihuStatus','openRange','projectlevel','operation']; |
||||
allorganizations:any //所有组织机构
|
||||
allunittype:any //所有单位类型
|
||||
tabledataSource:any //表格数据
|
||||
IsNewData='' //维护更新活新增
|
||||
|
||||
preparelevels: any; |
||||
async ngOnInit(): Promise<void> { |
||||
if (window.matchMedia("(max-width: 1400px)").matches) { |
||||
this.pcMore = false; |
||||
this.padMore = true; |
||||
this.pcfind = false; |
||||
this.padjt = true; |
||||
} else { |
||||
this.pcfind = true; |
||||
this.pcMore = true; |
||||
this.padMore = false; |
||||
this.padjt = false; |
||||
preparelevels:any |
||||
ngOnInit(): void { |
||||
if(window.matchMedia("(max-width: 1400px)").matches){ |
||||
this.pcMore=false |
||||
this.padMore=true |
||||
this.pcfind=false |
||||
this.padjt=true |
||||
}else{ |
||||
this.pcfind=true |
||||
this.pcMore=true |
||||
this.padMore=false |
||||
this.padjt=false |
||||
} |
||||
this.getunitdata(); |
||||
await this.getOrganizations(); |
||||
this.jsId = this.dataSource.data[0].id; |
||||
this.getOrganizations(); |
||||
this.getUnittype(); |
||||
this.getAllPlanInfo(); |
||||
let level = sessionStorage.getItem("level"); |
||||
if (level == "0") { |
||||
//如果是总队
|
||||
if(level == "0"){//如果是总队
|
||||
this.preparelevels = [ |
||||
{ name: "总队", value: "1" }, |
||||
{ name: "支队", value: "2" }, |
||||
{ name: "大队", value: "4" }, |
||||
{ name: "中队", value: "8" }, |
||||
]; |
||||
{name:"总队",value:"1"}, |
||||
{name:"支队",value:"2"}, |
||||
{name:"大队",value:"4"}, |
||||
{name:"中队",value:"8"} |
||||
] |
||||
} |
||||
if (level == "1") { |
||||
//如果是支队
|
||||
if(level == "1"){//如果是支队
|
||||
this.preparelevels = [ |
||||
{ name: "支队", value: "2" }, |
||||
{ name: "大队", value: "4" }, |
||||
{ name: "中队", value: "8" }, |
||||
]; |
||||
{name:"支队",value:"2"}, |
||||
{name:"大队",value:"4"}, |
||||
{name:"中队",value:"8"} |
||||
] |
||||
} |
||||
if (level == "2") { |
||||
//如果是大队
|
||||
if(level == "2"){//如果是大队
|
||||
this.preparelevels = [ |
||||
{ name: "大队", value: "4" }, |
||||
{ name: "中队", value: "8" }, |
||||
]; |
||||
{name:"大队",value:"4"}, |
||||
{name:"中队",value:"8"} |
||||
] |
||||
} |
||||
if (level == "3") { |
||||
//如果是中队
|
||||
this.preparelevels = [{ name: "中队", value: "8" }]; |
||||
if(level == "3"){//如果是中队
|
||||
this.preparelevels = [ |
||||
{name:"中队",value:"8"} |
||||
] |
||||
} |
||||
} |
||||
pcMore; //pc更多
|
||||
pcput = false; //pc收起
|
||||
pcfind; //pc查询
|
||||
padjt = false; |
||||
padMore = true; //pad收缩控制
|
||||
padput = false; //pad收起按钮
|
||||
imgsrcopen = "../../../assets/images/routdown2.png"; |
||||
imgsrcdown = "../../../assets/images/routup2.png"; |
||||
pcInfo() { |
||||
this.pcMore = !this.pcMore; |
||||
this.pcput = !this.pcput; |
||||
pcMore//pc更多
|
||||
pcput=false//pc收起
|
||||
pcfind//pc查询
|
||||
padjt=false |
||||
padMore=true//pad收缩控制
|
||||
padput=false//pad收起按钮
|
||||
imgsrcopen="../../../assets/images/routdown2.png" |
||||
imgsrcdown="../../../assets/images/routup2.png" |
||||
pcInfo(){ |
||||
this.pcMore=!this.pcMore |
||||
this.pcput=!this.pcput |
||||
} |
||||
padInfo() { |
||||
this.padMore = !this.padMore; |
||||
this.padput = !this.padput; |
||||
padInfo(){ |
||||
this.padMore=!this.padMore |
||||
this.padput=!this.padput |
||||
} |
||||
|
||||
allPlanInfo: any; //存储所有预案信息
|
||||
allPlanInfo:any //存储所有预案信息
|
||||
//获得所有预案信息
|
||||
IsNewCompanyData = ""; //单位维护更新或者新增
|
||||
getAllPlanInfo() { |
||||
let paramsdata: any = { |
||||
CompanyName: this.companyName || "", |
||||
OrganizationId: this.jsId || "", |
||||
HasChildrenOrganization: this.jscheck || "", |
||||
BuildingTypeId: this.unittype || "", |
||||
PlanType: this.reservePlanType || "", |
||||
AuditStatus: "", //审核状态
|
||||
PlanLevel: this.preparelevel || "", |
||||
HasChildrenPlanLevel: this.plcheck || "", |
||||
CreationTimeRangeStart: this.addtime || "", |
||||
CreationTimeRangeEnd: this.endtime || "", |
||||
PageNumber: this.PageNumber || "1", |
||||
PageSize: this.pageSizeOptions[0], |
||||
Sort: "", |
||||
IsNewData: this.IsNewData, |
||||
IsNewCompanyData: this.IsNewCompanyData, |
||||
}; |
||||
this.http |
||||
.get("/api/ApprovedPlans/GetReinforcementPlanComponents", { |
||||
params: paramsdata, |
||||
}) |
||||
.subscribe((data: any) => { |
||||
// console.log('增援预案列表',data)
|
||||
this.length = data.totalCount; |
||||
this.allPlanInfo = data; |
||||
this.tabledataSource = data.items; |
||||
}); |
||||
IsNewCompanyData=''//单位维护更新或者新增
|
||||
getAllPlanInfo(){ |
||||
let paramsdata:any = { |
||||
CompanyName: this.companyName || '', |
||||
OrganizationId: this.jsId || '', |
||||
HasChildrenOrganization:this.jscheck || '', |
||||
BuildingTypeId: this.unittype || '', |
||||
PlanType: this.reservePlanType || '', |
||||
AuditStatus:'', //审核状态
|
||||
PlanLevel: this.preparelevel || '', |
||||
HasChildrenPlanLevel: this.plcheck || '', |
||||
CreationTimeRangeStart:this.addtime||'', |
||||
CreationTimeRangeEnd:this.endtime||'', |
||||
PageNumber: this.PageNumber || '1', |
||||
PageSize: this.pageSizeOptions[0], |
||||
Sort: '', |
||||
IsNewData:this.IsNewData, |
||||
IsNewCompanyData:this.IsNewCompanyData |
||||
} |
||||
this.http.get("/api/ApprovedPlans/GetReinforcementPlanComponents",{params:paramsdata}).subscribe((data:any)=>{ |
||||
// console.log('增援预案列表',data)
|
||||
this.length = data.totalCount |
||||
this.allPlanInfo = data |
||||
this.tabledataSource = data.items
|
||||
}) |
||||
} |
||||
|
||||
//得到当前单位信息
|
||||
getunitdata() { |
||||
this.http.get("/api/Account/Profiles").subscribe((data: any) => { |
||||
this.organizationName = data.organizationName; |
||||
}); |
||||
getunitdata(){ |
||||
this.http.get("/api/Account/Profiles").subscribe( |
||||
(data:any)=>{ |
||||
this.organizationName = data.organizationName |
||||
} |
||||
) |
||||
} |
||||
addtime; //开始时间
|
||||
endtime; //结束时间
|
||||
integrityScoreMin; //完整度最小值
|
||||
integrityScoreMax; //完整度最大值
|
||||
organizationName: any; //当前单位组织机构名称
|
||||
treedata: any; //组织机构树型数据
|
||||
newArr: any = []; |
||||
newallorganizations: any; //用于存储在原始数据基础上的每个机构增加children字段
|
||||
addtime//开始时间
|
||||
endtime//结束时间
|
||||
integrityScoreMin//完整度最小值
|
||||
integrityScoreMax//完整度最大值
|
||||
organizationName:any //当前单位组织机构名称
|
||||
treedata:any //组织机构树型数据
|
||||
newArr:any = [] |
||||
newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段
|
||||
//获得所有组织机构
|
||||
getOrganizations() { |
||||
return new Promise<void>((resolve, reject) => { |
||||
this.http |
||||
.get("/api/Organizations", { |
||||
params: { |
||||
strict: "true", |
||||
}, |
||||
}) |
||||
.subscribe((data: any) => { |
||||
this.allorganizations = data; |
||||
this.dataSource.data = this.tree.toTree(data); |
||||
resolve(); |
||||
}); |
||||
}); |
||||
getOrganizations(){ |
||||
this.http.get('/api/Organizations').subscribe( |
||||
(data:any)=>{ |
||||
this.allorganizations = data |
||||
this.dataSource.data = this.tree.toTree(data); |
||||
} |
||||
) |
||||
} |
||||
|
||||
//获得所有单位类型
|
||||
getUnittype() { |
||||
this.http.get("/api/BuildingTypes/Simple").subscribe((data) => { |
||||
this.allunittype = data; |
||||
}); |
||||
getUnittype(){ |
||||
this.http.get('/api/BuildingTypes/Simple').subscribe( |
||||
data=>{ |
||||
this.allunittype = data |
||||
} |
||||
) |
||||
} |
||||
//分页事件
|
||||
chagePage(e) { |
||||
this.PageNumber = e.pageIndex + 1; |
||||
chagePage(e){ |
||||
this.PageNumber = e.pageIndex+1 |
||||
this.getAllPlanInfo(); |
||||
} |
||||
|
||||
//辖区中队div是否显示
|
||||
isorganizationbox: boolean = false; |
||||
isorganizationbox:boolean = false |
||||
//点击辖区中队树,将选择的辖区中队添加到变量
|
||||
add(node) { |
||||
this.isorganizationbox = false; |
||||
this.js = node.name; |
||||
this.jsId = node.id; |
||||
this.isorganizationbox = false |
||||
this.js = node.name |
||||
this.jsId = node.id |
||||
} |
||||
//关闭辖区中队隐藏框
|
||||
closeorganizationbox() { |
||||
this.isorganizationbox = false; |
||||
this.isorganizationbox = false |
||||
} |
||||
//打开辖区中队隐藏框
|
||||
openorganizationbox() { |
||||
this.isorganizationbox = true; |
||||
this.isorganizationbox = true |
||||
} |
||||
//关闭出现的组织机构div
|
||||
closediv() { |
||||
this.isorganizationbox = false; |
||||
closediv(){ |
||||
this.isorganizationbox = false |
||||
} |
||||
//查询
|
||||
onSubmit(e) { |
||||
this.PageNumber = 1; |
||||
this.pageEvent.pageIndex = 0; |
||||
this.getAllPlanInfo(); |
||||
onSubmit (e) { |
||||
this.PageNumber = 1 |
||||
this.pageEvent.pageIndex = 0 |
||||
this.getAllPlanInfo() |
||||
} |
||||
companyName: any; //单位名称
|
||||
js: any; //所选组织机构
|
||||
jsId: any; //所选组织机构的id
|
||||
jscheck: boolean; //所选组织机构勾选框
|
||||
unittype: any; //单位类型
|
||||
reservePlanType: any; //预案类型
|
||||
preparelevel: any; //编制级别
|
||||
plcheck: boolean; //编制级别勾选框
|
||||
companyName:any //单位名称
|
||||
js:any //所选组织机构
|
||||
jsId:any //所选组织机构的id
|
||||
jscheck:boolean //所选组织机构勾选框
|
||||
unittype:any //单位类型
|
||||
reservePlanType:any //预案类型
|
||||
preparelevel:any //编制级别
|
||||
plcheck:boolean //编制级别勾选框
|
||||
//重置
|
||||
reset() { |
||||
this.IsNewData = ""; |
||||
this.IsNewCompanyData = ""; |
||||
this.companyName = ""; |
||||
this.js = ""; |
||||
this.jsId = ""; |
||||
this.jscheck = false; |
||||
this.unittype = ""; |
||||
this.reservePlanType = ""; |
||||
this.preparelevel = ""; |
||||
this.addtime = ""; |
||||
this.endtime = ""; |
||||
this.plcheck = false; |
||||
reset(){ |
||||
this.IsNewData='' |
||||
this.IsNewCompanyData='' |
||||
this.companyName = '' |
||||
this.js = '' |
||||
this.jsId = '' |
||||
this.jscheck = false |
||||
this.unittype = '' |
||||
this.reservePlanType = '' |
||||
this.preparelevel = '' |
||||
this.addtime='' |
||||
this.endtime='' |
||||
this.plcheck = false |
||||
//重新获取初始化列表
|
||||
this.pageEvent.pageIndex = 0; |
||||
this.PageNumber = 1; |
||||
this.pageEvent.pageIndex = 0 |
||||
this.PageNumber = 1 |
||||
this.getAllPlanInfo(); |
||||
|
||||
} |
||||
|
||||
//查看预案
|
||||
openPlan(e) { |
||||
openPlan(e){ |
||||
// console.log(e)
|
||||
let id = e.id; |
||||
sessionStorage.setItem("planId", id); |
||||
sessionStorage.setItem("companyId", e.companyId); |
||||
let id = e.id
|
||||
sessionStorage.setItem("planId",id) |
||||
sessionStorage.setItem("companyId",e.companyId) |
||||
//sessionStorage.setItem("buildingTypeId",this.unittypeId)
|
||||
sessionStorage.setItem("editable", "0"); |
||||
sessionStorage.setItem("planName", e.name); |
||||
let companyId = sessionStorage.getItem("companyId"); |
||||
window.open( |
||||
`/keyUnit/viewunitinfoplan?id=${companyId}&orName=${e.company.organizationName}&orId=${e.company.organizationId}` |
||||
); |
||||
sessionStorage.setItem("editable","0") |
||||
sessionStorage.setItem("planName",e.name) |
||||
let companyId = sessionStorage.getItem("companyId") |
||||
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}&orName=${e.company.organizationName}&orId=${e.company.organizationId}`); |
||||
} |
||||
} |
||||
|
@ -1,177 +1,164 @@
|
||||
<div style="height: 100%;overflow-y: auto;"> |
||||
<div class="header"> |
||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm"> |
||||
<div class="queryBox"> |
||||
|
||||
<div class="queryField"> |
||||
<label style="margin-right: 10px;">预案名称:</label> |
||||
<mat-form-field class="example-full-width"> |
||||
<input matInput placeholder="请输入预案名称" name="companyName" autocomplete="off" [(ngModel)]="unitname"> |
||||
</mat-form-field> |
||||
</div> |
||||
<div class="queryField"> |
||||
<label style="margin-right: 10px;">编制级别:</label> |
||||
<mat-form-field> |
||||
<mat-select name="preparelevel" placeholder='请选择编制级别' [(ngModel)]="projectlevel"> |
||||
<!-- <mat-option value="1">总队</mat-option> |
||||
<div class="header" > |
||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm"> |
||||
<div class="queryBox"> |
||||
|
||||
<div class="queryField"> |
||||
<label style="margin-right: 10px;">预案名称:</label> |
||||
<mat-form-field class="example-full-width"> |
||||
<input matInput placeholder="请输入预案名称" name="companyName" autocomplete="off" [(ngModel)]="unitname"> |
||||
</mat-form-field> |
||||
</div> |
||||
<div class="queryField" > |
||||
<label style="margin-right: 10px;">编制级别:</label> |
||||
<mat-form-field> |
||||
<mat-select name="preparelevel" placeholder='请选择编制级别' [(ngModel)]="projectlevel"> |
||||
<!-- <mat-option value="1">总队</mat-option> |
||||
<mat-option value="2">支队</mat-option> |
||||
<mat-option value="4">大队</mat-option> |
||||
<mat-option value="8">中队</mat-option> --> |
||||
<mat-option *ngFor="let item of preparelevels" [value]="item.value">{{item.name}}</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox> |
||||
<span *ngIf="padMore" style="margin-left: 20px; color: #0080FF;" (click)='padInfo()'>更多筛选条件<img |
||||
[src]='imgsrcopen' style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span> |
||||
<span *ngIf="padput" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>收起<img [src]='imgsrcdown' |
||||
style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span> |
||||
</div> |
||||
|
||||
<div class="queryField" *ngIf="!pcfind"> |
||||
<button mat-raised-button color="primary">查询</button> |
||||
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button> |
||||
</div> |
||||
<div class="queryField" *ngIf="!padMore"> |
||||
<label style="margin-right: 10px;">添加人:</label> |
||||
<mat-form-field class="example-full-width"> |
||||
<input matInput placeholder="请输入添加人" name="addname" autocomplete="off" [(ngModel)]="addname"> |
||||
</mat-form-field> |
||||
|
||||
</div> |
||||
|
||||
<div class="queryField" *ngIf="!padMore"> |
||||
<label style="margin-right: 10px;">审核状态:</label> |
||||
<mat-form-field> |
||||
<mat-select name="toExamine" placeholder='请选择审核状态' [(ngModel)]="unitstate"> |
||||
<mat-option value="8">未提交审核</mat-option> |
||||
<mat-option value="1">审核中</mat-option> |
||||
<mat-option value="2">审核通过</mat-option> |
||||
<mat-option value="4">审核退回</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
<span *ngIf="pcMore" style="margin-left: 15px; color: #0080FF; cursor: pointer;" (click)='pcInfo()'>更多筛选条件<img |
||||
[src]='imgsrcopen' style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span> |
||||
<span *ngIf="pcput" style="margin-left: 10px; color: #0080FF; cursor: pointer;" (click)='pcInfo()'>收起<img |
||||
[src]='imgsrcdown' style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span> |
||||
</div> |
||||
<div class="queryField" *ngIf="pcfind"> |
||||
<button mat-raised-button color="primary">查询</button> |
||||
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button> |
||||
</div> |
||||
<div class="queryField" *ngIf="!padMore&&!pcMore"> |
||||
<label style="margin-right: 10px;">添加时间:</label> |
||||
<mat-form-field class="example-full-width"> |
||||
<input type="date" matInput name="addtime" autocomplete="off" [(ngModel)]="addtime"> |
||||
</mat-form-field> |
||||
<!-- <mat-icon aria-hidden="false" style="position: relative;right: 120px;top: 5px;">arrow forward</mat-icon> --> |
||||
<mat-icon *ngIf="padjt" aria-hidden="false" style="position: relative;right: 120px;top: 5px;" |
||||
id="padshow">arrow forward</mat-icon> |
||||
<span style="margin-left: 15px;" id="pcshow" *ngIf="!padMore&&!padjt">🠊</span> |
||||
<mat-form-field class="example-full-width" style="margin-left: 10px;"> |
||||
<input type="date" matInput autocomplete="off" name="endtime" [(ngModel)]="endtime"> |
||||
</mat-form-field> |
||||
</div> |
||||
<div class="queryField" *ngIf="!padMore&&!pcMore"> |
||||
<input type="radio" style="height: 16px;width: 16px;position: relative;top: 2px;" name="whgx" [value]='true' |
||||
[(ngModel)]="IsNewData"> |
||||
<label style="margin-right: 10px;margin-left: 2px;">新增</label> |
||||
<input type="radio" style="height: 16px;width: 16px;position: relative;top: 2px;" name="whgx" [value]='false' |
||||
[(ngModel)]="IsNewData"> |
||||
<label style="margin-right: 10px;margin-left: 2px;">维护更新</label> |
||||
</div> |
||||
|
||||
</div> |
||||
</form> |
||||
</div> |
||||
<!-- <mat-divider></mat-divider> --> |
||||
<div class="newadd"> |
||||
<div> |
||||
<button mat-raised-button color="primary" (click)='addunit()' *ngIf="levels=='0'"><img style="margin-bottom: 3px;" |
||||
src="../../../assets/images/newadd.png"> 新增</button> |
||||
<mat-option *ngFor="let item of preparelevels" [value]="item.value">{{item.name}}</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox> |
||||
<span *ngIf="padMore" style="margin-left: 20px; color: #0080FF;" (click)='padInfo()'>更多筛选条件<img [src]='imgsrcopen'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span> |
||||
<span *ngIf="padput" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>收起<img [src]='imgsrcdown'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span> |
||||
</div> |
||||
|
||||
<div class="queryField" *ngIf="!pcfind"> |
||||
<button mat-raised-button color="primary">查询</button> |
||||
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button> |
||||
</div> |
||||
<div class="queryField" *ngIf="!padMore"> |
||||
<label style="margin-right: 10px;">添加人:</label> |
||||
<mat-form-field class="example-full-width"> |
||||
<input matInput placeholder="请输入添加人" name="addname" autocomplete="off" [(ngModel)]="addname"> |
||||
</mat-form-field> |
||||
|
||||
</div> |
||||
|
||||
<div class="queryField" *ngIf="!padMore"> |
||||
<label style="margin-right: 10px;">审核状态:</label> |
||||
<mat-form-field> |
||||
<mat-select name="toExamine" placeholder='请选择审核状态' [(ngModel)]="unitstate"> |
||||
<mat-option value="8">未提交审核</mat-option> |
||||
<mat-option value="1">审核中</mat-option> |
||||
<mat-option value="2">审核通过</mat-option> |
||||
<mat-option value="4">审核退回</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
<span *ngIf="pcMore" style="margin-left: 15px; color: #0080FF; cursor: pointer;" (click)='pcInfo()'>更多筛选条件<img [src]='imgsrcopen'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span> |
||||
<span *ngIf="pcput" style="margin-left: 10px; color: #0080FF; cursor: pointer;" (click)='pcInfo()'>收起<img [src]='imgsrcdown'style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span> |
||||
</div> |
||||
<div class="queryField" *ngIf="pcfind" > |
||||
<button mat-raised-button color="primary">查询</button> |
||||
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button> |
||||
</div> |
||||
<div class="queryField" *ngIf="!padMore&&!pcMore"> |
||||
<label style="margin-right: 10px;">添加时间:</label> |
||||
<mat-form-field class="example-full-width"> |
||||
<input type="date" matInput name="addtime" autocomplete="off" [(ngModel)]="addtime"> |
||||
</mat-form-field> |
||||
<!-- <mat-icon aria-hidden="false" style="position: relative;right: 120px;top: 5px;">arrow forward</mat-icon> --> |
||||
<mat-icon *ngIf="padjt" aria-hidden="false" style="position: relative;right: 120px;top: 5px;" id="padshow">arrow forward</mat-icon> |
||||
<span style="margin-left: 15px;" id="pcshow" *ngIf="!padMore&&!padjt">🠊</span> |
||||
<mat-form-field class="example-full-width" style="margin-left: 10px;"> |
||||
<input type="date" matInput autocomplete="off" name="endtime" [(ngModel)]="endtime"> |
||||
</mat-form-field> |
||||
</div> |
||||
<div class="queryField" *ngIf="!padMore&&!pcMore"> |
||||
<input type="radio" style="height: 16px;width: 16px;position: relative;top: 2px;" name="whgx" [value]='true' [(ngModel)]="IsNewData"> |
||||
<label style="margin-right: 10px;margin-left: 2px;">新增</label> |
||||
<input type="radio" style="height: 16px;width: 16px;position: relative;top: 2px;" name="whgx" [value]='false' [(ngModel)]="IsNewData"> |
||||
<label style="margin-right: 10px;margin-left: 2px;">维护更新</label> |
||||
</div> |
||||
|
||||
</div> |
||||
</form> |
||||
</div> |
||||
|
||||
<div class="progressBox" style="margin-left: 100px;" *ngIf="downloadisLoading"> |
||||
|
||||
<!-- <button mat-raised-button style="margin-right: 5px;" (click)="cancelDowload()">取消下载</button> --> |
||||
<span title="{{downloadFileName}}" style="font-size: 12px;" class="filename">{{downloadFileName}}</span> |
||||
<span style="font-size: 12px;position: absolute;margin-left: 8px;">下载中...</span> |
||||
<mat-progress-bar mode="determinate" [value]="downloadProgress" class="progress"></mat-progress-bar> |
||||
<!-- <mat-divider></mat-divider> --> |
||||
<div class="newadd"> |
||||
<div> |
||||
<button mat-raised-button color="primary" (click)='addunit()' *ngIf="levels=='0'"><img style="margin-bottom: 3px;" src="../../../assets/images/newadd.png"> 新增</button> |
||||
</div> |
||||
|
||||
<div class="progressBox" style="margin-left: 100px;" *ngIf="downloadisLoading"> |
||||
|
||||
<!-- <button mat-raised-button style="margin-right: 5px;" (click)="cancelDowload()">取消下载</button> --> |
||||
<span title="{{downloadFileName}}" style="font-size: 12px;" class="filename">{{downloadFileName}}</span> |
||||
<span style="font-size: 12px;position: absolute;margin-left: 8px;">下载中...</span> |
||||
<mat-progress-bar mode="determinate" [value]="downloadProgress" class="progress"></mat-progress-bar> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="body"> |
||||
<div class="tablebox"> |
||||
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8"> |
||||
<ng-container matColumnDef="state"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;">预案状态</th> |
||||
<td mat-cell *matCellDef="let element"> |
||||
<span class="add" *ngIf="element.isNewData">新增</span> |
||||
<span class="weihu" *ngIf="!element.isNewData">维护更新</span> |
||||
</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="unitname"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 20%;">预案名称</th> |
||||
<td mat-cell *matCellDef="let element">{{element.name}}</td> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="addname"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;">添加人</th> |
||||
<td mat-cell *matCellDef="let element">{{element.creatorName}}</td> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="addtime"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;">添加时间</th> |
||||
<td mat-cell *matCellDef="let element">{{element.creationTime|date:'yyyy-MM-dd'}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="plantype"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;">预案类型</th> |
||||
<td mat-cell *matCellDef="let element">类型预案</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="passstate"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;">新增审核</th> |
||||
<td mat-cell *matCellDef="let element"> |
||||
{{element.newVerifyState}} |
||||
</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="isopen"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;">是否公开</th> |
||||
<td mat-cell *matCellDef="let element">{{element.openRange}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="projectlevel"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;">编制级别</th> |
||||
<td mat-cell *matCellDef="let element"> |
||||
{{element.planLevel=='1'?'总队':element.planLevel=='2'?'支队':element.planLevel=='4'?'大队':'中队'}}</td> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="auditstate"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;">审核状态</th> |
||||
<td mat-cell *matCellDef="let element"> |
||||
{{element.auditStatus | auditState}} |
||||
</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="operation"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 20%;">操作</th> |
||||
<td mat-cell *matCellDef="let element" style="white-space: nowrap;cursor: pointer;"> |
||||
<span style="color: blue;" (click)='openPlan(element)'>查看预案</span> |
||||
<span style="color: blue;margin-left: 4px;" (click)="submitAudit(element)" |
||||
*ngIf="(element.isNewData && element.newVerifyState=='未提交审核')||(!element.isNewData&&(element.maintenanceVerifyState=='审核通过'||element.maintenanceVerifyState=='未提交审核'))">提交审核</span> |
||||
<span style="color: blue;margin-left: 4px;" (click)="cancelAudit(element)" |
||||
*ngIf="element.auditStatus == 1||element.auditStatus == 16">撤销审核</span> |
||||
<span style="color: blue;margin-left: 4px;" (click)="auditResult(element)">审批结果</span> |
||||
<span style="color: blue;margin-left: 4px;" (click)='readFile(element)'>下载</span> |
||||
<span style="color: red;margin-left: 4px" (click)='deletePlan(element.id)'> |
||||
删除</span> |
||||
</td> |
||||
</ng-container> |
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> |
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> |
||||
</table> |
||||
<mat-paginator pageEvent [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions" |
||||
(page)="changePage($event)"> |
||||
|
||||
</mat-paginator> |
||||
|
||||
|
||||
<div class="body"> |
||||
<div class="tablebox"> |
||||
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8"> |
||||
<ng-container matColumnDef="state"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;">预案状态</th> |
||||
<td mat-cell *matCellDef="let element"> |
||||
<span class="add" *ngIf="element.isNewData">新增</span> |
||||
<span class="weihu" *ngIf="!element.isNewData">维护更新</span> |
||||
</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="unitname"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 20%;">预案名称</th> |
||||
<td mat-cell *matCellDef="let element">{{element.name}}</td> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="addname"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;">添加人</th> |
||||
<td mat-cell *matCellDef="let element">{{element.creatorName}}</td> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="addtime"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;">添加时间</th> |
||||
<td mat-cell *matCellDef="let element">{{element.creationTime|date:'yyyy-MM-dd'}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="plantype"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;">预案类型</th> |
||||
<td mat-cell *matCellDef="let element">类型预案</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="passstate"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;">新增审核</th> |
||||
<td mat-cell *matCellDef="let element"> |
||||
{{element.newVerifyState}} |
||||
</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="isopen"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;">是否公开</th> |
||||
<td mat-cell *matCellDef="let element">{{element.openRange}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="projectlevel"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;">编制级别</th> |
||||
<td mat-cell *matCellDef="let element">{{element.planLevel=='1'?'总队':element.planLevel=='2'?'支队':element.planLevel=='4'?'大队':'中队'}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="weihustate"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;">维护审核</th> |
||||
<td mat-cell *matCellDef="let element">{{element.maintenanceVerifyState}}</td> |
||||
</ng-container> |
||||
<ng-container matColumnDef="operation"> |
||||
<th mat-header-cell *matHeaderCellDef style="width: 20%;">操作</th> |
||||
<td mat-cell *matCellDef="let element" style="white-space: nowrap;cursor: pointer;"> |
||||
<span style="color: blue;" (click)='openPlan(element)'>查看预案</span> |
||||
<span style="color: blue;margin-left: 4px;" (click)="submitAudit(element)" *ngIf="(element.isNewData && element.newVerifyState=='未提交审核')||(!element.isNewData&&(element.maintenanceVerifyState=='审核通过'||element.maintenanceVerifyState=='未提交审核'))">提交审核</span> |
||||
<span style="color: blue;margin-left: 4px;" (click)="cancelAudit(element)" *ngIf="element.auditStatus == 1||element.auditStatus == 16">撤销审核</span> |
||||
<span style="color: blue;margin-left: 4px;" (click)="auditResult(element)">审批结果</span> |
||||
<span style="color: blue;margin-left: 4px;" (click)='readFile(element)'>下载</span> |
||||
<span style="color: red;margin-left: 4px" (click)='deletePlan(element.id)' *ngIf="element.auditStatus == 8"> 删除</span> |
||||
</td> |
||||
</ng-container> |
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> |
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> |
||||
</table> |
||||
<mat-paginator pageEvent [length]="length" |
||||
[pageSize]="pageSize" |
||||
[pageSizeOptions]="pageSizeOptions" |
||||
(page)="changePage($event)"> |
||||
|
||||
</mat-paginator> |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<p>type-plan works!</p> |
||||
<p>type-plan works!</p> |
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,364 +1,227 @@
|
||||
import { Component, OnInit } from "@angular/core"; |
||||
import { Router } from "@angular/router"; |
||||
import { EchartsDataService } from "../../echarts-data.service"; |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { Router } from '@angular/router'; |
||||
import {EchartsDataService,} from '../../echarts-data.service'; |
||||
declare var echarts: any; |
||||
declare var CryptoJS; |
||||
declare var CryptoJS |
||||
@Component({ |
||||
selector: "app-add-unit-one", |
||||
templateUrl: "./add-unit-one.component.html", |
||||
styleUrls: ["./add-unit-one.component.scss"], |
||||
selector: 'app-add-unit-one', |
||||
templateUrl: './add-unit-one.component.html', |
||||
styleUrls: ['./add-unit-one.component.scss'] |
||||
}) |
||||
export class AddUnitOneComponent implements OnInit { |
||||
constructor(private router: Router, public echartsData: EchartsDataService) {} |
||||
|
||||
setTimeoutObj; //延时器需要清除
|
||||
tabledata; |
||||
padHw; |
||||
orid; //获取本组织id
|
||||
constructor(private router: Router,public echartsData:EchartsDataService) { } |
||||
|
||||
setTimeoutObj//延时器需要清除
|
||||
tabledata |
||||
padHw |
||||
orid//获取本组织id
|
||||
|
||||
ngOnInit(): void { |
||||
if (window.matchMedia("(max-width: 1400px)").matches) { |
||||
this.padHw = true; |
||||
if(window.matchMedia("(max-width: 1400px)").matches){ |
||||
this.padHw=true |
||||
//this.padjt=
|
||||
} else { |
||||
this.padHw = false; |
||||
}else{ |
||||
this.padHw=false |
||||
} |
||||
if (sessionStorage.getItem("refresh") === "true") { |
||||
sessionStorage.removeItem("refresh"); |
||||
if(sessionStorage.getItem('refresh') === 'true') { |
||||
sessionStorage.removeItem('refresh'); |
||||
location.reload(); |
||||
} |
||||
} |
||||
/* this.buildData.push(this.echartsData.getData(null,`/api/StatisticsAnalysis/BuildingTypes`)) |
||||
this.orData=this.echartsData.getData(null,`/api/StatisticsAnalysis/Companies`) */ |
||||
let jwt = sessionStorage.getItem("token"); |
||||
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split(".")[1]); |
||||
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); |
||||
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); |
||||
let identityJsonparse = JSON.parse(identityJson); |
||||
this.orid = identityJsonparse.oid; |
||||
this.setTimeoutObj = window.setTimeout(() => { |
||||
this.getechartsdata(); |
||||
}); |
||||
let identityJsonparse=JSON.parse(identityJson) |
||||
this.orid=identityJsonparse.oid |
||||
this.setTimeoutObj = window.setTimeout(()=>{ |
||||
this.getechartsdata() |
||||
}) |
||||
this.echartsData.eventEmit.subscribe((value: any) => { |
||||
if (value == "echarts") { |
||||
if (value == 'echarts') { |
||||
setTimeout(() => { |
||||
this.indexBzt.resize(); |
||||
this.indexBzt.resize() |
||||
}, 500); |
||||
|
||||
} |
||||
}); |
||||
} |
||||
//更新echarts视图
|
||||
updateEcharts() { |
||||
this.indexBzt.resize(); |
||||
updateEcharts(){ |
||||
this.indexBzt.resize() |
||||
} |
||||
//获取服务层数据
|
||||
async getechartsdata() { |
||||
await this.echartsData.getData(null, `/api/StatisticsAnalysis/Companies`); |
||||
this.tabledata = JSON.parse(JSON.stringify(this.echartsData.allDate)); |
||||
async getechartsdata(){ |
||||
await this.echartsData.getData(null,`/api/StatisticsAnalysis/Companies`) |
||||
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) |
||||
//console.log(this.tabledata)
|
||||
this.initCharts("pieone"); |
||||
this.initCharts("pietwo"); |
||||
this.initCharts("pieone") |
||||
this.initCharts("pietwo") |
||||
} |
||||
//组件销毁时
|
||||
ngOnDestroy() { |
||||
ngOnDestroy(){ |
||||
window.clearTimeout(this.setTimeoutObj); |
||||
if (!this.indexBzt) { |
||||
return; |
||||
} |
||||
this.indexBzt.clear(); |
||||
this.indexBzt.dispose(); |
||||
this.indexBzt.clear() |
||||
this.indexBzt.dispose() |
||||
} |
||||
zhiNameData = [ |
||||
"浦东支队", |
||||
"黄浦支队", |
||||
"徐汇支队", |
||||
"长宁支队", |
||||
"静安支队", |
||||
"普陀支队", |
||||
"虹口支队", |
||||
"杨浦支队", |
||||
"闵行支队", |
||||
"宝山支队", |
||||
"嘉定支队", |
||||
"松江支队", |
||||
"金山支队", |
||||
"崇明支队", |
||||
]; |
||||
buildingData = [ |
||||
"高层", |
||||
"地下", |
||||
"轨道交通", |
||||
"化工生产", |
||||
"储罐类", |
||||
"厂房", |
||||
"古建筑", |
||||
"商市场", |
||||
"医院", |
||||
"学校", |
||||
"宾馆", |
||||
"娱乐场所", |
||||
"餐饮业", |
||||
"影剧院", |
||||
"展览建筑", |
||||
"隧道", |
||||
]; |
||||
indexBzt; //首页饼状图实例
|
||||
zhiNameData = ["浦东支队","黄浦支队","徐汇支队","长宁支队","静安支队","普陀支队","虹口支队","杨浦支队","闵行支队","宝山支队","嘉定支队","松江支队","金山支队","崇明支队"] |
||||
buildingData=["高层","地下","轨道交通","化工生产","储罐类","厂房","古建筑","商市场","医院","学校","宾馆","娱乐场所","餐饮业","影剧院","展览建筑","隧道"] |
||||
indexBzt//首页饼状图实例
|
||||
/* 首页饼状图 */ |
||||
lengthBuildData = []; |
||||
lengthOrData = []; |
||||
buildData = []; |
||||
orData = []; |
||||
initCharts(tid) { |
||||
for ( |
||||
var i = 0; |
||||
i < this.tabledata[0].buildingTypeStatistics.buildingTypes.length; |
||||
i++ |
||||
) { |
||||
this.buildData.push( |
||||
this.tabledata[0].buildingTypeStatistics.buildingTypes[i] |
||||
); |
||||
this.lengthBuildData.push( |
||||
this.tabledata[0].buildingTypeStatistics.buildingTypes[i] |
||||
.buildingTypeName |
||||
); |
||||
lengthBuildData=[] |
||||
lengthOrData=[] |
||||
buildData=[] |
||||
orData=[] |
||||
initCharts(tid){ |
||||
for(var i=0;i<this.tabledata[0].buildingTypeStatistics.buildingTypes.length;i++){ |
||||
this.buildData.push(this.tabledata[0].buildingTypeStatistics.buildingTypes[i]) |
||||
this.lengthBuildData.push(this.tabledata[0].buildingTypeStatistics.buildingTypes[i].buildingTypeName) |
||||
} |
||||
for ( |
||||
var i = 0; |
||||
i < this.tabledata[0].organizationStatistics.organizations.length; |
||||
i++ |
||||
) { |
||||
this.orData.push( |
||||
this.tabledata[0].organizationStatistics.organizations[i] |
||||
); |
||||
if ( |
||||
this.tabledata[0].organizationStatistics.organizations[i] |
||||
.organizationName.length > 5 && |
||||
this.padHw |
||||
) { |
||||
this.tabledata[0].organizationStatistics.organizations[ |
||||
i |
||||
].organizationName = |
||||
this.tabledata[0].organizationStatistics.organizations[ |
||||
i |
||||
].organizationName.slice(0, 5) + |
||||
"\n" + |
||||
this.tabledata[0].organizationStatistics.organizations[ |
||||
i |
||||
].organizationName.slice(5); |
||||
for(var i=0;i<this.tabledata[0].organizationStatistics.organizations.length;i++){ |
||||
this.orData.push(this.tabledata[0].organizationStatistics.organizations[i]) |
||||
if(this.tabledata[0].organizationStatistics.organizations[i].organizationName.length>5&&this.padHw){ |
||||
this.tabledata[0].organizationStatistics.organizations[i].organizationName=this.tabledata[0].organizationStatistics.organizations[i].organizationName.slice(0, 5) |
||||
+'\n'+this.tabledata[0].organizationStatistics.organizations[i].organizationName.slice(5) |
||||
} |
||||
this.lengthOrData.push( |
||||
this.tabledata[0].organizationStatistics.organizations[i] |
||||
.organizationName |
||||
); |
||||
this.lengthOrData.push(this.tabledata[0].organizationStatistics.organizations[i].organizationName) |
||||
} |
||||
this.buildData = this.buildData.map((v) => { |
||||
return { name: v.buildingTypeName, value: v.count, id: v.buildingTypeId }; |
||||
}); |
||||
this.orData = this.orData.map((v) => { |
||||
return { name: v.organizationName, value: v.count, id: v.organizationId }; |
||||
}); |
||||
this.indexBzt = echarts.init(document.getElementById(tid), "walden"); |
||||
let options = { |
||||
this.buildData=this.buildData.map(v=>{return {name: v.buildingTypeName,value:v.count,id:v.buildingTypeId}}) |
||||
this.orData=this.orData.map(v=>{return {name: v.organizationName,value:v.count,id:v.organizationId}}) |
||||
this.indexBzt = echarts.init(document.getElementById(tid),'walden'); |
||||
let options={ |
||||
title: { |
||||
text: |
||||
tid == "pieone" |
||||
? `组织机构统计(${this.tabledata[0].organizationStatistics.totalCount}家)` |
||||
: `建筑类型统计(${this.tabledata[0].buildingTypeStatistics.totalCount}家)`, |
||||
left: "center", |
||||
text:tid=="pieone"? `组织机构统计(${this.tabledata[0].organizationStatistics.totalCount}家)`:`建筑类型统计(${this.tabledata[0].buildingTypeStatistics.totalCount}家)`, |
||||
left: 'center', |
||||
//top: "5%",
|
||||
//bottom:800,
|
||||
textStyle: { |
||||
fontSize: 28, |
||||
}, |
||||
fontSize:28 |
||||
} |
||||
}, |
||||
tooltip: { |
||||
trigger: "item", |
||||
formatter: (params) => { |
||||
return tid == "pieone" |
||||
? this.biaogeTishi(params.data, "one") |
||||
: this.biaogeTishi(params.data, "two"); |
||||
trigger: 'item', |
||||
formatter: (params)=>{ |
||||
return tid=="pieone"?this.biaogeTishi(params.data,'one'):this.biaogeTishi(params.data,'two') |
||||
//return this.echartsData.tableTooltip(tid=="pieone"?this.echartsData.buildingType:this.echartsData.tableDataZhi,params.name)
|
||||
}, |
||||
position: this.echartsData.tableTooltipNoShow2, |
||||
}, |
||||
legend: { |
||||
//type: tid=="pieone"?'scroll':'',
|
||||
//orient: 'vertical',
|
||||
//left: tid=="pieone"?0:650,
|
||||
//right:30,
|
||||
//top:100,
|
||||
//bottom:tid=="pieone"?600:500,
|
||||
bottom: 90, |
||||
left: "center", |
||||
textStyle: { |
||||
fontSize: 14, |
||||
color: "#000000", |
||||
}, |
||||
data: tid == "pieone" ? this.lengthOrData : this.lengthBuildData, |
||||
position:this.echartsData.tableTooltipNoShow2 |
||||
}, |
||||
|
||||
series: [ |
||||
{ |
||||
name: "访问来源", |
||||
type: "pie", |
||||
radius: this.padHw ? "42%" : "50%", |
||||
center: ["48%", "53%"], |
||||
bottom: 130, |
||||
left: 30, |
||||
label: { |
||||
show: true, |
||||
fontSize: 16, |
||||
formatter: "{b}\n{c}家{d|({d}%)}", |
||||
name: '访问来源', |
||||
type: 'pie', |
||||
radius:this.padHw?'42%':'50%', |
||||
center: ['48%', '60%'], |
||||
bottom:130, |
||||
left:30, |
||||
label:{ |
||||
show:true, |
||||
fontSize:16, |
||||
formatter:'{b}\n{c}家{d|({d}%)}', |
||||
rich: { |
||||
d: { |
||||
align: "center", |
||||
fontSize: 16, |
||||
}, |
||||
align: 'center', |
||||
fontSize:16 |
||||
} |
||||
}, |
||||
}, |
||||
data: tid == "pieone" ? this.orData : this.buildData, |
||||
data:tid=="pieone"?this.orData:this.buildData, |
||||
emphasis: { |
||||
itemStyle: { |
||||
shadowBlur: 10, |
||||
shadowOffsetX: 0, |
||||
shadowColor: "rgba(0, 0, 0, 0.5)", |
||||
}, |
||||
}, |
||||
}, |
||||
], |
||||
shadowColor: 'rgba(0, 0, 0, 0.5)' |
||||
} |
||||
} |
||||
} |
||||
] |
||||
}; |
||||
this.indexBzt.on("click", (params) => { |
||||
tid == "pieone" |
||||
? (this.echartsData.zuzhiorBuilding = "zhi") |
||||
: (this.echartsData.zuzhiorBuilding = "building"); |
||||
if ( |
||||
(this.echartsData.level == "0" || |
||||
this.echartsData.level == "1" || |
||||
this.echartsData.level == "2") && |
||||
this.tishiData.length > 0 |
||||
) { |
||||
this.indexBzt.on('click', (params) => { |
||||
tid=="pieone"?this.echartsData.zuzhiorBuilding="zhi":this.echartsData.zuzhiorBuilding="building" |
||||
if((this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2')&&this.tishiData.length>0){ |
||||
//总队,支队,大队跳转
|
||||
this.tishiData.forEach((value, index, array) => { |
||||
if (array[index].organizationId == this.orid) { |
||||
array.splice(index, 1); |
||||
this.tishiData.forEach((value,index,array) => { |
||||
if(array[index].organizationId==this.orid){ |
||||
array.splice(index,1) |
||||
} |
||||
if (array.length > 0) { |
||||
this.router.navigate( |
||||
["/statisticanalysis/addUnit_one/addUnit_two_type"], |
||||
{ |
||||
queryParams: { |
||||
level: params.name, |
||||
id: params.data.id, |
||||
type: tid == "pieone" ? "zhi" : "build", |
||||
}, |
||||
} |
||||
); |
||||
} else { |
||||
this.router.navigate(["/statisticanalysis/CompangInfo"], { |
||||
queryParams: { |
||||
name: params.name, |
||||
type: 1, |
||||
buildid: tid != "pieone" ? params.data.id : "", |
||||
jsid: tid == "pieone" ? params.data.id : "", |
||||
}, |
||||
}); |
||||
if(array.length>0){ |
||||
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':params.name,'id':params.data.id,'type':tid=="pieone"?'zhi':'build'}}); |
||||
} |
||||
else{ |
||||
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1,'buildid':tid!="pieone"?params.data.id:'','jsid':tid=="pieone"?params.data.id:''}}); |
||||
} |
||||
}); |
||||
} else { |
||||
|
||||
}else{ |
||||
//中队跳转
|
||||
this.router.navigate(["/statisticanalysis/CompangInfo"], { |
||||
queryParams: { |
||||
name: params.name, |
||||
type: 1, |
||||
buildid: tid != "pieone" ? params.data.id : "", |
||||
jsid: tid == "pieone" ? params.data.id : "", |
||||
}, |
||||
}); |
||||
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1,'buildid':tid!="pieone"?params.data.id:'','jsid':tid=="pieone"?params.data.id:''}}); |
||||
} |
||||
|
||||
|
||||
}); |
||||
this.indexBzt.setOption(options); |
||||
} |
||||
res; |
||||
tishiData; |
||||
biaogeTishi(datas, type) { |
||||
res |
||||
tishiData |
||||
biaogeTishi(datas,type){ |
||||
//console.log(datas)
|
||||
this.res = ""; |
||||
this.tishiData = ""; |
||||
if (type == "two") { |
||||
for (var a in this.echartsData.obdata[0].buildingTypeStatistics |
||||
.buildingTypes) { |
||||
if ( |
||||
this.echartsData.obdata[0].buildingTypeStatistics.buildingTypes[a] |
||||
.buildingTypeName == datas.name |
||||
) { |
||||
this.tishiData = |
||||
this.echartsData.obdata[0].buildingTypeStatistics.buildingTypes[ |
||||
a |
||||
].organizations; |
||||
this.res='' |
||||
this.tishiData='' |
||||
if(type=='two'){ |
||||
for(var a in this.echartsData.obdata[0].buildingTypeStatistics.buildingTypes){ |
||||
if(this.echartsData.obdata[0].buildingTypeStatistics.buildingTypes[a].buildingTypeName==datas.name){ |
||||
this.tishiData=this.echartsData.obdata[0].buildingTypeStatistics.buildingTypes[a].organizations |
||||
} |
||||
} |
||||
} else { |
||||
for (var a in this.echartsData.obdata[0].organizationStatistics |
||||
.organizations) { |
||||
if ( |
||||
this.echartsData.obdata[0].organizationStatistics.organizations[a] |
||||
.organizationId == datas.id |
||||
) { |
||||
this.tishiData = |
||||
this.echartsData.obdata[0].organizationStatistics.organizations[ |
||||
a |
||||
].buildingTypes; |
||||
}else{ |
||||
for(var a in this.echartsData.obdata[0].organizationStatistics.organizations){ |
||||
if(this.echartsData.obdata[0].organizationStatistics.organizations[a].organizationId==datas.id){ |
||||
this.tishiData=this.echartsData.obdata[0].organizationStatistics.organizations[a].buildingTypes |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
//console.log(this.tishiData)
|
||||
var countall = 0; //总计
|
||||
var countbi = 0; //站比
|
||||
var allCountbi = 0; //总站比
|
||||
for (var i = 0; i < this.tishiData.length; i++) { |
||||
countall += this.tishiData[i].count; |
||||
} |
||||
this.res = |
||||
'<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">' + |
||||
datas.name + |
||||
"</span></div>"; |
||||
this.res += |
||||
'</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:14px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >'; |
||||
this.res += '<thead style="font-size:18px;"><tr>'; |
||||
this.res += '<td style="text-align:center;width:30%;">名称</td>'; |
||||
this.res += '<td style="text-align:center;width:30%;">数量</td>'; |
||||
this.res += '<td style="text-align:center;width:30%;">总占比</td>'; |
||||
this.res += "</tr></thead>"; |
||||
this.res += "<tbody>"; |
||||
for (var i = 0; i < this.tishiData.length; i++) { |
||||
countbi = |
||||
Math.round((this.tishiData[i].count / countall) * 10000) / 100.0; |
||||
allCountbi = allCountbi + countbi; |
||||
this.res += "<tr>"; |
||||
if (type == "two") { |
||||
this.res += |
||||
'<td style="text-align:center;">' + |
||||
this.tishiData[i].organizationName + |
||||
"</td>"; |
||||
} else { |
||||
this.res += |
||||
'<td style="text-align:center;">' + |
||||
this.tishiData[i].buildingTypeName + |
||||
"</td>"; |
||||
var countall=0//总计
|
||||
var countbi=0//站比
|
||||
var allCountbi=0//总站比
|
||||
for(var i=0;i<this.tishiData.length;i++){ |
||||
countall+=this.tishiData[i].count |
||||
} |
||||
|
||||
this.res += |
||||
'<td style="text-align:center;">' + this.tishiData[i].count + "</td>"; |
||||
if (countall == 0) { |
||||
this.res += '<td style="text-align:center;">0%</td></tr>'; |
||||
} else { |
||||
this.res += '<td style="text-align:center;">' + countbi + "%</td></tr>"; |
||||
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>' |
||||
this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:14px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >'; |
||||
this.res+='<thead style="font-size:18px;"><tr>'; |
||||
this.res+='<td style="text-align:center;width:30%;">名称</td>'; |
||||
this.res+='<td style="text-align:center;width:30%;">数量</td>' |
||||
this.res+='<td style="text-align:center;width:30%;">总占比</td>' |
||||
this.res+='</tr></thead>' |
||||
this.res+='<tbody>'; |
||||
for(var i=0;i<this.tishiData.length;i++){ |
||||
countbi=Math.round(this.tishiData[i].count/countall* 10000)/ 100.00 |
||||
allCountbi=allCountbi+countbi |
||||
this.res+='<tr>' |
||||
if(type=='two'){ |
||||
this.res+='<td style="text-align:center;">'+this.tishiData[i].organizationName+'</td>' |
||||
} |
||||
else{ |
||||
this.res+='<td style="text-align:center;">'+this.tishiData[i].buildingTypeName+'</td>' |
||||
} |
||||
|
||||
this.res+='<td style="text-align:center;">'+this.tishiData[i].count+'</td>' |
||||
if(countall==0){ |
||||
this.res+='<td style="text-align:center;">0%</td></tr>' |
||||
}else{ |
||||
this.res+='<td style="text-align:center;">'+countbi+'%</td></tr>' |
||||
} |
||||
|
||||
} |
||||
} |
||||
this.res += "</tbody>"; |
||||
this.res += |
||||
'<tfoot style="font-size:18px;"><td style="text-align:center;">总计</td><td style="text-align:center;">' + |
||||
countall + |
||||
'</td><td style="text-align:center;">100%</td></tfoot>'; |
||||
this.res += "</table></div></div>"; |
||||
return this.res; |
||||
this.res+='</tbody>' |
||||
this.res+='<tfoot style="font-size:18px;"><td style="text-align:center;">总计</td><td style="text-align:center;">'+countall+'</td><td style="text-align:center;">100%</td></tfoot>' |
||||
this.res+='</table></div></div>' |
||||
return this.res |
||||
} |
||||
|
||||
|
||||
} |
||||
|
@ -1,316 +1,239 @@
|
||||
import { Component, OnInit } from "@angular/core"; |
||||
import { Router } from "@angular/router"; |
||||
import { ActivatedRoute } from "@angular/router"; |
||||
import { Local } from "protractor/built/driverProviders"; |
||||
import { EchartsDataService } from "../../echarts-data.service"; |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { Router } from '@angular/router'; |
||||
import { ActivatedRoute } from '@angular/router'; |
||||
import { Local } from 'protractor/built/driverProviders'; |
||||
import {EchartsDataService} from '../../echarts-data.service'; |
||||
declare var echarts: any; |
||||
@Component({ |
||||
selector: "app-building-type-three-details", |
||||
templateUrl: "./building-type-three-details.component.html", |
||||
styleUrls: ["./building-type-three-details.component.scss"], |
||||
selector: 'app-building-type-three-details', |
||||
templateUrl: './building-type-three-details.component.html', |
||||
styleUrls: ['./building-type-three-details.component.scss'] |
||||
}) |
||||
export class BuildingTypeThreeDetailsComponent implements OnInit { |
||||
constructor( |
||||
public route: ActivatedRoute, |
||||
private router: Router, |
||||
public echartsData: EchartsDataService |
||||
) {} |
||||
forward() { |
||||
this.router.navigate([ |
||||
"/statisticanalysis/buildingType_one/buildingType_two_forward", |
||||
]); |
||||
|
||||
constructor(public route: ActivatedRoute,private router: Router,public echartsData:EchartsDataService) { } |
||||
forward(){ |
||||
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_two_forward']) |
||||
} |
||||
reverse() { |
||||
this.router.navigate([ |
||||
"/statisticanalysis/buildingType_one/buildingType_two_reverse", |
||||
]); |
||||
reverse(){ |
||||
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_two_reverse']) |
||||
} |
||||
//返回
|
||||
goBack() { |
||||
sessionStorage.setItem("refresh", "true"); |
||||
goBack () { |
||||
sessionStorage.setItem('refresh', 'true'); |
||||
history.go(-1); |
||||
this.echartsData.statefulInspectionToggle = true; |
||||
this.echartsData.statefulInspectionToggle = true |
||||
} |
||||
|
||||
organizationName: String; |
||||
listorganizationId; //上个页面传过来的组织id
|
||||
buildingTypeName: String; |
||||
buildingTypeId; |
||||
organizationId = []; //本层id
|
||||
padHw; |
||||
organizationName:String |
||||
listorganizationId//上个页面传过来的组织id
|
||||
buildingTypeName:String |
||||
buildingTypeId |
||||
organizationId=[]//本层id
|
||||
padHw |
||||
|
||||
ngOnInit(): void { |
||||
if (window.matchMedia("(max-width: 1300px)").matches) { |
||||
this.padHw = true; |
||||
if(window.matchMedia("(max-width: 1300px)").matches){ |
||||
this.padHw=true |
||||
//this.padjt=
|
||||
} else { |
||||
this.padHw = false; |
||||
}else{ |
||||
this.padHw=false |
||||
} |
||||
if (sessionStorage.getItem("refresh") === "true") { |
||||
sessionStorage.removeItem("refresh"); |
||||
if(sessionStorage.getItem('refresh') === 'true') { |
||||
sessionStorage.removeItem('refresh'); |
||||
location.reload(); |
||||
} |
||||
this.route.queryParams.subscribe((params) => { |
||||
this.organizationName = params["organizationName"]; |
||||
this.buildingTypeName = params["buildingTypeName"]; |
||||
this.listorganizationId = params["organizationId"]; |
||||
this.buildingTypeId = params["buildId"]; |
||||
}); |
||||
|
||||
window.setTimeout(() => { |
||||
this.getechartsdata(); |
||||
} |
||||
this.route.queryParams.subscribe(params => { |
||||
this.organizationName = params['organizationName']; |
||||
this.buildingTypeName = params['buildingTypeName']; |
||||
this.listorganizationId=params['organizationId']; |
||||
this.buildingTypeId=params['buildId']; |
||||
}); |
||||
|
||||
|
||||
window.setTimeout(()=>{ |
||||
this.getechartsdata() |
||||
}) |
||||
} |
||||
|
||||
|
||||
ngOnDestroy(): void { |
||||
if (!this.detailPlanEchart) { |
||||
return; |
||||
} |
||||
this.detailPlanEchart.clear(); |
||||
this.detailPlanEchart.dispose(); |
||||
this.detailPlanEchart.clear() |
||||
this.detailPlanEchart.dispose() |
||||
} |
||||
async getechartsdata() { |
||||
let paramsdata = { |
||||
async getechartsdata(){ |
||||
let paramsdata={ |
||||
//id:this.buildingTypeId,
|
||||
organizationId: this.listorganizationId, |
||||
}; |
||||
await this.echartsData.getData( |
||||
paramsdata, |
||||
`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildingTypeId}` |
||||
); |
||||
this.tabledata = JSON.parse(JSON.stringify(this.echartsData.allDate)); |
||||
//console.log(this.tabledata)
|
||||
for (var i = 0; i < this.tabledata[0].organizations.length; i++) { |
||||
this.zhongNameData.push( |
||||
this.tabledata[0].organizations[i].organizationName |
||||
); |
||||
this.zhongNumData.push(this.tabledata[0].organizations[i].count); |
||||
this.organizationId.push( |
||||
this.tabledata[0].organizations[i].organizationId |
||||
); |
||||
organizationId:this.listorganizationId |
||||
} |
||||
this.tiaoshiPao = this.echartsData.qipao( |
||||
this.tiaoshiPao, |
||||
this.zhongNumData, |
||||
this.zhongNameData |
||||
); |
||||
this.detailEcharts(); |
||||
await this.echartsData.getData(paramsdata,`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildingTypeId}`) |
||||
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) |
||||
//console.log(this.tabledata)
|
||||
for(var i=0;i<this.tabledata[0].organizations.length;i++){ |
||||
this.zhongNameData.push(this.tabledata[0].organizations[i].organizationName) |
||||
this.zhongNumData.push(this.tabledata[0].organizations[i].count) |
||||
this.organizationId.push(this.tabledata[0].organizations[i].organizationId) |
||||
} |
||||
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.zhongNumData,this.zhongNameData) |
||||
this.detailEcharts() |
||||
} |
||||
topTextlabel = { |
||||
show: true, // 开启显示
|
||||
position: "top", // 在上方显示
|
||||
position: 'top', // 在上方显示
|
||||
distance: 10, // 距离图形元素的距离。当 position 为字符描述值(如 'top'、'insideRight')时候有效。
|
||||
verticalAlign: "middle", |
||||
textStyle: { |
||||
// 数值样式
|
||||
color: "black", |
||||
fontSize: 12, |
||||
}, |
||||
}; //柱状图数值顶部显示
|
||||
zhongNameData = []; |
||||
zhongNumData = []; |
||||
tiaoshiPao: any; |
||||
detailPlanEchart; |
||||
tabledata; |
||||
detailEcharts() { |
||||
this.detailPlanEchart = echarts.init( |
||||
document.getElementById("barEchart"), |
||||
"walden" |
||||
); |
||||
verticalAlign: 'middle', |
||||
textStyle: { // 数值样式
|
||||
color: 'black', |
||||
fontSize: 12 |
||||
} |
||||
}//柱状图数值顶部显示
|
||||
zhongNameData = [] |
||||
zhongNumData = [] |
||||
tiaoshiPao:any |
||||
detailPlanEchart |
||||
tabledata |
||||
detailEcharts(){ |
||||
this.detailPlanEchart = echarts.init(document.getElementById('barEchart'),'walden');
|
||||
var option = { |
||||
title: { |
||||
top: this.padHw ? 10 : 0, |
||||
text: |
||||
this.buildingTypeName + |
||||
"(" + |
||||
this.organizationName + |
||||
")" + |
||||
`:总数(${this.tabledata[0].totalCount})`, |
||||
top:this.padHw?10:0, |
||||
text: this.buildingTypeName + '(' +this.organizationName + ')'+`:总数(${this.tabledata[0].totalCount})`, |
||||
left: "center", |
||||
textStyle: { |
||||
fontSize: 30, |
||||
}, |
||||
fontSize: 30 |
||||
} |
||||
}, |
||||
grid: { |
||||
top: this.padHw ? 120 : 110, |
||||
top:this.padHw?120:110, |
||||
//bottom: 10
|
||||
}, |
||||
}, |
||||
xAxis: { |
||||
id: this.organizationId, |
||||
type: "category", |
||||
data: this.zhongNameData, |
||||
// axisLabel: this.axisLabel
|
||||
axisLabel: { |
||||
//this.axisLabel,
|
||||
textStyle: { |
||||
fontSize: 18, |
||||
color: "#000000", |
||||
}, |
||||
}, |
||||
id:this.organizationId, |
||||
type: 'category', |
||||
data: this.zhongNameData, |
||||
// axisLabel: this.axisLabel
|
||||
axisLabel:{ |
||||
//this.axisLabel,
|
||||
textStyle:{ |
||||
fontSize :18, |
||||
color:'#000000' |
||||
} |
||||
|
||||
} |
||||
}, |
||||
yAxis: { |
||||
type: "value", |
||||
axisLabel: { |
||||
//this.axisLabel,
|
||||
textStyle: { |
||||
fontSize: 18, |
||||
color: "#000000", |
||||
}, |
||||
}, |
||||
type: 'value', |
||||
axisLabel:{ |
||||
//this.axisLabel,
|
||||
textStyle:{ |
||||
fontSize :18, |
||||
color:'#000000' |
||||
} |
||||
|
||||
} |
||||
}, |
||||
tooltip: { |
||||
trigger: "item", |
||||
formatter: (params) => { |
||||
return this.tableTooltip(params); |
||||
}, |
||||
trigger: 'item', |
||||
formatter: (params)=>{ |
||||
return this.tableTooltip(params) |
||||
} |
||||
}, |
||||
series: [ |
||||
{ |
||||
id: this.organizationId, |
||||
series: [{ |
||||
id:this.organizationId, |
||||
data: this.zhongNumData, |
||||
type: "bar", |
||||
barWidth: "38", |
||||
type: 'bar', |
||||
barWidth :'38', |
||||
markPoint: { |
||||
symbolSize: [65, 65], |
||||
data: this.tiaoshiPao, |
||||
}, |
||||
symbolSize:[65, 65], |
||||
data: this.tiaoshiPao |
||||
}, |
||||
backgroundStyle: { |
||||
color: "rgba(220, 220, 220, 0.8)", |
||||
color: 'rgba(220, 220, 220, 0.8)' |
||||
}, |
||||
//label: this.topTextlabel
|
||||
}, |
||||
], |
||||
}] |
||||
}; |
||||
this.detailPlanEchart.setOption(option); |
||||
this.detailPlanEchart.getZr().on("click", (params) => { |
||||
const pointInPixel = [params.offsetX, params.offsetY]; |
||||
if (this.detailPlanEchart.containPixel("grid", pointInPixel)) { |
||||
let xIndex = this.detailPlanEchart.convertFromPixel( |
||||
{ seriesIndex: 0 }, |
||||
[params.offsetX, params.offsetY] |
||||
)[0]; |
||||
this.detailPlanEchart.getZr().on('click', (params) => { |
||||
const pointInPixel= [params.offsetX, params.offsetY]; |
||||
if (this.detailPlanEchart.containPixel('grid',pointInPixel)) { |
||||
let xIndex=this.detailPlanEchart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0]; |
||||
/*事件处理代码书写位置*/ |
||||
if ( |
||||
this.echartsData.level == "0" && |
||||
this.tiao == false && |
||||
this.tabledata[0].organizations[xIndex].subOrganizations.length >= 1 |
||||
) { |
||||
if(this.echartsData.level=="0"&&this.tiao==false&&this.tabledata[0].organizations[xIndex].subOrganizations.length>=1){ |
||||
//总队不跳转
|
||||
this.zhongNameData = []; |
||||
this.zhongNumData = []; |
||||
this.organizationId = []; |
||||
this.tiaoshiPao = ""; |
||||
let paramsdatee = { |
||||
id: this.buildingTypeId, |
||||
organizationId: option.xAxis.id[xIndex], |
||||
}; |
||||
this.echartsData.getData( |
||||
paramsdatee, |
||||
`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildingTypeId}` |
||||
); |
||||
window.setTimeout(() => { |
||||
this.tabledata = JSON.parse( |
||||
JSON.stringify(this.echartsData.allDate) |
||||
); |
||||
this.zhongNameData=[] |
||||
this.zhongNumData=[] |
||||
this.organizationId=[] |
||||
this.tiaoshiPao='' |
||||
let paramsdatee={ |
||||
id:this.buildingTypeId, |
||||
organizationId:option.xAxis.id[xIndex] |
||||
} |
||||
this.echartsData.getData(paramsdatee,`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildingTypeId}`) |
||||
window.setTimeout(()=>{ |
||||
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) |
||||
//console.log(this.tabledata)
|
||||
for (var i = 0; i < this.tabledata[0].organizations.length; i++) { |
||||
this.zhongNameData.push( |
||||
this.tabledata[0].organizations[i].organizationName |
||||
); |
||||
this.zhongNumData.push(this.tabledata[0].organizations[i].count); |
||||
this.organizationId.push( |
||||
this.tabledata[0].organizations[i].organizationId |
||||
); |
||||
for(var i=0;i<this.tabledata[0].organizations.length;i++){ |
||||
this.zhongNameData.push(this.tabledata[0].organizations[i].organizationName) |
||||
this.zhongNumData.push(this.tabledata[0].organizations[i].count) |
||||
this.organizationId.push(this.tabledata[0].organizations[i].organizationId) |
||||
} |
||||
option.title.text = |
||||
this.buildingTypeName + |
||||
"(" + |
||||
option.xAxis.data[xIndex] + |
||||
")" + |
||||
`:总数(${this.tabledata[0].totalCount})`; |
||||
option.xAxis.data = this.zhongNameData; |
||||
option.series[0].data = this.zhongNumData; |
||||
this.tiaoshiPao = this.echartsData.qipao( |
||||
this.tiaoshiPao, |
||||
this.zhongNumData, |
||||
this.zhongNameData |
||||
); |
||||
option.series[0].markPoint.data = this.tiaoshiPao; |
||||
option.title.text = this.buildingTypeName + '(' +option.xAxis.data[xIndex]+ ')'+`:总数(${this.tabledata[0].totalCount})` |
||||
option.xAxis.data = this.zhongNameData |
||||
option.series[0].data = this.zhongNumData |
||||
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.zhongNumData,this.zhongNameData) |
||||
option.series[0].markPoint.data=this.tiaoshiPao |
||||
//option.series[0].id=this.organizationId
|
||||
option.xAxis.id = this.organizationId; |
||||
this.detailPlanEchart.clear(); |
||||
this.detailPlanEchart.setOption(option); |
||||
|
||||
option.xAxis.id=this.organizationId |
||||
this.detailPlanEchart.clear() |
||||
this.detailPlanEchart.setOption(option) |
||||
|
||||
//this.detailEcharts()
|
||||
}, 1000); |
||||
this.tiao = true; |
||||
} else { |
||||
this.router.navigate(["/statisticanalysis/CompangInfo"], { |
||||
queryParams: { |
||||
name: option.xAxis.data[xIndex], |
||||
type: 1, |
||||
jsid: option.xAxis.id[xIndex], |
||||
buildid: this.buildingTypeId, |
||||
}, |
||||
}); |
||||
},1000) |
||||
this.tiao=true |
||||
} |
||||
else{ |
||||
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':option.xAxis.data[xIndex],'type':1,'jsid':option.xAxis.id[xIndex],'buildid':this.buildingTypeId}}); |
||||
} |
||||
|
||||
} |
||||
}); |
||||
} |
||||
|
||||
tiao = false; |
||||
tishiData; |
||||
res; |
||||
tableTooltip(datas: any) { |
||||
for (var a in this.echartsData.obdata[0].organizations) { |
||||
if ( |
||||
this.echartsData.obdata[0].organizations[a].organizationName == |
||||
datas.name |
||||
) { |
||||
this.tishiData = |
||||
this.echartsData.obdata[0].organizations[a].subOrganizations; |
||||
tiao=false |
||||
tishiData |
||||
res |
||||
tableTooltip(datas:any){ |
||||
for(var a in this.echartsData.obdata[0].organizations){ |
||||
if(this.echartsData.obdata[0].organizations[a].organizationName==datas.name){ |
||||
this.tishiData=this.echartsData.obdata[0].organizations[a].subOrganizations |
||||
} |
||||
} |
||||
var countall = 0; //总计
|
||||
var countbi = 0; //站比
|
||||
var allCountbi = 0; //总站比
|
||||
for (var i = 0; i < this.tishiData.length; i++) { |
||||
countall += this.tishiData[i].count; |
||||
} |
||||
this.res = |
||||
'<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">' + |
||||
datas.name + |
||||
"</span></div>"; |
||||
this.res += |
||||
'</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >'; |
||||
this.res += '<thead style="font-size:18px;"><tr>'; |
||||
this.res += '<td style="text-align:center;width:30%;">名称</td>'; |
||||
this.res += '<td style="text-align:center;width:30%;">数量</td>'; |
||||
this.res += '<td style="text-align:center;width:30%;">总占比</td>'; |
||||
this.res += "</tr></thead>"; |
||||
this.res += "<tbody>"; |
||||
for (var i = 0; i < this.tishiData.length; i++) { |
||||
countbi = |
||||
Math.round((this.tishiData[i].count / countall) * 10000) / 100.0; |
||||
allCountbi = allCountbi + countbi; |
||||
this.res += "<tr>"; |
||||
this.res += |
||||
'<td style="text-align:center;">' + |
||||
this.tishiData[i].organizationName + |
||||
"</td>"; |
||||
this.res += |
||||
'<td style="text-align:center;">' + this.tishiData[i].count + "</td>"; |
||||
this.res += '<td style="text-align:center;">' + countbi + "%</td></tr>"; |
||||
} |
||||
|
||||
this.res += "</tbody>"; |
||||
this.res += |
||||
'<tfoot style="font-size:18px;"><td style="text-align:center;">总计</td><td style="text-align:center;">' + |
||||
countall + |
||||
'</td><td style="text-align:center;">' + |
||||
allCountbi.toFixed(2) + |
||||
"%</td></tfoot>"; |
||||
this.res += "</table></div></div>"; |
||||
return this.res; |
||||
var countall=0//总计
|
||||
var countbi=0//站比
|
||||
var allCountbi=0//总站比
|
||||
for(var i=0;i<this.tishiData.length;i++){ |
||||
countall+=this.tishiData[i].count |
||||
} |
||||
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>' |
||||
this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >'; |
||||
this.res+='<thead style="font-size:18px;"><tr>'; |
||||
this.res+='<td style="text-align:center;width:30%;">名称</td>'; |
||||
this.res+='<td style="text-align:center;width:30%;">数量</td>' |
||||
this.res+='<td style="text-align:center;width:30%;">总占比</td>' |
||||
this.res+='</tr></thead>' |
||||
this.res+='<tbody>'; |
||||
for(var i=0;i<this.tishiData.length;i++){ |
||||
countbi=Math.round(this.tishiData[i].count/countall* 10000)/ 100.00 |
||||
allCountbi=allCountbi+countbi |
||||
this.res+='<tr>' |
||||
this.res+='<td style="text-align:center;">'+this.tishiData[i].organizationName+'</td>' |
||||
this.res+='<td style="text-align:center;">'+this.tishiData[i].count+'</td>' |
||||
this.res+='<td style="text-align:center;">'+countbi+'%</td></tr>' |
||||
} |
||||
|
||||
this.res+='</tbody>' |
||||
this.res+='<tfoot style="font-size:18px;"><td style="text-align:center;">总计</td><td style="text-align:center;">'+countall+'</td><td style="text-align:center;">'+allCountbi.toFixed(2)+'%</td></tfoot>' |
||||
this.res+='</table></div></div>' |
||||
return this.res |
||||
} |
||||
} |
||||
|
@ -1,195 +1,153 @@
|
||||
import { Component, OnInit } from "@angular/core"; |
||||
import { Router } from "@angular/router"; |
||||
import { EchartsDataService } from "../../echarts-data.service"; |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { Router } from '@angular/router'; |
||||
import {EchartsDataService,} from '../../echarts-data.service' |
||||
declare var echarts: any; |
||||
|
||||
@Component({ |
||||
selector: "app-delete-one", |
||||
templateUrl: "./delete-one.component.html", |
||||
styleUrls: ["./delete-one.component.scss"], |
||||
selector: 'app-delete-one', |
||||
templateUrl: './delete-one.component.html', |
||||
styleUrls: ['./delete-one.component.scss'] |
||||
}) |
||||
export class DeleteOneComponent implements OnInit { |
||||
options: any; |
||||
options:any; |
||||
|
||||
indexBzt; //echarts实例
|
||||
indexBzt//echarts实例
|
||||
|
||||
constructor(private router: Router, public echartsData: EchartsDataService) {} |
||||
constructor(private router: Router,public echartsData:EchartsDataService) { } |
||||
|
||||
ngOnInit() { |
||||
window.setTimeout(() => { |
||||
this.initCharts(); |
||||
}, 0); |
||||
window.setTimeout(()=>{ |
||||
this.initCharts() |
||||
},0) |
||||
} |
||||
ngOnDestroy(): void { |
||||
if (this.indexBzt) { |
||||
this.indexBzt.clear(); |
||||
this.indexBzt.dispose(); |
||||
} |
||||
ngOnDestroy():void{ |
||||
this.indexBzt.clear() |
||||
this.indexBzt.dispose() |
||||
} |
||||
|
||||
/* 首页饼状图 */ |
||||
initCharts() { |
||||
initCharts(){ |
||||
//console.log(document.getElementById('indexBzt'))
|
||||
|
||||
|
||||
var ec = echarts as any; |
||||
this.indexBzt = ec.init(document.getElementById("indexBzt"), "walden"); |
||||
var options = { |
||||
this.indexBzt = ec.init(document.getElementById('indexBzt'),'walden'); |
||||
var options={ |
||||
title: { |
||||
text: "删除单位统计(8900家)", |
||||
left: "center", |
||||
top: "7%", |
||||
textStyle: { |
||||
fontSize: 31, |
||||
}, |
||||
text: '删除单位统计(8900家)', |
||||
left: 'center', |
||||
top: "7%", |
||||
textStyle:{ |
||||
fontSize:31 |
||||
} |
||||
}, |
||||
tooltip: { |
||||
trigger: "item", |
||||
//position: this.echartsData.tableTooltipNoShow2,
|
||||
formatter: (params) => { |
||||
//return this.biaogeTishi(params.name)
|
||||
return this.echartsData.biaogeTishiZhi(params.name); |
||||
}, |
||||
trigger: 'item', |
||||
//position: this.echartsData.tableTooltipNoShow2,
|
||||
formatter: (params)=>{ |
||||
//return this.biaogeTishi(params.name)
|
||||
return this.echartsData.biaogeTishiZhi(params.name) |
||||
}
|
||||
}, |
||||
legend: { |
||||
orient: "vertical", |
||||
right: 150, |
||||
top: 80, |
||||
//padding:20,
|
||||
// itemWidth:60,
|
||||
// itemHeight:25,
|
||||
textStyle: { |
||||
fontSize: 18, |
||||
color: "#000000", |
||||
}, |
||||
data: [ |
||||
"高层", |
||||
"地下", |
||||
"轨道交通", |
||||
"化工生产", |
||||
"储罐类", |
||||
"厂房", |
||||
"古建筑", |
||||
"商市场", |
||||
"医院", |
||||
"学校", |
||||
"宾馆", |
||||
"娱乐场所", |
||||
"餐饮业", |
||||
"影剧院", |
||||
"展览建筑", |
||||
"隧道", |
||||
], |
||||
orient: 'vertical', |
||||
right: 150, |
||||
top:80, |
||||
//padding:20,
|
||||
// itemWidth:60,
|
||||
// itemHeight:25,
|
||||
textStyle:{ |
||||
fontSize:18, |
||||
color:"#000000" |
||||
},
|
||||
data: ['高层', '地下', '轨道交通', '化工生产', '储罐类', '厂房', '古建筑', '商市场', '医院', '学校', '宾馆', '娱乐场所', '餐饮业', '影剧院', '展览建筑', '隧道'] |
||||
}, |
||||
series: [ |
||||
{ |
||||
name: "访问来源", |
||||
type: "pie", |
||||
radius: "65%", |
||||
center: ["50%", "60%"], |
||||
label: { |
||||
show: true, |
||||
fontSize: 18, |
||||
formatter: "{b}{c}家\n{d|({d}%)}", |
||||
{ |
||||
name: '访问来源', |
||||
type: 'pie', |
||||
radius: '65%', |
||||
center: ['50%', '60%'], |
||||
label:{ |
||||
show:true, |
||||
fontSize:18, |
||||
formatter:'{b}{c}家\n{d|({d}%)}', |
||||
rich: { |
||||
d: { |
||||
align: "center", |
||||
fontSize: 18, |
||||
}, |
||||
}, |
||||
}, |
||||
data: [ |
||||
{ value: 500, name: "高层" }, |
||||
{ value: 1300, name: "地下", itemStyle: { color: "#02A7F0" } }, |
||||
{ value: 1500, name: "轨道交通" }, |
||||
{ value: 1500, name: "化工生产" }, |
||||
{ value: 1700, name: "储罐类" }, |
||||
{ value: 800, name: "厂房" }, |
||||
{ value: 1500, name: "古建筑" }, |
||||
{ value: 1500, name: "商市场" }, |
||||
{ value: 1700, name: "医院" }, |
||||
{ value: 1700, name: "学校" }, |
||||
{ value: 1700, name: "宾馆" }, |
||||
{ value: 1700, name: "娱乐场所" }, |
||||
{ value: 1700, name: "餐饮业" }, |
||||
{ value: 1700, name: "影剧院" }, |
||||
{ value: 1700, name: "展览建筑" }, |
||||
{ value: 1700, name: "隧道" }, |
||||
], |
||||
emphasis: { |
||||
itemStyle: { |
||||
shadowBlur: 10, |
||||
shadowOffsetX: 0, |
||||
shadowColor: "rgba(0, 0, 0, 0.5)", |
||||
align: 'center', |
||||
fontSize:18 |
||||
} |
||||
}, |
||||
}, |
||||
}, |
||||
], |
||||
|
||||
}, |
||||
data: [ |
||||
{value: 500, name: '高层'}, |
||||
{value: 1300, name: '地下',itemStyle:{color:'#02A7F0'}}, |
||||
{value: 1500, name: '轨道交通'}, |
||||
{value: 1500, name: '化工生产'}, |
||||
{value: 1700, name: '储罐类'}, |
||||
{value: 800, name: '厂房'}, |
||||
{value: 1500, name: '古建筑'}, |
||||
{value: 1500, name: '商市场'}, |
||||
{value: 1700, name: '医院'}, |
||||
{value: 1700, name: '学校'}, |
||||
{value: 1700, name: '宾馆'}, |
||||
{value: 1700, name: '娱乐场所'}, |
||||
{value: 1700, name: '餐饮业'}, |
||||
{value: 1700, name: '影剧院'}, |
||||
{value: 1700, name: '展览建筑'}, |
||||
{value: 1700, name: '隧道'} |
||||
], |
||||
emphasis: { |
||||
itemStyle: { |
||||
shadowBlur: 10, |
||||
shadowOffsetX: 0, |
||||
shadowColor: 'rgba(0, 0, 0, 0.5)' |
||||
} |
||||
} |
||||
} |
||||
] |
||||
}; |
||||
this.indexBzt.on("click", (params) => { |
||||
this.router.navigateByUrl("/statisticanalysis/delete_one/delete_two"); |
||||
this.indexBzt.on('click', (params) => { |
||||
this.router.navigateByUrl('/statisticanalysis/delete_one/delete_two'); |
||||
}); |
||||
this.indexBzt.setOption(options); |
||||
} |
||||
/** |
||||
* @name: 表格提示框封装 |
||||
* @test: test font |
||||
* @msg: |
||||
* @msg:
|
||||
* @param {string(表头)} |
||||
* @return {type} |
||||
* @return {type}
|
||||
*/ |
||||
biaogeTishi(biaotou: string) { |
||||
var shuju = |
||||
'[{"name":"浦东支队","number":"156","zhanbi":"3%"},{"name":"黄浦支队","number":"144","zhanbi":"2.8%"},'; |
||||
shuju += |
||||
'{"name":"徐汇支队","number":"133","zhanbi":"2.1%"},{"name":"长宁支队","number":"122","zhanbi":"1.6%"},'; |
||||
shuju += |
||||
'{"name":"静安支队","number":"120","zhanbi":"1.3%"},{"name":"普陀支队","number":"100","zhanbi":"1.1%"},'; |
||||
shuju += |
||||
'{"name":"虹口支队","number":"95","zhanbi":"1%"},{"name":"杨浦支队","number":"90","zhanbi":"0.9%"},'; |
||||
shuju += |
||||
'{"name":"闵行支队","number":"88","zhanbi":"0.8%"},{"name":"宝山支队","number":"83","zhanbi":"0.7%"},'; |
||||
shuju += |
||||
'{"name":"徐汇支队","number":"133","zhanbi":"2.1%"},{"name":"长宁支队","number":"122","zhanbi":"1.6%"},'; |
||||
shuju += |
||||
'{"name":"嘉定支队","number":"78","zhanbi":"0.6%"},{"name":"松江支队","number":"75","zhanbi":"0.5%"},'; |
||||
shuju += |
||||
'{"name":"金山支队","number":"65","zhanbi":"0.4%"},{"name":"崇明支队","number":"55","zhanbi":"0.3%"}]'; |
||||
var jsonObj = JSON.parse(shuju); |
||||
var res = |
||||
'<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#000000;font-size:30px;text-align: center;display:block;">' + |
||||
biaotou + |
||||
"</span></div>"; |
||||
res += |
||||
'</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px; background:#FFFFFF; color:#000000;border-collapse:collapse;"cellspacing="0"; >'; |
||||
res += "<thead><tr>"; |
||||
res += |
||||
'<td style="text-align:center;width:30%;border:1px solid #000000">名称</td>'; |
||||
res += |
||||
'<td style="text-align:center;width:30%;border:1px solid #000000">数量</td>'; |
||||
res += |
||||
'<td style="text-align:center;width:30%;border:1px solid #000000">总占比</td>'; |
||||
res += "</tr></thead>"; |
||||
res += "<tbody>"; |
||||
for (var i = 0; i < jsonObj.length; i++) { |
||||
res += "<tr>"; |
||||
res += |
||||
'<td style="text-align:center;border:1px solid #000000">' + |
||||
jsonObj[i].name + |
||||
"</td>"; |
||||
res += |
||||
'<td style="text-align:center;border:1px solid #000000">' + |
||||
jsonObj[i].number + |
||||
"</td>"; |
||||
res += |
||||
'<td style="text-align:center;border:1px solid #000000">' + |
||||
jsonObj[i].zhanbi + |
||||
"</td></tr>"; |
||||
} |
||||
|
||||
res += "</tbody>"; |
||||
res += |
||||
'<tfoot><td style="text-align:center;border:1px solid #000000">总计</td><td style="text-align:center;border:1px solid #000000">1356</td><td style="text-align:center;border:1px solid #000000">19%</td></tfoot>'; |
||||
res += "</table></div></div>"; |
||||
return res; |
||||
biaogeTishi(biaotou:string){ |
||||
var shuju='[{"name":"浦东支队","number":"156","zhanbi":"3%"},{"name":"黄浦支队","number":"144","zhanbi":"2.8%"},' |
||||
shuju+='{"name":"徐汇支队","number":"133","zhanbi":"2.1%"},{"name":"长宁支队","number":"122","zhanbi":"1.6%"},' |
||||
shuju+='{"name":"静安支队","number":"120","zhanbi":"1.3%"},{"name":"普陀支队","number":"100","zhanbi":"1.1%"},' |
||||
shuju+='{"name":"虹口支队","number":"95","zhanbi":"1%"},{"name":"杨浦支队","number":"90","zhanbi":"0.9%"},' |
||||
shuju+='{"name":"闵行支队","number":"88","zhanbi":"0.8%"},{"name":"宝山支队","number":"83","zhanbi":"0.7%"},' |
||||
shuju+='{"name":"徐汇支队","number":"133","zhanbi":"2.1%"},{"name":"长宁支队","number":"122","zhanbi":"1.6%"},' |
||||
shuju+='{"name":"嘉定支队","number":"78","zhanbi":"0.6%"},{"name":"松江支队","number":"75","zhanbi":"0.5%"},' |
||||
shuju+='{"name":"金山支队","number":"65","zhanbi":"0.4%"},{"name":"崇明支队","number":"55","zhanbi":"0.3%"}]' |
||||
var jsonObj = JSON.parse(shuju); |
||||
var res = '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#000000;font-size:30px;text-align: center;display:block;">'+biaotou+'</span></div>' |
||||
res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px; background:#FFFFFF; color:#000000;border-collapse:collapse;"cellspacing="0"; >'; |
||||
res+='<thead><tr>'; |
||||
res+='<td style="text-align:center;width:30%;border:1px solid #000000">名称</td>'; |
||||
res+='<td style="text-align:center;width:30%;border:1px solid #000000">数量</td>' |
||||
res+='<td style="text-align:center;width:30%;border:1px solid #000000">总占比</td>' |
||||
res+='</tr></thead>' |
||||
res+='<tbody>'; |
||||
for(var i=0;i<jsonObj.length;i++){ |
||||
res+='<tr>' |
||||
res+='<td style="text-align:center;border:1px solid #000000">'+jsonObj[i].name+'</td>' |
||||
res+='<td style="text-align:center;border:1px solid #000000">'+jsonObj[i].number+'</td>' |
||||
res+='<td style="text-align:center;border:1px solid #000000">'+jsonObj[i].zhanbi+'</td></tr>' |
||||
} |
||||
|
||||
res+='</tbody>' |
||||
res+='<tfoot><td style="text-align:center;border:1px solid #000000">总计</td><td style="text-align:center;border:1px solid #000000">1356</td><td style="text-align:center;border:1px solid #000000">19%</td></tfoot>' |
||||
res+='</table></div></div>' |
||||
return res |
||||
} |
||||
|
||||
} |
||||
|
@ -1,311 +1,227 @@
|
||||
import { Component, OnInit } from "@angular/core"; |
||||
import { Router } from "@angular/router"; |
||||
import { |
||||
MatDialog, |
||||
MatDialogRef, |
||||
MAT_DIALOG_DATA, |
||||
} from "@angular/material/dialog"; |
||||
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar"; |
||||
import { ActivatedRoute } from "@angular/router"; |
||||
import { EchartsDataService } from "../../echarts-data.service"; |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { Router } from '@angular/router'; |
||||
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; |
||||
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
||||
import { ActivatedRoute } from '@angular/router'; |
||||
import { EchartsDataService } from '../../echarts-data.service'; |
||||
declare var echarts: any; |
||||
@Component({ |
||||
selector: "app-delete-two-newadd", |
||||
templateUrl: "./delete-two-newadd.component.html", |
||||
styleUrls: ["./delete-two-newadd.component.scss"], |
||||
selector: 'app-delete-two-newadd', |
||||
templateUrl: './delete-two-newadd.component.html', |
||||
styleUrls: ['./delete-two-newadd.component.scss'] |
||||
}) |
||||
export class DeleteTwoNewaddComponent implements OnInit { |
||||
constructor( |
||||
private router: Router, |
||||
public dialog: MatDialog, |
||||
public snackBar: MatSnackBar, |
||||
private serviceData: EchartsDataService, |
||||
public route: ActivatedRoute |
||||
) {} |
||||
|
||||
year: String; |
||||
buildingTypeName: String; |
||||
level: String; |
||||
setTimeoutObj; //延时器需要清除
|
||||
constructor(private router: Router,public dialog: MatDialog,public snackBar: MatSnackBar,private serviceData: EchartsDataService,public route: ActivatedRoute) { } |
||||
|
||||
year:String |
||||
buildingTypeName:String |
||||
level:String |
||||
setTimeoutObj//延时器需要清除
|
||||
ngOnInit(): void { |
||||
this.dateInit(); |
||||
this.bianli(); |
||||
this.route.queryParams.subscribe((params) => { |
||||
this.year = params["level"]; |
||||
this.buildingTypeName = params["headtext"]; |
||||
}); |
||||
this.setTimeoutObj = window.setTimeout(() => { |
||||
this.detailEcharts(); |
||||
this.dateInit () |
||||
this.bianli() |
||||
this.route.queryParams.subscribe(params => { |
||||
this.year = params['level']; |
||||
this.buildingTypeName = params['headtext']; |
||||
}); |
||||
this.setTimeoutObj = window.setTimeout(()=>{ |
||||
this.detailEcharts() |
||||
}) |
||||
} |
||||
ngOnDestroy() { |
||||
ngOnDestroy(){ |
||||
window.clearTimeout(this.setTimeoutObj); |
||||
if (this.detailPlanEchart) { |
||||
this.detailPlanEchart.clear(); |
||||
this.detailPlanEchart.dispose(); |
||||
} |
||||
this.detailPlanEchart.clear() |
||||
this.detailPlanEchart.dispose() |
||||
} |
||||
|
||||
selectType: string = "month"; //选择当前的 查询类型 按月/年
|
||||
selectType:string = 'month'; //选择当前的 查询类型 按月/年
|
||||
|
||||
//查询数据
|
||||
years: any = []; |
||||
selectMonth: any = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; |
||||
years:any = [] |
||||
selectMonth:any = [1,2,3,4,5,6,7,8,9,10,11,12] |
||||
|
||||
//日期初始化
|
||||
dateInit() { |
||||
let date = new Date().getFullYear(); |
||||
for (let i = date; i >= date - 10; i--) { |
||||
this.years.unshift(i); |
||||
dateInit () { |
||||
let date = (new Date()).getFullYear() |
||||
for (let i=date; i>=date-10;i--) { |
||||
this.years.unshift(i) |
||||
} |
||||
} |
||||
selectOneYear: any = new Date().getFullYear(); //开始年份
|
||||
selectStartMonth: any = 1; //开始月份
|
||||
Submit(e) {} |
||||
selectStartYear: any = new Date().getFullYear(); //开始年份
|
||||
selectOneYear:any = (new Date()).getFullYear() //开始年份
|
||||
selectStartMonth:any = 1 //开始月份
|
||||
Submit (e) { |
||||
|
||||
} |
||||
selectStartYear:any = (new Date()).getFullYear() //开始年份
|
||||
|
||||
topTextlabel = { |
||||
show: true, // 开启显示
|
||||
position: "top", // 在上方显示
|
||||
position: 'top', // 在上方显示
|
||||
distance: 10, // 距离图形元素的距离。当 position 为字符描述值(如 'top'、'insideRight')时候有效。
|
||||
verticalAlign: "middle", |
||||
textStyle: { |
||||
// 数值样式
|
||||
color: "black", |
||||
fontSize: 12, |
||||
}, |
||||
}; //柱状图数值顶部显示
|
||||
zhongNameData = [ |
||||
"浦东中队", |
||||
"黄浦中队", |
||||
"徐汇中队", |
||||
"长宁中队", |
||||
"静安中队", |
||||
"普陀中队", |
||||
"虹口中队", |
||||
"杨浦中队", |
||||
"闵行中队", |
||||
"宝山中队", |
||||
"嘉定中队", |
||||
]; |
||||
zhongNumData = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; |
||||
verticalAlign: 'middle', |
||||
textStyle: { // 数值样式
|
||||
color: 'black', |
||||
fontSize: 12 |
||||
} |
||||
}//柱状图数值顶部显示
|
||||
zhongNameData = ["浦东中队","黄浦中队","徐汇中队","长宁中队","静安中队","普陀中队","虹口中队","杨浦中队","闵行中队","宝山中队","嘉定中队"] |
||||
zhongNumData = [0,0,0,0,0,0,0,0,0,0,0] |
||||
|
||||
zhiNameData = [ |
||||
"浦东支队", |
||||
"黄浦支队", |
||||
"徐汇支队", |
||||
"长宁支队", |
||||
"静安支队", |
||||
"普陀支队", |
||||
"虹口支队", |
||||
"杨浦支队", |
||||
"闵行支队", |
||||
"宝山支队", |
||||
"嘉定支队", |
||||
]; |
||||
zhiNumData = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; |
||||
tiaoshiPao: any; |
||||
zhiNameData = ["浦东支队","黄浦支队","徐汇支队","长宁支队","静安支队","普陀支队","虹口支队","杨浦支队","闵行支队","宝山支队","嘉定支队"] |
||||
zhiNumData = [0,0,0,0,0,0,0,0,0,0,0] |
||||
tiaoshiPao:any |
||||
//气泡提示数据获取
|
||||
bianli() { |
||||
var arrshuzu = "["; |
||||
for (var i = 0; i < this.dateNum.length; i++) { |
||||
arrshuzu += |
||||
'{"value":' + |
||||
this.dateNum[i] + |
||||
',"coord":[' + |
||||
i + |
||||
"," + |
||||
this.dateNum[i] + |
||||
'],"name":' + |
||||
'"' + |
||||
this.date[i] + |
||||
'"' + |
||||
"},"; |
||||
bianli(){ |
||||
var arrshuzu='['; |
||||
for(var i=0;i<this.dateNum.length;i++){ |
||||
arrshuzu+='{"value":'+this.dateNum[i]+',"coord":['+i+','+this.dateNum[i]+'],"name":'+'"'+this.date[i]+'"'+'},' |
||||
} |
||||
arrshuzu = arrshuzu.substring(0, arrshuzu.length - 1); |
||||
arrshuzu += "]"; |
||||
this.tiaoshiPao = JSON.parse(arrshuzu); |
||||
arrshuzu=arrshuzu.substring(0,arrshuzu.length-1) |
||||
arrshuzu+=']' |
||||
this.tiaoshiPao=JSON.parse(arrshuzu) |
||||
//return tishiPao
|
||||
} |
||||
//返回
|
||||
goBack() { |
||||
history.go(-1); |
||||
goBack () { |
||||
history.go(-1) |
||||
//this.echartsData.statefulInspectionToggle = true
|
||||
} |
||||
|
||||
detailPlanEchart; |
||||
option; |
||||
date = [ |
||||
"高层", |
||||
"轨道交通", |
||||
"储罐类", |
||||
"古建筑", |
||||
"地下", |
||||
"化工生产", |
||||
"厂房", |
||||
"商市场", |
||||
]; |
||||
dateNum = [0, 0, 0, 0, 0, 0, 0, 0]; |
||||
detailPlanEchart |
||||
option |
||||
date = ['高层', '轨道交通', '储罐类', '古建筑', '地下', '化工生产', '厂房', '商市场'] |
||||
dateNum = [0, 0, 0, 0, 0, 0, 0, 0] |
||||
|
||||
detailEcharts() { |
||||
this.detailPlanEchart = echarts.init( |
||||
document.getElementById("barEchart"), |
||||
"skinUpp" |
||||
); |
||||
detailEcharts(){ |
||||
this.detailPlanEchart = echarts.init(document.getElementById('barEchart'), 'skinUpp');
|
||||
this.option = { |
||||
grid: { |
||||
top: 90, |
||||
left: 40, |
||||
left:40, |
||||
right: 20, |
||||
//bottom: 20,
|
||||
}, |
||||
// 标题
|
||||
title: { |
||||
text: this.buildingTypeName + "(" + this.year + ")", |
||||
text: this.buildingTypeName + '(' + this.year + ')', |
||||
top: -4, |
||||
left: "center", |
||||
textStyle: { |
||||
left: 'center', |
||||
textStyle:{ |
||||
//文字颜色
|
||||
color: "#000", |
||||
fontSize: 30, |
||||
}, |
||||
color:'#000', |
||||
fontSize: 30 |
||||
} |
||||
}, |
||||
//提示框
|
||||
tooltip: { |
||||
trigger: "axis", |
||||
formatter: (params) => { |
||||
if (params[0].seriesName == "year") { |
||||
return this.serviceData.tableTooltip( |
||||
this.serviceData.monthTooltip, |
||||
params[0].name |
||||
); |
||||
} else { |
||||
return this.serviceData.tableTooltip( |
||||
this.serviceData.tableDataZhi, |
||||
params[0].name |
||||
); |
||||
trigger: 'axis', |
||||
formatter: (params)=>{ |
||||
if(params[0].seriesName == "year"){ |
||||
return this.serviceData.tableTooltip(this.serviceData.monthTooltip,params[0].name) |
||||
}else{ |
||||
return this.serviceData.tableTooltip(this.serviceData.tableDataZhi,params[0].name) |
||||
} |
||||
}, |
||||
position: this.serviceData.tableTooltipNoShow2, |
||||
position:this.serviceData.tableTooltipNoShow2 |
||||
}, |
||||
// x轴
|
||||
xAxis: { |
||||
type: "category", |
||||
type: 'category', |
||||
data: this.date, |
||||
axisLabel: { |
||||
color: "#000", //刻度线标签颜色
|
||||
textStyle: { |
||||
fontSize: 18, |
||||
color: "#000000", |
||||
}, |
||||
textStyle:{ |
||||
fontSize :18, |
||||
color:'#000000' |
||||
} |
||||
}, |
||||
//设置坐标轴字体颜色和宽度
|
||||
axisLine: { |
||||
axisLine: {
|
||||
lineStyle: { |
||||
color: "#000", |
||||
}, |
||||
}, |
||||
splitLine: { |
||||
//分割线配置
|
||||
show: true, |
||||
splitLine: {//分割线配置
|
||||
show:true, |
||||
lineStyle: { |
||||
color: "#999", |
||||
}, |
||||
}, |
||||
color: '#999', |
||||
} |
||||
} |
||||
}, |
||||
// y轴
|
||||
yAxis: { |
||||
type: "value", |
||||
name: "个", |
||||
type: 'value', |
||||
name: '个', |
||||
axisLabel: { |
||||
//color: "#000", //刻度线标签颜色
|
||||
textStyle: { |
||||
fontSize: 18, |
||||
color: "#000000", |
||||
}, |
||||
textStyle:{ |
||||
fontSize :18, |
||||
color:'#000000' |
||||
} |
||||
}, |
||||
//设置坐标轴字体颜色和宽度
|
||||
axisLine: { |
||||
//设置坐标轴字体颜色和宽度
|
||||
axisLine: { |
||||
lineStyle: { |
||||
color: "#000", |
||||
}, |
||||
}, |
||||
} |
||||
} |
||||
}, |
||||
// 数据
|
||||
series: [ |
||||
{ |
||||
name: "xxx", |
||||
type: "line", |
||||
series: [{ |
||||
name: 'xxx', |
||||
type: 'line', |
||||
markPoint: { |
||||
symbolSize: [65, 65], |
||||
data: this.tiaoshiPao, |
||||
}, |
||||
data: this.dateNum, |
||||
symbolSize:[65, 65], |
||||
data: this.tiaoshiPao |
||||
}, |
||||
data: this.dateNum, |
||||
} |
||||
], |
||||
}; |
||||
this.detailPlanEchart.setOption(this.option); |
||||
this.detailPlanEchart.getZr().on("click", (params) => { |
||||
const pointInPixel = [params.offsetX, params.offsetY]; |
||||
if (this.detailPlanEchart.containPixel("grid", pointInPixel)) { |
||||
let xIndex = this.detailPlanEchart.convertFromPixel( |
||||
{ seriesIndex: 0 }, |
||||
[params.offsetX, params.offsetY] |
||||
)[0]; |
||||
this.detailPlanEchart.getZr().on('click',params=>{ |
||||
const pointInPixel= [params.offsetX, params.offsetY]; |
||||
if (this.detailPlanEchart.containPixel('grid',pointInPixel)) { |
||||
let xIndex=this.detailPlanEchart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0]; |
||||
/*事件处理代码书写位置*/ |
||||
if (this.serviceData.level == "0") { |
||||
this.router.navigate(["/statisticanalysis/delete_one/delete_there"], { |
||||
queryParams: { |
||||
level: this.option.xAxis.data[xIndex], |
||||
headtext: this.buildingTypeName, |
||||
zhong: "1", |
||||
}, |
||||
}); |
||||
} else if (this.serviceData.level == "1") { |
||||
this.router.navigate(["/statisticanalysis/delete_one/delete_four"], { |
||||
queryParams: { |
||||
level: this.option.xAxis.data[xIndex] + this.buildingTypeName, |
||||
}, |
||||
}); |
||||
if(this.serviceData.level=='0'){ |
||||
this.router.navigate(['/statisticanalysis/delete_one/delete_there'],{queryParams:{'level':this.option.xAxis.data[xIndex],'headtext':this.buildingTypeName,'zhong':'1'}}); |
||||
}else if(this.serviceData.level=='1'){ |
||||
this.router.navigate(['/statisticanalysis/delete_one/delete_four'],{queryParams:{'level':this.option.xAxis.data[xIndex]+this.buildingTypeName}}); |
||||
} |
||||
|
||||
} |
||||
}); |
||||
} |
||||
//返回按钮
|
||||
backBtn() { |
||||
window.history.go(-1); |
||||
} |
||||
|
||||
tableTooltip(params: any) { |
||||
backBtn(){ |
||||
window.history.go(-1) |
||||
}
|
||||
|
||||
tableTooltip(params:any){ |
||||
var data = [ |
||||
{ |
||||
name: params.name, |
||||
number: params.value, |
||||
zhanbi: ((params.value / 1340) * 100).toFixed(2) + "%", |
||||
}, |
||||
]; |
||||
var res = |
||||
'<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">' + |
||||
params.name + |
||||
"</span></div>"; |
||||
res += |
||||
'</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >'; |
||||
res += '<thead style="font-size:18px;"><tr>'; |
||||
res += '<td style="text-align:center;width:30%;">名称</td>'; |
||||
res += '<td style="text-align:center;width:30%;">数量</td>'; |
||||
res += '<td style="text-align:center;width:30%;">总占比</td>'; |
||||
res += "</tr></thead>"; |
||||
res += "<tbody>"; |
||||
for (var i = 0; i < data.length; i++) { |
||||
res += "<tr>"; |
||||
res += '<td style="text-align:center;">' + data[i].name + "</td>"; |
||||
res += '<td style="text-align:center;">' + data[i].number + "</td>"; |
||||
res += '<td style="text-align:center;">' + data[i].zhanbi + "</td></tr>"; |
||||
} |
||||
|
||||
res += "</tbody>"; |
||||
// res+='<tfoot><td style="text-align:center;border:1px solid #000000">总计</td><td style="text-align:center;border:1px solid #000000">1356</td><td style="text-align:center;border:1px solid #000000">19%</td></tfoot>'
|
||||
res += "</table></div></div>"; |
||||
return res; |
||||
{name:params.name,number:params.value,zhanbi:(params.value/1340 * 100).toFixed(2) + "%"} |
||||
] |
||||
var res = '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+params.name+'</span></div>' |
||||
res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >'; |
||||
res+='<thead style="font-size:18px;"><tr>'; |
||||
res+='<td style="text-align:center;width:30%;">名称</td>'; |
||||
res+='<td style="text-align:center;width:30%;">数量</td>' |
||||
res+='<td style="text-align:center;width:30%;">总占比</td>' |
||||
res+='</tr></thead>' |
||||
res+='<tbody>'; |
||||
for(var i=0;i<data.length;i++){ |
||||
res+='<tr>' |
||||
res+='<td style="text-align:center;">'+data[i].name+'</td>' |
||||
res+='<td style="text-align:center;">'+data[i].number+'</td>' |
||||
res+='<td style="text-align:center;">'+data[i].zhanbi+'</td></tr>' |
||||
} |
||||
|
||||
res+='</tbody>' |
||||
// res+='<tfoot><td style="text-align:center;border:1px solid #000000">总计</td><td style="text-align:center;border:1px solid #000000">1356</td><td style="text-align:center;border:1px solid #000000">19%</td></tfoot>'
|
||||
res+='</table></div></div>' |
||||
return res |
||||
} |
||||
|
||||
} |
||||
|
@ -1,25 +1,56 @@
|
||||
@import "../../../assets/css/newStyle.css"; |
||||
.main-center{ |
||||
position: relative; |
||||
// .main{ |
||||
|
||||
// } |
||||
.main-center { |
||||
position: relative; |
||||
} |
||||
#chartMap { |
||||
margin-left: 5px; |
||||
} |
||||
#chartMap{ |
||||
margin-left: 5px; |
||||
.number-area { |
||||
position: absolute; |
||||
top: 0; |
||||
display: block; |
||||
width: 80%; |
||||
} |
||||
.number-area{ |
||||
position: absolute; |
||||
top: 0; |
||||
display: block; |
||||
width:80%; |
||||
.total-item { |
||||
z-index: 200; |
||||
cursor: pointer; |
||||
} |
||||
.total-item{ |
||||
z-index: 200; |
||||
cursor: pointer; |
||||
.total-item div { |
||||
height: 23px !important; |
||||
line-height: 23px !important; |
||||
} |
||||
.total-item div{ |
||||
height: 23px!important; |
||||
line-height: 23px!important; |
||||
.xxx div { |
||||
height: 20px !important; |
||||
line-height: 20px !important; |
||||
} |
||||
.xxx div{ |
||||
height: 20px!important; |
||||
line-height: 20px!important; |
||||
|
||||
#tooltip { |
||||
width: 170px; |
||||
height: 90px; |
||||
position: fixed; |
||||
background-color: rgba(0, 0, 0, 0.8); |
||||
border-radius: 8px; |
||||
z-index: 999; |
||||
.content { |
||||
width: 100%; |
||||
height: 100%; |
||||
position: relative; |
||||
color: #fff; |
||||
font-size: 14px; |
||||
display: flex; |
||||
flex-direction: column; |
||||
justify-content: center; |
||||
box-sizing: border-box; |
||||
padding-left: 12px; |
||||
.close { |
||||
position: absolute; |
||||
right: 8px; |
||||
top: 3px; |
||||
|
||||
cursor: pointer; |
||||
} |
||||
} |
||||
} |
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,543 +1,310 @@
|
||||
/* |
||||
* @Descripttion: |
||||
* @version: |
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Author: sueRimn |
||||
* @Date: 2020-09-01 15:24:39 |
||||
* @LastEditors: sueRimn |
||||
* @LastEditTime: 2021-07-21 08:54:04 |
||||
*/ |
||||
import { Component, OnInit } from "@angular/core"; |
||||
import { Router } from "@angular/router"; |
||||
import { EchartsDataService } from "../../echarts-data.service"; |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { Router } from '@angular/router'; |
||||
import {EchartsDataService,} from '../../echarts-data.service' |
||||
declare var echarts: any; |
||||
declare var CryptoJS; |
||||
declare var CryptoJS |
||||
|
||||
@Component({ |
||||
selector: "app-page-one", |
||||
templateUrl: "./page-one.component.html", |
||||
styleUrls: ["./page-one.component.scss"], |
||||
selector: 'app-page-one', |
||||
templateUrl: './page-one.component.html', |
||||
styleUrls: ['./page-one.component.scss'] |
||||
}) |
||||
export class PageOneComponent implements OnInit { |
||||
options: any; |
||||
options:any; |
||||
|
||||
constructor(private router: Router,public echartsData:EchartsDataService) { } |
||||
|
||||
constructor(private router: Router, public echartsData: EchartsDataService) {} |
||||
|
||||
padHw; |
||||
orid; |
||||
padHw |
||||
orid |
||||
ngOnInit() { |
||||
if (window.matchMedia("(max-width: 1400px)").matches) { |
||||
this.padHw = true; |
||||
if(window.matchMedia("(max-width: 1400px)").matches){ |
||||
this.padHw=true |
||||
//this.padjt=
|
||||
} else { |
||||
this.padHw = false; |
||||
}else{ |
||||
this.padHw=false |
||||
} |
||||
if (sessionStorage.getItem("refresh") === "true") { |
||||
sessionStorage.removeItem("refresh"); |
||||
if(sessionStorage.getItem('refresh') === 'true') { |
||||
sessionStorage.removeItem('refresh'); |
||||
location.reload(); |
||||
} |
||||
|
||||
window.setTimeout(() => { |
||||
this.getechartsdata(); |
||||
}); |
||||
} |
||||
|
||||
window.setTimeout(()=>{ |
||||
this.getechartsdata() |
||||
}) |
||||
let jwt = sessionStorage.getItem("token"); |
||||
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split(".")[1]); |
||||
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); |
||||
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); |
||||
let identityJsonparse = JSON.parse(identityJson); |
||||
this.orid = identityJsonparse.oid; |
||||
let identityJsonparse=JSON.parse(identityJson) |
||||
this.orid=identityJsonparse.oid |
||||
//console.log(identityJsonparse)
|
||||
} |
||||
ngOnDestroy(): void { |
||||
if (!this.indexBzt) { |
||||
return; |
||||
} |
||||
this.indexBzt.clear(); |
||||
this.indexBzt.dispose(); |
||||
this.indexBzt.clear() |
||||
this.indexBzt.dispose() |
||||
} |
||||
async getechartsdata() { |
||||
await this.echartsData.getData(null, `/api/StatisticsAnalysis/Plans`); |
||||
this.initCharts("pieone"); |
||||
this.initCharts("pietwo"); |
||||
async getechartsdata(){ |
||||
await this.echartsData.getData(null,`/api/StatisticsAnalysis/Plans`) |
||||
this.initCharts("pieone") |
||||
this.initCharts("pietwo") |
||||
} |
||||
//级别和类型转换
|
||||
pieonetype = true; //级别
|
||||
clickhuan() { |
||||
this.pieonetype = !this.pieonetype; |
||||
this.initCharts("pieone"); |
||||
pieonetype=true//级别
|
||||
clickhuan(){ |
||||
this.pieonetype=!this.pieonetype |
||||
this.initCharts("pieone") |
||||
} |
||||
|
||||
/* 首页饼状图 */ |
||||
indexBzt; |
||||
tabledata; |
||||
count; |
||||
indexData; |
||||
planCategoriesData = []; //预案级别
|
||||
planStatusesData = []; //预案状态
|
||||
planTypeStatisticsdata = []; //预案类型
|
||||
initCharts(tid) { |
||||
this.planTypeStatisticsdata = []; |
||||
this.planCategoriesData = []; |
||||
this.tabledata = JSON.parse(JSON.stringify(this.echartsData.allDate)); |
||||
if (tid == "pieone") { |
||||
if (this.pieonetype) { |
||||
this.tabledata[0].planCategoryStatistics.planCategories.forEach( |
||||
(value, index, array) => { |
||||
if (array[index].planCategoryName == "LevelOne") { |
||||
this.planCategoriesData.push({ |
||||
name: "Ⅰ级预案", |
||||
value: array[index].count, |
||||
planStatusName: array[index].planCategoryName, |
||||
type: 1, |
||||
}); |
||||
} else if (array[index].planCategoryName == "LevelTwo") { |
||||
this.planCategoriesData.push({ |
||||
name: "Ⅱ级预案", |
||||
value: array[index].count, |
||||
planStatusName: array[index].planCategoryName, |
||||
type: 2, |
||||
}); |
||||
} else if (array[index].planCategoryName == "LevelThree") { |
||||
this.planCategoriesData.push({ |
||||
name: "Ⅲ级预案", |
||||
value: array[index].count, |
||||
planStatusName: array[index].planCategoryName, |
||||
type: 3, |
||||
}); |
||||
} else if (array[index].planCategoryName == "LevelFour") { |
||||
this.planCategoriesData.push({ |
||||
name: "Ⅳ级预案", |
||||
value: array[index].count, |
||||
planStatusName: array[index].planCategoryName, |
||||
type: 4, |
||||
}); |
||||
} else if (array[index].planCategoryName == "LevelFive") { |
||||
this.planCategoriesData.push({ |
||||
name: "Ⅴ级预案", |
||||
value: array[index].count, |
||||
planStatusName: array[index].planCategoryName, |
||||
type: 5, |
||||
}); |
||||
} |
||||
indexBzt |
||||
tabledata |
||||
count |
||||
indexData |
||||
planCategoriesData=[]//预案级别
|
||||
planStatusesData=[]//预案状态
|
||||
planTypeStatisticsdata=[]//预案类型
|
||||
initCharts(tid){ |
||||
this.planTypeStatisticsdata=[] |
||||
this.planCategoriesData=[] |
||||
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) |
||||
if(tid=='pieone') |
||||
{ |
||||
if(this.pieonetype){ |
||||
this.tabledata[0].planCategoryStatistics.planCategories.forEach((value,index,array) => { |
||||
if(array[index].planCategoryName=='LevelOne'){ |
||||
this.planCategoriesData.push({name:'Ⅰ级预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:1}) |
||||
}else if(array[index].planCategoryName=='LevelTwo'){ |
||||
this.planCategoriesData.push({name:'Ⅱ级预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:2}) |
||||
}else if(array[index].planCategoryName=='LevelThree'){ |
||||
this.planCategoriesData.push({name:'Ⅲ级预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:3}) |
||||
}else if(array[index].planCategoryName=='LevelFour'){ |
||||
this.planCategoriesData.push({name:'Ⅳ级预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:4}) |
||||
}else if(array[index].planCategoryName=='LevelFive'){ |
||||
this.planCategoriesData.push({name:'Ⅴ级预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:5}) |
||||
} |
||||
); |
||||
} else { |
||||
this.tabledata[0].planTypeStatistics.planTypes.forEach( |
||||
(value, index, array) => { |
||||
if (array[index].planTypeName == "Plan2D") { |
||||
this.planTypeStatisticsdata.push({ |
||||
name: "二维预案", |
||||
value: array[index].count, |
||||
planStatusName: array[index].planTypeName, |
||||
type: 1, |
||||
}); |
||||
} else if (array[index].planTypeName == "Plan3D") { |
||||
this.planTypeStatisticsdata.push({ |
||||
name: "三维预案", |
||||
value: array[index].count, |
||||
planStatusName: array[index].planTypeName, |
||||
type: 2, |
||||
}); |
||||
} else if (array[index].planTypeName == "Other") { |
||||
this.planTypeStatisticsdata.push({ |
||||
name: "其它预案", |
||||
value: array[index].count, |
||||
planStatusName: array[index].planTypeName, |
||||
type: 3, |
||||
}); |
||||
} else if (array[index].planTypeName == "PlanText") { |
||||
this.planTypeStatisticsdata.push({ |
||||
name: "文本预案", |
||||
value: array[index].count, |
||||
planStatusName: array[index].planTypeName, |
||||
type: 4, |
||||
}); |
||||
} |
||||
}); |
||||
}else{ |
||||
this.tabledata[0].planTypeStatistics.planTypes.forEach((value,index,array) => { |
||||
if(array[index].planTypeName=='Plan2D'){ |
||||
this.planTypeStatisticsdata.push({name:'二维预案',value:array[index].count,planStatusName:array[index].planTypeName,type:1}) |
||||
}else if(array[index].planTypeName=='Plan3D'){ |
||||
this.planTypeStatisticsdata.push({name:'三维预案',value:array[index].count,planStatusName:array[index].planTypeName,type:2}) |
||||
}else if(array[index].planTypeName=='Other'){ |
||||
this.planTypeStatisticsdata.push({name:'其它预案',value:array[index].count,planStatusName:array[index].planTypeName,type:3}) |
||||
}else if(array[index].planTypeName=='PlanText'){ |
||||
this.planTypeStatisticsdata.push({name:'文本预案',value:array[index].count,planStatusName:array[index].planTypeName,type:4}) |
||||
} |
||||
); |
||||
}); |
||||
} |
||||
} else { |
||||
this.tabledata[0].planStatusStatistics.planStatuses.forEach( |
||||
(value, index, array) => { |
||||
if (array[index].planStatusName == "New") { |
||||
this.planStatusesData.push({ |
||||
name: "预案新增", |
||||
value: array[index].count, |
||||
type: 1, |
||||
planStatusName: array[index].planStatusName, |
||||
}); |
||||
} else if (array[index].planStatusName == "Auditing") { |
||||
this.planStatusesData.push({ |
||||
name: "预案审核中", |
||||
value: array[index].count, |
||||
type: 2, |
||||
planStatusName: array[index].planStatusName, |
||||
}); |
||||
} else if (array[index].planStatusName == "Approved") { |
||||
this.planStatusesData.push({ |
||||
name: "预案审核通过", |
||||
value: array[index].count, |
||||
type: 3, |
||||
planStatusName: array[index].planStatusName, |
||||
}); |
||||
} else if (array[index].planStatusName == "Rejected") { |
||||
this.planStatusesData.push({ |
||||
name: "预案审核退回", |
||||
value: array[index].count, |
||||
type: 4, |
||||
planStatusName: array[index].planStatusName, |
||||
}); |
||||
} else if (array[index].planStatusName == "Editing") { |
||||
this.planStatusesData.push({ |
||||
name: "预案编制", |
||||
value: array[index].count, |
||||
type: 5, |
||||
planStatusName: array[index].planStatusName, |
||||
}); |
||||
} |
||||
|
||||
}else{ |
||||
this.tabledata[0].planStatusStatistics.planStatuses.forEach((value,index,array) => { |
||||
if(array[index].planStatusName=='New'){ |
||||
this.planStatusesData.push({name:'预案新增',value:array[index].count,type:1,planStatusName:array[index].planStatusName}) |
||||
}else if(array[index].planStatusName=='Auditing'){ |
||||
this.planStatusesData.push({name:'预案审核中',value:array[index].count,type:2,planStatusName:array[index].planStatusName}) |
||||
}else if(array[index].planStatusName=='Approved'){ |
||||
this.planStatusesData.push({name:'预案审核通过',value:array[index].count,type:3,planStatusName:array[index].planStatusName}) |
||||
}else if(array[index].planStatusName=='Rejected'){ |
||||
this.planStatusesData.push({name:'预案审核退回',value:array[index].count,type:4,planStatusName:array[index].planStatusName}) |
||||
}else if(array[index].planStatusName=='Editing'){ |
||||
this.planStatusesData.push({name:'预案编制',value:array[index].count,type:5,planStatusName:array[index].planStatusName}) |
||||
} |
||||
); |
||||
}); |
||||
} |
||||
|
||||
|
||||
|
||||
var ec = echarts as any; |
||||
this.indexBzt = ec.init(document.getElementById(tid), "walden"); |
||||
var options = { |
||||
this.indexBzt = ec.init(document.getElementById(tid),'walden'); |
||||
var options={ |
||||
title: { |
||||
text: |
||||
tid == "pieone" && this.pieonetype |
||||
? `预案级别统计(${this.tabledata[0].planCategoryStatistics.totalCount}份)` |
||||
: tid == "pieone" && !this.pieonetype |
||||
? `预案类型统计(${this.tabledata[0].planTypeStatistics.totalCount}份)` |
||||
: `预案状态统计(${this.tabledata[0].planStatusStatistics.totalCount}份)`, |
||||
top: "7%", |
||||
left: "center", |
||||
textStyle: { |
||||
fontSize: this.padHw ? 25 : 31, |
||||
}, |
||||
text:tid=='pieone'&&this.pieonetype?`预案级别统计(${this.tabledata[0].planCategoryStatistics.totalCount}份)` :tid=='pieone'&&!this.pieonetype?`预案类型统计(${this.tabledata[0].planTypeStatistics.totalCount}份)`:`预案状态统计(${this.tabledata[0].planStatusStatistics.totalCount}份)`, |
||||
top: "7%", |
||||
left: 'center', |
||||
textStyle:{ |
||||
fontSize:this.padHw?25: 31 |
||||
} |
||||
}, |
||||
tooltip: { |
||||
trigger: "item", |
||||
formatter: (params) => { |
||||
this.echartsData.biaogeTishiyuan(params.data, tid, this.pieonetype); |
||||
return this.echartsData.res; |
||||
}, |
||||
trigger: 'item', |
||||
formatter: (params)=>{ |
||||
this.echartsData.biaogeTishiyuan(params.data,tid,this.pieonetype) |
||||
return this.echartsData.res |
||||
} |
||||
}, |
||||
legend: { |
||||
bottom: 50, |
||||
left: "center", |
||||
//padding:20,
|
||||
// itemWidth:60,
|
||||
// itemHeight:25,
|
||||
textStyle: { |
||||
fontSize: this.padHw ? 15 : 18, |
||||
color: "#000000", |
||||
}, |
||||
data: |
||||
tid == "pieone" && this.pieonetype |
||||
? ["Ⅰ级预案", "Ⅱ级预案", "Ⅲ级预案", "Ⅳ级预案", "Ⅴ级预案"] |
||||
: tid == "pieone" && !this.pieonetype |
||||
? ["二维预案", "三维预案", "其它预案", "文本预案"] |
||||
: [ |
||||
"预案新增", |
||||
"预案审核通过", |
||||
"预案编制", |
||||
"预案审核退回", |
||||
"预案审核中", |
||||
], |
||||
left: 'center', |
||||
//padding:20,
|
||||
// itemWidth:60,
|
||||
// itemHeight:25,
|
||||
textStyle:{ |
||||
fontSize:this.padHw?15: 18, |
||||
color:"#000000" |
||||
}, |
||||
data:tid=='pieone'&&this.pieonetype?['Ⅰ级预案', 'Ⅱ级预案', 'Ⅲ级预案', 'Ⅳ级预案', 'Ⅴ级预案']:tid=='pieone'&&!this.pieonetype?['二维预案', '三维预案', '其它预案', '文本预案'] :['预案新增', '预案审核通过', '预案编制', '预案审核退回', '预案审核中'] |
||||
}, |
||||
series: [ |
||||
{ |
||||
name: "访问来源", |
||||
type: "pie", |
||||
radius: "50%", |
||||
center: ["50%", "45%"], |
||||
label: { |
||||
normal: { |
||||
show: true, |
||||
// position: 'inner',
|
||||
fontSize: this.padHw ? 14 : 18, |
||||
formatter: this.padHw ? "{b} \n{c}份({d}%)" : "{b} {c}份\n({d}%)", |
||||
}, |
||||
rich: { |
||||
d: { |
||||
align: "center", |
||||
{ |
||||
name: '访问来源', |
||||
type: 'pie', |
||||
radius: '50%', |
||||
center: ['50%', '45%'], |
||||
label:{ |
||||
normal:{ |
||||
show:true, |
||||
// position: 'inner',
|
||||
fontSize:this.padHw?14: 18, |
||||
formatter:this.padHw?'{b} \n{c}份({d}%)' :'{b} {c}份\n({d}%)', |
||||
}, |
||||
rich: { |
||||
d: { |
||||
align: 'center', |
||||
} |
||||
}, |
||||
|
||||
}, |
||||
}, |
||||
}, |
||||
data: |
||||
tid == "pieone" && this.pieonetype |
||||
? this.planCategoriesData |
||||
: tid == "pieone" && !this.pieonetype |
||||
? this.planTypeStatisticsdata |
||||
: this.planStatusesData, |
||||
emphasis: { |
||||
itemStyle: { |
||||
shadowBlur: 10, |
||||
shadowOffsetX: 0, |
||||
shadowColor: "rgba(0, 0, 0, 0.5)", |
||||
}, |
||||
}, |
||||
}, |
||||
], |
||||
data:tid=='pieone'&&this.pieonetype?this.planCategoriesData:tid=='pieone'&&!this.pieonetype?this.planTypeStatisticsdata:this.planStatusesData, |
||||
emphasis: { |
||||
itemStyle: { |
||||
shadowBlur: 10, |
||||
shadowOffsetX: 0, |
||||
shadowColor: 'rgba(0, 0, 0, 0.5)' |
||||
} |
||||
} |
||||
} |
||||
] |
||||
}; |
||||
this.indexBzt.on("click", (params) => { |
||||
this.indexBzt.on('click', (params) => { |
||||
// console.log(params)
|
||||
if (tid == "pieone") { |
||||
if (this.pieonetype) { |
||||
for ( |
||||
var i = 0; |
||||
i < this.tabledata[0].planCategoryStatistics.planCategories.length; |
||||
i++ |
||||
) { |
||||
if ( |
||||
this.tabledata[0].planCategoryStatistics.planCategories[i] |
||||
.planCategoryName == params.data.planStatusName |
||||
) { |
||||
if ( |
||||
(this.echartsData.level == "0" || |
||||
this.echartsData.level == "1" || |
||||
this.echartsData.level == "2") && |
||||
this.tabledata[0].planCategoryStatistics.planCategories[i] |
||||
.organizations.length > 0 |
||||
) { |
||||
this.tabledata[0].planCategoryStatistics.planCategories[ |
||||
i |
||||
].organizations.forEach((element, index, array) => { |
||||
if (array[index].organizationId == this.orid) { |
||||
array.splice(index, 1); |
||||
if(tid=='pieone'){ |
||||
if(this.pieonetype){ |
||||
for(var i=0;i<this.tabledata[0].planCategoryStatistics.planCategories.length;i++){ |
||||
if(this.tabledata[0].planCategoryStatistics.planCategories[i].planCategoryName==params.data.planStatusName){ |
||||
if((this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2')&&this.tabledata[0].planCategoryStatistics.planCategories[i].organizations.length>0){ |
||||
this.tabledata[0].planCategoryStatistics.planCategories[i].organizations.forEach((element,index,array) => { |
||||
if(array[index].organizationId==this.orid){ |
||||
array.splice(index,1) |
||||
} |
||||
window.setTimeout(() => { |
||||
if (array.length > 0) { |
||||
this.router.navigate( |
||||
["/statisticanalysis/statePageOne/time"], |
||||
{ |
||||
queryParams: { |
||||
level: params.name, |
||||
type: params.data.type, |
||||
tid: "pieone", |
||||
pieonetype: this.pieonetype, |
||||
}, |
||||
} |
||||
); |
||||
} else { |
||||
this.router.navigate(["/statisticanalysis/AllPlan"], { |
||||
queryParams: { |
||||
xname: params.name, |
||||
name: params.name, |
||||
id: null, |
||||
type: params.data.type, |
||||
tid: "pieone", |
||||
pieonetype: this.pieonetype, |
||||
}, |
||||
}); |
||||
window.setTimeout(()=>{ |
||||
if(array.length>0){ |
||||
this.router.navigate(['/statisticanalysis/statePageOne/time'],{queryParams:{'level':params.name,'type':params.data.type,'tid':'pieone','pieonetype':this.pieonetype}}); |
||||
} |
||||
else{ |
||||
this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'xname':params.name,'name':params.name,'id':null,'type':params.data.type,'tid':'pieone','pieonetype':this.pieonetype}}); |
||||
} |
||||
}); |
||||
}) |
||||
}); |
||||
} else if (this.echartsData.level == "3") { |
||||
|
||||
} |
||||
else if(this.echartsData.level=='3'){ |
||||
//中队跳转
|
||||
this.router.navigate(["/statisticanalysis/AllPlan"], { |
||||
queryParams: { |
||||
xname: params.name, |
||||
name: params.name, |
||||
id: null, |
||||
type: params.data.type, |
||||
tid: "pieone", |
||||
pieonetype: this.pieonetype, |
||||
}, |
||||
}); |
||||
this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'xname':params.name,'name':params.name,'id':null,'type':params.data.type,'tid':'pieone','pieonetype':this.pieonetype}}); |
||||
} |
||||
} |
||||
} |
||||
} else { |
||||
for ( |
||||
var i = 0; |
||||
i < this.tabledata[0].planTypeStatistics.planTypes.length; |
||||
i++ |
||||
) { |
||||
if ( |
||||
this.tabledata[0].planTypeStatistics.planTypes[i].planTypeName == |
||||
params.data.planStatusName |
||||
) { |
||||
if ( |
||||
(this.echartsData.level == "0" || |
||||
this.echartsData.level == "1" || |
||||
this.echartsData.level == "2") && |
||||
this.tabledata[0].planCategoryStatistics.planCategories[i] |
||||
.organizations.length > 0 |
||||
) { |
||||
this.tabledata[0].planTypeStatistics.planTypes[ |
||||
i |
||||
].organizations.forEach((element, index, array) => { |
||||
if (array[index].organizationId == this.orid) { |
||||
array.splice(index, 1); |
||||
}else{ |
||||
for(var i=0;i<this.tabledata[0].planTypeStatistics.planTypes.length;i++){ |
||||
if(this.tabledata[0].planTypeStatistics.planTypes[i].planTypeName==params.data.planStatusName){ |
||||
if((this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2')&&this.tabledata[0].planCategoryStatistics.planCategories[i].organizations.length>0){ |
||||
this.tabledata[0].planTypeStatistics.planTypes[i].organizations.forEach((element,index,array) => { |
||||
if(array[index].organizationId==this.orid){ |
||||
array.splice(index,1) |
||||
} |
||||
window.setTimeout(() => { |
||||
if (array.length > 0) { |
||||
this.router.navigate( |
||||
["/statisticanalysis/statePageOne/time"], |
||||
{ |
||||
queryParams: { |
||||
level: params.name, |
||||
type: params.data.type, |
||||
tid: "pieone", |
||||
pieonetype: this.pieonetype, |
||||
}, |
||||
} |
||||
); |
||||
} else { |
||||
this.router.navigate(["/statisticanalysis/AllPlan"], { |
||||
queryParams: { |
||||
xname: params.name, |
||||
name: params.name, |
||||
id: null, |
||||
type: params.data.type, |
||||
tid: "pieone", |
||||
pieonetype: this.pieonetype, |
||||
}, |
||||
}); |
||||
window.setTimeout(()=>{ |
||||
if(array.length>0){ |
||||
this.router.navigate(['/statisticanalysis/statePageOne/time'],{queryParams:{'level':params.name,'type':params.data.type,'tid':'pieone','pieonetype':this.pieonetype}}); |
||||
} |
||||
else{ |
||||
this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'xname':params.name,'name':params.name,'id':null,'type':params.data.type,'tid':'pieone','pieonetype':this.pieonetype}}); |
||||
} |
||||
}); |
||||
}) |
||||
}); |
||||
} else if (this.echartsData.level == "3") { |
||||
|
||||
} |
||||
else if(this.echartsData.level=='3'){ |
||||
//中队跳转
|
||||
this.router.navigate(["/statisticanalysis/AllPlan"], { |
||||
queryParams: { |
||||
xname: params.name, |
||||
name: params.name, |
||||
id: null, |
||||
type: params.data.type, |
||||
tid: "pieone", |
||||
pieonetype: this.pieonetype, |
||||
}, |
||||
}); |
||||
this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'xname':params.name,'name':params.name,'id':null,'type':params.data.type,'tid':'pieone','pieonetype':this.pieonetype}}); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} else { |
||||
for ( |
||||
var i = 0; |
||||
i < this.tabledata[0].planStatusStatistics.planStatuses.length; |
||||
i++ |
||||
) { |
||||
if ( |
||||
this.tabledata[0].planStatusStatistics.planStatuses[i] |
||||
.planStatusName == params.data.planStatusName |
||||
) { |
||||
if ( |
||||
(this.echartsData.level == "0" || |
||||
this.echartsData.level == "1" || |
||||
this.echartsData.level == "2") && |
||||
this.tabledata[0].planStatusStatistics.planStatuses[i] |
||||
.organizations.length > 0 |
||||
) { |
||||
this.tabledata[0].planStatusStatistics.planStatuses[ |
||||
i |
||||
].organizations.forEach((element, index, array) => { |
||||
if (array[index].organizationId == this.orid) { |
||||
array.splice(index, 1); |
||||
|
||||
}else{ |
||||
for(var i=0;i<this.tabledata[0].planStatusStatistics.planStatuses.length;i++){ |
||||
if(this.tabledata[0].planStatusStatistics.planStatuses[i].planStatusName==params.data.planStatusName){ |
||||
if((this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2')&&this.tabledata[0].planStatusStatistics.planStatuses[i].organizations.length>0){ |
||||
this.tabledata[0].planStatusStatistics.planStatuses[i].organizations.forEach((element,index,array) => { |
||||
if(array[index].organizationId==this.orid){ |
||||
array.splice(index,1) |
||||
} |
||||
window.setTimeout(() => { |
||||
if (array.length > 0) { |
||||
this.router.navigate( |
||||
["/statisticanalysis/statePageOne/time"], |
||||
{ |
||||
queryParams: { |
||||
level: params.name, |
||||
type: params.data.type, |
||||
tid: "pietwo", |
||||
}, |
||||
} |
||||
); |
||||
} else { |
||||
this.router.navigate(["/statisticanalysis/AllPlan"], { |
||||
queryParams: { |
||||
xname: params.name, |
||||
name: params.name, |
||||
id: null, |
||||
type: params.data.type, |
||||
tid: "pietwo", |
||||
}, |
||||
}); |
||||
window.setTimeout(()=>{ |
||||
if(array.length>0){ |
||||
this.router.navigate(['/statisticanalysis/statePageOne/time'],{queryParams:{'level':params.name,'type':params.data.type,'tid':'pietwo'}}); |
||||
} |
||||
}); |
||||
else{ |
||||
this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'xname':params.name,'name':params.name,'id':null,'type':params.data.type,'tid':'pietwo'}}); |
||||
} |
||||
}) |
||||
}); |
||||
} else if (this.echartsData.level == "3") { |
||||
|
||||
} |
||||
else if(this.echartsData.level=='3'){ |
||||
//中队跳转
|
||||
this.router.navigate(["/statisticanalysis/AllPlan"], { |
||||
queryParams: { |
||||
xname: params.name, |
||||
name: params.name, |
||||
id: null, |
||||
type: params.data.type, |
||||
tid: "pietwo", |
||||
}, |
||||
}); |
||||
this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'xname':params.name,'name':params.name,'id':null,'type':params.data.type,'tid':'pietwo'}}); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
}); |
||||
this.indexBzt.setOption(options); |
||||
} |
||||
/** |
||||
* @name: 表格提示框封装 |
||||
* @test: test font |
||||
* @msg: |
||||
* @msg:
|
||||
* @param {string(表头)} |
||||
* @return {type} |
||||
* @return {type}
|
||||
*/ |
||||
biaogeTishi(biaotou: string) { |
||||
var shuju = |
||||
'[{"name":"浦东支队","number":"156","zhanbi":"3%"},{"name":"黄浦支队","number":"144","zhanbi":"2.8%"},'; |
||||
shuju += |
||||
'{"name":"徐汇支队","number":"133","zhanbi":"2.1%"},{"name":"长宁支队","number":"122","zhanbi":"1.6%"},'; |
||||
shuju += |
||||
'{"name":"静安支队","number":"120","zhanbi":"1.3%"},{"name":"普陀支队","number":"100","zhanbi":"1.1%"},'; |
||||
shuju += |
||||
'{"name":"虹口支队","number":"95","zhanbi":"1%"},{"name":"杨浦支队","number":"90","zhanbi":"0.9%"},'; |
||||
shuju += |
||||
'{"name":"闵行支队","number":"88","zhanbi":"0.8%"},{"name":"宝山支队","number":"83","zhanbi":"0.7%"},'; |
||||
shuju += |
||||
'{"name":"徐汇支队","number":"133","zhanbi":"2.1%"},{"name":"长宁支队","number":"122","zhanbi":"1.6%"},'; |
||||
shuju += |
||||
'{"name":"嘉定支队","number":"78","zhanbi":"0.6%"},{"name":"松江支队","number":"75","zhanbi":"0.5%"},'; |
||||
shuju += |
||||
'{"name":"金山支队","number":"65","zhanbi":"0.4%"},{"name":"崇明支队","number":"55","zhanbi":"0.3%"}]'; |
||||
var jsonObj = JSON.parse(shuju); |
||||
var res = |
||||
'<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#000000;font-size:30px;text-align: center;display:block;">' + |
||||
biaotou + |
||||
"</span></div>"; |
||||
res += |
||||
'</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px; background:#FFFFFF; color:#000000;border-collapse:collapse;"cellspacing="0"; >'; |
||||
res += "<thead><tr>"; |
||||
res += |
||||
'<td style="text-align:center;width:30%;border:1px solid #000000">名称</td>'; |
||||
res += |
||||
'<td style="text-align:center;width:30%;border:1px solid #000000">数量</td>'; |
||||
res += |
||||
'<td style="text-align:center;width:30%;border:1px solid #000000">总占比</td>'; |
||||
res += "</tr></thead>"; |
||||
res += "<tbody>"; |
||||
for (var i = 0; i < jsonObj.length; i++) { |
||||
res += "<tr>"; |
||||
res += |
||||
'<td style="text-align:center;border:1px solid #000000">' + |
||||
jsonObj[i].name + |
||||
"</td>"; |
||||
res += |
||||
'<td style="text-align:center;border:1px solid #000000">' + |
||||
jsonObj[i].number + |
||||
"</td>"; |
||||
res += |
||||
'<td style="text-align:center;border:1px solid #000000">' + |
||||
jsonObj[i].zhanbi + |
||||
"</td></tr>"; |
||||
} |
||||
|
||||
res += "</tbody>"; |
||||
res += |
||||
'<tfoot><td style="text-align:center;border:1px solid #000000">总计</td><td style="text-align:center;border:1px solid #000000">1356</td><td style="text-align:center;border:1px solid #000000">19%</td></tfoot>'; |
||||
res += "</table></div></div>"; |
||||
return res; |
||||
biaogeTishi(biaotou:string){ |
||||
var shuju='[{"name":"浦东支队","number":"156","zhanbi":"3%"},{"name":"黄浦支队","number":"144","zhanbi":"2.8%"},' |
||||
shuju+='{"name":"徐汇支队","number":"133","zhanbi":"2.1%"},{"name":"长宁支队","number":"122","zhanbi":"1.6%"},' |
||||
shuju+='{"name":"静安支队","number":"120","zhanbi":"1.3%"},{"name":"普陀支队","number":"100","zhanbi":"1.1%"},' |
||||
shuju+='{"name":"虹口支队","number":"95","zhanbi":"1%"},{"name":"杨浦支队","number":"90","zhanbi":"0.9%"},' |
||||
shuju+='{"name":"闵行支队","number":"88","zhanbi":"0.8%"},{"name":"宝山支队","number":"83","zhanbi":"0.7%"},' |
||||
shuju+='{"name":"徐汇支队","number":"133","zhanbi":"2.1%"},{"name":"长宁支队","number":"122","zhanbi":"1.6%"},' |
||||
shuju+='{"name":"嘉定支队","number":"78","zhanbi":"0.6%"},{"name":"松江支队","number":"75","zhanbi":"0.5%"},' |
||||
shuju+='{"name":"金山支队","number":"65","zhanbi":"0.4%"},{"name":"崇明支队","number":"55","zhanbi":"0.3%"}]' |
||||
var jsonObj = JSON.parse(shuju); |
||||
var res = '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#000000;font-size:30px;text-align: center;display:block;">'+biaotou+'</span></div>' |
||||
res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px; background:#FFFFFF; color:#000000;border-collapse:collapse;"cellspacing="0"; >'; |
||||
res+='<thead><tr>'; |
||||
res+='<td style="text-align:center;width:30%;border:1px solid #000000">名称</td>'; |
||||
res+='<td style="text-align:center;width:30%;border:1px solid #000000">数量</td>' |
||||
res+='<td style="text-align:center;width:30%;border:1px solid #000000">总占比</td>' |
||||
res+='</tr></thead>' |
||||
res+='<tbody>'; |
||||
for(var i=0;i<jsonObj.length;i++){ |
||||
res+='<tr>' |
||||
res+='<td style="text-align:center;border:1px solid #000000">'+jsonObj[i].name+'</td>' |
||||
res+='<td style="text-align:center;border:1px solid #000000">'+jsonObj[i].number+'</td>' |
||||
res+='<td style="text-align:center;border:1px solid #000000">'+jsonObj[i].zhanbi+'</td></tr>' |
||||
} |
||||
|
||||
res+='</tbody>' |
||||
res+='<tfoot><td style="text-align:center;border:1px solid #000000">总计</td><td style="text-align:center;border:1px solid #000000">1356</td><td style="text-align:center;border:1px solid #000000">19%</td></tfoot>' |
||||
res+='</table></div></div>' |
||||
return res |
||||
} |
||||
|
||||
} |
||||
|
@ -1,8 +0,0 @@
|
||||
<div class="box"> |
||||
<button mat-button style="position: absolute;left: 50%;top: 0;z-index: 999;" (click)="createimg()">生成图片</button> |
||||
<div id="mapxxx"></div> |
||||
<div class="img"> |
||||
<img [src]="canvasImg" alt=""> |
||||
</div> |
||||
</div> |
||||
|
@ -1,17 +0,0 @@
|
||||
.box{ |
||||
width: 100%; |
||||
height: 100%; |
||||
display: flex; |
||||
#mapxxx{ |
||||
width: 500px; |
||||
height: 500px; |
||||
} |
||||
.img{ |
||||
width: 500px; |
||||
height: 500px; |
||||
img{ |
||||
width: 500px; |
||||
height: 500px; |
||||
} |
||||
} |
||||
} |
@ -1,25 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { TestComponent } from './test.component'; |
||||
|
||||
describe('TestComponent', () => { |
||||
let component: TestComponent; |
||||
let fixture: ComponentFixture<TestComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ TestComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(TestComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue