Browse Source

一体化任务刷新跳转bug

非煤矿山灾害智能感知和预警系统
jingbowen 3 years ago
parent
commit
805a8805d1
  1. 686
      src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html
  2. 1146
      src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.scss
  3. 560
      src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts
  4. 42
      src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.html
  5. 66
      src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.ts
  6. 120
      src/app/home/task/da-subordinate-audit/da-subordinate-audit.component.html
  7. 322
      src/app/home/task/da-subordinate-audit/da-subordinate-audit.component.scss
  8. 478
      src/app/home/task/da-subordinate-audit/da-subordinate-audit.component.ts
  9. 220
      src/app/home/task/station-task-apply/station-task-apply.component.html
  10. 396
      src/app/home/task/station-task-apply/station-task-apply.component.ts
  11. 92
      src/app/home/task/task.component.html
  12. 44
      src/app/home/task/task.component.ts
  13. 166
      src/app/http-interceptors/base-interceptor.ts
  14. 266
      src/app/pages/login/login.component.ts
  15. 84
      src/app/service/cache-token.service.ts
  16. 444
      src/styles.scss

686
src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html

@ -1,344 +1,344 @@
<!-- <p>月度任务总览</p> -->
<div class="box">
<div class="timebox">
<nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<nz-option [nzValue]="2022" nzLabel="2022年"></nz-option>
</nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.id == selectedMonth}">
{{item.name}}
</div>
</div>
<div style="flex: 1;overflow-y: auto;">
<!-- 上部仪表盘 -->
<div class="instrumentpanelbox">
<div class="instrumentpanelheader">
<span><img src="../../../../assets/images/icon/task1.png" alt=""> 上级任务指标</span>
</div>
<div class="instrumentpanel">
<div class="instrumentpanelitem instrumentpanelitemclose" *ngFor="let item of cardData">
<div class="itemone" *ngIf="!item.isDetails">
<div class="instrumentpanelitemleft">
<div class="panelheadername" [style]="'background:'+ item.background">
<img [src]="'../../../../assets/images/icon/'+ item.icon" alt="">
{{item.name}}
</div>
<div class="tasknum">
<p>
<span style="margin-right: 6px;">任务分配</span>
<i (click)="openDetails(item,true)"
style="vertical-align: text-top;cursor: pointer;" nz-icon nzType="right-circle"
nzTheme="outline"></i>
</p>
<p style="font-weight: 900;font-size: 36px;text-align: left;">5/9</p>
</div>
<div class="jindu">
<p>
<span>完成率</span>
<span>60%</span>
</p>
<nz-progress style="width: 100%;" [nzPercent]="75" nzStrokeColor="#42B983"
[nzShowInfo]="false"></nz-progress>
</div>
</div>
</div>
<div class="itemtwo" *ngIf="item.isDetails">
<p class="itemtwotitle">
<span>{{item.name}}</span>
<span class="back" (click)="openDetails(item,false)"><i nz-icon nzType="rollback"
nzTheme="outline"></i>返回</span>
</p>
<div class="itemtwocontent">
<div class="itemtwocontentitem">
<p class="itemtwocontentitemp1">
<span class="itemtwocontentitemp1name">济南历下森豪室内娱乐场</span>
</p>
<p>
<span class="green" style="margin-right: 12px;">已分配</span>
<span class="green">已检查</span>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 下级任务申请 -->
<div class="taskaudit">
<div class="taskauditheader">
<span><img src="../../../../assets/images/icon/task.png" alt=""> 下级任务申请</span>
<span (click)="istaskauditexpand()" class="expand blue">
{{istaskauditExpanded ? '收起' :'展开'}}
<i nz-icon [nzType]="istaskauditExpanded ? 'down' : 'up'" nzTheme="outline"></i>
</span>
</div>
<!-- 任务 -->
<div *ngIf="istaskauditExpanded">
<div class="taskauditbox" *ngFor="let item of taskData">
<div class="header">
<span>{{item.name}}</span>
<span (click)="expand(item)" class="expand blue">
{{item.isExpand ? '收起' :'展开'}}
<i nz-icon [nzType]="item.isExpand ? 'down' : 'up'" nzTheme="outline"></i>
</span>
</div>
<div class="content" *ngIf="item.isExpand">
<div *ngFor="let i of item.list" class="card greencard"
[ngClass]="{'redcard': i.approvalStatus == 'reject'}">
<div class="unitname">
<img src="../../../../assets/images/icon/unit.png" alt="">
<span>{{i.company.companyName}}</span>
</div>
<div class="info">
<span>
<img src="../../../../assets/images/icon/main.png" alt="">
{{i.mainSupervisor ? i.mainSupervisor.name : '未分配'}}
</span>
<span>
<img src="../../../../assets/images/icon/assist.png" alt="">
{{i.assitantSupervisor ? i.assitantSupervisor.name : '未分配'}}
</span>
<span class="blue" (click)="allot(i)">分配</span>
<span>|</span>
<span>申请人: {{i.assitantOrganization.name}}</span>
<!-- <span class="blue">修改</span> -->
</div>
<div class="btn">
<button [ngClass]="{'forbidbtn': i.approvalStatus}" [disabled]="i.approvalStatus"
nz-button (click)="agree(i)">同意</button>
<button [ngClass]="{'forbidbtn': i.approvalStatus}" [disabled]="i.approvalStatus"
nz-button (click)="reject(i)">驳回</button>
</div>
<img *ngIf="i.approvalStatus == 'reject'" class="auditimg"
src="../../../../assets/images/icon/reject.png" alt="">
<img *ngIf="i.approvalStatus == 'approved'" class="auditimg"
src="../../../../assets/images/icon/agree.png" alt="">
</div>
</div>
</div>
</div>
</div>
<!-- 本级部署 -->
<div class="deploybox">
<div class="deployboxheader">
<span><img src="../../../../assets/images/icon/task0.png" alt=""> 本级部署</span>
<span (click)="isdeployboxexpand()" class="expand blue">
{{isdeployboxExpanded ? '收起' :'展开'}}
<i nz-icon [nzType]="isdeployboxExpanded ? 'down' : 'up'" nzTheme="outline"></i>
</span>
</div>
<div class="deploycontent" *ngIf="isdeployboxExpanded">
<div class="deploycontentitem">
<div class="title">
月计划统计
</div>
<div class="details">
<div class="detailsname">
月计划总数
<span style="font-weight: 18;font-size: 26px;margin-left: 10px;">15</span>
</div>
<span>已完成 15</span>
<span class="progresssquare">
<span>完成率</span>
<nz-progress nzStrokeLinecap="square" style="width: 70%;margin-bottom: 3px;"
[nzPercent]="75" nzStrokeColor="#42B983" [nzShowInfo]="false" [nzStrokeWidth]="18">
</nz-progress>
<span>75%</span>
</span>
</div>
</div>
<div class="deploycontentitem">
<div class="title">
周计划统计
</div>
<div class="details">
<div class="detailsname">
周计划总数
<span style="font-weight: 18;font-size: 26px;margin-left: 10px;">15</span>
</div>
<span>已完成 15</span>
<span class="progresssquare">
<span>完成率</span>
<nz-progress nzStrokeLinecap="square" style="width: 70%;margin-bottom: 3px;"
[nzPercent]="75" nzStrokeColor="#42B983" [nzShowInfo]="false" [nzStrokeWidth]="18">
</nz-progress>
<span>75%</span>
</span>
</div>
</div>
</div>
</div>
<!-- 救援站列表 -->
<div class="stationcardlistbox">
<div class="stationcardlistitembox" *ngFor="let item of stationData">
<div class="stationcardlistitem">
<div class="header">
<span style="width: 16%;">
<img src="../../../../assets//images/icon/station.png" alt="">
{{item.name}}
</span>
<span style="width: 8%;">单位总数: 7/8</span>
<div style="width: 66%;" class="progress progresssquare">
<span>完成进度</span>
<nz-progress nzStrokeLinecap="square" nzStrokeWidth="16" nzStrokeColor="#42B983"
[nzPercent]="30"></nz-progress>
</div>
<button nz-button nzType="primary">任务下派</button>
<span (click)="expandcarditem(item)" class="expand blue">
{{item.isExpand ? '收起' :'展开'}}
<i nz-icon [nzType]="item.isExpand ? 'down' : 'up'" nzTheme="outline"></i>
</span>
</div>
<div class="maincontent" *ngIf="item.isExpand">
<div class="maincontentitem">
<div class="maincontentitemleft">
<div class="panelheadername panelheadernameor">
<img src="'../../../../assets/images/icon/huodong.png" alt="">
重大活动
</div>
<div class="num">
<div class="round" style="background: #2C4DC0;"></div>
<span class="word">已分配</span>
<span class="boldspan">1</span>
</div>
<div class="num">
<div class="round" style="background: #42B983;"></div>
<span class="word">已完成</span>
<span class="boldspan">1</span>
</div>
</div>
<div class="maincontentitemright">
<div class="maincontentitemrightitem">
<div class="flexcol namebox">
<span>
尬粒酒店管理有限公司济南泺文路分公司
</span>
<span>
单位名称
</span>
</div>
<div class="flexcol">
<span>
重点单位
</span>
<span>
级别
</span>
</div>
<div class="flexcol">
<span>
历下区A消防救援站
</span>
<span>
责任机构
</span>
</div>
<div class="flexcol">
<span>
历下区B消防救援站
</span>
<span>
协助机构
</span>
</div>
<div class="flexcol">
<span>
宣传
</span>
<span>
同步工作
</span>
</div>
<div class="flexcol progressbox progresssquare">
<span>
<nz-progress style="width: 200px;" nzStrokeLinecap="square"
nzStrokeWidth="16" nzStrokeColor="#42B983" [nzPercent]="30">
</nz-progress>
</span>
<span>
进度
</span>
</div>
<div class="btnbox">
<button nz-button nzType="primary">提交审核</button>
<button style="margin-left: 12px;" nz-button nzType="primary">取消</button>
</div>
</div>
<div class="maincontentitemrightitem">
<div class="flexcol namebox">
<span>
尬粒酒店管理有限公司济南泺文路分公司
</span>
<span>
单位名称
</span>
</div>
<div class="flexcol">
<span>
重点单位
</span>
<span>
级别
</span>
</div>
<div class="flexcol">
<span>
历下区A消防救援站
</span>
<span>
责任机构
</span>
</div>
<div class="flexcol">
<span>
历下区B消防救援站
</span>
<span>
协助机构
</span>
</div>
<div class="flexcol">
<span>
宣传
</span>
<span>
同步工作
</span>
</div>
<div class="flexcol progressbox progresssquare">
<span>
<nz-progress style="width: 200px;" nzStrokeLinecap="square"
nzStrokeWidth="16" nzStrokeColor="#42B983" [nzPercent]="30">
</nz-progress>
</span>
<span>
进度
</span>
</div>
<div class="btnbox">
<button nz-button nzType="primary">提交审核</button>
<button style="margin-left: 12px;" nz-button nzType="primary">取消</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- -->
<div class="cutoffrule"></div>
</div>
<!-- <p>月度任务总览</p> -->
<div class="box">
<div class="timebox">
<nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<nz-option [nzValue]="2022" nzLabel="2022年"></nz-option>
</nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.id == selectedMonth}">
{{item.name}}
</div>
</div>
<div style="flex: 1;overflow-y: auto;">
<!-- 上部仪表盘 -->
<div class="instrumentpanelbox">
<div class="instrumentpanelheader">
<span><img src="../../../../assets/images/icon/task1.png" alt=""> 上级任务指标</span>
</div>
<div class="instrumentpanel">
<div class="instrumentpanelitem instrumentpanelitemclose" *ngFor="let item of cardData">
<div class="itemone" *ngIf="!item.isDetails">
<div class="instrumentpanelitemleft">
<div class="panelheadername" [style]="'background:'+ item.background">
<img [src]="'../../../../assets/images/icon/'+ item.icon" alt="">
{{item.name}}
</div>
<div class="tasknum">
<p>
<span style="margin-right: 6px;">任务分配</span>
<i (click)="openDetails(item,true)"
style="vertical-align: text-top;cursor: pointer;" nz-icon nzType="right-circle"
nzTheme="outline"></i>
</p>
<p style="font-weight: 900;font-size: 36px;text-align: left;">5/9</p>
</div>
<div class="jindu">
<p>
<span>完成率</span>
<span>60%</span>
</p>
<nz-progress style="width: 100%;" [nzPercent]="75" nzStrokeColor="#42B983"
[nzShowInfo]="false"></nz-progress>
</div>
</div>
</div>
<div class="itemtwo" *ngIf="item.isDetails">
<p class="itemtwotitle">
<span>{{item.name}}</span>
<span class="back" (click)="openDetails(item,false)"><i nz-icon nzType="rollback"
nzTheme="outline"></i>返回</span>
</p>
<div class="itemtwocontent">
<div class="itemtwocontentitem">
<p class="itemtwocontentitemp1">
<span class="itemtwocontentitemp1name">济南历下森豪室内娱乐场</span>
</p>
<p>
<span class="green" style="margin-right: 12px;">已分配</span>
<span class="green">已检查</span>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 下级任务申请 -->
<div class="taskaudit">
<div class="taskauditheader">
<span><img src="../../../../assets/images/icon/task.png" alt=""> 下级任务申请</span>
<span (click)="istaskauditexpand()" class="expand blue">
{{istaskauditExpanded ? '收起' :'展开'}}
<i nz-icon [nzType]="istaskauditExpanded ? 'down' : 'up'" nzTheme="outline"></i>
</span>
</div>
<!-- 任务 -->
<div *ngIf="istaskauditExpanded">
<div class="taskauditbox" *ngFor="let item of taskData">
<div class="header">
<span>{{item.name}}</span>
<span (click)="expand(item)" class="expand blue">
{{item.isExpand ? '收起' :'展开'}}
<i nz-icon [nzType]="item.isExpand ? 'down' : 'up'" nzTheme="outline"></i>
</span>
</div>
<div class="content" *ngIf="item.isExpand">
<div *ngFor="let i of item.list" class="card greencard"
[ngClass]="{'redcard': i.approvalStatus == 'reject'}">
<div class="unitname">
<img src="../../../../assets/images/icon/unit.png" alt="">
<span>{{i.company.companyName}}</span>
</div>
<div class="info">
<span>
<img src="../../../../assets/images/icon/main.png" alt="">
{{i.mainSupervisor ? i.mainSupervisor.name : '未分配'}}
</span>
<span>
<img src="../../../../assets/images/icon/assist.png" alt="">
{{i.assitantSupervisor ? i.assitantSupervisor.name : '未分配'}}
</span>
<span class="blue" (click)="allot(i)">分配</span>
<span>|</span>
<span>申请人: {{i.assitantOrganization.name}}</span>
<!-- <span class="blue">修改</span> -->
</div>
<div class="btn">
<button [ngClass]="{'forbidbtn': i.approvalStatus}" [disabled]="i.approvalStatus"
nz-button (click)="agree(i)">同意</button>
<button [ngClass]="{'forbidbtn': i.approvalStatus}" [disabled]="i.approvalStatus"
nz-button (click)="reject(i)">驳回</button>
</div>
<img *ngIf="i.approvalStatus == 'reject'" class="auditimg"
src="../../../../assets/images/icon/reject.png" alt="">
<img *ngIf="i.approvalStatus == 'approved'" class="auditimg"
src="../../../../assets/images/icon/agree.png" alt="">
</div>
</div>
</div>
</div>
</div>
<!-- 本级部署 -->
<div class="deploybox">
<div class="deployboxheader">
<span><img src="../../../../assets/images/icon/task0.png" alt=""> 本级部署</span>
<span (click)="isdeployboxexpand()" class="expand blue">
{{isdeployboxExpanded ? '收起' :'展开'}}
<i nz-icon [nzType]="isdeployboxExpanded ? 'down' : 'up'" nzTheme="outline"></i>
</span>
</div>
<div class="deploycontent" *ngIf="isdeployboxExpanded">
<div class="deploycontentitem">
<div class="title">
月计划统计
</div>
<div class="details">
<div class="detailsname">
月计划总数
<span style="font-weight: 18;font-size: 26px;margin-left: 10px;">15</span>
</div>
<span>已完成 15</span>
<span class="progresssquare">
<span>完成率</span>
<nz-progress nzStrokeLinecap="square" style="width: 70%;margin-bottom: 3px;"
[nzPercent]="75" nzStrokeColor="#42B983" [nzShowInfo]="false" [nzStrokeWidth]="18">
</nz-progress>
<span>75%</span>
</span>
</div>
</div>
<div class="deploycontentitem">
<div class="title">
周计划统计
</div>
<div class="details">
<div class="detailsname">
周计划总数
<span style="font-weight: 18;font-size: 26px;margin-left: 10px;">15</span>
</div>
<span>已完成 15</span>
<span class="progresssquare">
<span>完成率</span>
<nz-progress nzStrokeLinecap="square" style="width: 70%;margin-bottom: 3px;"
[nzPercent]="75" nzStrokeColor="#42B983" [nzShowInfo]="false" [nzStrokeWidth]="18">
</nz-progress>
<span>75%</span>
</span>
</div>
</div>
</div>
</div>
<!-- 救援站列表 -->
<div class="stationcardlistbox">
<div class="stationcardlistitembox" *ngFor="let item of stationData">
<div class="stationcardlistitem">
<div class="header">
<span style="width: 16%;">
<img src="../../../../assets//images/icon/station.png" alt="">
{{item.name}}
</span>
<span style="width: 8%;">单位总数: 7/8</span>
<div style="width: 66%;" class="progress progresssquare">
<span>完成进度</span>
<nz-progress nzStrokeLinecap="square" nzStrokeWidth="16" nzStrokeColor="#42B983"
[nzPercent]="30"></nz-progress>
</div>
<button nz-button nzType="primary">任务下派</button>
<span (click)="expandcarditem(item)" class="expand blue">
{{item.isExpand ? '收起' :'展开'}}
<i nz-icon [nzType]="item.isExpand ? 'down' : 'up'" nzTheme="outline"></i>
</span>
</div>
<div class="maincontent" *ngIf="item.isExpand">
<div class="maincontentitem">
<div class="maincontentitemleft">
<div class="panelheadername panelheadernameor">
<img src="'../../../../assets/images/icon/huodong.png" alt="">
重大活动
</div>
<div class="num">
<div class="round" style="background: #2C4DC0;"></div>
<span class="word">已分配</span>
<span class="boldspan">1</span>
</div>
<div class="num">
<div class="round" style="background: #42B983;"></div>
<span class="word">已完成</span>
<span class="boldspan">1</span>
</div>
</div>
<div class="maincontentitemright">
<div class="maincontentitemrightitem">
<div class="flexcol namebox">
<span>
尬粒酒店管理有限公司济南泺文路分公司
</span>
<span>
单位名称
</span>
</div>
<div class="flexcol">
<span>
重点单位
</span>
<span>
级别
</span>
</div>
<div class="flexcol">
<span>
历下区A消防救援站
</span>
<span>
责任机构
</span>
</div>
<div class="flexcol">
<span>
历下区B消防救援站
</span>
<span>
协助机构
</span>
</div>
<div class="flexcol">
<span>
宣传
</span>
<span>
同步工作
</span>
</div>
<div class="flexcol progressbox progresssquare">
<span>
<nz-progress style="width: 200px;" nzStrokeLinecap="square"
nzStrokeWidth="16" nzStrokeColor="#42B983" [nzPercent]="30">
</nz-progress>
</span>
<span>
进度
</span>
</div>
<div class="btnbox">
<button nz-button nzType="primary">提交审核</button>
<button style="margin-left: 12px;" nz-button nzType="primary">取消</button>
</div>
</div>
<div class="maincontentitemrightitem">
<div class="flexcol namebox">
<span>
尬粒酒店管理有限公司济南泺文路分公司
</span>
<span>
单位名称
</span>
</div>
<div class="flexcol">
<span>
重点单位
</span>
<span>
级别
</span>
</div>
<div class="flexcol">
<span>
历下区A消防救援站
</span>
<span>
责任机构
</span>
</div>
<div class="flexcol">
<span>
历下区B消防救援站
</span>
<span>
协助机构
</span>
</div>
<div class="flexcol">
<span>
宣传
</span>
<span>
同步工作
</span>
</div>
<div class="flexcol progressbox progresssquare">
<span>
<nz-progress style="width: 200px;" nzStrokeLinecap="square"
nzStrokeWidth="16" nzStrokeColor="#42B983" [nzPercent]="30">
</nz-progress>
</span>
<span>
进度
</span>
</div>
<div class="btnbox">
<button nz-button nzType="primary">提交审核</button>
<button style="margin-left: 12px;" nz-button nzType="primary">取消</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- -->
<div class="cutoffrule"></div>
</div>
</div>

1146
src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.scss

File diff suppressed because it is too large Load Diff

560
src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts

@ -1,280 +1,280 @@
import { HttpClient } from '@angular/common/http';
import { Component, OnInit, ViewContainerRef } from '@angular/core';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
import { AllotPersonComponent } from '../da-subordinate-audit/allot-person/allot-person.component';
@Component({
selector: 'app-da-monthly-task-overview',
templateUrl: './da-monthly-task-overview.component.html',
styleUrls: ['./da-monthly-task-overview.component.scss']
})
export class DaMonthlyTaskOverviewComponent implements OnInit {
constructor(private http: HttpClient, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService) { }
OrganizationId
ngOnInit(): void {
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.selectedMonth = new Date().getMonth() + 1
this.getTaskList()
//获得主协调查人员
this.getSupervisor('main')
this.getSupervisor('assisted')
}
selectedMonth
selectedYear = 2022
selectedTime
selectMonth(item) {
this.selectedMonth = item.id
this.getTaskList()
}
selectYear(e) {
this.selectedYear = e
console.log('年', e)
this.getTaskList()
}
months = [
{ id: 1, name: '1月', isable: true },
{ id: 2, name: '2月', isable: true },
{ id: 3, name: '3月', isable: true },
{ id: 4, name: '4月', isable: true },
{ id: 5, name: '5月', isable: true },
{ id: 6, name: '6月', isable: true },
{ id: 7, name: '7月', isable: true },
{ id: 8, name: '8月', isable: true },
{ id: 9, name: '9月', isable: true },
{ id: 10, name: '10月', isable: true },
{ id: 11, name: '11月', isable: true },
{ id: 12, name: '12月', isable: true }
]
istaskauditExpanded = true
istaskauditexpand() {
this.istaskauditExpanded = !this.istaskauditExpanded
}
isdeployboxExpanded = true
isdeployboxexpand() {
this.isdeployboxExpanded = !this.isdeployboxExpanded
}
shuxiTaskData = {
isExpand: true
}
zhidaoTaskData = {
isExpand: true
}
PageNumber = 1
PageSize = 9999
taskData = [
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [], isExpand: true },
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [], isExpand: true }
]
isloading = false
getTaskList() {
this.isloading = true
this.taskData = [
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [], isExpand: true },
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [], isExpand: true }
]
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
console.log('查询时间', selectedTime)
let params = {
Month: selectedTime,
OrganizationId: this.OrganizationId,
PageNumber: this.PageNumber,
PageSize: this.PageSize
}
this.http.get('/api/PlanTasks', {
params: params
}).subscribe((data: any) => {
let arr1 = []
let arr2 = []
data.items.forEach(element => {
if (element.taskName == '熟悉演练') {
arr1.push(element)
}
if (element.taskName == '联络指导') {
arr2.push(element)
}
});
arr1.forEach(item => {
if (!!item.approvalStatus) {
this.taskData[0].finished += 1
}
});
arr2.forEach(item => {
if (!!item.approvalStatus) {
this.taskData[1].finished += 1
}
});
this.taskData[0].totalCount = arr1.length
this.taskData[0].list = [...arr1]
this.taskData[1].totalCount = arr2.length
this.taskData[1].list = [...arr2]
this.isloading = false
})
}
assitantsupervisorList
mainsupervisorList
getSupervisor(type) {
let params = {
inspectorType: type
}
this.http.get('/api/Users/Inspectors', {
params: params
}).subscribe((data: any) => {
console.log('检查员列表', data)
if (type == 'main') {
this.mainsupervisorList = data
} else {
this.assitantsupervisorList = data
}
})
}
allot(item) {
console.log(item)
if (this.mainsupervisorList.length == 0 || this.assitantsupervisorList.length == 0) {
this.message.create('warning', '请从用户管理添加检查人员');
return
}
const modal = this.modal.create({
nzTitle: '分配监督检查员',
nzContent: AllotPersonComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 485,
nzMaskClosable: false,
nzComponentParams: {
mainsupervisorList: this.mainsupervisorList,
assitantsupervisorList: this.assitantsupervisorList
},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise((resolve, reject) => {
let body = {
mainSupervisorId: instance.validateForm.value.main,
assitantSupervisorId: instance.validateForm.value.assitant
}
this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({
next: async (data) => {
this.message.create('success', '分配成功');
resolve(data)
this.getTaskList()
return true
},
error: (err) => {
this.message.create('warning', '分配失败');
reject(err)
return false
}
})
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
}
agree(item) {
this.modal.confirm({
nzTitle: `确定要同意该申请吗?`,
nzOkText: '确定',
nzOkType: 'default',
nzOnOk: () => {
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: 'approved'
}
}).subscribe({
next: (data) => {
this.message.create('success', '审核成功');
this.getTaskList()
},
error: (err) => {
this.message.create('warning', '审核失败');
}
})
},
nzCancelText: '取消'
});
}
reject(item) {
this.modal.confirm({
nzTitle: `确定要驳回该申请吗?`,
nzOkText: '确定',
nzOkType: 'default',
nzOnOk: () => {
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: 'reject'
}
}).subscribe({
next: (data) => {
this.message.create('success', '审核成功');
this.getTaskList()
},
error: (err) => {
this.message.create('warning', '审核失败');
}
})
},
nzCancelText: '取消'
});
}
expand(data) {
data.isExpand = !data.isExpand
}
formatOne = (percent: number): string => `${percent}%\n完成率`;
cardData = [
{ name: '重大活动', isDetails: false, background: '#FF9203', icon: 'huodong.png' },
{ name: '双随机', isDetails: false, background: '#1D9DFF', icon: 'suiji.png' },
{ name: '行政许可', isDetails: false, background: '#42B983', icon: 'xuke.png' },
{ name: '熟悉演练', isDetails: false, background: '#9D80FF', icon: 'yanlian.png' },
{ name: '联络指导', isDetails: false, background: '#5483EA', icon: 'zhidao.png' },
{ name: '消防宣传', isDetails: false, background: '#FF5D2A', icon: 'xuanchuan.png' },
{ name: '投诉举报', isDetails: false, background: '#5087FF', icon: 'tousu.png' },
{ name: '火灾调查', isDetails: false, background: '#FF404D', icon: 'huozai.png' }
]
openDetails(data, type) {
data.isDetails = type
}
xxx = false
radioChange(e) {
setTimeout(() => {
this.xxx = !this.xxx
}, 0);
}
stationData = [
{ name: '历下区A消防救援站', isExpand: true },
{ name: '历下区B消防救援站', isExpand: false },
{ name: '历下区C消防救援站', isExpand: false }
]
expandcarditem(item) {
item.isExpand = !item.isExpand
}
}
import { HttpClient } from '@angular/common/http';
import { Component, OnInit, ViewContainerRef } from '@angular/core';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
import { AllotPersonComponent } from '../da-subordinate-audit/allot-person/allot-person.component';
@Component({
selector: 'app-da-monthly-task-overview',
templateUrl: './da-monthly-task-overview.component.html',
styleUrls: ['./da-monthly-task-overview.component.scss']
})
export class DaMonthlyTaskOverviewComponent implements OnInit {
constructor(private http: HttpClient, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService) { }
OrganizationId
ngOnInit(): void {
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.selectedMonth = new Date().getMonth() + 1
this.getTaskList()
//获得主协调查人员
this.getSupervisor('main')
this.getSupervisor('assisted')
}
selectedMonth
selectedYear = 2022
selectedTime
selectMonth(item) {
this.selectedMonth = item.id
this.getTaskList()
}
selectYear(e) {
this.selectedYear = e
console.log('年', e)
this.getTaskList()
}
months = [
{ id: 1, name: '1月', isable: true },
{ id: 2, name: '2月', isable: true },
{ id: 3, name: '3月', isable: true },
{ id: 4, name: '4月', isable: true },
{ id: 5, name: '5月', isable: true },
{ id: 6, name: '6月', isable: true },
{ id: 7, name: '7月', isable: true },
{ id: 8, name: '8月', isable: true },
{ id: 9, name: '9月', isable: true },
{ id: 10, name: '10月', isable: true },
{ id: 11, name: '11月', isable: true },
{ id: 12, name: '12月', isable: true }
]
istaskauditExpanded = true
istaskauditexpand() {
this.istaskauditExpanded = !this.istaskauditExpanded
}
isdeployboxExpanded = true
isdeployboxexpand() {
this.isdeployboxExpanded = !this.isdeployboxExpanded
}
shuxiTaskData = {
isExpand: true
}
zhidaoTaskData = {
isExpand: true
}
PageNumber = 1
PageSize = 9999
taskData = [
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [], isExpand: true },
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [], isExpand: true }
]
isloading = false
getTaskList() {
this.isloading = true
this.taskData = [
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [], isExpand: true },
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [], isExpand: true }
]
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
console.log('查询时间', selectedTime)
let params = {
Month: selectedTime,
OrganizationId: this.OrganizationId,
PageNumber: this.PageNumber,
PageSize: this.PageSize
}
this.http.get('/api/PlanTasks', {
params: params
}).subscribe((data: any) => {
let arr1 = []
let arr2 = []
data.items.forEach(element => {
if (element.taskName == '熟悉演练') {
arr1.push(element)
}
if (element.taskName == '联络指导') {
arr2.push(element)
}
});
arr1.forEach(item => {
if (!!item.approvalStatus) {
this.taskData[0].finished += 1
}
});
arr2.forEach(item => {
if (!!item.approvalStatus) {
this.taskData[1].finished += 1
}
});
this.taskData[0].totalCount = arr1.length
this.taskData[0].list = [...arr1]
this.taskData[1].totalCount = arr2.length
this.taskData[1].list = [...arr2]
this.isloading = false
})
}
assitantsupervisorList
mainsupervisorList
getSupervisor(type) {
let params = {
inspectorType: type
}
this.http.get('/api/Users/Inspectors', {
params: params
}).subscribe((data: any) => {
console.log('检查员列表', data)
if (type == 'main') {
this.mainsupervisorList = data
} else {
this.assitantsupervisorList = data
}
})
}
allot(item) {
console.log(item)
if (this.mainsupervisorList.length == 0 || this.assitantsupervisorList.length == 0) {
this.message.create('warning', '请从用户管理添加检查人员');
return
}
const modal = this.modal.create({
nzTitle: '分配监督检查员',
nzContent: AllotPersonComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 485,
nzMaskClosable: false,
nzComponentParams: {
mainsupervisorList: this.mainsupervisorList,
assitantsupervisorList: this.assitantsupervisorList
},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise((resolve, reject) => {
let body = {
mainSupervisorId: instance.validateForm.value.main,
assitantSupervisorId: instance.validateForm.value.assitant
}
this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({
next: async (data) => {
this.message.create('success', '分配成功');
resolve(data)
this.getTaskList()
return true
},
error: (err) => {
this.message.create('warning', '分配失败');
reject(err)
return false
}
})
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
}
agree(item) {
this.modal.confirm({
nzTitle: `确定要同意该申请吗?`,
nzOkText: '确定',
nzOkType: 'default',
nzOnOk: () => {
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: 'approved'
}
}).subscribe({
next: (data) => {
this.message.create('success', '审核成功');
this.getTaskList()
},
error: (err) => {
this.message.create('warning', '审核失败');
}
})
},
nzCancelText: '取消'
});
}
reject(item) {
this.modal.confirm({
nzTitle: `确定要驳回该申请吗?`,
nzOkText: '确定',
nzOkType: 'default',
nzOnOk: () => {
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: 'reject'
}
}).subscribe({
next: (data) => {
this.message.create('success', '审核成功');
this.getTaskList()
},
error: (err) => {
this.message.create('warning', '审核失败');
}
})
},
nzCancelText: '取消'
});
}
expand(data) {
data.isExpand = !data.isExpand
}
formatOne = (percent: number): string => `${percent}%\n完成率`;
cardData = [
{ name: '重大活动', isDetails: false, background: '#FF9203', icon: 'huodong.png' },
{ name: '双随机', isDetails: false, background: '#1D9DFF', icon: 'suiji.png' },
{ name: '行政许可', isDetails: false, background: '#42B983', icon: 'xuke.png' },
{ name: '熟悉演练', isDetails: false, background: '#9D80FF', icon: 'yanlian.png' },
{ name: '联络指导', isDetails: false, background: '#5483EA', icon: 'zhidao.png' },
{ name: '消防宣传', isDetails: false, background: '#FF5D2A', icon: 'xuanchuan.png' },
{ name: '投诉举报', isDetails: false, background: '#5087FF', icon: 'tousu.png' },
{ name: '火灾调查', isDetails: false, background: '#FF404D', icon: 'huozai.png' }
]
openDetails(data, type) {
data.isDetails = type
}
xxx = false
radioChange(e) {
setTimeout(() => {
this.xxx = !this.xxx
}, 0);
}
stationData = [
{ name: '历下区A消防救援站', isExpand: true },
{ name: '历下区B消防救援站', isExpand: false },
{ name: '历下区C消防救援站', isExpand: false }
]
expandcarditem(item) {
item.isExpand = !item.isExpand
}
}

