Compare commits
35 Commits
Author | SHA1 | Date |
---|---|---|
|
311da85ea1 | 3 months ago |
|
3799207fad | 3 months ago |
|
cca7eb69cb | 3 months ago |
|
f549bdddee | 4 months ago |
|
5477317eb3 | 6 months ago |
|
39832ce94f | 11 months ago |
|
ed1f680b76 | 11 months ago |
|
1d34e328e3 | 11 months ago |
|
0980d84ca3 | 1 year ago |
|
8e24430c91 | 1 year ago |
|
de4f21a50e | 1 year ago |
|
3b3d841de0 | 1 year ago |
|
0e576e149f | 1 year ago |
|
0b0405af2c | 1 year ago |
|
c5bdcd5fa7 | 1 year ago |
|
56bb98000e | 1 year ago |
|
c897c18244 | 1 year ago |
|
a9706d32e3 | 1 year ago |
|
8fe4e0a875 | 1 year ago |
|
892a11cbe9 | 1 year ago |
|
c4ebd842cd | 1 year ago |
|
b1c382b51d | 1 year ago |
|
e4b418048d | 1 year ago |
|
326b7dc782 | 2 years ago |
|
4fa2f38f51 | 2 years ago |
|
5b6f55359e | 2 years ago |
|
d48ab61752 | 2 years ago |
|
b4d4c892a6 | 2 years ago |
|
34a45a0c3a | 2 years ago |
|
af5da5c315 | 2 years ago |
|
de0f601460 | 2 years ago |
|
53387b0c59 | 2 years ago |
|
39e6672992 | 2 years ago |
|
748e932959 | 2 years ago |
|
627a19c13f | 2 years ago |
86 changed files with 32490 additions and 9705 deletions
@ -1,63 +1,69 @@
|
||||
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 { 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"; |
||||
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 |
||||
], |
||||
providers: [httpInterceptorProviders, CacheTokenService, TreeService], |
||||
bootstrap: [AppComponent] |
||||
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], |
||||
}) |
||||
export class AppModule { } |
||||
export class AppModule {} |
||||
|
@ -1,31 +1,70 @@
|
||||
import { Injectable } from '@angular/core'; |
||||
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; |
||||
import { HttpClient } from "@angular/common/http"; |
||||
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) {} |
||||
|
||||
constructor(private router: Router) { |
||||
// 路由守卫
|
||||
async canActivate( |
||||
next: ActivatedRouteSnapshot, |
||||
state: RouterStateSnapshot |
||||
): Promise<boolean> { |
||||
console.log("next", next); |
||||
console.log("state", state); |
||||
|
||||
if ( |
||||
next.queryParams.singleSignOn && |
||||
next.queryParams.singleSignOn === "true" |
||||
) { |
||||
//执行自动登录逻辑
|
||||
await this.onSubmit(); |
||||
} |
||||
return this.checkLogin(); |
||||
} |
||||
|
||||
// 路由守卫
|
||||
canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { |
||||
checkLogin(): boolean { |
||||
// 判断本地有没有token
|
||||
const token = sessionStorage.getItem("token"); |
||||
|
||||
return this.checkLogin(); |
||||
// 如果有token,允许访问
|
||||
if (token) { |
||||
return true; |
||||
} |
||||
|
||||
checkLogin(): boolean { |
||||
//如果没有token,跳转登录页
|
||||
this.router.navigate(["/login"]); |
||||
return false; |
||||
} |
||||
|
||||
// 判断本地有没有token
|
||||
const token = sessionStorage.getItem('token'); |
||||
|
||||
// 如果有token,允许访问
|
||||
if (token) { return true; } |
||||
|
||||
//如果没有token,跳转登录页
|
||||
this.router.navigate(['/login']); |
||||
return false; |
||||
} |
||||
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(); |
||||
} |
||||
); |
||||
}); |
||||
} |
||||
} |
||||
|
@ -1,11 +1,73 @@
|
||||
<!-- 株洲项目:传入预案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> |
||||
<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> |
@ -1,93 +1,102 @@
|
||||
/* |
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Descripttion: |
||||
* @version: |
||||
* @Author: sueRimn |
||||
* @Date: 2020-12-24 10:59:48 |
||||
* @LastEditors: sueRimn |
||||
* @LastEditTime: 2021-04-09 17:12:59 |
||||
*/ |
||||
export interface Data { |
||||
token:string, |
||||
refreshToken:string, |
||||
expires: number, |
||||
realName:string, |
||||
level:any, |
||||
isDefaultPassword:string |
||||
token: string; |
||||
refreshToken: string; |
||||
expires: number; |
||||
realName: string; |
||||
level: any; |
||||
isDefaultPassword: string; |
||||
} |
||||
|
||||
export interface windows { |
||||
token:string |
||||
token: string; |
||||
} |
||||
export enum isno { |
||||
"是", |
||||
"否" |
||||
"是", |
||||
"否", |
||||
} |
||||
|
||||
export enum PlanTypeEnum { |
||||
"zero", |
||||
"二维预案", |
||||
"三维预案", |
||||
"three", |
||||
"其他预案", |
||||
"five", |
||||
"six", |
||||
"seven", |
||||
"卡片预案", |
||||
"none", |
||||
"teen", |
||||
"shiyi", |
||||
"shier", |
||||
"shisan", |
||||
"shisi", |
||||
"shiwu", |
||||
"文本预案" |
||||
"zero", |
||||
"二维预案", |
||||
"三维预案", |
||||
"three", |
||||
"其他预案", |
||||
"five", |
||||
"six", |
||||
"seven", |
||||
"卡片预案", |
||||
"none", |
||||
"teen", |
||||
"shiyi", |
||||
"shier", |
||||
"shisan", |
||||
"shisi", |
||||
"shiwu", |
||||
"文本预案", |
||||
} |
||||
|
||||
export enum AuditStatusEnum { |
||||
"zero", |
||||
"审核中", |
||||
"审核通过", |
||||
"two", |
||||
"终审退回", |
||||
"five", |
||||
"six", |
||||
"seven", |
||||
"未提交审核", |
||||
"nine", |
||||
"ten", |
||||
"eleven", |
||||
"twelve", |
||||
"thieteen", |
||||
"fourteen", |
||||
"fifteen", |
||||
"待终审", |
||||
"shiqi", |
||||
"shiba", |
||||
"shijiu", |
||||
"ershi", |
||||
"ershiyi", |
||||
"ershier", |
||||
"ershis", |
||||
"t1", |
||||
"t2", |
||||
"t3", |
||||
"t4", |
||||
"t5", |
||||
"t6", |
||||
"t7", |
||||
"t8", |
||||
"初审退回", |
||||
"zero", |
||||
"审核中", |
||||
"审核通过", |
||||
"two", |
||||
"终审退回", |
||||
"five", |
||||
"six", |
||||
"seven", |
||||
"未提交审核", |
||||
"nine", |
||||
"ten", |
||||
"eleven", |
||||
"twelve", |
||||
"thieteen", |
||||
"fourteen", |
||||
"fifteen", |
||||
"待终审", |
||||
"shiqi", |
||||
"shiba", |
||||
"shijiu", |
||||
"ershi", |
||||
"ershiyi", |
||||
"ershier", |
||||
"ershis", |
||||
"t1", |
||||
"t2", |
||||
"t3", |
||||
"t4", |
||||
"t5", |
||||
"t6", |
||||
"t7", |
||||
"t8", |
||||
"初审退回", |
||||
} |
||||
|
||||
export enum PlanLevelEnum { |
||||
"编制级别0", |
||||
"总队", |
||||
"支队", |
||||
"编制级别3", |
||||
"大队", |
||||
"编制级别5", |
||||
"编制级别6", |
||||
"编制级别7", |
||||
"中队" |
||||
"编制级别0", |
||||
"总队", |
||||
"支队", |
||||
"编制级别3", |
||||
"大队", |
||||
"编制级别5", |
||||
"编制级别6", |
||||
"编制级别7", |
||||
"中队", |
||||
} |
||||
|
||||
export enum PlanAuditStatusEnum { |
||||
"非审核状态" = 0, |
||||
"未提交审核" = 8, |
||||
"待审核" = 1, |
||||
"初审通过" = 16, |
||||
"初审退回" = 32, |
||||
"终审通过" = 2, |
||||
"终审退回" = 4, |
||||
} |
||||
|
@ -1,83 +1,95 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
import { isno, PlanTypeEnum, AuditStatusEnum, PlanLevelEnum } from '../interface' |
||||
@Pipe({ name: 'isno' }) |
||||
import { Pipe, PipeTransform } from "@angular/core"; |
||||
import { |
||||
isno, |
||||
PlanTypeEnum, |
||||
AuditStatusEnum, |
||||
PlanLevelEnum, |
||||
PlanAuditStatusEnum, |
||||
} from "../interface"; |
||||
@Pipe({ name: "isno" }) |
||||
export class IsnoPipe implements PipeTransform { |
||||
transform(value: boolean): string { |
||||
if (value) { |
||||
var x = 0 |
||||
} else { |
||||
x = 1 |
||||
} |
||||
return isno[x] |
||||
transform(value: boolean): string { |
||||
if (value) { |
||||
var x = 0; |
||||
} else { |
||||
x = 1; |
||||
} |
||||
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: '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 |
||||
} |
||||
@Pipe({ name: "auditState" }) |
||||
export class auditState implements PipeTransform { |
||||
transform(value: number): string { |
||||
return PlanAuditStatusEnum[value]; |
||||
} |
||||
} |
||||
|
||||
@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; |
||||
} |
||||
} |
||||
} |
||||
@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,190 +1,201 @@
|
||||
<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> |
||||
<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> |
||||
<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="!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="!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;"> |
||||
<button mat-raised-button color="primary" type="submit">查询</button> |
||||
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button> |
||||
</div> --> |
||||
</form> |
||||
</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> --> |
||||
</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> --> |
||||
</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 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 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> |
||||
<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="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> |
||||
</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> |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,10 @@
|
||||
<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> |
@ -0,0 +1,4 @@
|
||||
.box{ |
||||
max-height: 400px; |
||||
overflow-y: auto; |
||||
} |
@ -0,0 +1,25 @@
|
||||
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(); |
||||
}); |
||||
}); |
@ -0,0 +1,126 @@
|
||||
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,251 +1,296 @@
|
||||
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 |
||||
) {} |
||||
|
||||
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
|
||||
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','auditStatus','weihuStatus','openRange','projectlevel','operation']; |
||||
allorganizations:any //所有组织机构
|
||||
allunittype:any //所有单位类型
|
||||
tabledataSource:any //表格数据
|
||||
IsNewData='' //维护更新活新增
|
||||
displayedColumns: string[] = [ |
||||
"state", |
||||
"unitname", |
||||
"planname", |
||||
"addpeople", |
||||
"level", |
||||
"addtime", |
||||
"plantype", |
||||
"auditstate", |
||||
"openRange", |
||||
"projectlevel", |
||||
"operation", |
||||
]; |
||||
allorganizations: any; //所有组织机构
|
||||
allunittype: any; //所有单位类型
|
||||
tabledataSource: any; //表格数据
|
||||
IsNewData = ""; //维护更新活新增
|
||||
|
||||
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 |
||||
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; |
||||
} |
||||
this.getunitdata(); |
||||
this.getOrganizations(); |
||||
await this.getOrganizations(); |
||||
this.jsId = this.dataSource.data[0].id; |
||||
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(){ |
||||
this.http.get('/api/Organizations').subscribe( |
||||
(data:any)=>{ |
||||
this.allorganizations = data |
||||
this.dataSource.data = this.tree.toTree(data); |
||||
} |
||||
) |
||||
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(); |
||||
}); |
||||
}); |
||||
} |
||||
|
||||
//获得所有单位类型
|
||||
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,164 +1,177 @@
|
||||
<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> |
||||
</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-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> |
||||
</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="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 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 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> |
||||
</div> |
||||
</div> |
||||
<p>type-plan works!</p> |
||||
<p>type-plan works!</p> |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,187 +1,230 @@
|
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { Router } from '@angular/router'; |
||||
import { HttpClient } from '@angular/common/http' |
||||
import {EchartsDataService,} from '../../echarts-data.service' |
||||
import { map } from 'rxjs/operators'; |
||||
import { Component, OnInit } from "@angular/core"; |
||||
import { Router } from "@angular/router"; |
||||
import { HttpClient } from "@angular/common/http"; |
||||
import { EchartsDataService } from "../../echarts-data.service"; |
||||
import { map } from "rxjs/operators"; |
||||
declare var echarts: any; |
||||
@Component({ |
||||
selector: 'app-building-type-one', |
||||
templateUrl: './building-type-one.component.html', |
||||
styleUrls: ['./building-type-one.component.scss'] |
||||
selector: "app-building-type-one", |
||||
templateUrl: "./building-type-one.component.html", |
||||
styleUrls: ["./building-type-one.component.scss"], |
||||
}) |
||||
export class BuildingTypeOneComponent implements OnInit { |
||||
|
||||
constructor(private http:HttpClient,private router: Router,public echartsData:EchartsDataService) { } |
||||
constructor( |
||||
private http: HttpClient, |
||||
private router: Router, |
||||
public echartsData: EchartsDataService |
||||
) {} |
||||
|
||||
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; |
||||
} |
||||
|
||||
window.setTimeout(()=>{ |
||||
this.getechartsdata() |
||||
}) |
||||
|
||||
window.setTimeout(() => { |
||||
this.getechartsdata(); |
||||
}); |
||||
} |
||||
ngOnDestroy(): void { |
||||
this.indexBzt.clear() |
||||
this.indexBzt.dispose() |
||||
if (!this.indexBzt) { |
||||
return; |
||||
} |
||||
this.indexBzt.clear(); |
||||
this.indexBzt.dispose(); |
||||
} |
||||
async getechartsdata(){ |
||||
await this.echartsData.getData(null,`/api/StatisticsAnalysis/BuildingTypes`) |
||||
this.initCharts() |
||||
async getechartsdata() { |
||||
await this.echartsData.getData( |
||||
null, |
||||
`/api/StatisticsAnalysis/BuildingTypes` |
||||
); |
||||
this.initCharts(); |
||||
} |
||||
/* 首页饼状图 */ |
||||
indexBzt |
||||
padHw |
||||
lengthdata=[]//提示数据
|
||||
count=0//总数
|
||||
indexData=[]//所有数据
|
||||
tabledata |
||||
initCharts(){ |
||||
if(sessionStorage.getItem('refresh') === 'true') { |
||||
sessionStorage.removeItem('refresh'); |
||||
indexBzt; |
||||
padHw; |
||||
lengthdata = []; //提示数据
|
||||
count = 0; //总数
|
||||
indexData = []; //所有数据
|
||||
tabledata; |
||||
initCharts() { |
||||
if (sessionStorage.getItem("refresh") === "true") { |
||||
sessionStorage.removeItem("refresh"); |
||||
location.reload(); |
||||
} |
||||
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) |
||||
// console.log(this.tabledata)
|
||||
//console.log(this.echartsData.orid)
|
||||
for(var i=0;i<this.tabledata[0].buildingTypes.length;i++){ |
||||
this.lengthdata.push(this.tabledata[0].buildingTypes[i].buildingTypeName) |
||||
this.count=this.count+this.tabledata[0].buildingTypes[i].count |
||||
this.indexData.push(this.tabledata[0].buildingTypes[i]) |
||||
} |
||||
//JSON.parse(JSON.stringify(this.indexData).replace(/buildingTypeName/g, 'name'))
|
||||
this.indexData=this.indexData.map(v=>{return {name: v.buildingTypeName,value:v.count,id:v.buildingTypeId}}) |
||||
//console.log(this.indexData)
|
||||
this.indexBzt = echarts.init(document.getElementById('indexBzt'),'walden'); |
||||
let options={ |
||||
} |
||||
this.tabledata = JSON.parse(JSON.stringify(this.echartsData.allDate)); |
||||
// console.log(this.tabledata)
|
||||
//console.log(this.echartsData.orid)
|
||||
for (var i = 0; i < this.tabledata[0].buildingTypes.length; i++) { |
||||
this.lengthdata.push(this.tabledata[0].buildingTypes[i].buildingTypeName); |
||||
this.count = this.count + this.tabledata[0].buildingTypes[i].count; |
||||
this.indexData.push(this.tabledata[0].buildingTypes[i]); |
||||
} |
||||
//JSON.parse(JSON.stringify(this.indexData).replace(/buildingTypeName/g, 'name'))
|
||||
this.indexData = this.indexData.map((v) => { |
||||
return { name: v.buildingTypeName, value: v.count, id: v.buildingTypeId }; |
||||
}); |
||||
//console.log(this.indexData)
|
||||
this.indexBzt = echarts.init(document.getElementById("indexBzt"), "walden"); |
||||
let options = { |
||||
title: { |
||||
text: `建筑类型统计(${this.count}家)`, |
||||
left: 'center', |
||||
top: "7%", |
||||
textStyle: { |
||||
fontSize:31 |
||||
} |
||||
left: "center", |
||||
top: "7%", |
||||
textStyle: { |
||||
fontSize: 31, |
||||
}, |
||||
}, |
||||
tooltip: { |
||||
trigger: 'item', |
||||
trigger: "item", |
||||
position: this.echartsData.tableTooltipNoShow2, |
||||
formatter: (params)=>{ |
||||
this.echartsData.biaogeTishiZhi(params.data) |
||||
return this.echartsData.res |
||||
} |
||||
formatter: (params) => { |
||||
this.echartsData.biaogeTishiZhi(params.data); |
||||
return this.echartsData.res; |
||||
}, |
||||
}, |
||||
legend: { |
||||
orient: 'vertical', |
||||
orient: "vertical", |
||||
//left:this.padHw?50:0,
|
||||
right:this.padHw?20:250, |
||||
top:60, |
||||
textStyle:{ |
||||
fontSize:18, |
||||
color:"#000000" |
||||
},
|
||||
data: this.lengthdata |
||||
right: this.padHw ? 20 : 250, |
||||
top: 60, |
||||
textStyle: { |
||||
fontSize: 18, |
||||
color: "#000000", |
||||
}, |
||||
data: this.lengthdata, |
||||
}, |
||||
series: [ |
||||
{ |
||||
top:this.padHw?'15%':'0', |
||||
name: '访问来源', |
||||
type: 'pie', |
||||
radius: '60%', |
||||
center: ['50%', '53%'], |
||||
label:{ |
||||
show:true, |
||||
fontSize:18, |
||||
formatter:'{b}{c}家\n{d|({d}%)}', |
||||
top: this.padHw ? "15%" : "0", |
||||
name: "访问来源", |
||||
type: "pie", |
||||
radius: "60%", |
||||
center: ["50%", "53%"], |
||||
label: { |
||||
show: true, |
||||
fontSize: 18, |
||||
formatter: "{b}{c}家\n{d|({d}%)}", |
||||
rich: { |
||||
d: { |
||||
align: 'center', |
||||
fontSize:18 |
||||
} |
||||
align: "center", |
||||
fontSize: 18, |
||||
}, |
||||
}, |
||||
}, |
||||
data:this.indexData, |
||||
data: this.indexData, |
||||
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) => { |
||||
var index=0 |
||||
for(var i=0;i<this.tabledata[0].buildingTypes.length;i++){ |
||||
if(this.tabledata[0].buildingTypes[i].buildingTypeName==params.name){ |
||||
if((this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2')&&this.tabledata[0].buildingTypes[i].organizations.length>0){ |
||||
this.indexBzt.on("click", (params) => { |
||||
var index = 0; |
||||
for (var i = 0; i < this.tabledata[0].buildingTypes.length; i++) { |
||||
if ( |
||||
this.tabledata[0].buildingTypes[i].buildingTypeName == params.name |
||||
) { |
||||
if ( |
||||
(this.echartsData.level == "0" || |
||||
this.echartsData.level == "1" || |
||||
this.echartsData.level == "2") && |
||||
this.tabledata[0].buildingTypes[i].organizations.length > 0 |
||||
) { |
||||
//总队,支队,大队跳转
|
||||
this.tabledata[0].buildingTypes[i].organizations.forEach((value,index,array) => { |
||||
if(array[index].organizationId==this.echartsData.orid){ |
||||
array.splice(index,1) |
||||
this.tabledata[0].buildingTypes[i].organizations.forEach( |
||||
(value, index, array) => { |
||||
if (array[index].organizationId == this.echartsData.orid) { |
||||
array.splice(index, 1); |
||||
} |
||||
if (array.length > 0) { |
||||
this.router.navigate( |
||||
[ |
||||
"/statisticanalysis/buildingType_one/buildingType_two_reverse", |
||||
], |
||||
{ queryParams: { level: params.name, id: params.data.id } } |
||||
); |
||||
} else { |
||||
this.router.navigate(["/statisticanalysis/CompangInfo"], { |
||||
queryParams: { |
||||
name: params.name, |
||||
type: 1, |
||||
buildid: params.data.id, |
||||
}, |
||||
}); |
||||
} |
||||
} |
||||
if(array.length>0){ |
||||
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_two_reverse'],{queryParams:{'level':params.name,'id':params.data.id}}); |
||||
}else{ |
||||
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1,'buildid':params.data.id}}); |
||||
} |
||||
}); |
||||
|
||||
}else { |
||||
); |
||||
} else { |
||||
//中队跳转
|
||||
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1,'buildid':params.data.id}}); |
||||
this.router.navigate(["/statisticanalysis/CompangInfo"], { |
||||
queryParams: { |
||||
name: params.name, |
||||
type: 1, |
||||
buildid: params.data.id, |
||||
}, |
||||
}); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
}); |
||||
this.indexBzt.setOption(options); |
||||
|
||||
|
||||
|
||||
} |
||||
tishiData |
||||
res:string |
||||
biaogeTishiZhi(datas){ |
||||
for(var a in this.tabledata.buildingTypes){ |
||||
if(this.tabledata.buildingTypes[a].buildingTypeId==datas.id){ |
||||
this.tishiData=this.tabledata.buildingTypes[a].organizations |
||||
tishiData; |
||||
res: string; |
||||
biaogeTishiZhi(datas) { |
||||
for (var a in this.tabledata.buildingTypes) { |
||||
if (this.tabledata.buildingTypes[a].buildingTypeId == datas.id) { |
||||
this.tishiData = this.tabledata.buildingTypes[a].organizations; |
||||
} |
||||
} |
||||
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>'; |
||||
//var res='<div class="tishi" style=" width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span >'+biaotou+'</span></div>'
|
||||
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 |
||||
|
||||
} |
||||
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>"; |
||||
//var res='<div class="tishi" style=" width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span >'+biaotou+'</span></div>'
|
||||
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; |
||||
} |
||||
} |
||||
|
@ -1,239 +1,316 @@
|
||||
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']; |
||||
} |
||||
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(); |
||||
}); |
||||
|
||||
|
||||
window.setTimeout(()=>{ |
||||
this.getechartsdata() |
||||
}) |
||||
} |
||||
|
||||
|
||||
ngOnDestroy(): void { |
||||
this.detailPlanEchart.clear() |
||||
this.detailPlanEchart.dispose() |
||||
if (!this.detailPlanEchart) { |
||||
return; |
||||
} |
||||
this.detailPlanEchart.clear(); |
||||
this.detailPlanEchart.dispose(); |
||||
} |
||||
async getechartsdata(){ |
||||
let paramsdata={ |
||||
async getechartsdata() { |
||||
let paramsdata = { |
||||
//id:this.buildingTypeId,
|
||||
organizationId:this.listorganizationId |
||||
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 |
||||
); |
||||
} |
||||
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() |
||||
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 |
||||
}, 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, |
||||
}, |
||||
}); |
||||
} |
||||
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.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 |
||||
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; |
||||
} |
||||
} |
||||
|
@ -1,393 +1,478 @@
|
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { ActivatedRoute, Router } from '@angular/router'; |
||||
import {EchartsDataService} from '../../echarts-data.service'; |
||||
import { HttpClient } from '@angular/common/http' |
||||
import { Component, OnInit } from "@angular/core"; |
||||
import { ActivatedRoute, Router } from "@angular/router"; |
||||
import { EchartsDataService } from "../../echarts-data.service"; |
||||
import { HttpClient } from "@angular/common/http"; |
||||
declare var echarts: any; |
||||
@Component({ |
||||
selector: 'app-building-type-two-reverse', |
||||
templateUrl: './building-type-two-reverse.component.html', |
||||
styleUrls: ['./building-type-two-reverse.component.scss'] |
||||
selector: "app-building-type-two-reverse", |
||||
templateUrl: "./building-type-two-reverse.component.html", |
||||
styleUrls: ["./building-type-two-reverse.component.scss"], |
||||
}) |
||||
export class BuildingTypeTwoReverseComponent implements OnInit { |
||||
constructor( |
||||
private http: HttpClient, |
||||
private router: Router, |
||||
public data: EchartsDataService, |
||||
private route: ActivatedRoute |
||||
) {} |
||||
|
||||
constructor(private http:HttpClient,private router: Router,public data:EchartsDataService,private route:ActivatedRoute) { } |
||||
|
||||
forward(){ |
||||
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_two_forward']) |
||||
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", |
||||
]); |
||||
} |
||||
headname//标题
|
||||
buildId//建筑id
|
||||
padHw//是否是华为pad
|
||||
headname; //标题
|
||||
buildId; //建筑id
|
||||
padHw; //是否是华为pad
|
||||
ngOnInit(): void { |
||||
if(window.matchMedia("(max-width: 1300px)").matches&&window.matchMedia("(max-height: 700px)").matches){ |
||||
this.padHw=true |
||||
if ( |
||||
window.matchMedia("(max-width: 1300px)").matches && |
||||
window.matchMedia("(max-height: 700px)").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(param=>{ |
||||
this.headname=param.level |
||||
this.buildId=param.id |
||||
} |
||||
this.route.queryParams.subscribe((param) => { |
||||
this.headname = param.level; |
||||
this.buildId = param.id; |
||||
}); |
||||
let paramsdata:any = { |
||||
id:this.buildId, |
||||
let paramsdata: any = { |
||||
id: this.buildId, |
||||
//organizationId:'1'
|
||||
} |
||||
|
||||
window.setTimeout(()=>{ |
||||
this.getechartsdata() |
||||
}; |
||||
|
||||
window.setTimeout(() => { |
||||
this.getechartsdata(); |
||||
}); |
||||
|
||||
} |
||||
ngOnDestroy(): void { |
||||
/* this.indexBzt.clear() |
||||
this.indexBzt.dispose() */ |
||||
this.forArr.forEach(item => { |
||||
item.echart.clear() |
||||
item.echart.dispose() |
||||
}) |
||||
if (this.forArr && this.forArr.length !== 0) { |
||||
this.forArr.forEach((item) => { |
||||
item.echart.clear(); |
||||
item.echart.dispose(); |
||||
}); |
||||
} |
||||
} |
||||
async getechartsdata(){ |
||||
await this.data.getData(null,`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildId}`) |
||||
this.tabledata=JSON.parse(JSON.stringify(this.data.allDate)) |
||||
for(var i=0;i<this.tabledata[0].organizations.length;i++){ |
||||
this.zhiNameData.push(this.tabledata[0].organizations[i].organizationName) |
||||
this.zhiNumData.push(this.tabledata[0].organizations[i].count) |
||||
this.organizationId.push(this.tabledata[0].organizations[i].organizationId) |
||||
} |
||||
this.tiaoshiPao=this.data.qipao(this.tiaoshiPao,this.zhiNumData,this.zhiNameData) |
||||
this.barEcharts() |
||||
async getechartsdata() { |
||||
await this.data.getData( |
||||
null, |
||||
`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildId}` |
||||
); |
||||
this.tabledata = JSON.parse(JSON.stringify(this.data.allDate)); |
||||
for (var i = 0; i < this.tabledata[0].organizations.length; i++) { |
||||
this.zhiNameData.push( |
||||
this.tabledata[0].organizations[i].organizationName |
||||
); |
||||
this.zhiNumData.push(this.tabledata[0].organizations[i].count); |
||||
this.organizationId.push( |
||||
this.tabledata[0].organizations[i].organizationId |
||||
); |
||||
} |
||||
this.tiaoshiPao = this.data.qipao( |
||||
this.tiaoshiPao, |
||||
this.zhiNumData, |
||||
this.zhiNameData |
||||
); |
||||
this.barEcharts(); |
||||
} |
||||
axisLabel = { |
||||
interval: 0, |
||||
rotate:38, |
||||
textStyle:{ |
||||
fontSize :16, |
||||
color:'#000000' |
||||
},
|
||||
formatter:function(value)
|
||||
{
|
||||
var ret = "";//拼接加\n返回的类目项
|
||||
var maxLength = 2;//每项显示文字个数
|
||||
var valLength = value.length;//X轴类目项的文字个数
|
||||
var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
|
||||
if (rowN > 1)//如果类目项的文字大于3,
|
||||
{
|
||||
for (var i = 0; i < rowN; i++) {
|
||||
var temp = "";//每次截取的字符串
|
||||
var start = i * maxLength;//开始截取的位置
|
||||
var end = start + maxLength;//结束截取的位置
|
||||
//这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
|
||||
temp = value.substring(start, end) + "\n";
|
||||
ret += temp; //凭借最终的字符串
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}//echarts两个字换行
|
||||
rotate: 38, |
||||
textStyle: { |
||||
fontSize: 16, |
||||
color: "#000000", |
||||
}, |
||||
formatter: function (value) { |
||||
var ret = ""; //拼接加\n返回的类目项
|
||||
var maxLength = 2; //每项显示文字个数
|
||||
var valLength = value.length; //X轴类目项的文字个数
|
||||
var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
|
||||
if (rowN > 1) { |
||||
//如果类目项的文字大于3,
|
||||
for (var i = 0; i < rowN; i++) { |
||||
var temp = ""; //每次截取的字符串
|
||||
var start = i * maxLength; //开始截取的位置
|
||||
var end = start + maxLength; //结束截取的位置
|
||||
//这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
|
||||
temp = value.substring(start, end) + "\n"; |
||||
ret += temp; //凭借最终的字符串
|
||||
} |
||||
return ret; |
||||
} else { |
||||
return value; |
||||
} |
||||
}, |
||||
}; //echarts两个字换行
|
||||
|
||||
topTextlabel = { |
||||
show: true, // 开启显示
|
||||
position: 'top', // 在上方显示
|
||||
position: "top", // 在上方显示
|
||||
distance: 10, // 距离图形元素的距离。当 position 为字符描述值(如 'top'、'insideRight')时候有效。
|
||||
verticalAlign: 'middle', |
||||
textStyle: { // 数值样式
|
||||
color: 'black', |
||||
fontSize: 12 |
||||
} |
||||
}//柱状图数值顶部显示
|
||||
verticalAlign: "middle", |
||||
textStyle: { |
||||
// 数值样式
|
||||
color: "black", |
||||
fontSize: 12, |
||||
}, |
||||
}; //柱状图数值顶部显示
|
||||
|
||||
tableDataZhi = [ {name:"浦东支队",number:"156",zhanbi:"3%"}, |
||||
{name:"黄浦支队",number:"144",zhanbi:"2.8%"}, |
||||
{name:"徐汇支队",number:"133",zhanbi:"2.1%"}, |
||||
{name:"长宁支队",number:"122",zhanbi:"1.6%"}, |
||||
{name:"静安支队",number:"120",zhanbi:"1.3%"}, |
||||
{name:"普陀支队",number:"100",zhanbi:"1.1%"}, |
||||
{name:"虹口支队",number:"95",zhanbi:"1%"}, |
||||
{name:"杨浦支队",number:"90",zhanbi:"0.9%"}, |
||||
{name:"闵行支队",number:"88",zhanbi:"0.8%"}, |
||||
{name:"宝山支队",number:"83",zhanbi:"0.7%"}, |
||||
{name:"徐汇支队",number:"133",zhanbi:"2.1%"}, |
||||
{name:"长宁支队",number:"122",zhanbi:"1.6%"}, |
||||
{name:"嘉定支队",number:"78",zhanbi:"0.6%"}, |
||||
{name:"松江支队",number:"75",zhanbi:"0.5%"}, |
||||
{name:"金山支队",number:"65",zhanbi:"0.4%"}, |
||||
{name:"崇明支队",number:"55",zhanbi:"0.3%"} ] |
||||
tableDataZhong = [ {name:"浦东中队",number:"156",zhanbi:"3%"}, |
||||
{name:"黄浦中队",number:"144",zhanbi:"2.8%"}, |
||||
{name:"徐汇中队",number:"133",zhanbi:"2.1%"}, |
||||
{name:"长宁中队",number:"122",zhanbi:"1.6%"}, |
||||
{name:"静安中队",number:"120",zhanbi:"1.3%"}, |
||||
{name:"普陀中队",number:"100",zhanbi:"1.1%"}, |
||||
{name:"虹口中队",number:"95",zhanbi:"1%"}, |
||||
{name:"杨浦中队",number:"90",zhanbi:"0.9%"}, |
||||
{name:"闵行中队",number:"88",zhanbi:"0.8%"}, |
||||
{name:"宝山中队",number:"83",zhanbi:"0.7%"}, |
||||
{name:"徐汇中队",number:"133",zhanbi:"2.1%"}, |
||||
{name:"长宁中队",number:"122",zhanbi:"1.6%"}, |
||||
{name:"嘉定中队",number:"78",zhanbi:"0.6%"}, |
||||
{name:"松江中队",number:"75",zhanbi:"0.5%"}, |
||||
{name:"金山中队",number:"65",zhanbi:"0.4%"}, |
||||
{name:"崇明中队",number:"55",zhanbi:"0.3%"} ] |
||||
zhiNameData = [] |
||||
zhiNumData = [] |
||||
tiaoshiPao:any |
||||
tableDataZhi = [ |
||||
{ name: "浦东支队", number: "156", zhanbi: "3%" }, |
||||
{ name: "黄浦支队", number: "144", zhanbi: "2.8%" }, |
||||
{ name: "徐汇支队", number: "133", zhanbi: "2.1%" }, |
||||
{ name: "长宁支队", number: "122", zhanbi: "1.6%" }, |
||||
{ name: "静安支队", number: "120", zhanbi: "1.3%" }, |
||||
{ name: "普陀支队", number: "100", zhanbi: "1.1%" }, |
||||
{ name: "虹口支队", number: "95", zhanbi: "1%" }, |
||||
{ name: "杨浦支队", number: "90", zhanbi: "0.9%" }, |
||||
{ name: "闵行支队", number: "88", zhanbi: "0.8%" }, |
||||
{ name: "宝山支队", number: "83", zhanbi: "0.7%" }, |
||||
{ name: "徐汇支队", number: "133", zhanbi: "2.1%" }, |
||||
{ name: "长宁支队", number: "122", zhanbi: "1.6%" }, |
||||
{ name: "嘉定支队", number: "78", zhanbi: "0.6%" }, |
||||
{ name: "松江支队", number: "75", zhanbi: "0.5%" }, |
||||
{ name: "金山支队", number: "65", zhanbi: "0.4%" }, |
||||
{ name: "崇明支队", number: "55", zhanbi: "0.3%" }, |
||||
]; |
||||
tableDataZhong = [ |
||||
{ name: "浦东中队", number: "156", zhanbi: "3%" }, |
||||
{ name: "黄浦中队", number: "144", zhanbi: "2.8%" }, |
||||
{ name: "徐汇中队", number: "133", zhanbi: "2.1%" }, |
||||
{ name: "长宁中队", number: "122", zhanbi: "1.6%" }, |
||||
{ name: "静安中队", number: "120", zhanbi: "1.3%" }, |
||||
{ name: "普陀中队", number: "100", zhanbi: "1.1%" }, |
||||
{ name: "虹口中队", number: "95", zhanbi: "1%" }, |
||||
{ name: "杨浦中队", number: "90", zhanbi: "0.9%" }, |
||||
{ name: "闵行中队", number: "88", zhanbi: "0.8%" }, |
||||
{ name: "宝山中队", number: "83", zhanbi: "0.7%" }, |
||||
{ name: "徐汇中队", number: "133", zhanbi: "2.1%" }, |
||||
{ name: "长宁中队", number: "122", zhanbi: "1.6%" }, |
||||
{ name: "嘉定中队", number: "78", zhanbi: "0.6%" }, |
||||
{ name: "松江中队", number: "75", zhanbi: "0.5%" }, |
||||
{ name: "金山中队", number: "65", zhanbi: "0.4%" }, |
||||
{ name: "崇明中队", number: "55", zhanbi: "0.3%" }, |
||||
]; |
||||
zhiNameData = []; |
||||
zhiNumData = []; |
||||
tiaoshiPao: any; |
||||
//气泡提示数据获取
|
||||
bianli(){ |
||||
if(this.zhiNumData.length>=1){ |
||||
var arrshuzu='['; |
||||
for(var i=0;i<this.zhiNumData.length;i++){ |
||||
arrshuzu+='{"value":'+this.zhiNumData[i]+',"coord":['+i+','+this.zhiNumData[i]+'],"name":'+'"'+this.zhiNameData[i]+'"'+'},' |
||||
} |
||||
arrshuzu=arrshuzu.substring(0,arrshuzu.length-1) |
||||
arrshuzu+=']' |
||||
this.tiaoshiPao=JSON.parse(arrshuzu) |
||||
bianli() { |
||||
if (this.zhiNumData.length >= 1) { |
||||
var arrshuzu = "["; |
||||
for (var i = 0; i < this.zhiNumData.length; i++) { |
||||
arrshuzu += |
||||
'{"value":' + |
||||
this.zhiNumData[i] + |
||||
',"coord":[' + |
||||
i + |
||||
"," + |
||||
this.zhiNumData[i] + |
||||
'],"name":' + |
||||
'"' + |
||||
this.zhiNameData[i] + |
||||
'"' + |
||||
"},"; |
||||
} |
||||
arrshuzu = arrshuzu.substring(0, arrshuzu.length - 1); |
||||
arrshuzu += "]"; |
||||
this.tiaoshiPao = JSON.parse(arrshuzu); |
||||
} |
||||
|
||||
} |
||||
forArr = [{id:'gaoceng',name:'高层',echart:null}, |
||||
{id:'dixia',name:'地下',echart:null}, |
||||
{id:'guidao',name:'轨道交通',echart:null}, |
||||
{id:'huagong',name:'化工生产',echart:null}, |
||||
{id:'chuguan',name:'储罐类',echart:null}, |
||||
{id:'changfang',name:'厂房',echart:null}, |
||||
{id:'gujianzhu',name:'古建筑',echart:null}, |
||||
{id:'shichang',name:'商市场',echart:null}, |
||||
{id:'yiyuan',name:'医院',echart:null}, |
||||
{id:'xuexiao',name:'学校',echart:null}, |
||||
{id:'binguan',name:'宾馆',echart:null}, |
||||
{id:'yule',name:'娱乐场所',echart:null}, |
||||
{id:'canyin',name:'餐饮业',echart:null}, |
||||
{id:'yingyuan',name:'影剧院',echart:null}, |
||||
{id:'zhanlan',name:'展览建筑',echart:null}, |
||||
{id:'suidao',name:'隧道',echart:null}] |
||||
|
||||
|
||||
forArr = [ |
||||
{ id: "gaoceng", name: "高层", echart: null }, |
||||
{ id: "dixia", name: "地下", echart: null }, |
||||
{ id: "guidao", name: "轨道交通", echart: null }, |
||||
{ id: "huagong", name: "化工生产", echart: null }, |
||||
{ id: "chuguan", name: "储罐类", echart: null }, |
||||
{ id: "changfang", name: "厂房", echart: null }, |
||||
{ id: "gujianzhu", name: "古建筑", echart: null }, |
||||
{ id: "shichang", name: "商市场", echart: null }, |
||||
{ id: "yiyuan", name: "医院", echart: null }, |
||||
{ id: "xuexiao", name: "学校", echart: null }, |
||||
{ id: "binguan", name: "宾馆", echart: null }, |
||||
{ id: "yule", name: "娱乐场所", echart: null }, |
||||
{ id: "canyin", name: "餐饮业", echart: null }, |
||||
{ id: "yingyuan", name: "影剧院", echart: null }, |
||||
{ id: "zhanlan", name: "展览建筑", echart: null }, |
||||
{ id: "suidao", name: "隧道", echart: null }, |
||||
]; |
||||
|
||||
//返回
|
||||
goback(){ |
||||
sessionStorage.setItem('refresh', 'true'); |
||||
goback() { |
||||
sessionStorage.setItem("refresh", "true"); |
||||
history.go(-1); |
||||
} |
||||
/* 顶部饼状图 */ |
||||
indexBzt |
||||
initCharts(){ |
||||
|
||||
this.indexBzt = echarts.init(document.getElementById('pie'),'walden'); |
||||
let options={ |
||||
indexBzt; |
||||
initCharts() { |
||||
this.indexBzt = echarts.init(document.getElementById("pie"), "walden"); |
||||
let options = { |
||||
title: { |
||||
text: '建筑类型统计(8900家)', |
||||
left: 'center', |
||||
top: "7%", |
||||
textStyle: { |
||||
fontSize:26 |
||||
} |
||||
text: "建筑类型统计(8900家)", |
||||
left: "center", |
||||
top: "7%", |
||||
textStyle: { |
||||
fontSize: 26, |
||||
}, |
||||
}, |
||||
tooltip: { |
||||
trigger: 'item', |
||||
formatter: (params)=>{ |
||||
return this.data.tableTooltip(this.tableDataZhi,params.name) |
||||
trigger: "item", |
||||
formatter: (params) => { |
||||
return this.data.tableTooltip(this.tableDataZhi, params.name); |
||||
}, |
||||
position: this.data.tableTooltipNoShow2 |
||||
position: this.data.tableTooltipNoShow2, |
||||
}, |
||||
legend: { |
||||
orient: 'vertical', |
||||
orient: "vertical", |
||||
right: 150, |
||||
top:80, |
||||
textStyle:{ |
||||
fontSize:18, |
||||
color:"#000000" |
||||
top: 80, |
||||
textStyle: { |
||||
fontSize: 18, |
||||
color: "#000000", |
||||
}, |
||||
data: ['高层', '地下', '轨道交通', '化工生产', '储罐类' , '厂房','古建筑', '商市场', '医院', '学校', '宾馆' , '娱乐场所','餐饮业', '影剧院', '展览建筑' , '隧道'] |
||||
data: [ |
||||
"高层", |
||||
"地下", |
||||
"轨道交通", |
||||
"化工生产", |
||||
"储罐类", |
||||
"厂房", |
||||
"古建筑", |
||||
"商市场", |
||||
"医院", |
||||
"学校", |
||||
"宾馆", |
||||
"娱乐场所", |
||||
"餐饮业", |
||||
"影剧院", |
||||
"展览建筑", |
||||
"隧道", |
||||
], |
||||
}, |
||||
series: [ |
||||
{ |
||||
name: '访问来源', |
||||
type: 'pie', |
||||
radius: '70%', |
||||
center: ['50%', '60%'], |
||||
label:{ |
||||
show:true, |
||||
fontSize:16, |
||||
formatter:'{b}{c}家\n{d|({d}%)}', |
||||
name: "访问来源", |
||||
type: "pie", |
||||
radius: "70%", |
||||
center: ["50%", "60%"], |
||||
label: { |
||||
show: true, |
||||
fontSize: 16, |
||||
formatter: "{b}{c}家\n{d|({d}%)}", |
||||
rich: { |
||||
d: { |
||||
align: 'center', |
||||
fontSize:16 |
||||
} |
||||
align: "center", |
||||
fontSize: 16, |
||||
}, |
||||
}, |
||||
}, |
||||
data: [ |
||||
{value: 500, name: '高层'}, |
||||
{value: 800, name: '地下'}, |
||||
{value: 900, name: '轨道交通'}, |
||||
{value: 800, name: '化工生产'}, |
||||
{value: 1200, name: '储罐类'}, |
||||
{value: 1500, name: '厂房'}, |
||||
{value: 1400, name: '古建筑'}, |
||||
{value: 600, name: '商市场'}, |
||||
{value: 568, name: '医院'}, |
||||
{value: 888, name: '学校'}, |
||||
{value: 485, name: '宾馆'}, |
||||
{value: 966, name: '娱乐场所'}, |
||||
{value: 789, name: '餐饮业'}, |
||||
{value: 500, name: '影剧院'}, |
||||
{value: 1025, name: '展览建筑'}, |
||||
{value: 600, name: '隧道'} |
||||
{ value: 500, name: "高层" }, |
||||
{ value: 800, name: "地下" }, |
||||
{ value: 900, name: "轨道交通" }, |
||||
{ value: 800, name: "化工生产" }, |
||||
{ value: 1200, name: "储罐类" }, |
||||
{ value: 1500, name: "厂房" }, |
||||
{ value: 1400, name: "古建筑" }, |
||||
{ value: 600, name: "商市场" }, |
||||
{ value: 568, name: "医院" }, |
||||
{ value: 888, name: "学校" }, |
||||
{ value: 485, name: "宾馆" }, |
||||
{ value: 966, name: "娱乐场所" }, |
||||
{ value: 789, name: "餐饮业" }, |
||||
{ value: 500, name: "影剧院" }, |
||||
{ value: 1025, name: "展览建筑" }, |
||||
{ value: 600, name: "隧道" }, |
||||
], |
||||
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) => { |
||||
this.indexBzt.on("click", (params) => { |
||||
// this.router.navigateByUrl('/statisticanalysis/buildingType_two_forward');
|
||||
}); |
||||
this.indexBzt.setOption(options); |
||||
} |
||||
//柱状图
|
||||
lengthdata=[]//提示数据
|
||||
count=0//总数
|
||||
indexData=[]//所有数据
|
||||
organizationId=[] |
||||
tabledata |
||||
barEcharts(){ |
||||
this.forArr.forEach(item=>{ |
||||
let _this = this |
||||
item.echart = echarts.init(document.getElementById('gaoceng'),'walden'); |
||||
let option = { |
||||
title: { |
||||
text: this.headname+this.tabledata[0].totalCount, |
||||
left: "center", |
||||
top:this.padHw?"18":"0", |
||||
bottom:this.padHw?"0":'510', |
||||
lengthdata = []; //提示数据
|
||||
count = 0; //总数
|
||||
indexData = []; //所有数据
|
||||
organizationId = []; |
||||
tabledata; |
||||
barEcharts() { |
||||
this.forArr.forEach((item) => { |
||||
let _this = this; |
||||
item.echart = echarts.init(document.getElementById("gaoceng"), "walden"); |
||||
let option = { |
||||
title: { |
||||
text: this.headname + this.tabledata[0].totalCount, |
||||
left: "center", |
||||
top: this.padHw ? "18" : "0", |
||||
bottom: this.padHw ? "0" : "510", |
||||
textStyle: { |
||||
fontSize: 30, |
||||
}, |
||||
}, |
||||
grid: { |
||||
//top: 90,
|
||||
bottom: "18%", |
||||
}, |
||||
xAxis: { |
||||
id: this.organizationId, |
||||
type: "category", |
||||
data: this.zhiNameData, |
||||
axisLabel: { |
||||
//this.axisLabel,
|
||||
interval: 0, |
||||
rotate: 28, |
||||
textStyle: { |
||||
fontSize: 30 |
||||
} |
||||
fontSize: 16, |
||||
color: "#000000", |
||||
}, |
||||
}, |
||||
grid: { |
||||
//top: 90,
|
||||
bottom: '18%', |
||||
}, |
||||
xAxis: { |
||||
id:this.organizationId, |
||||
type: 'category', |
||||
data: this.zhiNameData, |
||||
axisLabel:{ |
||||
//this.axisLabel,
|
||||
interval: 0, |
||||
rotate:28, |
||||
textStyle:{ |
||||
fontSize :16, |
||||
color:'#000000' |
||||
} |
||||
|
||||
} |
||||
yAxis: { |
||||
type: "value", |
||||
axisLabel: { |
||||
//this.axisLabel,
|
||||
textStyle: { |
||||
fontSize: 16, |
||||
color: "#000000", |
||||
}, |
||||
}, |
||||
yAxis: { |
||||
type: 'value', |
||||
axisLabel:{ |
||||
//this.axisLabel,
|
||||
textStyle:{ |
||||
fontSize :16, |
||||
color:'#000000' |
||||
} |
||||
|
||||
} |
||||
}, |
||||
tooltip: { |
||||
trigger: "item", |
||||
formatter: (params) => { |
||||
return this.tableTooltip(params); |
||||
}, |
||||
tooltip: { |
||||
trigger: 'item', |
||||
formatter: (params)=>{ |
||||
return this.tableTooltip(params) |
||||
position: this.data.tableTooltipNoShow2, |
||||
}, |
||||
series: [ |
||||
{ |
||||
data: this.zhiNumData, |
||||
type: "bar", |
||||
markPoint: { |
||||
data: this.tiaoshiPao, |
||||
}, |
||||
position: this.data.tableTooltipNoShow2 |
||||
}, |
||||
series: [{ |
||||
data: this.zhiNumData, |
||||
type: 'bar', |
||||
markPoint: { |
||||
data:this.tiaoshiPao |
||||
//showBackground: true,
|
||||
backgroundStyle: { |
||||
color: "rgba(220, 220, 220, 0.8)", |
||||
}, |
||||
//showBackground: true,
|
||||
backgroundStyle: { |
||||
color: 'rgba(220, 220, 220, 0.8)' |
||||
barWidth: "38", |
||||
//label: this.topTextlabel
|
||||
}, |
||||
], |
||||
}; |
||||
item.echart.setOption(option); |
||||
item.echart.getZr().on("click", (params) => { |
||||
const pointInPixel = [params.offsetX, params.offsetY]; |
||||
if (item.echart.containPixel("grid", pointInPixel)) { |
||||
let xIndex = item.echart.convertFromPixel({ seriesIndex: 0 }, [ |
||||
params.offsetX, |
||||
params.offsetY, |
||||
])[0]; |
||||
/*事件处理代码书写位置*/ |
||||
if ( |
||||
(this.data.level == "0" || this.data.level == "1") && |
||||
this.tabledata[0].organizations[xIndex].subOrganizations.length >= 1 |
||||
) { |
||||
//总队,支队跳转
|
||||
this.router.navigate( |
||||
[ |
||||
"/statisticanalysis/buildingType_one/buildingType_three_details", |
||||
], |
||||
{ |
||||
queryParams: { |
||||
organizationName: option.xAxis.data[xIndex], |
||||
buildingTypeName: this.headname, |
||||
buildId: this.buildId, |
||||
organizationId: option.xAxis.id[xIndex], |
||||
}, |
||||
} |
||||
); |
||||
} else { |
||||
this.router.navigate(["/statisticanalysis/CompangInfo"], { |
||||
queryParams: { |
||||
name: option.xAxis.data[xIndex], |
||||
type: 1, |
||||
jsid: option.xAxis.id[xIndex], |
||||
buildid: this.buildId, |
||||
}, |
||||
barWidth :'38', |
||||
//label: this.topTextlabel
|
||||
}] |
||||
}; |
||||
item.echart.setOption(option); |
||||
item.echart.getZr().on('click', (params) => { |
||||
const pointInPixel= [params.offsetX, params.offsetY]; |
||||
if (item.echart.containPixel('grid',pointInPixel)) { |
||||
let xIndex=item.echart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0]; |
||||
/*事件处理代码书写位置*/ |
||||
if((this.data.level=='0'||this.data.level=='1')&&this.tabledata[0].organizations[xIndex].subOrganizations.length>=1){ |
||||
//总队,支队跳转
|
||||
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_three_details'],{queryParams:{'organizationName':option.xAxis.data[xIndex],'buildingTypeName':this.headname,'buildId':this.buildId,'organizationId':option.xAxis.id[xIndex]}}) |
||||
} |
||||
else{ |
||||
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':option.xAxis.data[xIndex],'type':1,'jsid':option.xAxis.id[xIndex],'buildid':this.buildId}}); |
||||
}); |
||||
} |
||||
//this.router.navigate(['/statisticanalysis/delete_one/delete_four'],{queryParams:{'level':this.option.xAxis.data[xIndex]+headName}});
|
||||
} |
||||
//this.router.navigate(['/statisticanalysis/delete_one/delete_four'],{queryParams:{'level':this.option.xAxis.data[xIndex]+headName}});
|
||||
} |
||||
|
||||
}); |
||||
}) |
||||
|
||||
|
||||
}); |
||||
}); |
||||
} |
||||
|
||||
//提示框表格
|
||||
res |
||||
tishiData |
||||
tableTooltip(datas){ |
||||
for(var a in this.data.obdata[0].organizations){ |
||||
if(this.data.obdata[0].organizations[a].organizationName==datas.name){ |
||||
this.tishiData=this.data.obdata[0].organizations[a].subOrganizations |
||||
res; |
||||
tishiData; |
||||
tableTooltip(datas) { |
||||
for (var a in this.data.obdata[0].organizations) { |
||||
if (this.data.obdata[0].organizations[a].organizationName == datas.name) { |
||||
this.tishiData = this.data.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.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 |
||||
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; |
||||
} |
||||
} |
||||
|
@ -1,153 +1,195 @@
|
||||
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{ |
||||
this.indexBzt.clear() |
||||
this.indexBzt.dispose() |
||||
ngOnDestroy(): void { |
||||
if (this.indexBzt) { |
||||
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 |
||||
} |
||||
}, |
||||
|
||||
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)' |
||||
} |
||||
} |
||||
} |
||||
] |
||||
}, |
||||
}, |
||||
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,227 +1,311 @@
|
||||
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 |
||||
) {} |
||||
|
||||
constructor(private router: Router,public dialog: MatDialog,public snackBar: MatSnackBar,private serviceData: EchartsDataService,public route: ActivatedRoute) { } |
||||
|
||||
year:String |
||||
buildingTypeName:String |
||||
level:String |
||||
setTimeoutObj//延时器需要清除
|
||||
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.dateInit(); |
||||
this.bianli(); |
||||
this.route.queryParams.subscribe((params) => { |
||||
this.year = params["level"]; |
||||
this.buildingTypeName = params["headtext"]; |
||||
}); |
||||
this.setTimeoutObj = window.setTimeout(() => { |
||||
this.detailEcharts(); |
||||
}); |
||||
this.setTimeoutObj = window.setTimeout(()=>{ |
||||
this.detailEcharts() |
||||
}) |
||||
} |
||||
ngOnDestroy(){ |
||||
ngOnDestroy() { |
||||
window.clearTimeout(this.setTimeoutObj); |
||||
this.detailPlanEchart.clear() |
||||
this.detailPlanEchart.dispose() |
||||
if (this.detailPlanEchart) { |
||||
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 |
||||
}, |
||||
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){ |
||||
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 |
||||
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; |
||||
} |
||||
} |
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,310 +1,543 @@
|
||||
/* |
||||
* @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; |
||||
|
||||
constructor(private router: Router,public echartsData:EchartsDataService) { } |
||||
options: any; |
||||
|
||||
padHw |
||||
orid |
||||
constructor(private router: Router, public echartsData: EchartsDataService) {} |
||||
|
||||
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 { |
||||
this.indexBzt.clear() |
||||
this.indexBzt.dispose() |
||||
if (!this.indexBzt) { |
||||
return; |
||||
} |
||||
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; |
||||
} |
||||
} |
||||
|
@ -0,0 +1,15 @@
|
||||
<h1 mat-dialog-title>新增App-Key</h1> |
||||
<div mat-dialog-content> |
||||
<mat-form-field style="width: 100%;"> |
||||
<mat-label>app名称</mat-label> |
||||
<input matInput [(ngModel)]="nameData.applicationName"> |
||||
</mat-form-field> |
||||
<mat-form-field style="width: 100%;"> |
||||
<mat-label>厂商名称</mat-label> |
||||
<input matInput [(ngModel)]="nameData.companyName"> |
||||
</mat-form-field> |
||||
</div> |
||||
<div mat-dialog-actions> |
||||
<button mat-button (click)="onNoClick()">取消</button> |
||||
<button mat-button (click)="onClick()" cdkFocusInitial>确定</button> |
||||
</div> |
@ -0,0 +1,39 @@
|
||||
<div class="app_key_box"> |
||||
<button mat-flat-button color="primary" (click)="openDialog()">新增appKey</button> |
||||
<mat-table [dataSource]="dataSource" class="mat-elevation-z8"> |
||||
<ng-container matColumnDef="num"> |
||||
<mat-header-cell *matHeaderCellDef> 序号 </mat-header-cell> |
||||
<mat-cell *matCellDef="let element;let i =index"> |
||||
{{i+1}} |
||||
</mat-cell> |
||||
</ng-container> |
||||
<ng-container matColumnDef="id"> |
||||
<mat-header-cell *matHeaderCellDef> appKey </mat-header-cell> |
||||
<mat-cell *matCellDef="let element"> {{element.id}} </mat-cell> |
||||
</ng-container> |
||||
<ng-container matColumnDef="applicationName"> |
||||
<mat-header-cell *matHeaderCellDef> app名称 </mat-header-cell> |
||||
<mat-cell *matCellDef="let element"> {{element.applicationName}} </mat-cell> |
||||
</ng-container> |
||||
<ng-container matColumnDef="companyName"> |
||||
<mat-header-cell *matHeaderCellDef> 厂商 </mat-header-cell> |
||||
<mat-cell *matCellDef="let element"> {{element.companyName}} </mat-cell> |
||||
</ng-container> |
||||
<ng-container matColumnDef="appSecret"> |
||||
<mat-header-cell *matHeaderCellDef> appSecret </mat-header-cell> |
||||
<mat-cell *matCellDef="let element"> {{element.appSecret}} </mat-cell> |
||||
</ng-container> |
||||
<ng-container matColumnDef="creationTime"> |
||||
<mat-header-cell *matHeaderCellDef> 创建时间 </mat-header-cell> |
||||
<mat-cell *matCellDef="let element"> {{element.creationTime | date:'yyyy-MM-dd HH:mm:ss' }} </mat-cell> |
||||
</ng-container> |
||||
<ng-container matColumnDef="operate"> |
||||
<mat-header-cell *matHeaderCellDef> 操作 </mat-header-cell> |
||||
<mat-cell *matCellDef="let element;let i =index"> |
||||
<span class="delete" (click)="delete(element,i)">删除</span> |
||||
</mat-cell> |
||||
</ng-container> |
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row> |
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row> |
||||
</mat-table> |
||||
</div> |
@ -0,0 +1,18 @@
|
||||
.app_key_box { |
||||
box-sizing: border-box; |
||||
padding: 10px 20px; |
||||
} |
||||
button { |
||||
margin-bottom: 10px; |
||||
} |
||||
|
||||
table { |
||||
width: 100%; |
||||
} |
||||
.mat-column-num { |
||||
flex: 0.3; |
||||
} |
||||
.delete { |
||||
cursor: pointer; |
||||
color: #f44336; |
||||
} |
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { AppKeyComponent } from './app-key.component'; |
||||
|
||||
describe('AppKeyComponent', () => { |
||||
let component: AppKeyComponent; |
||||
let fixture: ComponentFixture<AppKeyComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ AppKeyComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(AppKeyComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,99 @@
|
||||
import { HttpClient } from "@angular/common/http"; |
||||
import { Component, Inject, OnInit } from "@angular/core"; |
||||
import { |
||||
MatDialog, |
||||
MatDialogRef, |
||||
MAT_DIALOG_DATA, |
||||
} from "@angular/material/dialog"; |
||||
import { MatSnackBar } from "@angular/material/snack-bar"; |
||||
|
||||
@Component({ |
||||
selector: "app-app-key", |
||||
templateUrl: "./app-key.component.html", |
||||
styleUrls: ["./app-key.component.scss"], |
||||
}) |
||||
export class AppKeyComponent implements OnInit { |
||||
constructor(public dialog: MatDialog, private http: HttpClient) {} |
||||
displayedColumns: string[] = [ |
||||
"num", |
||||
"id", |
||||
"applicationName", |
||||
"companyName", |
||||
"appSecret", |
||||
"creationTime", |
||||
"operate", |
||||
]; |
||||
dataSource: any; |
||||
ngOnInit(): void { |
||||
this.getList(); |
||||
} |
||||
|
||||
getList() { |
||||
this.http.get("/api/ExternalApplications").subscribe((res) => { |
||||
this.dataSource = res; |
||||
}); |
||||
} |
||||
openDialog(): void { |
||||
const dialogRef = this.dialog.open(AddKeyDialog, { |
||||
width: "300px", |
||||
data: {}, |
||||
}); |
||||
dialogRef.afterClosed().subscribe((result) => { |
||||
console.log("uuu", result); |
||||
if (result) { |
||||
console.log("uuu", this.dataSource); |
||||
this.dataSource.push(result); |
||||
this.dataSource = [...this.dataSource]; |
||||
} |
||||
}); |
||||
} |
||||
delete(element, index) { |
||||
const isTrue = confirm("你确定要删除这个AppKey吗?"); |
||||
if (isTrue) { |
||||
this.http |
||||
.delete(`/api/ExternalApplications/${element.id}`) |
||||
.subscribe((res) => { |
||||
console.log("删除成功"); |
||||
this.dataSource.splice(index, 1); |
||||
this.dataSource = [...this.dataSource]; |
||||
}); |
||||
} |
||||
} |
||||
} |
||||
|
||||
@Component({ |
||||
selector: "add-key", |
||||
templateUrl: "./add-key.html", |
||||
}) |
||||
export class AddKeyDialog { |
||||
constructor( |
||||
private http: HttpClient, |
||||
public dialogRef: MatDialogRef<AddKeyDialog>, |
||||
@Inject(MAT_DIALOG_DATA) public data: any, |
||||
private _snackBar: MatSnackBar |
||||
) {} |
||||
|
||||
nameData = { |
||||
applicationName: "", |
||||
companyName: "", |
||||
}; |
||||
|
||||
onNoClick(): void { |
||||
this.dialogRef.close(); |
||||
} |
||||
|
||||
onClick() { |
||||
if (!this.nameData.applicationName || !this.nameData.companyName) { |
||||
return; |
||||
} |
||||
let body = this.nameData; |
||||
this.http.post("/api/ExternalApplications", body).subscribe((res) => { |
||||
this.dialogRef.close(res); |
||||
this._snackBar.open("新建成功", "确定", { |
||||
duration: 500, |
||||
horizontalPosition: "center", |
||||
verticalPosition: "top", |
||||
}); |
||||
}); |
||||
} |
||||
} |
@ -1,109 +1,126 @@
|
||||
mat-tree{ |
||||
width:800px; |
||||
button{ |
||||
display: block; |
||||
float: right; |
||||
} |
||||
mat-tree-node{ |
||||
position: relative; |
||||
mat-tree { |
||||
width: 800px; |
||||
button { |
||||
display: block; |
||||
float: right; |
||||
} |
||||
mat-tree-node { |
||||
position: relative; |
||||
|
||||
.deleted{ |
||||
position: absolute; |
||||
right: 0px; |
||||
} |
||||
.deleted { |
||||
position: absolute; |
||||
right: 0px; |
||||
} |
||||
|
||||
.disabled{ |
||||
position: absolute; |
||||
right: 40px; |
||||
} |
||||
.disabled { |
||||
position: absolute; |
||||
right: 40px; |
||||
} |
||||
|
||||
.edit{ |
||||
position: absolute; |
||||
right:160px; |
||||
} |
||||
.create{ |
||||
position: absolute; |
||||
right: 200px; |
||||
} |
||||
.up{ |
||||
position: absolute; |
||||
right: 120px; |
||||
} |
||||
.down{ |
||||
position: absolute; |
||||
right: 80px; |
||||
} |
||||
.edit { |
||||
position: absolute; |
||||
right: 160px; |
||||
} |
||||
} |
||||
form{ |
||||
text-align: center; |
||||
button{ |
||||
margin: 0 8px; |
||||
margin-top: 8px; |
||||
.create { |
||||
position: absolute; |
||||
right: 200px; |
||||
} |
||||
.up { |
||||
position: absolute; |
||||
right: 120px; |
||||
} |
||||
.down { |
||||
position: absolute; |
||||
right: 80px; |
||||
} |
||||
} |
||||
} |
||||
form { |
||||
text-align: center; |
||||
button { |
||||
margin: 0 8px; |
||||
margin-top: 8px; |
||||
} |
||||
} |
||||
|
||||
.leftbox{ |
||||
width: 300px; |
||||
float: left; |
||||
.leftbox { |
||||
width: 300px; |
||||
float: left; |
||||
} |
||||
.treebox{ |
||||
float: right; |
||||
height: 250px; |
||||
width: 300px; |
||||
/* overflow: auto; */ |
||||
overflow-x: hidden; |
||||
overflow-y: auto; |
||||
.treebox { |
||||
float: right; |
||||
height: 250px; |
||||
width: 300px; |
||||
/* overflow: auto; */ |
||||
overflow-x: hidden; |
||||
overflow-y: auto; |
||||
} |
||||
.smalltreebox{ |
||||
.smalltreebox { |
||||
width: 300px; |
||||
mat-tree-node { |
||||
width: 300px; |
||||
mat-tree-node{ |
||||
width: 300px; |
||||
} |
||||
} |
||||
} |
||||
.orilist{ |
||||
list-style: none; |
||||
|
||||
.orilist { |
||||
list-style: none; |
||||
} |
||||
.orilist:hover{ |
||||
cursor: pointer; |
||||
background-color: rgba(225, 225, 225, 0.8); |
||||
.orilist:hover { |
||||
cursor: pointer; |
||||
background-color: rgba(225, 225, 225, 0.8); |
||||
} |
||||
|
||||
.box{ |
||||
div{ |
||||
float: left; |
||||
.box { |
||||
box-sizing: border-box; |
||||
padding: 12px; |
||||
height: 100%; |
||||
overflow-y: auto; |
||||
position: relative; |
||||
div { |
||||
float: left; |
||||
} |
||||
.rightDiv { |
||||
display: flex; |
||||
flex-direction: column; |
||||
border: 1px solid gray; |
||||
border-radius: 6px; |
||||
box-sizing: border-box; |
||||
padding: 20px; |
||||
|
||||
.topbox { |
||||
display: flex; |
||||
height: 40px; |
||||
line-height: 40px; |
||||
} |
||||
.rightDiv{ |
||||
.listBox { |
||||
width: 100%; |
||||
text-align: center; |
||||
li { |
||||
display: flex; |
||||
flex-direction: column; |
||||
border: 1px solid gray; |
||||
border-radius: 6px; |
||||
justify-content: space-between; |
||||
box-sizing: border-box; |
||||
padding: 20px; |
||||
|
||||
.topbox{ |
||||
display: flex; |
||||
height: 40px; |
||||
line-height: 40px; |
||||
} |
||||
.listBox{ |
||||
width: 100%; |
||||
text-align: center; |
||||
li{ |
||||
display: flex; |
||||
justify-content: space-between; |
||||
box-sizing: border-box; |
||||
padding: 3px 6px; |
||||
align-items: center; |
||||
.btnbox{ |
||||
display: flex; |
||||
align-items: center; |
||||
button{ |
||||
margin: 0 2px; |
||||
} |
||||
} |
||||
} |
||||
padding: 3px 6px; |
||||
align-items: center; |
||||
.btnbox { |
||||
display: flex; |
||||
align-items: center; |
||||
button { |
||||
margin: 0 2px; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
.spinner { |
||||
position: absolute; |
||||
width: 100%; |
||||
height: 100%; |
||||
background-color: rgba(125, 125, 125, 0.3); |
||||
z-index: 999; |
||||
left: 0; |
||||
top: 0; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
} |
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,53 +1,59 @@
|
||||
/* |
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Descripttion: |
||||
* @version: |
||||
* @Author: sueRimn |
||||
* @Date: 2021-01-29 15:54:45 |
||||
* @LastEditors: sueRimn |
||||
* @LastEditTime: 2021-05-20 10:14:47 |
||||
*/ |
||||
import { Routes, RouterModule } from '@angular/router'; |
||||
import { NgModule } from '@angular/core'; |
||||
import { UiComponent } from './ui.component'; |
||||
import { PaginatorComponent } from './paginator/paginator.component'; |
||||
import { UserdataComponent } from './userdata/userdata.component'; |
||||
import { OrganizationComponent } from './organization/organization.component'; |
||||
import { UnittypeComponent } from './unittype/unittype.component'; |
||||
import { AuthorityComponent } from './authority/authority.component'; |
||||
import { RoleComponent } from './role/role.component'; |
||||
import { UsermanagementComponent } from './usermanagement/usermanagement.component'; |
||||
import { NavmenusComponent } from './navmenus/navmenus.component'; |
||||
import { FireProtectionElementsComponent } from './fire-protection-elements/fire-protection-elements.component'; |
||||
import {MaterialBankComponent} from './material-bank/material-bank.component' |
||||
import {UnitInformationComponent} from './unit-information/unit-information.component' |
||||
import { EnterpriseuserComponent } from './enterpriseuser/enterpriseuser.component'; |
||||
import { FireFightingFacilitiesFormworkComponent } from './fire-fighting-facilities-formwork/fire-fighting-facilities-formwork.component' |
||||
import { CollectionToolsComponent } from './collection-tools/collection-tools.component'; |
||||
import { PlanTemplateComponent } from './plan-template/plan-template.component' |
||||
|
||||
|
||||
import { Routes, RouterModule } from "@angular/router"; |
||||
import { NgModule } from "@angular/core"; |
||||
import { UiComponent } from "./ui.component"; |
||||
import { PaginatorComponent } from "./paginator/paginator.component"; |
||||
import { UserdataComponent } from "./userdata/userdata.component"; |
||||
import { OrganizationComponent } from "./organization/organization.component"; |
||||
import { UnittypeComponent } from "./unittype/unittype.component"; |
||||
import { AuthorityComponent } from "./authority/authority.component"; |
||||
import { RoleComponent } from "./role/role.component"; |
||||
import { UsermanagementComponent } from "./usermanagement/usermanagement.component"; |
||||
import { NavmenusComponent } from "./navmenus/navmenus.component"; |
||||
import { FireProtectionElementsComponent } from "./fire-protection-elements/fire-protection-elements.component"; |
||||
import { MaterialBankComponent } from "./material-bank/material-bank.component"; |
||||
import { UnitInformationComponent } from "./unit-information/unit-information.component"; |
||||
import { EnterpriseuserComponent } from "./enterpriseuser/enterpriseuser.component"; |
||||
import { FireFightingFacilitiesFormworkComponent } from "./fire-fighting-facilities-formwork/fire-fighting-facilities-formwork.component"; |
||||
import { CollectionToolsComponent } from "./collection-tools/collection-tools.component"; |
||||
import { PlanTemplateComponent } from "./plan-template/plan-template.component"; |
||||
import { AppKeyComponent } from "./app-key/app-key.component"; |
||||
|
||||
const routes: Routes = [ |
||||
{ path: '', component: UiComponent}, |
||||
{ path: 'paginator', component:PaginatorComponent }, |
||||
{ path: 'userdata', component:UserdataComponent }, |
||||
{ path: 'organization', component:OrganizationComponent }, |
||||
{ path: 'unittype', component:UnittypeComponent }, |
||||
{ path: 'authority', component:AuthorityComponent }, |
||||
{ path: 'role', component:RoleComponent }, |
||||
{ path: 'usermanagement', component:UsermanagementComponent }, |
||||
{ path: 'navmenus', component:NavmenusComponent }, |
||||
{ path: 'fireProtectionElements', component:FireProtectionElementsComponent }, |
||||
{ path: 'materialBank', component:MaterialBankComponent }, |
||||
{ path: 'unitInformation', component:UnitInformationComponent }, |
||||
{ path: 'enterpriseuser', component:EnterpriseuserComponent }, |
||||
{ path: 'fireFightingFacilitiesFormwork', component:FireFightingFacilitiesFormworkComponent }, |
||||
{ path: 'collectionTools', component:CollectionToolsComponent }, |
||||
{ path: 'PlanTemplate', component:PlanTemplateComponent }, |
||||
{ path: "", component: UiComponent }, |
||||
{ path: "paginator", component: PaginatorComponent }, |
||||
{ path: "userdata", component: UserdataComponent }, |
||||
{ path: "organization", component: OrganizationComponent }, |
||||
{ path: "unittype", component: UnittypeComponent }, |
||||
{ path: "authority", component: AuthorityComponent }, |
||||
{ path: "role", component: RoleComponent }, |
||||
{ path: "usermanagement", component: UsermanagementComponent }, |
||||
{ path: "navmenus", component: NavmenusComponent }, |
||||
{ |
||||
path: "fireProtectionElements", |
||||
component: FireProtectionElementsComponent, |
||||
}, |
||||
{ path: "materialBank", component: MaterialBankComponent }, |
||||
{ path: "unitInformation", component: UnitInformationComponent }, |
||||
{ path: "enterpriseuser", component: EnterpriseuserComponent }, |
||||
{ |
||||
path: "fireFightingFacilitiesFormwork", |
||||
component: FireFightingFacilitiesFormworkComponent, |
||||
}, |
||||
{ path: "collectionTools", component: CollectionToolsComponent }, |
||||
{ path: "PlanTemplate", component: PlanTemplateComponent }, |
||||
{ path: "appkey", component: AppKeyComponent }, |
||||
]; |
||||
|
||||
@NgModule({ |
||||
imports: [RouterModule.forChild(routes)], |
||||
exports: [RouterModule] |
||||
imports: [RouterModule.forChild(routes)], |
||||
exports: [RouterModule], |
||||
}) |
||||
export class UiRoutingModule {} |
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue