Browse Source

[修改]修改救援站和检查员页面

非煤矿山灾害智能感知和预警系统
邵佳豪 3 years ago
parent
commit
5f8c88c525
  1. 11138
      package-lock.json
  2. 1
      package.json
  3. 2
      proxy.config.json
  4. 15
      src/app/home/nav/nav.component.ts
  5. 2
      src/app/home/system-management/user/adduser/adduser.component.html
  6. 2
      src/app/home/system-management/user/adduser/adduser.component.ts
  7. 2
      src/app/home/system-management/user/edituser/edituser.component.html
  8. 2
      src/app/home/system-management/user/edituser/edituser.component.ts
  9. 4
      src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html
  10. 16
      src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts
  11. 4
      src/app/home/task/da-oneself-plan/da-oneself-plan.component.html
  12. 14
      src/app/home/task/da-oneself-plan/da-oneself-plan.component.ts
  13. 12
      src/app/home/task/station-task-apply/apply/apply.component.ts
  14. 52
      src/app/home/task/station-task-apply/station-task-apply.component.html
  15. 21
      src/app/home/task/station-task-apply/station-task-apply.component.ts
  16. 9
      src/app/home/task/station-weekly-plan/station-weekly-plan.component.html
  17. 79
      src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts
  18. 3
      src/app/home/task/station-weekly-plan/task-details/task-details.component.ts
  19. 16
      src/app/home/task/zhi-indicators/zhi-indicators.component.html
  20. 54
      src/signalR.ts

11138
package-lock.json generated

File diff suppressed because it is too large Load Diff

1
package.json

@ -18,6 +18,7 @@
"@angular/platform-browser": "~13.1.0", "@angular/platform-browser": "~13.1.0",
"@angular/platform-browser-dynamic": "~13.1.0", "@angular/platform-browser-dynamic": "~13.1.0",
"@angular/router": "~13.1.0", "@angular/router": "~13.1.0",
"@microsoft/signalr": "^6.0.8",
"@types/file-saver": "^2.0.5", "@types/file-saver": "^2.0.5",
"echarts": "^5.3.3", "echarts": "^5.3.3",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",

2
proxy.config.json