42
src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.html

@ -1,22 +1,22 @@
<div class="box">
<form nz-form [formGroup]="validateForm">
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="检查员(主)">检查员(主)</nz-form-label>
<nz-form-control>
<nz-select formControlName="main" nzPlaceHolder="请选择消防监督检查员(主)">
<nz-option *ngFor="let item of mainsupervisorList" [nzValue]="item.id" [nzLabel]="item.name">
</nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="检查员(协)">检查员(协)</nz-form-label>
<nz-form-control>
<nz-select formControlName="assitant" nzPlaceHolder="请选择消防监督检查员(协)">
<nz-option *ngFor="let item of assitantsupervisorList" [nzValue]="item.id" [nzLabel]="item.name">
</nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</form>
<div class="box">
<form nz-form [formGroup]="validateForm">
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="检查员(主)">检查员(主)</nz-form-label>
<nz-form-control>
<nz-select formControlName="main" nzPlaceHolder="请选择消防监督检查员(主)">
<nz-option *ngFor="let item of mainsupervisorList" [nzValue]="item.id" [nzLabel]="item.name">
</nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="检查员(协)">检查员(协)</nz-form-label>
<nz-form-control>
<nz-select formControlName="assitant" nzPlaceHolder="请选择消防监督检查员(协)">
<nz-option *ngFor="let item of assitantsupervisorList" [nzValue]="item.id" [nzLabel]="item.name">
</nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</form>
</div>

66
src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.ts

@ -1,33 +1,33 @@
import { Component, OnInit, Input } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
import { TreeService } from 'src/app/service/tree.service';
@Component({
selector: 'app-allot-person',
templateUrl: './allot-person.component.html',
styleUrls: ['./allot-person.component.scss']
})
export class AllotPersonComponent implements OnInit {
@Input() mainsupervisorList?: any;
@Input() assitantsupervisorList?: any;
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
ngOnInit(): void {
this.validateForm = this.fb.group({
main: [null, [Validators.required]],
assitant: [null, [Validators.required]]
});
}
destroyModal(): void {
this.modal.destroy({ data: 'this the result data' });
}
listOfData: any[] = [];
}
import { Component, OnInit, Input } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
import { TreeService } from 'src/app/service/tree.service';
@Component({
selector: 'app-allot-person',
templateUrl: './allot-person.component.html',
styleUrls: ['./allot-person.component.scss']
})
export class AllotPersonComponent implements OnInit {
@Input() mainsupervisorList?: any;
@Input() assitantsupervisorList?: any;
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
ngOnInit(): void {
this.validateForm = this.fb.group({
main: [null, [Validators.required]],
assitant: [null, [Validators.required]]
});
}
destroyModal(): void {
this.modal.destroy({ data: 'this the result data' });
}
listOfData: any[] = [];
}

120
src/app/home/task/da-subordinate-audit/da-subordinate-audit.component.html

@ -1,61 +1,61 @@
<!-- <p>下级任务申请</p> -->
<div class="box">
<div class="timebox">
<nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<nz-option [nzValue]="2022" nzLabel="2022年"></nz-option>
</nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.id == selectedMonth}">
{{item.name}}
</div>
</div>
<div class="content">
<div class="spin" *ngIf="isloading">
<nz-spin nzSimple></nz-spin>
</div>
<div class="tabheader">
<div *ngFor="let item of data" class="tabtitle" [ngClass]="{'selectedTab': selectedTab == item.id}"
(click)="selectTab(item)">
<div [ngClass]="{'blue': selectedTab == item.id}">
<span>{{item.name}}</span>
<span style="margin: 0 8px;"></span>
<span>已审批: {{item.finished}}/{{item.totalCount}}</span>
</div>
</div>
</div>
<div class="tabbody">
<div class="card greencard" [ngClass]="{'redcard': item.approvalStatus == 'reject'}"
*ngFor="let item of atPresentData.list">
<div class="unitname">
<img src="../../../../assets/images/icon/unit.png" alt="">
<span>{{item.company.companyName}}</span>
</div>
<div class="info">
<span>
<img src="../../../../assets/images/icon/main.png" alt="">
{{item.mainSupervisor ? item.mainSupervisor.name : '未分配'}}
</span>
<span>
<img src="../../../../assets/images/icon/assist.png" alt="">
{{item.assitantSupervisor ? item.assitantSupervisor.name : '未分配'}}
</span>
<span class="blue" (click)="allot(item)">分配</span>
<span>|</span>
<span>申请人: {{item.assitantOrganization.name}}</span>
<!-- <span class="blue">修改</span> -->
</div>
<div class="btn">
<button [ngClass]="{'forbidbtn': item.approvalStatus}" [disabled]="item.approvalStatus" nz-button
(click)="agree(item)">同意</button>
<button [ngClass]="{'forbidbtn': item.approvalStatus}" [disabled]="item.approvalStatus" nz-button
(click)="reject(item)">驳回</button>
</div>
<img *ngIf="item.approvalStatus == 'reject'" class="auditimg"
src="../../../../assets/images/icon/reject.png" alt="">
<img *ngIf="item.approvalStatus == 'approved'" class="auditimg"
src="../../../../assets/images/icon/agree.png" alt="">
</div>
</div>
</div>
<!-- <p>下级任务申请</p> -->
<div class="box">
<div class="timebox">
<nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<nz-option [nzValue]="2022" nzLabel="2022年"></nz-option>
</nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.id == selectedMonth}">
{{item.name}}
</div>
</div>
<div class="content">
<div class="spin" *ngIf="isloading">
<nz-spin nzSimple></nz-spin>
</div>
<div class="tabheader">
<div *ngFor="let item of data" class="tabtitle" [ngClass]="{'selectedTab': selectedTab == item.id}"
(click)="selectTab(item)">
<div [ngClass]="{'blue': selectedTab == item.id}">
<span>{{item.name}}</span>
<span style="margin: 0 8px;"></span>
<span>已审批: {{item.finished}}/{{item.totalCount}}</span>
</div>
</div>
</div>
<div class="tabbody">
<div class="card greencard" [ngClass]="{'redcard': item.approvalStatus == 'reject'}"
*ngFor="let item of atPresentData.list">
<div class="unitname">
<img src="../../../../assets/images/icon/unit.png" alt="">
<span>{{item.company.companyName}}</span>
</div>
<div class="info">
<span>
<img src="../../../../assets/images/icon/main.png" alt="">
{{item.mainSupervisor ? item.mainSupervisor.name : '未分配'}}
</span>
<span>
<img src="../../../../assets/images/icon/assist.png" alt="">
{{item.assitantSupervisor ? item.assitantSupervisor.name : '未分配'}}
</span>
<span class="blue" (click)="allot(item)">分配</span>
<span>|</span>
<span>申请人: {{item.assitantOrganization.name}}</span>
<!-- <span class="blue">修改</span> -->
</div>
<div class="btn">
<button [ngClass]="{'forbidbtn': item.approvalStatus}" [disabled]="item.approvalStatus" nz-button
(click)="agree(item)">同意</button>
<button [ngClass]="{'forbidbtn': item.approvalStatus}" [disabled]="item.approvalStatus" nz-button
(click)="reject(item)">驳回</button>
</div>
<img *ngIf="item.approvalStatus == 'reject'" class="auditimg"
src="../../../../assets/images/icon/reject.png" alt="">
<img *ngIf="item.approvalStatus == 'approved'" class="auditimg"
src="../../../../assets/images/icon/agree.png" alt="">
</div>
</div>
</div>
</div>

322
src/app/home/task/da-subordinate-audit/da-subordinate-audit.component.scss