@ -4,7 +4,7 @@
"secure": false, "secure": false,
"changeOrigin": true "changeOrigin": true
}, },
"/signalr": { "/hubs": {
"target": "https://121.36.37.70:8204", "target": "https://121.36.37.70:8204",
"secure": false, "secure": false,
"ws": true, "ws": true,

15
src/app/home/nav/nav.component.ts

@ -5,6 +5,8 @@ import { HttpClient } from '@angular/common/http';
import { ChangePasswordComponent } from '../change-password/change-password.component'; import { ChangePasswordComponent } from '../change-password/change-password.component';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from 'ng-zorro-antd/message';
import signalR from '../../../signalR'
@Component({ @Component({
selector: 'app-nav', selector: 'app-nav',
templateUrl: './nav.component.html', templateUrl: './nav.component.html',
@ -20,18 +22,29 @@ export class NavComponent implements OnInit {
//调用服务中的function刷新token //调用服务中的function刷新token
this.token.startUp() this.token.startUp()
this.user = JSON.parse(sessionStorage.getItem('userData')).name this.user = JSON.parse(sessionStorage.getItem('userData')).name
let roles = JSON.parse(sessionStorage.getItem('userData')).roles let roles = JSON.parse(sessionStorage.getItem('userData')).roles
let isTrue = roles.find(item => { let isTrue = roles.find(item => {
return item.name == '超级管理员' return item.name == '超级管理员'
}) })
isTrue ? this.isSuperAdmin = true : this.isSuperAdmin = false isTrue ? this.isSuperAdmin = true : this.isSuperAdmin = false
// signalR.initSR();
// // 接收来自中心的消息
// (signalR.SR as any).on('receiveNotification', (message: string, senderName: string) => {
// // 接收后要做的事
// console.log('收到消息---', message)
// })
} }
signOut() { signOut() {
this.router.navigate(['/login']) this.router.navigate(['/login'])
} }
ngOnDestroy(): void { ngOnDestroy(): void {
this.token.delete() this.token.delete()
// console.log('断开SR')
// signalR.stopSR();
} }
changePassword() { changePassword() {

2
src/app/home/system-management/user/adduser/adduser.component.html

@ -17,7 +17,7 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="电子邮箱">电子邮箱</nz-form-label> <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="电子邮箱">电子邮箱</nz-form-label>
<nz-form-control> <nz-form-control>
<nz-input-group> <nz-input-group>
<input nz-input type="text" formControlName="email" placeholder="请输入电子邮箱" /> <input nz-input type="text" formControlName="email" placeholder="请输入电子邮箱" />

2
src/app/home/system-management/user/adduser/adduser.component.ts

@ -20,7 +20,7 @@ export class AdduserComponent implements OnInit {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
account: [null, [Validators.required]], account: [null, [Validators.required]],
name: [null, [Validators.required]], name: [null, [Validators.required]],
email: [null], email: [null, [Validators.required]],
organization: [null, [Validators.required]], organization: [null, [Validators.required]],
role: [[], [Validators.required]] role: [[], [Validators.required]]
}); });

2
src/app/home/system-management/user/edituser/edituser.component.html

@ -17,7 +17,7 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="电子邮箱">电子邮箱</nz-form-label> <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="电子邮箱">电子邮箱</nz-form-label>
<nz-form-control> <nz-form-control>
<nz-input-group> <nz-input-group>
<input nz-input type="text" formControlName="email" placeholder="请输入电子邮箱" /> <input nz-input type="text" formControlName="email" placeholder="请输入电子邮箱" />

2
src/app/home/system-management/user/edituser/edituser.component.ts

@ -24,7 +24,7 @@ export class EdituserComponent implements OnInit {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
account: [this.data.username, [Validators.required]], account: [this.data.username, [Validators.required]],
name: [this.data.name, [Validators.required]], name: [this.data.name, [Validators.required]],
email: [this.data.email], email: [this.data.email, [Validators.required]],
organization: [this.data.organizationId, [Validators.required]], organization: [this.data.organizationId, [Validators.required]],
role: [rolesId, [Validators.required]] role: [rolesId, [Validators.required]]
}); });

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

@ -312,7 +312,7 @@
</span> </span>
<span style="width: 8%;"> <span style="width: 8%;">
<span> <span>
单位总数:{{element.awaitInspect}}/{{element.allUnitsNum}} 单位总数:{{element.allUnitsNum}}/{{TuesdayThursdayNum}}
</span> </span>
</span> </span>
<div style="width: 72%;" class="progress progresssquare"> <div style="width: 72%;" class="progress progresssquare">
@ -336,7 +336,7 @@
<div class="num"> <div class="num">
<div class="round" style="background: #2C4DC0;"></div> <div class="round" style="background: #2C4DC0;"></div>
<span class="word">已分配</span> <span class="word">已分配</span>
<span class="boldspan">{{item.inspected}}</span> <span class="boldspan">{{item.data.length}}</span>
</div> </div>
<div class="num"> <div class="num">
<div class="round" style="background: #87D068;"></div> <div class="round" style="background: #87D068;"></div>

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

@ -17,6 +17,7 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
selectedTime selectedTime
selectMonth(item) { selectMonth(item) {
this.selectedMonth = item.id this.selectedMonth = item.id
this.getTuesdayThursdayNum()
this.getHigherTasks() this.getHigherTasks()
this.getTaskList() this.getTaskList()
this.getAllStation() this.getAllStation()
@ -24,11 +25,24 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
} }
selectYear(e) { selectYear(e) {
this.selectedYear = e this.selectedYear = e
this.getTuesdayThursdayNum()
this.getHigherTasks() this.getHigherTasks()
this.getTaskList() this.getTaskList()
this.getAllStation() this.getAllStation()
this.getCountStat() this.getCountStat()
} }
//当月有几个周二周四
TuesdayThursdayNum = 0
getTuesdayThursdayNum() {
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
this.http.get(`/api/TaskTargets/GetTargetCount/${selectedTime}`).subscribe((data: any) => {
console.log('最大日期', data)
this.TuesdayThursdayNum = data
})
}
months = [ months = [
{ id: 1, name: '1月', isable: true }, { id: 1, name: '1月', isable: true },
{ id: 2, name: '2月', isable: true }, { id: 2, name: '2月', isable: true },
@ -62,7 +76,7 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
//统计信息 //统计信息
this.getCountStat() this.getCountStat()
this.getTuesdayThursdayNum()
//本级部署 //本级部署
this.getAllStation() this.getAllStation()
} }

4
src/app/home/task/da-oneself-plan/da-oneself-plan.component.html

@ -95,7 +95,7 @@
</span> </span>
<span style="width: 8%;"> <span style="width: 8%;">
<span> <span>
单位总数:{{element.awaitInspect}}/{{element.allUnitsNum}} 单位总数:{{element.allUnitsNum}}/{{TuesdayThursdayNum}}
</span> </span>
</span> </span>
<div style="width: 66%;" class="progress progresssquare"> <div style="width: 66%;" class="progress progresssquare">
@ -119,7 +119,7 @@
<div class="num"> <div class="num">
<div class="round" style="background: #2C4DC0;"></div> <div class="round" style="background: #2C4DC0;"></div>
<span class="word">已分配</span> <span class="word">已分配</span>
<span class="boldspan">{{item.inspected}}</span> <span class="boldspan">{{item.data.length}}</span>
</div> </div>
<div class="num"> <div class="num">
<div class="round" style="background: #42B983;"></div> <div class="round" style="background: #42B983;"></div>

14
src/app/home/task/da-oneself-plan/da-oneself-plan.component.ts

@ -19,21 +19,35 @@ export class DaOneselfPlanComponent implements OnInit {
this.selectedMonth = new Date().getMonth() + 1 this.selectedMonth = new Date().getMonth() + 1
this.getTasks() this.getTasks()
this.getAllStation() this.getAllStation()
this.getTuesdayThursdayNum()
} }
selectedMonth selectedMonth
selectedYear = 2022 selectedYear = 2022
selectedTime selectedTime
selectMonth(item) { selectMonth(item) {
this.selectedMonth = item.id this.selectedMonth = item.id
this.getTuesdayThursdayNum()
this.getTasks() this.getTasks()
this.getAllStation() this.getAllStation()
} }
selectYear(e) { selectYear(e) {
this.selectedYear = e this.selectedYear = e
console.log('年', e) console.log('年', e)
this.getTuesdayThursdayNum()
this.getTasks() this.getTasks()
this.getAllStation() this.getAllStation()
} }
//当月有几个周二周四
TuesdayThursdayNum = 0
getTuesdayThursdayNum() {
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
this.http.get(`/api/TaskTargets/GetTargetCount/${selectedTime}`).subscribe((data: any) => {
console.log('最大日期', data)
this.TuesdayThursdayNum = data
})
}
months = [ months = [
{ id: 1, name: '1月', isable: true }, { id: 1, name: '1月', isable: true },
{ id: 2, name: '2月', isable: true }, { id: 2, name: '2月', isable: true },

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

@ -33,13 +33,10 @@ export class ApplyComponent implements OnInit {
Promise.all([this.getCompanies(), this.getAllOrganization()]) Promise.all([this.getCompanies(), this.getAllOrganization()])
.then((results) => { .then((results) => {
let arr = [...JSON.parse(JSON.stringify(this.allOrList)), ...JSON.parse(JSON.stringify(this.unitList))] let arr = [...JSON.parse(JSON.stringify(this.allOrList)), ...JSON.parse(JSON.stringify(this.unitList))]
console.log(789456, this.allOrList)
console.log(789456, this.unitList)
let nodes = [...this.toTree.toTree(arr)] let nodes = [...this.toTree.toTree(arr)]
console.log('6666',nodes)
this.unitPopover.nodes = JSON.parse(JSON.stringify(nodes)) this.unitPopover.nodes = JSON.parse(JSON.stringify(nodes))
}); });
} }
@ -66,7 +63,12 @@ export class ApplyComponent implements OnInit {
element.disableCheckbox = true element.disableCheckbox = true
}); });
this.allOrList = JSON.parse(JSON.stringify(data.items)) this.allOrList = JSON.parse(JSON.stringify(data.items))
this.allOrList.length == 1 ? this.allOrList[0].parentId = null : null console.log(111,this.allOrList)
this.allOrList.forEach(element => {
if(element.id == JSON.parse(sessionStorage.getItem('userData')).organizationId){
element.parentId = null
}
});
resolve(data) resolve(data)
}) })
}) })

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