@ -1,161 +1,161 @@
.box {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
.timebox {
width: 100%;
height: 68px;
box-sizing: border-box;
padding: 0 20px;
display: flex;
align-items: center;
nz-select {
margin-right: 16px;
border-radius: 4px 4px 4px 4px;
}
.monthbtn {
width: 80px;
height: 32px;
line-height: 32px;
background: #FFFFFF;
border-radius: 4px 4px 4px 4px;
opacity: 1;
border: 1px solid #E4E7EC;
color: #303133;
margin-right: 16px;
cursor: pointer;
}
.selectedMonth {
background: #2C4DC0;
color: #FFFFFF;
}
}
.content {
flex: 1;
overflow: hidden;
margin: 20px;
margin-top: 0px;
background: #fff;
box-shadow: 0px 3px 8px 1px rgba(0, 0, 0, 0.0800);
border-radius: 4px 4px 4px 4px;
opacity: 1;
border: 1px solid #E4E7EC;
color: #303133;
text-align: left;
display: flex;
flex-direction: column;
position: relative;
.tabheader {
width: 100%;
height: 52px;
background: #E4E7EC;
display: flex;
.tabtitle {
width: 205px;
height: 52px;
line-height: 52px;
text-align: center;
display: flex;
justify-content: center;
cursor: pointer;
div {
border-top: 2px solid #E4E7EC;
}
}
.selectedTab {
background: #fff;
div {
border-top: 2px solid #2C4DC0;
}
}
}
.tabbody {
flex: 1;
overflow-y: auto;
color: #000;
box-sizing: border-box;
padding: 18px;
.card {
color: #303133;
width: 100%;
height: 70px;
border-radius: 4px 4px 4px 4px;
opacity: 1;
display: flex;
margin-bottom: 18px;
box-sizing: border-box;
padding: 0 20px;
position: relative;
div {
display: flex;
align-items: center;
img {
margin-top: -3px;
}
}
.unitname {
flex: 3;
}
.info {
flex: 6;
span {
margin-right: 20px;
}
}
.btn {
flex: 1;
button:nth-child(1) {
background: #42B983;
color: white;
}
button:nth-child(2) {
background: #FF0000;
color: white;
margin-left: 20px;
}
}
.auditimg {
position: absolute;
right: 18%;
top: 9%;
}
}
.greencard {
background: rgba(66, 185, 131, 0.0400);
border: 1px solid rgba(66, 185, 131, 0.1600);
}
.redcard {
background: rgba(255, 0, 0, 0.0200);
border: 1px solid rgba(255, 0, 0, 0.1000);
}
}
}
.box {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
.timebox {
width: 100%;
height: 68px;
box-sizing: border-box;
padding: 0 20px;
display: flex;
align-items: center;
nz-select {
margin-right: 16px;
border-radius: 4px 4px 4px 4px;
}
.monthbtn {
width: 80px;
height: 32px;
line-height: 32px;
background: #FFFFFF;
border-radius: 4px 4px 4px 4px;
opacity: 1;
border: 1px solid #E4E7EC;
color: #303133;
margin-right: 16px;
cursor: pointer;
}
.selectedMonth {
background: #2C4DC0;
color: #FFFFFF;
}
}
.content {
flex: 1;
overflow: hidden;
margin: 20px;
margin-top: 0px;
background: #fff;
box-shadow: 0px 3px 8px 1px rgba(0, 0, 0, 0.0800);
border-radius: 4px 4px 4px 4px;
opacity: 1;
border: 1px solid #E4E7EC;
color: #303133;
text-align: left;
display: flex;
flex-direction: column;
position: relative;
.tabheader {
width: 100%;
height: 52px;
background: #E4E7EC;
display: flex;
.tabtitle {
width: 205px;
height: 52px;
line-height: 52px;
text-align: center;
display: flex;
justify-content: center;
cursor: pointer;
div {
border-top: 2px solid #E4E7EC;
}
}
.selectedTab {
background: #fff;
div {
border-top: 2px solid #2C4DC0;
}
}
}
.tabbody {
flex: 1;
overflow-y: auto;
color: #000;
box-sizing: border-box;
padding: 18px;
.card {
color: #303133;
width: 100%;
height: 70px;
border-radius: 4px 4px 4px 4px;
opacity: 1;
display: flex;
margin-bottom: 18px;
box-sizing: border-box;
padding: 0 20px;
position: relative;
div {
display: flex;
align-items: center;
img {
margin-top: -3px;
}
}
.unitname {
flex: 3;
}
.info {
flex: 6;
span {
margin-right: 20px;
}
}
.btn {
flex: 1;
button:nth-child(1) {
background: #42B983;
color: white;
}
button:nth-child(2) {
background: #FF0000;
color: white;
margin-left: 20px;
}
}
.auditimg {
position: absolute;
right: 18%;
top: 9%;
}
}
.greencard {
background: rgba(66, 185, 131, 0.0400);
border: 1px solid rgba(66, 185, 131, 0.1600);
}
.redcard {
background: rgba(255, 0, 0, 0.0200);
border: 1px solid rgba(255, 0, 0, 0.1000);
}
}
}

478
src/app/home/task/da-subordinate-audit/da-subordinate-audit.component.ts

@ -1,239 +1,239 @@
import { HttpClient } from '@angular/common/http';
import { Component, OnInit, ViewContainerRef } from '@angular/core';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
import { AllotPersonComponent } from './allot-person/allot-person.component';
@Component({
selector: 'app-da-subordinate-audit',
templateUrl: './da-subordinate-audit.component.html',
styleUrls: ['./da-subordinate-audit.component.scss']
})
export class DaSubordinateAuditComponent implements OnInit {
constructor(private http: HttpClient, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService) { }
OrganizationId
selectedTab = 0
atPresentData = { id: 0, name: '', finished: 0, totalCount: 0, list: [] }
selectTab(item) {
this.selectedTab = item.id
this.atPresentData = item
}
ngOnInit(): void {
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.selectedMonth = new Date().getMonth() + 1
this.getTaskList(0)
//获得主协调查人员
this.getSupervisor('main')
this.getSupervisor('assisted')
}
months = [
{ id: 1, name: '1月', isable: true },
{ id: 2, name: '2月', isable: true },
{ id: 3, name: '3月', isable: true },
{ id: 4, name: '4月', isable: true },
{ id: 5, name: '5月', isable: true },
{ id: 6, name: '6月', isable: true },
{ id: 7, name: '7月', isable: true },
{ id: 8, name: '8月', isable: true },
{ id: 9, name: '9月', isable: true },
{ id: 10, name: '10月', isable: true },
{ id: 11, name: '11月', isable: true },
{ id: 12, name: '12月', isable: true }
]
selectedMonth
selectedYear = 2022
selectedTime
selectMonth(item) {
this.selectedMonth = item.id
this.getTaskList(this.selectedTab)
}
selectYear(e) {
this.selectedYear = e
console.log('年', e)
this.getTaskList(this.selectedTab)
}
PageNumber = 1
PageSize = 9999
data = [
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [] },
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [] }
]
isloading = false
getTaskList(index) {
this.isloading = true
this.data = [
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [] },
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [] }
]
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
console.log('查询时间', selectedTime)
let params = {
Month: selectedTime,
OrganizationId: this.OrganizationId,
PageNumber: this.PageNumber,
PageSize: this.PageSize
}
this.http.get('/api/PlanTasks', {
params: params
}).subscribe((data: any) => {
let arr1 = []
let arr2 = []
data.items.forEach(element => {
if (element.taskName == '熟悉演练') {
arr1.push(element)
}
if (element.taskName == '联络指导') {
arr2.push(element)
}
});
arr1.forEach(item => {
if (!!item.approvalStatus) {
this.data[0].finished += 1
}
});
arr2.forEach(item => {
if (!!item.approvalStatus) {
this.data[1].finished += 1
}
});
this.data[0].totalCount = arr1.length
this.data[0].list = [...arr1]
this.data[1].totalCount = arr2.length
this.data[1].list = [...arr2]
this.atPresentData = this.data[index]
console.log(this.atPresentData)
this.isloading = false
})
}
assitantsupervisorList
mainsupervisorList
getSupervisor(type) {
let params = {
inspectorType: type
}
this.http.get('/api/Users/Inspectors', {
params: params
}).subscribe((data: any) => {
console.log('检查员列表', data)
if (type == 'main') {
this.mainsupervisorList = data
} else {
this.assitantsupervisorList = data
}
})
}
allot(item) {
console.log(item)
if (this.mainsupervisorList.length == 0 || this.assitantsupervisorList.length == 0) {
this.message.create('warning', '请从用户管理添加检查人员');
return
}
const modal = this.modal.create({
nzTitle: '分配监督检查员',
nzContent: AllotPersonComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 485,
nzMaskClosable: false,
nzComponentParams: {
mainsupervisorList: this.mainsupervisorList,
assitantsupervisorList: this.assitantsupervisorList
},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise((resolve, reject) => {
let body = {
mainSupervisorId: instance.validateForm.value.main,
assitantSupervisorId: instance.validateForm.value.assitant
}
this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({
next: async (data) => {
this.message.create('success', '分配成功');
resolve(data)
this.getTaskList(this.selectedTab)
return true
},
error: (err) => {
this.message.create('warning', '分配失败');
reject(err)
return false
}
})
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
}
agree(item) {
this.modal.confirm({
nzTitle: `确定要同意该申请吗?`,
nzOkText: '确定',
nzOkType: 'default',
nzOnOk: () => {
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: 'approved'
}
}).subscribe({
next: (data) => {
this.message.create('success', '审核成功');
this.getTaskList(this.selectedTab)
},
error: (err) => {
this.message.create('warning', '审核失败');
}
})
},
nzCancelText: '取消'
});
}
reject(item) {
this.modal.confirm({
nzTitle: `确定要驳回该申请吗?`,
nzOkText: '确定',
nzOkType: 'default',
nzOnOk: () => {
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: 'reject'
}
}).subscribe({
next: (data) => {
this.message.create('success', '审核成功');
this.getTaskList(this.selectedTab)
},
error: (err) => {
this.message.create('warning', '审核失败');
}
})
},
nzCancelText: '取消'
});
}
}
import { HttpClient } from '@angular/common/http';
import { Component, OnInit, ViewContainerRef } from '@angular/core';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
import { AllotPersonComponent } from './allot-person/allot-person.component';
@Component({
selector: 'app-da-subordinate-audit',
templateUrl: './da-subordinate-audit.component.html',
styleUrls: ['./da-subordinate-audit.component.scss']
})
export class DaSubordinateAuditComponent implements OnInit {
constructor(private http: HttpClient, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService) { }
OrganizationId
selectedTab = 0
atPresentData = { id: 0, name: '', finished: 0, totalCount: 0, list: [] }
selectTab(item) {
this.selectedTab = item.id
this.atPresentData = item
}
ngOnInit(): void {
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.selectedMonth = new Date().getMonth() + 1
this.getTaskList(0)
//获得主协调查人员
this.getSupervisor('main')
this.getSupervisor('assisted')
}
months = [
{ id: 1, name: '1月', isable: true },
{ id: 2, name: '2月', isable: true },
{ id: 3, name: '3月', isable: true },
{ id: 4, name: '4月', isable: true },
{ id: 5, name: '5月', isable: true },
{ id: 6, name: '6月', isable: true },
{ id: 7, name: '7月', isable: true },
{ id: 8, name: '8月', isable: true },
{ id: 9, name: '9月', isable: true },
{ id: 10, name: '10月', isable: true },
{ id: 11, name: '11月', isable: true },
{ id: 12, name: '12月', isable: true }
]
selectedMonth
selectedYear = 2022
selectedTime
selectMonth(item) {
this.selectedMonth = item.id
this.getTaskList(this.selectedTab)
}
selectYear(e) {
this.selectedYear = e
console.log('年', e)
this.getTaskList(this.selectedTab)
}
PageNumber = 1
PageSize = 9999
data = [
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [] },
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [] }
]
isloading = false
getTaskList(index) {
this.isloading = true
this.data = [
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [] },
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [] }
]
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
console.log('查询时间', selectedTime)
let params = {
Month: selectedTime,
OrganizationId: this.OrganizationId,
PageNumber: this.PageNumber,
PageSize: this.PageSize
}
this.http.get('/api/PlanTasks', {
params: params
}).subscribe((data: any) => {
let arr1 = []
let arr2 = []
data.items.forEach(element => {
if (element.taskName == '熟悉演练') {
arr1.push(element)
}
if (element.taskName == '联络指导') {
arr2.push(element)
}
});
arr1.forEach(item => {
if (!!item.approvalStatus) {
this.data[0].finished += 1
}
});
arr2.forEach(item => {
if (!!item.approvalStatus) {
this.data[1].finished += 1
}
});
this.data[0].totalCount = arr1.length
this.data[0].list = [...arr1]
this.data[1].totalCount = arr2.length
this.data[1].list = [...arr2]
this.atPresentData = this.data[index]
console.log(this.atPresentData)
this.isloading = false
})
}
assitantsupervisorList
mainsupervisorList
getSupervisor(type) {
let params = {
inspectorType: type
}
this.http.get('/api/Users/Inspectors', {
params: params
}).subscribe((data: any) => {
console.log('检查员列表', data)
if (type == 'main') {
this.mainsupervisorList = data
} else {
this.assitantsupervisorList = data
}
})
}
allot(item) {
console.log(item)
if (this.mainsupervisorList.length == 0 || this.assitantsupervisorList.length == 0) {
this.message.create('warning', '请从用户管理添加检查人员');
return
}
const modal = this.modal.create({
nzTitle: '分配监督检查员',
nzContent: AllotPersonComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 485,
nzMaskClosable: false,
nzComponentParams: {
mainsupervisorList: this.mainsupervisorList,
assitantsupervisorList: this.assitantsupervisorList
},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise((resolve, reject) => {
let body = {
mainSupervisorId: instance.validateForm.value.main,
assitantSupervisorId: instance.validateForm.value.assitant
}
this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({
next: async (data) => {
this.message.create('success', '分配成功');
resolve(data)
this.getTaskList(this.selectedTab)
return true
},
error: (err) => {
this.message.create('warning', '分配失败');
reject(err)
return false
}
})
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
}
agree(item) {
this.modal.confirm({
nzTitle: `确定要同意该申请吗?`,
nzOkText: '确定',
nzOkType: 'default',
nzOnOk: () => {
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: 'approved'
}
}).subscribe({
next: (data) => {
this.message.create('success', '审核成功');
this.getTaskList(this.selectedTab)
},
error: (err) => {
this.message.create('warning', '审核失败');
}
})
},
nzCancelText: '取消'
});
}
reject(item) {
this.modal.confirm({
nzTitle: `确定要驳回该申请吗?`,
nzOkText: '确定',
nzOkType: 'default',
nzOnOk: () => {
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: 'reject'
}
}).subscribe({
next: (data) => {
this.message.create('success', '审核成功');
this.getTaskList(this.selectedTab)
},
error: (err) => {
this.message.create('warning', '审核失败');
}
})
},
nzCancelText: '取消'
});
}
}

220
src/app/home/task/station-task-apply/station-task-apply.component.html

@ -1,111 +1,111 @@
<!-- <p>任务申请</p> -->
<div class="box">
<div class="fffbox">
<div class="header">
<span>
任务申请
</span>
<span style="font-size: 14px; color: #42B983;">
<i nz-icon nzType="info-circle" nzTheme="outline"></i>
任务申请已开始!剩余时间 3天13小时 / 生成周计划已开始!剩余时间 23:54:03
</span>
</div>
<div class="searchbox">
<div class="search">
<nz-select nzPlaceHolder="任务名称" [(ngModel)]="searchForm.taskname">
<nz-option nzValue="监督检查" nzLabel="监督检查"></nz-option>
<nz-option nzValue="熟悉演练" nzLabel="熟悉演练"></nz-option>
</nz-select>
<input type="text" nz-input placeholder="单位名称" [(ngModel)]="searchForm.unitname" />
<!-- <nz-select nzPlaceHolder="单位级别" [(ngModel)]="searchForm.unitlevel">
<nz-option nzValue="一般单位" nzLabel="一般单位"></nz-option>
<nz-option nzValue="重点单位" nzLabel="重点单位"></nz-option>
</nz-select> -->
<nz-tree-select [nzExpandedKeys]="expandKeys" [nzNodes]="nodes" nzShowSearch nzPlaceHolder="协助机构"
[(ngModel)]="searchForm.or" [nzExpandedIcon]="multiExpandedIconTpl"
[nzDropdownClassName]="'maxHeightTreeSelect'" [nzAllowClear]="false"></nz-tree-select>
<ng-template #multiExpandedIconTpl let-node let-origin="origin">
<ng-container *ngIf="node.children.length == 0; else elseTemplate">
</ng-container>
<ng-template #elseTemplate>
<i nz-icon [nzType]="node.isExpanded ? 'caret-down' : 'caret-right'"
class="ant-tree-switcher-line-icon"></i>
</ng-template>
</ng-template>
<button (click)="search()" nz-button nzType="primary"><i nz-icon nzType="search"
nzTheme="outline"></i>查询</button>
<button (click)="reset()" nz-button nzType="default"><i nz-icon nzType="reload"
nzTheme="outline"></i>重置</button>
</div>
</div>
<div class="content">
<div class="applybtn">
<button (click)="apply()" nz-button nzType="primary"><i nz-icon nzType="form"
nzTheme="outline"></i>申请</button>
</div>
<div class="tablebox">
<nz-table nzBordered #basicTable [nzLoading]="nzLoading" [nzData]="taskLIst" [nzShowPagination]='false'
[nzPageSize]='10'>
<thead>
<tr>
<th [width]="'15%'">任务名称</th>
<th [width]="'20%'">单位名称</th>
<!-- <th>单位级别</th> -->
<th>协助机构</th>
<th>时间</th>
<th>申请结果</th>
<th>检查结果</th>
<th [width]="'8%'">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of basicTable.data">
<td>
{{item.taskName}}
</td>
<td nzBreakWord>
{{item.company.companyName}}
</td>
<!-- <td>
一般单位
</td> -->
<td>
{{item.assitantOrganization.name}}
</td>
<td>
{{item.creationTime | date:"yyyy-MM-dd hh:mm:ss"}}
</td>
<td>
<ng-container *ngIf="item.approvalStatus; else elseTemplate">
<ng-container *ngIf="item.approvalStatus == 'reject'; else elseTemplate2">
<span class="green">审核驳回</span>
</ng-container>
<ng-template #elseTemplate2>
<span class="red">审核通过</span>
</ng-template>
</ng-container>
<ng-template #elseTemplate>
未审核
</ng-template>
</td>
<td>
/
</td>
<td class="operation">
<a class="blue" (click)="look(item)">查看</a>
</td>
</tr>
</tbody>
</nz-table>
</div>
<div class="pagination">
<nz-pagination [nzHideOnSinglePage]="false" [nzPageIndex]="1" [nzTotal]="totalCount" [nzPageSize]="10"
[nzShowTotal]="totalTemplate" nzShowQuickJumper (nzPageIndexChange)="pageChange($event)">
</nz-pagination>
<ng-template #totalTemplate let-total> 10条/页,共{{totalCount}}条 </ng-template>
</div>
</div>
</div>
<!-- <p>任务申请</p> -->
<div class="box">
<div class="fffbox">
<div class="header">
<span>
任务申请
</span>
<span style="font-size: 14px; color: #42B983;">
<i nz-icon nzType="info-circle" nzTheme="outline"></i>
任务申请已开始!剩余时间 3天13小时 / 生成周计划已开始!剩余时间 23:54:03
</span>
</div>
<div class="searchbox">
<div class="search">
<nz-select nzPlaceHolder="任务名称" [(ngModel)]="searchForm.taskname">
<nz-option nzValue="监督检查" nzLabel="监督检查"></nz-option>
<nz-option nzValue="熟悉演练" nzLabel="熟悉演练"></nz-option>
</nz-select>
<input type="text" nz-input placeholder="单位名称" [(ngModel)]="searchForm.unitname" />
<!-- <nz-select nzPlaceHolder="单位级别" [(ngModel)]="searchForm.unitlevel">
<nz-option nzValue="一般单位" nzLabel="一般单位"></nz-option>
<nz-option nzValue="重点单位" nzLabel="重点单位"></nz-option>
</nz-select> -->
<nz-tree-select [nzExpandedKeys]="expandKeys" [nzNodes]="nodes" nzShowSearch nzPlaceHolder="协助机构"
[(ngModel)]="searchForm.or" [nzExpandedIcon]="multiExpandedIconTpl"
[nzDropdownClassName]="'maxHeightTreeSelect'" [nzAllowClear]="false"></nz-tree-select>
<ng-template #multiExpandedIconTpl let-node let-origin="origin">
<ng-container *ngIf="node.children.length == 0; else elseTemplate">
</ng-container>
<ng-template #elseTemplate>
<i nz-icon [nzType]="node.isExpanded ? 'caret-down' : 'caret-right'"
class="ant-tree-switcher-line-icon"></i>
</ng-template>
</ng-template>
<button (click)="search()" nz-button nzType="primary"><i nz-icon nzType="search"
nzTheme="outline"></i>查询</button>
<button (click)="reset()" nz-button nzType="default"><i nz-icon nzType="reload"
nzTheme="outline"></i>重置</button>
</div>
</div>
<div class="content">
<div class="applybtn">
<button (click)="apply()" nz-button nzType="primary"><i nz-icon nzType="form"
nzTheme="outline"></i>申请</button>
</div>
<div class="tablebox">
<nz-table nzBordered #basicTable [nzLoading]="nzLoading" [nzData]="taskLIst" [nzShowPagination]='false'
[nzPageSize]='10'>
<thead>
<tr>
<th [width]="'15%'">任务名称</th>
<th [width]="'20%'">单位名称</th>
<!-- <th>单位级别</th> -->
<th>协助机构</th>
<th>时间</th>
<th>申请结果</th>
<th>检查结果</th>
<th [width]="'8%'">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of basicTable.data">
<td>
{{item.taskName}}
</td>
<td nzBreakWord>
{{item.company.companyName}}
</td>
<!-- <td>
一般单位
</td> -->
<td>
{{item.assitantOrganization.name}}
</td>
<td>
{{item.creationTime | date:"yyyy-MM-dd hh:mm:ss"}}
</td>
<td>
<ng-container *ngIf="item.approvalStatus; else elseTemplate">
<ng-container *ngIf="item.approvalStatus == 'reject'; else elseTemplate2">
<span class="green">审核驳回</span>
</ng-container>
<ng-template #elseTemplate2>
<span class="red">审核通过</span>
</ng-template>
</ng-container>
<ng-template #elseTemplate>
未审核
</ng-template>
</td>
<td>
/
</td>
<td class="operation">
<a class="blue" (click)="look(item)">查看</a>
</td>
</tr>
</tbody>
</nz-table>
</div>
<div class="pagination">
<nz-pagination [nzHideOnSinglePage]="false" [nzPageIndex]="1" [nzTotal]="totalCount" [nzPageSize]="10"
[nzShowTotal]="totalTemplate" nzShowQuickJumper (nzPageIndexChange)="pageChange($event)">
</nz-pagination>
<ng-template #totalTemplate let-total> 10条/页,共{{totalCount}}条 </ng-template>
</div>
</div>
</div>
</div>

396
src/app/home/task/station-task-apply/station-task-apply.component.ts