@ -85,7 +85,7 @@
[ngClass]="{'greenborder': item.approvalStatus == '通过','redborder': item.approvalStatus == '驳回'}"> [ngClass]="{'greenborder': item.approvalStatus == '通过','redborder': item.approvalStatus == '驳回'}">
<div class="flexcol tasknamebox"> <div class="flexcol tasknamebox">
<span> <span>
{{item.taskName}} {{item.taskType}}
</span> </span>
<span> <span>
任务名称 任务名称
@ -117,25 +117,41 @@
</div> </div>
<div class="flexcol flexcolassistant"> <div class="flexcol flexcolassistant">
<span class="assistant" nz-tooltip [nzTooltipTitle]="titleTemplate"> <span class="assistant" nz-tooltip [nzTooltipTitle]="titleTemplate">
<span *ngFor="let i of item.supervisors"> <ng-container *ngIf="isSupervisor; else elseTemplate2">
<img *ngIf="i.posts && i.posts[0] == '主查人员'" <span *ngFor="let i of item.assitantOrganizations">
src="../../../../assets/images/icon/main.png" alt=""> {{i.name}}
<img *ngIf="i.posts && i.posts[0] == '协查人员'" </span>
src="../../../../assets/images/icon/assist.png" alt=""> </ng-container>
{{i.name}} <ng-template #elseTemplate2>
</span> <span *ngFor="let i of item.supervisors">
<img *ngIf="i.posts && i.posts[0] == '主查人员'"
src="../../../../assets/images/icon/main.png" alt="">
<img *ngIf="i.posts && i.posts[0] == '协查人员'"
src="../../../../assets/images/icon/assist.png" alt="">
{{i.name}}
</span>
</ng-template>
</span> </span>
<ng-template #titleTemplate let-thing> <ng-template #titleTemplate let-thing>
<span style="margin-right: 6px;" *ngFor="let i of item.supervisors"> <ng-container *ngIf="isSupervisor; else elseTemplate3">
<img *ngIf="i.posts && i.posts[0] == '主查人员'" <span style="margin-right: 6px;" *ngFor="let i of item.assitantOrganizations">
src="../../../../assets/images/icon/main.png" alt=""> {{i.name}}
<img *ngIf="i.posts && i.posts[0] == '协查人员'" </span>
src="../../../../assets/images/icon/assist.png" alt=""> </ng-container>
{{i.name}} <ng-template #elseTemplate3>
</span> <span style="margin-right: 6px;" *ngFor="let i of item.supervisors">
<img *ngIf="i.posts && i.posts[0] == '主查人员'"
src="../../../../assets/images/icon/main.png" alt="">
<img *ngIf="i.posts && i.posts[0] == '协查人员'"
src="../../../../assets/images/icon/assist.png" alt="">
{{i.name}}
</span>
</ng-template>
</ng-template> </ng-template>
<span> <span>
协助人员 {{isSupervisor ? '协助机构' : '协助人员'}}
</span> </span>
</div> </div>
<div class="flexcol"> <div class="flexcol">
@ -149,13 +165,13 @@
<div class="flexcol"> <div class="flexcol">
<span> <span>
<ng-container <ng-container
*ngIf="item.approvalStatus == '通过'|| item.approvalStatus == '驳回' ; else elseTemplate"> *ngIf="item.approvalStatus == '通过'|| item.approvalStatus == '驳回' ; else elseTemplate4">
<img *ngIf="item.approvalStatus == '通过'" <img *ngIf="item.approvalStatus == '通过'"
src="../../../../assets/images/icon/agree.png" alt=""> src="../../../../assets/images/icon/agree.png" alt="">
<img *ngIf="item.approvalStatus == '驳回'" <img *ngIf="item.approvalStatus == '驳回'"
src="../../../../assets/images/icon/reject.png" alt=""> src="../../../../assets/images/icon/reject.png" alt="">
</ng-container> </ng-container>
<ng-template #elseTemplate> <ng-template #elseTemplate4>
<span>{{item.approvalStatus}}</span> <span>{{item.approvalStatus}}</span>
</ng-template> </ng-template>
</span> </span>

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

@ -55,12 +55,6 @@ export class StationTaskApplyComponent implements OnInit {
this.getTaskList() this.getTaskList()
} }
cancel(item, type) {
}
delete(item) {
}
isloading = false isloading = false
totalCount totalCount
@ -72,12 +66,13 @@ export class StationTaskApplyComponent implements OnInit {
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
let params = { let params = {
Month: selectedTime, Month: selectedTime,
OrganizationId: this.OrganizationId,
TaskName: this.searchForm.taskname, TaskName: this.searchForm.taskname,
CompanyName: this.searchForm.unitname, CompanyName: this.searchForm.unitname,
AssitantOrganizationId: this.searchForm.or, AssitantOrganizationId: this.searchForm.or,
CreatorId: this.isSupervisor ? this.userId : null,//如果是检查员需要传CreatorId只针对这个账户 如果是救援站就不需要
CreationTypes:['申领任务'],
OrganizationId: this.OrganizationId,
PageNumber: this.PageNumber, PageNumber: this.PageNumber,
CreatorId: this.userId,
PageSize: this.PageSize PageSize: this.PageSize
} }
this.http.get('/api/PlanTasks', { this.http.get('/api/PlanTasks', {
@ -130,6 +125,7 @@ export class StationTaskApplyComponent implements OnInit {
element.title = element.name element.title = element.name
element.disableCheckbox = true element.disableCheckbox = true
element.selectable = false element.selectable = false
element.level == 'squadron' ? element.disableCheckbox = false : null
}); });
this.organizationListAll = JSON.parse(JSON.stringify(data.items)) this.organizationListAll = JSON.parse(JSON.stringify(data.items))
this.organizationList = JSON.parse(JSON.stringify(data.items)).filter(item => { this.organizationList = JSON.parse(JSON.stringify(data.items)).filter(item => {
@ -202,7 +198,8 @@ export class StationTaskApplyComponent implements OnInit {
Promise.all([this.getAllOrganization(), this.getSupervisor(), this.getUsers()]) Promise.all([this.getAllOrganization(), this.getSupervisor(), this.getUsers()])
.then((results) => { .then((results) => {
if (this.isSupervisor) { if (this.isSupervisor) {
let arr = [...this.users, ...this.organizationListAll] // let arr = [...this.users, ...this.organizationListAll]
let arr = [...this.organizationListAll]
this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr))) this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr)))
} else { } else {
let arr = [...this.supervisorList, ...this.organizationList] let arr = [...this.supervisorList, ...this.organizationList]
@ -242,13 +239,10 @@ export class StationTaskApplyComponent implements OnInit {
} }
} }
mouseEnter() { mouseEnter() {
// console.log('进入了')
window.clearInterval(this.timer); window.clearInterval(this.timer);
} }
mouseleave() { mouseleave() {
this.rollStart() this.rollStart()
} }
ngOnDestroy(): void { ngOnDestroy(): void {
console.log('退出了') console.log('退出了')
@ -288,7 +282,8 @@ export class StationTaskApplyComponent implements OnInit {
taskType: instance.validateForm.value.taskname, taskType: instance.validateForm.value.taskname,
companyId: instance.selectedUnitData.id, companyId: instance.selectedUnitData.id,
organizationId: this.OrganizationId, organizationId: this.OrganizationId,
supervisorIds: instance.validateForm.value.organization, supervisorIds: this.isSupervisor ? [] : instance.validateForm.value.organization,
assitantOrganizationIds: this.isSupervisor ? instance.validateForm.value.organization : [],
creationType: '申领任务', creationType: '申领任务',
approvalStatus: '待处理' approvalStatus: '待处理'
} }

9
src/app/home/task/station-weekly-plan/station-weekly-plan.component.html

@ -129,13 +129,14 @@
<img src="../../../../assets//images/icon/station.png" alt=""> <img src="../../../../assets//images/icon/station.png" alt="">
{{element.name}} {{element.name}}
</span> </span>
<span style="width: 8%;">单位总数: {{element.awaitInspect}}/{{element.allUnitsNum}}</span> <span style="width: 8%;">单位总数: {{element.allUnitsNum}}/{{TuesdayThursdayNum}}</span>
<div style="width: 60%;" class="progress progresssquare"> <div style="width: 60%;" class="progress progresssquare">
<span>完成进度</span> <span>完成进度</span>
<nz-progress nzStrokeLinecap="square" [nzStrokeWidth]="16" nzStrokeColor="#42B983" <nz-progress nzStrokeLinecap="square" [nzStrokeWidth]="16" nzStrokeColor="#42B983"
[nzPercent]="element.percentage"></nz-progress> [nzPercent]="element.percentage"></nz-progress>
</div> </div>
<button nz-button nzType="primary" style="margin-right: 12px;" (click)="adjustment(element)">任务调整</button> <button nz-button nzType="primary" style="margin-right: 12px;"
(click)="adjustment(element)">任务调整</button>
<button nz-button nzType="primary" (click)="createTask(element)">{{isSupervisor ? '协同任务' : <button nz-button nzType="primary" (click)="createTask(element)">{{isSupervisor ? '协同任务' :
'生成周计划'}}</button> '生成周计划'}}</button>
<span (click)="expandcarditem(element)" class="expand blue"> <span (click)="expandcarditem(element)" class="expand blue">
@ -153,7 +154,7 @@
<div class="num"> <div class="num">
<div class="round" style="background: #2C4DC0;"></div> <div class="round" style="background: #2C4DC0;"></div>
<span class="word">已分配</span> <span class="word">已分配</span>
<span class="boldspan">{{item.inspected}}</span> <span class="boldspan">{{item.data.length}}</span>
</div> </div>
<div class="num"> <div class="num">
<div class="round" style="background: #42B983;"></div> <div class="round" style="background: #42B983;"></div>
@ -207,7 +208,7 @@
</span> </span>
</ng-template> </ng-template>
<span> <span>
协助人员 协助机构/人员
</span> </span>
</div> </div>
<div class="flexcol"> <div class="flexcol">

79
src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts

@ -44,16 +44,30 @@ export class StationWeeklyPlanComponent implements OnInit {
selectMonth(item) { selectMonth(item) {
this.selectedMonth = item.id this.selectedMonth = item.id
this.initializeData() this.initializeData()
this.getTuesdayThursdayNum()
this.getTaskList() this.getTaskList()
this.getTaskListPass(this.stationData[0]) this.getTaskListPass(this.stationData[0])
} }
selectYear(e) { selectYear(e) {
this.selectedYear = e this.selectedYear = e
this.initializeData() this.initializeData()
this.getTuesdayThursdayNum()
this.getTaskList() this.getTaskList()
this.getTaskListPass(this.stationData[0]) this.getTaskListPass(this.stationData[0])
} }
//当月有几个周二周四
TuesdayThursdayNum = 0
getTuesdayThursdayNum() {
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
this.http.get(`/api/TaskTargets/GetTargetCount/${selectedTime}`).subscribe((data: any) => {
console.log('最大日期', data)
this.TuesdayThursdayNum = data
})
}
isExpand = true isExpand = true
expand() { expand() {
this.isExpand = !this.isExpand this.isExpand = !this.isExpand
@ -171,7 +185,8 @@ export class StationWeeklyPlanComponent implements OnInit {
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
let params = { let params = {
Month: selectedTime, Month: selectedTime,
SupervisorId: this.userId, SupervisorId: this.isSupervisor ? this.userId : null,
AssitantOrganizationId: this.isSupervisor ? null : this.OrganizationId,
PageNumber: this.PageNumber, PageNumber: this.PageNumber,
PageSize: this.PageSize PageSize: this.PageSize
} }
@ -211,7 +226,8 @@ export class StationWeeklyPlanComponent implements OnInit {
let params = { let params = {
Month: selectedTime, Month: selectedTime,
approvalStatuses: ['通过', '待检查', '已检查'], approvalStatuses: ['通过', '待检查', '已检查'],
SupervisorId: this.userId, SupervisorId: this.isSupervisor ? this.userId : null,
AssitantOrganizationId: this.isSupervisor ? null : this.OrganizationId,
PageNumber: this.PageNumber, PageNumber: this.PageNumber,
PageSize: this.PageSize PageSize: this.PageSize
} }
@ -287,7 +303,6 @@ export class StationWeeklyPlanComponent implements OnInit {
item.isLoading = false item.isLoading = false
item.passed += 1 item.passed += 1
this.getTaskListPass(this.stationData[0]) this.getTaskListPass(this.stationData[0])
}, },
error: (err) => { error: (err) => {
this.message.create('warning', '接受失败'); this.message.create('warning', '接受失败');
@ -329,23 +344,35 @@ export class StationWeeklyPlanComponent implements OnInit {
} }
userName userName
organizationName
ngOnInit(): void { ngOnInit(): void {
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.userId = JSON.parse(sessionStorage.getItem('userData')).id this.userId = JSON.parse(sessionStorage.getItem('userData')).id
this.userName = JSON.parse(sessionStorage.getItem('userData')).name this.userName = JSON.parse(sessionStorage.getItem('userData')).name
this.stationData[0].name = this.userName
this.organizationName = JSON.parse(sessionStorage.getItem('userData')).organizationName
let roles = JSON.parse(sessionStorage.getItem('userData')).roles let roles = JSON.parse(sessionStorage.getItem('userData')).roles
let isSupervisor = roles.find(item => { let isSupervisor = roles.find(item => {
return item.name.indexOf('检查') != -1 return item.name.indexOf('检查') != -1
}) })
isSupervisor ? this.isSupervisor = true : this.isSupervisor = false isSupervisor ? this.isSupervisor = true : this.isSupervisor = false
if (isSupervisor) {
this.stationData[0].name = this.userName
} else {
this.stationData[0].name = this.organizationName
}
this.selectedMonth = new Date().getMonth() + 1 this.selectedMonth = new Date().getMonth() + 1
// this.getAllStation() // this.getAllStation()
this.getTaskList() this.getTaskList()
this.getTaskListPass(this.stationData[0]) this.getTaskListPass(this.stationData[0])
this.getTuesdayThursdayNum()
setTimeout(() => { setTimeout(() => {
this.rollStart() this.rollStart()
}, 0); }, 0);
@ -391,10 +418,6 @@ export class StationWeeklyPlanComponent implements OnInit {
expandcarditem(item) { expandcarditem(item) {
item.isExpand = !item.isExpand item.isExpand = !item.isExpand
// console.log(item)
// if (item.isExpand) {
// this.getTaskListOfStation(item)
// }
} }
//获得消防站下的所有任务 //获得消防站下的所有任务
@ -414,13 +437,13 @@ export class StationWeeklyPlanComponent implements OnInit {
next: (data: any) => { next: (data: any) => {
item.isLoading = false item.isLoading = false
let listData = [ let listData = [
{ name: '双随机', background: '#1D9DFF', icon: 'suiji.png', scale: '0/0', data: [] }, { name: '双随机', background: '#1D9DFF', icon: 'suiji.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
{ name: '行政许可', background: '#42B983', icon: 'xuke.png', scale: '0/0', data: [] }, { name: '行政许可', background: '#42B983', icon: 'xuke.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
{ name: '熟悉演练', background: '#9D80FF', icon: 'yanlian.png', scale: '0/0', data: [] }, { name: '熟悉演练', background: '#9D80FF', icon: 'yanlian.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
{ name: '联络指导', background: '#5483EA', icon: 'zhidao.png', scale: '0/0', data: [] }, { name: '联络指导', background: '#5483EA', icon: 'zhidao.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
{ name: '消防宣传', background: '#FF5D2A', icon: 'xuanchuan.png', scale: '0/0', data: [] }, { name: '消防宣传', background: '#FF5D2A', icon: 'xuanchuan.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
{ name: '投诉举报', background: '#5087FF', icon: 'tousu.png', scale: '0/0', data: [] }, { name: '投诉举报', background: '#5087FF', icon: 'tousu.png', scale: '0/0', data: [], inspected: 0, finished: 0 },
{ name: '火灾调查', background: '#FF404D', icon: 'huozai.png', scale: '0/0', data: [] } { name: '火灾调查', background: '#FF404D', icon: 'huozai.png', scale: '0/0', data: [], inspected: 0, finished: 0 }
] ]
data.items.forEach(element => { data.items.forEach(element => {
listData.forEach((item, key) => { listData.forEach((item, key) => {
@ -435,7 +458,21 @@ export class StationWeeklyPlanComponent implements OnInit {
} }
} }
item.data = listData item.data = listData
// console.log('点击的救援站通过数据', item) console.log('当前登录用户所有通过的任务', item);
item.allUnitsNum = 0
item.awaitInspect = 0
item.inspected = 0
item.finished = 0
item.data.forEach(element => {
item.allUnitsNum += element.data.length
element.data.forEach(i => {
i.approvalStatus == '待检查' ? item.awaitInspect += 1 : null
i.approvalStatus == '已检查' ? item.inspected += 1 : null
i.approvalStatus == '待检查' ? element.inspected += 1 : null
i.approvalStatus == '已检查' ? element.finished += 1 : null
});
});
item.percentage = Math.round(item.inspected / item.allUnitsNum) * 100
}, },
error: (err) => { error: (err) => {
this.message.create('warning', '获取数据失败'); this.message.create('warning', '获取数据失败');
@ -443,6 +480,8 @@ export class StationWeeklyPlanComponent implements OnInit {
} }
}) })
} }
taskDetails(item) { taskDetails(item) {
// console.log(item) // console.log(item)
const modal = this.modal.create({ const modal = this.modal.create({
@ -459,7 +498,11 @@ export class StationWeeklyPlanComponent implements OnInit {
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!')); modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result)); modal.afterClose.subscribe(result => {
// item
// this.getTaskList()
this.getTaskListPass(this.stationData[0])
});
} }

3
src/app/home/task/station-weekly-plan/task-details/task-details.component.ts

@ -39,6 +39,7 @@ export class TaskDetailsComponent implements OnInit {
} }
} }
}); });
this.data.passed += 1
}, },
error: (err) => { error: (err) => {
this.message.create('warning', '接受失败'); this.message.create('warning', '接受失败');
@ -68,8 +69,10 @@ export class TaskDetailsComponent implements OnInit {
if (element.isExpand) { if (element.isExpand) {
this.parent.getTaskListOfStation(element) this.parent.getTaskListOfStation(element)
} }
} }
}); });
this.data.passed -= 1
}, },
error: (err) => { error: (err) => {
this.message.create('warning', '拒绝失败'); this.message.create('warning', '拒绝失败');

16
src/app/home/task/zhi-indicators/zhi-indicators.component.html

@ -120,9 +120,9 @@
<thead> <thead>
<tr> <tr>
<th nzWidth="25%">单位名称</th> <th nzWidth="25%">单位名称</th>
<th nzWidth="42%">配合机构</th> <th nzWidth="40%">配合机构</th>
<th nzWidth="25%">说明</th> <th nzWidth="25%">说明</th>
<th nzWidth="8%">操作</th> <th nzWidth="10%">操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -268,9 +268,9 @@
<thead> <thead>
<tr> <tr>
<th nzWidth="25%">单位名称</th> <th nzWidth="25%">单位名称</th>
<th nzWidth="42%">配合机构</th> <th nzWidth="40%">配合机构</th>
<th nzWidth="25%">说明</th> <th nzWidth="25%">说明</th>
<th nzWidth="8%">操作</th> <th nzWidth="10%">操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -418,10 +418,10 @@
<tr> <tr>
<th nzWidth="18%">责任机构</th> <th nzWidth="18%">责任机构</th>
<th nzWidth="6%">任务额</th> <th nzWidth="6%">任务额</th>
<th nzWidth="25%">单位名称</th> <th nzWidth="23%">单位名称</th>
<th nzWidth="15%">监督员</th> <th nzWidth="15%">监督员</th>
<th>说明</th> <th>说明</th>
<th nzWidth="8%">操作</th> <th nzWidth="10%">操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -606,9 +606,9 @@
<tr> <tr>
<th nzWidth="25%">责任机构</th> <th nzWidth="25%">责任机构</th>
<th nzWidth="6%">任务额</th> <th nzWidth="6%">任务额</th>
<th nzWidth="30%">单位名称</th> <th nzWidth="32%">单位名称</th>
<th>说明</th> <th>说明</th>
<th nzWidth="8%">操作</th> <th nzWidth="10%">操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

54
src/signalR.ts

@ -0,0 +1,54 @@
import * as signalR from '@microsoft/signalr'
export default {
SR: {},
// 初始化连接
initSR: function () {
const that = this
// // 连接 SignalR
const options: signalR.IHttpConnectionOptions = {
accessTokenFactory: async () => {
return sessionStorage.getItem('token')
}
}
// 1.获取系统中定义的baseURL
const url = '/hubs/notification'
// 2.初始化连接
that.SR = new signalR.HubConnectionBuilder()
.withUrl(url, options)
.configureLogging(signalR.LogLevel.Information)
.build();
// 3. 在停止signalR时,不让onclose内的 start执行
(that.SR as any).flag = true
// 4.启动连接的方法
async function start() {
try {
await (that.SR as any).start();
} catch (err) {
setTimeout(start, 5000);
}
}
// 5.关闭之后重连
(that.SR as any).onclose(async () => {
if ((that.SR as any).flag) {
await start();
}
});
// 6.启动连接
start();
},
// 停止连接,因为调用that.SR.stop(),同时会触发5操作,所以用了flag
stopSR: function () {
// const that = this
// (this.SR as any).flag = false
// async function stop() {
// try {
// await (this.SR as any).stop();
// } catch (err) {
// console.log(err)
// }
// }
this.signalR.stop();
}
};
Loading…
Cancel
Save