@ -1,198 +1,198 @@
import { Component, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
import { NzModalService } from 'ng-zorro-antd/modal';
import { NzMessageService } from 'ng-zorro-antd/message';
import { HttpClient } from '@angular/common/http';
import { TreeService } from 'src/app/service/tree.service';
import { ApplyComponent } from './apply/apply.component';
import { ApplyLookComponent } from './apply-look/apply-look.component';
@Component({
selector: 'app-station-task-apply',
templateUrl: './station-task-apply.component.html',
styleUrls: ['./station-task-apply.component.scss']
})
export class StationTaskApplyComponent implements OnInit {
validateForm!: FormGroup;
constructor(private fb: FormBuilder, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient, private toTree: TreeService) { }
searchForm = {
taskname: '',
unitname: '',
unitlevel: '',
or: ''
}
OrganizationId
ngOnInit(): void {
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.getAllOrganization()
this.getTaskList()
}
cancel(item, type) {
}
delete(item) {
}
nzLoading = false
totalCount
PageNumber = 1
PageSize = 10
taskLIst = []
getTaskList() {
this.nzLoading = true
let params = {
OrganizationId: this.OrganizationId,
TaskName: this.searchForm.taskname,
CompanyName: this.searchForm.unitname,
AssitantOrganizationId: this.searchForm.or,
PageNumber: this.PageNumber,
PageSize: this.PageSize
}
this.http.get('/api/PlanTasks', {
params: params
}).subscribe((data: any) => {
this.nzLoading = false
console.log('任务申请列表', data);
this.totalCount = data.totalCount
this.taskLIst = [...data.items]
})
}
pageChange($event) {
this.PageNumber = $event
this.getTaskList()
}
search() {
this.PageNumber = 1
this.getTaskList()
}
reset() {
this.PageNumber = 1
this.searchForm = {
taskname: '',
unitname: '',
unitlevel: '',
or: ''
}
this.getTaskList()
}
expandKeys
defaultOrId: string
//获取所有组织机构
nodes: any = []
getAllOrganization() {
let params = {
PageNumber: 1,
PageSize: 9999
}
this.http.get('/api/Organizations', {
params: params
}).subscribe((data: any) => {
data.items.forEach(element => {
element.key = element.id
element.title = element.name
});
this.nodes = [...this.toTree.toTree(data.items)]
})
}
apply() {
if (this.nodes.length == 0) {
this.message.create('warning', '组织机构初始化中,请稍后重试');
return
}
const modal = this.modal.create({
nzTitle: '申请',
nzContent: ApplyComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 660,
nzMaskClosable: false,
nzComponentParams: {
title: "熟悉演练",
nodes: this.nodes,
},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise((resolve, reject) => {
let body = {
organizationId: this.OrganizationId,
taskName: "联络指导",
companyId: instance.validateForm.value.unitname,
assitantOrganizationId: instance.validateForm.value.organization,
}
this.http.post('/api/PlanTasks', body).subscribe({
next: (data) => {
this.message.create('success', '创建成功');
resolve(data)
this.getTaskList()
return true
},
error: (err) => {
this.message.create('warning', '创建失败');
reject(err)
return false
}
})
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
}
look(item) {
const modal = this.modal.create({
nzTitle: '详情',
nzContent: ApplyLookComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 660,
nzMaskClosable: false,
nzComponentParams: {
data: item,
},
nzFooter: null,
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
let roleNames = [...instance.validateForm.value.role, ...instance.validateForm.value.role2]
let body = {
userName: instance.validateForm.value.account,
name: instance.validateForm.value.name,
organizationUnitId: Number(instance.validateForm.value.organization),
roleNames: roleNames,
phoneNumber: instance.validateForm.value.phonenum,
isActive: true
}
// this.http.post(this.addUrl, body).subscribe(data => {
// resolve(data)
// this.message.create('success', '创建成功!');
// this.SkipCount = 0
// this.getAllUsers()
// return true
// }, err => {
// resolve(err)
// this.message.create('warning', err.error.error.message);
// return false
// })
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
}
}
import { Component, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
import { NzModalService } from 'ng-zorro-antd/modal';
import { NzMessageService } from 'ng-zorro-antd/message';
import { HttpClient } from '@angular/common/http';
import { TreeService } from 'src/app/service/tree.service';
import { ApplyComponent } from './apply/apply.component';
import { ApplyLookComponent } from './apply-look/apply-look.component';
@Component({
selector: 'app-station-task-apply',
templateUrl: './station-task-apply.component.html',
styleUrls: ['./station-task-apply.component.scss']
})
export class StationTaskApplyComponent implements OnInit {
validateForm!: FormGroup;
constructor(private fb: FormBuilder, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient, private toTree: TreeService) { }
searchForm = {
taskname: '',
unitname: '',
unitlevel: '',
or: ''
}
OrganizationId
ngOnInit(): void {
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.getAllOrganization()
this.getTaskList()
}
cancel(item, type) {
}
delete(item) {
}
nzLoading = false
totalCount
PageNumber = 1
PageSize = 10
taskLIst = []
getTaskList() {
this.nzLoading = true
let params = {
OrganizationId: this.OrganizationId,
TaskName: this.searchForm.taskname,
CompanyName: this.searchForm.unitname,
AssitantOrganizationId: this.searchForm.or,
PageNumber: this.PageNumber,
PageSize: this.PageSize
}
this.http.get('/api/PlanTasks', {
params: params
}).subscribe((data: any) => {
this.nzLoading = false
console.log('任务申请列表', data);
this.totalCount = data.totalCount
this.taskLIst = [...data.items]
})
}
pageChange($event) {
this.PageNumber = $event
this.getTaskList()
}
search() {
this.PageNumber = 1
this.getTaskList()
}
reset() {
this.PageNumber = 1
this.searchForm = {
taskname: '',
unitname: '',
unitlevel: '',
or: ''
}
this.getTaskList()
}
expandKeys
defaultOrId: string
//获取所有组织机构
nodes: any = []
getAllOrganization() {
let params = {
PageNumber: 1,
PageSize: 9999
}
this.http.get('/api/Organizations', {
params: params
}).subscribe((data: any) => {
data.items.forEach(element => {
element.key = element.id
element.title = element.name
});
this.nodes = [...this.toTree.toTree(data.items)]
})
}
apply() {
if (this.nodes.length == 0) {
this.message.create('warning', '组织机构初始化中,请稍后重试');
return
}
const modal = this.modal.create({
nzTitle: '申请',
nzContent: ApplyComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 660,
nzMaskClosable: false,
nzComponentParams: {
title: "熟悉演练",
nodes: this.nodes,
},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise((resolve, reject) => {
let body = {
organizationId: this.OrganizationId,
taskName: "联络指导",
companyId: instance.validateForm.value.unitname,
assitantOrganizationId: instance.validateForm.value.organization,
}
this.http.post('/api/PlanTasks', body).subscribe({
next: (data) => {
this.message.create('success', '创建成功');
resolve(data)
this.getTaskList()
return true
},
error: (err) => {
this.message.create('warning', '创建失败');
reject(err)
return false
}
})
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
}
look(item) {
const modal = this.modal.create({
nzTitle: '详情',
nzContent: ApplyLookComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 660,
nzMaskClosable: false,
nzComponentParams: {
data: item,
},
nzFooter: null,
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
let roleNames = [...instance.validateForm.value.role, ...instance.validateForm.value.role2]
let body = {
userName: instance.validateForm.value.account,
name: instance.validateForm.value.name,
organizationUnitId: Number(instance.validateForm.value.organization),
roleNames: roleNames,
phoneNumber: instance.validateForm.value.phonenum,
isActive: true
}
// this.http.post(this.addUrl, body).subscribe(data => {
// resolve(data)
// this.message.create('success', '创建成功!');
// this.SkipCount = 0
// this.getAllUsers()
// return true
// }, err => {
// resolve(err)
// this.message.create('warning', err.error.error.message);
// return false
// })
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
}
}

92
src/app/home/task/task.component.html

@ -1,47 +1,47 @@
<div class="box">
<div class="nav">
<ul *ngIf="level == 'brigade'">
<li [routerLink]="['/task/indicators']" routerLinkActive="router-link-active">
<i nz-icon nzType="book" nzTheme="outline"></i>
任务指标
</li>
<li [routerLink]="['/task/audit']" routerLinkActive="router-link-active">
<i nz-icon nzType="audit" nzTheme="outline"></i>
工作审批
</li>
</ul>
<ul *ngIf="level == 'battalion'">
<li [routerLink]="['/task/monthlytaskoverview']" routerLinkActive="router-link-active">
<i nz-icon nzType="appstore" nzTheme="outline"></i>
月度任务总览
</li>
<li [routerLink]="['/task/subordinateaudit']" routerLinkActive="router-link-active">
<i nz-icon nzType="file-protect" nzTheme="outline"></i>
下级任务申请
</li>
<li [routerLink]="['/task/oneselfplan']" routerLinkActive="router-link-active">
<i nz-icon nzType="file-text" nzTheme="outline"></i>
本级计划
</li>
</ul>
<ul *ngIf="level == 'squadron'">
<li [routerLink]="['/task/taskexecution']" routerLinkActive="router-link-active">
<i nz-icon nzType="file-protect" nzTheme="outline"></i>
任务执行
</li>
<li [routerLink]="['/task/taskapply']" routerLinkActive="router-link-active">
<i nz-icon nzType="file-text" nzTheme="outline"></i>
任务申请
</li>
<li [routerLink]="['/task/weeklyplan']" routerLinkActive="router-link-active">
<i nz-icon nzType="container" nzTheme="outline"></i>
生成周计划
</li>
</ul>
</div>
<div class="content">
<div class="routerbox">
<router-outlet></router-outlet>
</div>
</div>
<div class="box">
<div class="nav">
<ul *ngIf="level == 'brigade'">
<li [routerLink]="['/task/indicators']" routerLinkActive="router-link-active">
<i nz-icon nzType="book" nzTheme="outline"></i>
任务指标
</li>
<li [routerLink]="['/task/audit']" routerLinkActive="router-link-active">
<i nz-icon nzType="audit" nzTheme="outline"></i>
工作审批
</li>
</ul>
<ul *ngIf="level == 'battalion'">
<li [routerLink]="['/task/monthlytaskoverview']" routerLinkActive="router-link-active">
<i nz-icon nzType="appstore" nzTheme="outline"></i>
月度任务总览
</li>
<li [routerLink]="['/task/subordinateaudit']" routerLinkActive="router-link-active">
<i nz-icon nzType="file-protect" nzTheme="outline"></i>
下级任务申请
</li>
<li [routerLink]="['/task/oneselfplan']" routerLinkActive="router-link-active">
<i nz-icon nzType="file-text" nzTheme="outline"></i>
本级计划
</li>
</ul>
<ul *ngIf="level == 'squadron'">
<li [routerLink]="['/task/taskexecution']" routerLinkActive="router-link-active">
<i nz-icon nzType="file-protect" nzTheme="outline"></i>
任务执行
</li>
<li [routerLink]="['/task/taskapply']" routerLinkActive="router-link-active">
<i nz-icon nzType="file-text" nzTheme="outline"></i>
任务申请
</li>
<li [routerLink]="['/task/weeklyplan']" routerLinkActive="router-link-active">
<i nz-icon nzType="container" nzTheme="outline"></i>
生成周计划
</li>
</ul>
</div>
<div class="content">
<div class="routerbox">
<router-outlet></router-outlet>
</div>
</div>
</div>

44
src/app/home/task/task.component.ts

@ -1,17 +1,27 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
@Component({
selector: 'app-task',
templateUrl: './task.component.html',
styleUrls: ['./task.component.scss']
})
export class TaskComponent implements OnInit {
level=""
constructor(private router: Router) { }
ngOnInit(): void {
this.level=JSON.parse(sessionStorage.getItem('userData')).organizationLevel
}
}
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
@Component({
selector: 'app-task',
templateUrl: './task.component.html',
styleUrls: ['./task.component.scss']
})
export class TaskComponent implements OnInit {
level=""
constructor(private router: Router) { }
ngOnInit(): void {
this.level=JSON.parse(sessionStorage.getItem('userData')).organizationLevel
if(this.router.url=="/task"){
if(this.level=="brigade"){
this.router.navigate(['/task/indicators'])
}else if(this.level=="battalion"){
this.router.navigate(['/task/monthlytaskoverview'])
}else if(this.level=="squadron"){
this.router.navigate(['/task/taskexecution'])
}
}
}
}

166
src/app/http-interceptors/base-interceptor.ts

@ -1,83 +1,83 @@
import { Injectable } from '@angular/core';
import {
HttpClient, HttpInterceptor, HttpHandler, HttpRequest,
HttpErrorResponse
} from '@angular/common/http';
import { throwError } from 'rxjs'
import { catchError } from 'rxjs/operators';
import { Router } from '@angular/router'
import { CacheTokenService } from '../service/cache-token.service'
import { NzMessageService } from 'ng-zorro-antd/message';
//baseurl
// const baseurl = 'http://39.106.78.171:8008';
@Injectable()
export class BaseInterceptor implements HttpInterceptor {
constructor(private router: Router, public token: CacheTokenService, private message: NzMessageService) { }
intercept(req: any, next: HttpHandler) {
let params = req.params;
for (const key of req.params.keys()) {
if (params.get(key) === undefined || params.get(key) === null) {
params = params.delete(key, undefined);
}
}
req = req.clone({ params });
// debugger
// console.log('xxxxxx',req)
let newReq = req.clone({
url: req.hadBaseurl ? `${req.url}` : `${req.url}`,
});
if (!req.cancelToken) {
/*获取token*/
let token = sessionStorage.getItem('token')
/*此处设置额外请求头,token令牌*/
newReq.headers =
newReq.headers.set('Authorization', `Bearer ${token}`)
}
// 携带请求头发送下一次请求
return next.handle(newReq)
.pipe(
//箭头函数,注意this指向
catchError((err) => this.handleError(err))
)
}
// 捕获错误
//401 token过期 403没权限!!! 400参数错误 404未找到 614刷新令牌过期!!!
private handleError(error: HttpErrorResponse) {
console.log('http错误', error)
// 用户认证失败返回登录页
if (error.status === 401) {
this.token.delete()
sessionStorage.clear()
localStorage.removeItem("isautologin")
this.message.create('error', `认证失败!`);
this.router.navigate(['/login'])
return
}
if (error.status === 403) {
this.message.create('error', `无权限!`);
return
}
if (error.error instanceof ErrorEvent) {
// 发生客户端或网络错误。相应处理。
console.error('An error occurred:', error.message);
} else {
// 服务端返回http状态码
// 服务端返回错误信息
console.error(
`状态码${error.status}, ` +
`错误内容:${error.error}`);
this.message.create('error', error.error.title);
}
// 返回带有面向用户的错误信息
return throwError(() => {
new Error('error')
});
};
}
import { Injectable } from '@angular/core';
import {
HttpClient, HttpInterceptor, HttpHandler, HttpRequest,
HttpErrorResponse
} from '@angular/common/http';
import { throwError } from 'rxjs'
import { catchError } from 'rxjs/operators';
import { Router } from '@angular/router'
import { CacheTokenService } from '../service/cache-token.service'
import { NzMessageService } from 'ng-zorro-antd/message';
//baseurl
// const baseurl = 'http://39.106.78.171:8008';
@Injectable()
export class BaseInterceptor implements HttpInterceptor {
constructor(private router: Router, public token: CacheTokenService, private message: NzMessageService) { }
intercept(req: any, next: HttpHandler) {
let params = req.params;
for (const key of req.params.keys()) {
if (params.get(key) === undefined || params.get(key) === null) {
params = params.delete(key, undefined);
}
}
req = req.clone({ params });
// debugger
// console.log('xxxxxx',req)
let newReq = req.clone({
url: req.hadBaseurl ? `${req.url}` : `${req.url}`,
});
if (!req.cancelToken) {
/*获取token*/
let token = sessionStorage.getItem('token')
/*此处设置额外请求头,token令牌*/
newReq.headers =
newReq.headers.set('Authorization', `Bearer ${token}`)
}
// 携带请求头发送下一次请求
return next.handle(newReq)
.pipe(
//箭头函数,注意this指向
catchError((err) => this.handleError(err))
)
}
// 捕获错误
//401 token过期 403没权限!!! 400参数错误 404未找到 614刷新令牌过期!!!
private handleError(error: HttpErrorResponse) {
console.log('http错误', error)
// 用户认证失败返回登录页
if (error.status === 401) {
this.token.delete()
sessionStorage.clear()
localStorage.removeItem("isautologin")
this.message.create('error', `认证失败!`);
this.router.navigate(['/login'])
return
}
if (error.status === 403) {
this.message.create('error', `无权限!`);
return
}
if (error.error instanceof ErrorEvent) {
// 发生客户端或网络错误。相应处理。
console.error('An error occurred:', error.message);
} else {
// 服务端返回http状态码
// 服务端返回错误信息
console.error(
`状态码${error.status}, ` +
`错误内容:${error.error}`);
this.message.create('error', error.error.title);
}
// 返回带有面向用户的错误信息
return throwError(() => {
new Error('error')
});
};
}

266
src/app/pages/login/login.component.ts

@ -1,127 +1,139 @@
import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http'
import { Router } from '@angular/router'
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzMessageService } from 'ng-zorro-antd/message';
import { Base64 } from 'js-base64';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.scss'],
})
export class LoginComponent implements OnInit {
validateForm!: FormGroup;
constructor(private http: HttpClient, private router: Router, private fb: FormBuilder, private message: NzMessageService) { }
ngOnInit() {
this.validateForm = this.fb.group({
userName: [null, [Validators.required]],
password: [null, [Validators.required]],
remember: [null],
autologin: [null],
});
//如果本地储存了账号密码信息,那就回显在输入框
let account = localStorage.getItem('account')
let password = localStorage.getItem('password')
if (account && password) {
this.validateForm.patchValue({
userName: Base64.decode(localStorage.getItem('account')),
password: Base64.decode(localStorage.getItem('password'))
});
this.remember = true //这一步是回显后让勾选框为选中状态
}
//自动登录
if (localStorage.getItem('isautologin') == 'true') {
this.submitForm()
this.autologin = true //这一步是回显后让勾选框为选中状态
}
}
errmsg: string = ''; //错误信息
// //跳转注册页面
// toRegister() {
// this.router.navigate(['/register'])
// }
//记住密码
rememberInfo() {
// 判断用户是否勾选记住密码,如果勾选,在本地储存中储存登录信息
if (this.remember) {
localStorage.setItem("account", Base64.encode(this.validateForm.value.userName))
localStorage.setItem("password", Base64.encode(this.validateForm.value.password))
}
}
//自动登录
autoLogin() {
if (this.autologin) {
localStorage.setItem("isautologin", 'true')
}
}
remember: any//记住密码
autologin: any//自动登录
isLoading = false;
messages: any
encryptedAccessToken: any
submitForm(): void {
if (!this.remember) {
localStorage.removeItem("account")
localStorage.removeItem("password")
}
if (!this.autologin) {
localStorage.removeItem("isautologin")
}
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
if (!this.validateForm.valid) {
this.message.create('error', `请输入账号密码`);
return
}
this.isLoading = true;
this.http.post('/api/Accounts/SignIn', {
username: this.validateForm.value.userName,
password: this.validateForm.value.password
}).subscribe({
next: (data: any) => {
sessionStorage.setItem("token", data.token);
sessionStorage.setItem("refreshToken", data.refreshToken);
this.http.get('/api/Accounts/Profile').subscribe({
next: (data: any) => {
console.log('登录用户信息', data)
this.isLoading = false;
this.rememberInfo()
this.autoLogin()
this.router.navigate(['/system'])
this.message.create('success', `登录成功`);
sessionStorage.setItem("userData", JSON.stringify(data));
},
error: (err) => {
this.isLoading = false;
}
})
},
error: (err) => {
this.isLoading = false;
}
})
}
forget() {
this.message.create('warning', `请联系管理员`);
}
}
import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http'
import { Router } from '@angular/router'
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzMessageService } from 'ng-zorro-antd/message';
import { Base64 } from 'js-base64';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.scss'],
})
export class LoginComponent implements OnInit {
validateForm!: FormGroup;
constructor(private http: HttpClient, private router: Router, private fb: FormBuilder, private message: NzMessageService) { }
ngOnInit() {
this.validateForm = this.fb.group({
userName: [null, [Validators.required]],
password: [null, [Validators.required]],
remember: [null],
autologin: [null],
});
//如果本地储存了账号密码信息,那就回显在输入框
let account = localStorage.getItem('account')
let password = localStorage.getItem('password')
if (account && password) {
this.validateForm.patchValue({
userName: Base64.decode(localStorage.getItem('account')),
password: Base64.decode(localStorage.getItem('password'))
});
this.remember = true //这一步是回显后让勾选框为选中状态
}
//自动登录
if (localStorage.getItem('isautologin') == 'true') {
this.submitForm()
this.autologin = true //这一步是回显后让勾选框为选中状态
}
}
errmsg: string = ''; //错误信息
// //跳转注册页面
// toRegister() {
// this.router.navigate(['/register'])
// }
//记住密码
rememberInfo() {
// 判断用户是否勾选记住密码,如果勾选,在本地储存中储存登录信息
if (this.remember) {
localStorage.setItem("account", Base64.encode(this.validateForm.value.userName))
localStorage.setItem("password", Base64.encode(this.validateForm.value.password))
}
}
//自动登录
autoLogin() {
if (this.autologin) {
localStorage.setItem("isautologin", 'true')
}
}
remember: any//记住密码
autologin: any//自动登录
isLoading = false;
messages: any
encryptedAccessToken: any
submitForm(): void {
if (!this.remember) {
localStorage.removeItem("account")
localStorage.removeItem("password")
}
if (!this.autologin) {
localStorage.removeItem("isautologin")
}
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
if (!this.validateForm.valid) {
this.message.create('error', `请输入账号密码`);
return
}
this.isLoading = true;
this.http.post('/api/Accounts/SignIn', {
username: this.validateForm.value.userName,
password: this.validateForm.value.password
}).subscribe({
next: (data: any) => {
sessionStorage.setItem("token", data.token);
sessionStorage.setItem("refreshToken", data.refreshToken);
this.http.get('/api/Accounts/Profile').subscribe({
next: async (data: any) => {
console.log('登录用户信息', data)
this.isLoading = false;
this.rememberInfo()
this.autoLogin()
this.router.navigate(['/system'])
this.message.create('success', `登录成功`);
sessionStorage.setItem("userData", JSON.stringify(data));
await this.getLevel()
},
error: (err) => {
this.isLoading = false;
}
})
},
error: (err) => {
this.isLoading = false;
}
})
}
forget() {
this.message.create('warning', `请联系管理员`);
}
getLevel(){
const a = JSON.parse(sessionStorage.getItem("userData")).organizationLevel
if(a=="brigade"){
sessionStorage.setItem('levelRouter',"/task/indicators")
}else if(a=="battalion"){
sessionStorage.setItem('levelRouter',"/task/monthlytaskoverview")
}else{
sessionStorage.setItem('levelRouter',"/task/taskexecution")
}
}
}

84
src/app/service/cache-token.service.ts

@ -1,42 +1,42 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'
@Injectable({
providedIn: 'root'
})
export class CacheTokenService {
constructor(private http: HttpClient) { }
public timer: number | undefined;
//刷新token令牌定时器
startUp = (): void => {
window.clearInterval(this.timer)
this.timer = window.setInterval(() => {
var token = sessionStorage.getItem("token");
var refreshToken = sessionStorage.getItem("refreshToken");
this.http.post('/api/Accounts/RefreshToken', {
token: token,
refreshToken: refreshToken
}).subscribe((data: any) => {
console.log('定时刷新token成功', data)
sessionStorage.setItem("token", data.token);
sessionStorage.setItem("refreshToken", data.refreshToken);
})
}, 60 * 1000)
console.log('启动定时刷新token')
}
//删除定时器
delete = (): void => {
console.log('消除定时刷新token')
window.clearInterval(this.timer)
}
}
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'
@Injectable({
providedIn: 'root'
})
export class CacheTokenService {
constructor(private http: HttpClient) { }
public timer: number | undefined;
//刷新token令牌定时器
startUp = (): void => {
window.clearInterval(this.timer)
this.timer = window.setInterval(() => {
var token = sessionStorage.getItem("token");
var refreshToken = sessionStorage.getItem("refreshToken");
this.http.post('/api/Accounts/RefreshToken', {
token: token,
refreshToken: refreshToken
}).subscribe((data: any) => {
console.log('定时刷新token成功', data)
sessionStorage.setItem("token", data.token);
sessionStorage.setItem("refreshToken", data.refreshToken);
})
}, 60 * 1000)
console.log('启动定时刷新token')
}
//删除定时器
delete = (): void => {
console.log('消除定时刷新token')
window.clearInterval(this.timer)
}
}

444
src/styles.scss

@ -1,223 +1,223 @@
@import "~ng-zorro-antd/ng-zorro-antd.min.css";
@import "~ng-zorro-antd/style/index.min.css";
/* 引入基本样式 */
@import "~ng-zorro-antd/button/style/index.min.css";
/* 引入组件样式 */
@font-face {
font-family: synormal;
src: url("./assets/font-family/synormal.OTF");
}
/* css初始化 */
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
font-family: synormal !important;
}
body {
font-family: Roboto, "Helvetica Neue", sans-serif;
}
ul,
ol,
dl,
li,
dt,
dd,
p,
form,
input,
h1,
h2,
h3,
h4,
h5,
h6,
section,
article,
aside,
header,
footer,
nav,
figure,
time,
mark,
main,
canvas {
margin: 0;
padding: 0;
}
b,
strong,
i,
em,
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 500;
font-style: normal;
}
img {
border: none;
outline: none;
}
a {
text-decoration: none;
color: #000;
}
p {
color: #000;
}
ul,
ol,
li {
list-style: none;
overflow-x: hidden;
}
textarea {
resize: none;
}
/* 滚动条样式 */
// ::-webkit-scrollbar:horizontal { width: 5px; background-color: white; }
::-webkit-scrollbar-thumb {
background: #E4E7EC;
}
::-webkit-scrollbar {
width: 5px;
}
::-webkit-scrollbar-track {
// background-color: #999;
}
app-root {
height: 100%;
}
.blue {
cursor: pointer;
color: #2C4DC0 !important;
}
.green {
cursor: pointer;
color: #42B983 !important;
}
.red {
cursor: pointer;
color: #FF0000 !important;
}
.forbid {
color: gray;
pointer-events: none
}
.forbidbtn {
background: gray !important;
pointer-events: none
}
.box {
width: 100%;
height: 100%;
overflow-y: auto;
}
.ant-tabs-content {
height: 100%;
}
.ant-pagination-next,
.ant-pagination-prev {
overflow: hidden;
}
.pagination {
margin: 15px 0;
display: flex;
align-items: center;
justify-content: center;
}
.maxHeightTreeSelect {
max-height: 280px;
}
// 可展开面板
.panel {
width: 100%;
background: #FFFFFF;
box-shadow: 0px 3px 8px 1px rgba(0, 0, 0, 0.0800);
border-radius: 4px 4px 4px 4px;
opacity: 1;
border: 1px solid #E4E7EC;
box-sizing: border-box;
padding: 16px;
.panelheader {
height: 46px;
display: flex;
align-items: center;
}
}
.panelheadernameblue {
background-color: #1D9DFF;
}
.panelheadernamepurple {
background-color: #9D80FF;
}
.panelheadernameblue2 {
background-color: #5087FF;
}
.panelheadernamegreen {
background-color: #42B983;
}
.panelheadernameor {
background-color: #FF9203;
}
.panelheadernameor2 {
background-color: #FF5D2A;
}
.panelheadernamered {
background-color: #FF404D;
}
.spin {
background: rgb(134, 131, 131, 0.2);
position: absolute;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
@import "~ng-zorro-antd/ng-zorro-antd.min.css";
@import "~ng-zorro-antd/style/index.min.css";
/* 引入基本样式 */
@import "~ng-zorro-antd/button/style/index.min.css";
/* 引入组件样式 */
@font-face {
font-family: synormal;
src: url("./assets/font-family/synormal.OTF");
}
/* css初始化 */
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
font-family: synormal !important;
}
body {
font-family: Roboto, "Helvetica Neue", sans-serif;
}
ul,
ol,
dl,
li,
dt,
dd,
p,
form,
input,
h1,
h2,
h3,
h4,
h5,
h6,
section,
article,
aside,
header,
footer,
nav,
figure,
time,
mark,
main,
canvas {
margin: 0;
padding: 0;
}
b,
strong,
i,
em,
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 500;
font-style: normal;
}
img {
border: none;
outline: none;
}
a {
text-decoration: none;
color: #000;
}
p {
color: #000;
}
ul,
ol,
li {
list-style: none;
overflow-x: hidden;
}
textarea {
resize: none;
}
/* 滚动条样式 */
// ::-webkit-scrollbar:horizontal { width: 5px; background-color: white; }
::-webkit-scrollbar-thumb {
background: #E4E7EC;
}
::-webkit-scrollbar {
width: 5px;
}
::-webkit-scrollbar-track {
// background-color: #999;
}
app-root {
height: 100%;
}
.blue {
cursor: pointer;
color: #2C4DC0 !important;
}
.green {
cursor: pointer;
color: #42B983 !important;
}
.red {
cursor: pointer;
color: #FF0000 !important;
}
.forbid {
color: gray;
pointer-events: none
}
.forbidbtn {
background: gray !important;
pointer-events: none
}
.box {
width: 100%;
height: 100%;
overflow-y: auto;
}
.ant-tabs-content {
height: 100%;
}
.ant-pagination-next,
.ant-pagination-prev {
overflow: hidden;
}
.pagination {
margin: 15px 0;
display: flex;
align-items: center;
justify-content: center;
}
.maxHeightTreeSelect {
max-height: 280px;
}
// 可展开面板
.panel {
width: 100%;
background: #FFFFFF;
box-shadow: 0px 3px 8px 1px rgba(0, 0, 0, 0.0800);
border-radius: 4px 4px 4px 4px;
opacity: 1;
border: 1px solid #E4E7EC;
box-sizing: border-box;
padding: 16px;
.panelheader {
height: 46px;
display: flex;
align-items: center;
}
}
.panelheadernameblue {
background-color: #1D9DFF;
}
.panelheadernamepurple {
background-color: #9D80FF;
}
.panelheadernameblue2 {
background-color: #5087FF;
}
.panelheadernamegreen {
background-color: #42B983;
}
.panelheadernameor {
background-color: #FF9203;
}
.panelheadernameor2 {
background-color: #FF5D2A;
}
.panelheadernamered {
background-color: #FF404D;
}
.spin {
background: rgb(134, 131, 131, 0.2);
position: absolute;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
Loading…
Cancel
Save