From 105dca66910f7493cd2c60abb419f7bccb7da9e9 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Wed, 31 Aug 2022 11:36:54 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/home/nav/nav.component.ts | 20 +++++++++---------- .../user/adduser/adduser.component.html | 15 +++++++++++--- .../user/adduser/adduser.component.ts | 7 ++++--- .../user/edituser/edituser.component.html | 15 +++++++++++--- .../user/edituser/edituser.component.ts | 7 ++++--- .../user/user.component.html | 6 ++++++ .../system-management/user/user.component.ts | 2 ++ .../da-monthly-task-overview.component.ts | 10 ++++++++++ .../zhi-indicators.component.html | 16 +++++++-------- .../zhi-indicators.component.ts | 5 +++++ src/signalR.ts | 20 +++++++++---------- 11 files changed, 83 insertions(+), 40 deletions(-) diff --git a/src/app/home/nav/nav.component.ts b/src/app/home/nav/nav.component.ts index e1a930e..ef35c8c 100644 --- a/src/app/home/nav/nav.component.ts +++ b/src/app/home/nav/nav.component.ts @@ -16,7 +16,6 @@ export class NavComponent implements OnInit { constructor(private modal: NzModalService, private http: HttpClient, private message: NzMessageService, private viewContainerRef: ViewContainerRef, private router: Router, public token: CacheTokenService) { } user = null - isSuperAdmin ngOnInit(): void { //调用服务中的function刷新token @@ -27,12 +26,14 @@ export class NavComponent implements OnInit { return item.name == '超级管理员' }) isTrue ? this.isSuperAdmin = true : this.isSuperAdmin = false - // signalR.initSR(); - // // 接收来自中心的消息 - // (signalR.SR as any).on('receiveNotification', (message: string, senderName: string) => { - // // 接收后要做的事 - // console.log('收到消息---', message) - // }) + + + signalR.initSR(); + // 接收来自中心的消息 + (signalR.SR as any).on('receiveNotification', (message: string, senderName: string) => { + // 接收后要做的事 + console.log('收到消息---', message) + }) @@ -41,10 +42,9 @@ export class NavComponent implements OnInit { this.router.navigate(['/login']) } ngOnDestroy(): void { - this.token.delete() - // console.log('断开SR') - // signalR.stopSR(); + (signalR.SR as any).receiveNotification = [] + signalR.stopSR() } changePassword() { diff --git a/src/app/home/system-management/user/adduser/adduser.component.html b/src/app/home/system-management/user/adduser/adduser.component.html index a3ff138..06c82f8 100644 --- a/src/app/home/system-management/user/adduser/adduser.component.html +++ b/src/app/home/system-management/user/adduser/adduser.component.html @@ -9,7 +9,7 @@ - 真实姓名 + 真实姓名 @@ -17,7 +17,7 @@ - 电子邮箱 + 电子邮箱 @@ -43,7 +43,7 @@ - 角色 + 角色 @@ -51,5 +51,14 @@ + + 职位 + + + + + + + \ No newline at end of file diff --git a/src/app/home/system-management/user/adduser/adduser.component.ts b/src/app/home/system-management/user/adduser/adduser.component.ts index 6469be4..cf0c5dd 100644 --- a/src/app/home/system-management/user/adduser/adduser.component.ts +++ b/src/app/home/system-management/user/adduser/adduser.component.ts @@ -19,10 +19,11 @@ export class AdduserComponent implements OnInit { ngOnInit(): void { this.validateForm = this.fb.group({ account: [null, [Validators.required]], - name: [null, [Validators.required]], - email: [null, [Validators.required]], + name: [null], + email: [null], organization: [null, [Validators.required]], - role: [[], [Validators.required]] + role: [[]], + posts: [[]] }); if (this.roleList.length == 0) { diff --git a/src/app/home/system-management/user/edituser/edituser.component.html b/src/app/home/system-management/user/edituser/edituser.component.html index a3ff138..06c82f8 100644 --- a/src/app/home/system-management/user/edituser/edituser.component.html +++ b/src/app/home/system-management/user/edituser/edituser.component.html @@ -9,7 +9,7 @@ - 真实姓名 + 真实姓名 @@ -17,7 +17,7 @@ - 电子邮箱 + 电子邮箱 @@ -43,7 +43,7 @@ - 角色 + 角色 @@ -51,5 +51,14 @@ + + 职位 + + + + + + + \ No newline at end of file diff --git a/src/app/home/system-management/user/edituser/edituser.component.ts b/src/app/home/system-management/user/edituser/edituser.component.ts index 085e1a8..33f9c30 100644 --- a/src/app/home/system-management/user/edituser/edituser.component.ts +++ b/src/app/home/system-management/user/edituser/edituser.component.ts @@ -23,10 +23,11 @@ export class EdituserComponent implements OnInit { }); this.validateForm = this.fb.group({ account: [this.data.username, [Validators.required]], - name: [this.data.name, [Validators.required]], - email: [this.data.email, [Validators.required]], + name: [this.data.name], + email: [this.data.email], organization: [this.data.organizationId, [Validators.required]], - role: [rolesId, [Validators.required]] + role: [rolesId], + posts: [this.data.posts] }); if (this.roleList.length == 0) { this.getAllRoles() diff --git a/src/app/home/system-management/user/user.component.html b/src/app/home/system-management/user/user.component.html index d687c08..a6fbd54 100644 --- a/src/app/home/system-management/user/user.component.html +++ b/src/app/home/system-management/user/user.component.html @@ -38,6 +38,7 @@ 真实姓名 所属机构 角色 + 职位 创建时间 操作 @@ -58,6 +59,11 @@ {{i.name}} + + + {{i}} + + {{item.creationTime | date:"yyyy-MM-dd"}} diff --git a/src/app/home/system-management/user/user.component.ts b/src/app/home/system-management/user/user.component.ts index f506a2a..9e1230a 100644 --- a/src/app/home/system-management/user/user.component.ts +++ b/src/app/home/system-management/user/user.component.ts @@ -139,6 +139,7 @@ export class UserComponent implements OnInit { email: instance.validateForm.value.email, organizationId: instance.validateForm.value.organization, roleIds: instance.validateForm.value.role, + posts: instance.validateForm.value.posts, } this.http.post('/api/Users', body).subscribe({ next: async (data) => { @@ -192,6 +193,7 @@ export class UserComponent implements OnInit { email: instance.validateForm.value.email, organizationId: instance.validateForm.value.organization, roleIds: instance.validateForm.value.role, + posts: instance.validateForm.value.posts, } this.http.patch(`/api/Users/${item.id}`, body).subscribe({ next: async (data) => { diff --git a/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts b/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts index 2ffbd38..40f0a6d 100644 --- a/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts +++ b/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts @@ -3,6 +3,7 @@ import { Component, NgZone, 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'; +import signalR from '../../../../signalR' @Component({ selector: 'app-da-monthly-task-overview', templateUrl: './da-monthly-task-overview.component.html', @@ -62,6 +63,15 @@ export class DaMonthlyTaskOverviewComponent implements OnInit { OrganizationId ngOnInit(): void { + + + + // 接收来自中心的消息 + (signalR.SR as any).on('receiveNotification', (message: string, senderName: string) => { + // 接收后要做的事 + console.log('收到消息---', message) + }) + this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId this.selectedMonth = new Date().getMonth() + 1 diff --git a/src/app/home/task/zhi-indicators/zhi-indicators.component.html b/src/app/home/task/zhi-indicators/zhi-indicators.component.html index 256d8a1..e6069c4 100644 --- a/src/app/home/task/zhi-indicators/zhi-indicators.component.html +++ b/src/app/home/task/zhi-indicators/zhi-indicators.component.html @@ -448,19 +448,19 @@
- - - + + {{o.name}} - - - + + {{o.name}} diff --git a/src/app/home/task/zhi-indicators/zhi-indicators.component.ts b/src/app/home/task/zhi-indicators/zhi-indicators.component.ts index 2d810de..2308eb2 100644 --- a/src/app/home/task/zhi-indicators/zhi-indicators.component.ts +++ b/src/app/home/task/zhi-indicators/zhi-indicators.component.ts @@ -9,6 +9,8 @@ import { NzMessageService } from 'ng-zorro-antd/message'; import { NzModalService } from 'ng-zorro-antd/modal'; import { EditOrComponent } from './edit-or/edit-or.component'; import { AllotPersonComponent } from '../da-subordinate-audit/allot-person/allot-person.component'; + +import signalR from '../../../../signalR' @Component({ selector: 'app-zhi-indicators', templateUrl: './zhi-indicators.component.html', @@ -401,6 +403,9 @@ export class ZhiIndicatorsComponent implements OnInit { OrganizationId ngOnInit(): void { + + + this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId this.selectedMonth = new Date().getMonth() + 1 //说明保存防抖 diff --git a/src/signalR.ts b/src/signalR.ts index 191dba1..9e5fe4b 100644 --- a/src/signalR.ts +++ b/src/signalR.ts @@ -40,15 +40,15 @@ export default { }, // 停止连接,因为调用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(); + let that = this; + (that.SR as any).flag = false + async function stop() { + try { + await that.SR.stop(); + console.log("signaR退出成功"); + } catch (err) { } + } + stop(); } + }; \ No newline at end of file From df41203cdb35a93e87d08a592d57040cec7060a4 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Wed, 31 Aug 2022 15:05:52 +0800 Subject: [PATCH 2/4] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8F=8C=E9=9A=8F=E6=9C=BA=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../allot-person/allot-person.component.html | 6 +- .../allot-person/allot-person.component.ts | 3 +- .../apply/apply.component.html | 17 +++++- .../apply/apply.component.scss | 15 +++++ .../apply/apply.component.ts | 22 +++---- .../station-task-apply.component.html | 21 +++---- .../station-task-apply.component.ts | 58 ++++++++++++++++--- src/theme.less | 2 +- 8 files changed, 110 insertions(+), 34 deletions(-) diff --git a/src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.html b/src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.html index f43ee10..cb169d0 100644 --- a/src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.html +++ b/src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.html @@ -3,7 +3,8 @@ 检查员(主) - + @@ -12,7 +13,8 @@ 检查员(协) - + diff --git a/src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.ts b/src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.ts index 5b6b9f3..801017a 100644 --- a/src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.ts +++ b/src/app/home/task/da-subordinate-audit/allot-person/allot-person.component.ts @@ -21,7 +21,8 @@ export class AllotPersonComponent implements OnInit { assitant: [null, [Validators.required]] }); - + // console.log(this.mainsupervisorList) + // console.log(this.assitantsupervisorList) } destroyModal(): void { this.modal.destroy({ data: 'this the result data' }); diff --git a/src/app/home/task/station-task-apply/apply/apply.component.html b/src/app/home/task/station-task-apply/apply/apply.component.html index 7b568fa..226607b 100644 --- a/src/app/home/task/station-task-apply/apply/apply.component.html +++ b/src/app/home/task/station-task-apply/apply/apply.component.html @@ -3,7 +3,7 @@ 任务名称 - + @@ -122,5 +122,20 @@ + + 检查人员 + + + + + + + + + + + + +
\ No newline at end of file diff --git a/src/app/home/task/station-task-apply/apply/apply.component.scss b/src/app/home/task/station-task-apply/apply/apply.component.scss index 6ccbeba..36b1abf 100644 --- a/src/app/home/task/station-task-apply/apply/apply.component.scss +++ b/src/app/home/task/station-task-apply/apply/apply.component.scss @@ -26,6 +26,7 @@ border: 1px solid #d9d9d9; box-sizing: border-box; padding: 10px; + nz-form-item { margin: 12px 0; } @@ -76,3 +77,17 @@ } } } + + +.itembox { + .img1 { + margin-right: 8px; + } + + .img2 { + margin: 0 8px; + } + .select{ + width: 44.6%; + } +} diff --git a/src/app/home/task/station-task-apply/apply/apply.component.ts b/src/app/home/task/station-task-apply/apply/apply.component.ts index 33d9f4a..4cf7a98 100644 --- a/src/app/home/task/station-task-apply/apply/apply.component.ts +++ b/src/app/home/task/station-task-apply/apply/apply.component.ts @@ -17,16 +17,23 @@ export class ApplyComponent implements OnInit { @Input() supervisorList?: any; @Input() organizationList?: any; @Input() users?: any; + @Input() mainsupervisorList?: any; + @Input() assitantsupervisorList?: any; validateForm!: FormGroup; constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService, private message: NzMessageService) { } - + taskType newTree ngOnInit(): void { + + console.log('mainsupervisorList', this.mainsupervisorList) + console.log('assitantsupervisorList', this.assitantsupervisorList) this.validateForm = this.fb.group({ taskname: [null, [Validators.required]], - organization: [null, [Validators.required]] + organization: [null, [Validators.required]], + main: [null], + assist: [null] }); this.newTree = this.nodes @@ -35,7 +42,6 @@ export class ApplyComponent implements OnInit { .then((results) => { let arr = [...JSON.parse(JSON.stringify(this.allOrList)), ...JSON.parse(JSON.stringify(this.unitList))] let nodes = [...this.toTree.toTree(arr)] - console.log('6666',nodes) this.unitPopover.nodes = JSON.parse(JSON.stringify(nodes)) }); } @@ -63,9 +69,9 @@ export class ApplyComponent implements OnInit { element.disableCheckbox = true }); this.allOrList = JSON.parse(JSON.stringify(data.items)) - console.log(111,this.allOrList) + console.log(111, this.allOrList) this.allOrList.forEach(element => { - if(element.id == JSON.parse(sessionStorage.getItem('userData')).organizationId){ + if (element.id == JSON.parse(sessionStorage.getItem('userData')).organizationId) { element.parentId = null } }); @@ -147,12 +153,7 @@ export class ApplyComponent implements OnInit { } isPopover(data, e?: any) { e ? e.stopPropagation() : null - console.log(data) data.isPopover = !data.isPopover - // data.unitList.forEach(element => { - // element.checked = false - // }); - } // 弹出 tab popoverMenuSelect(data, type) { @@ -183,7 +184,6 @@ export class ApplyComponent implements OnInit { } } } - console.log(data.search2Value) } } diff --git a/src/app/home/task/station-task-apply/station-task-apply.component.html b/src/app/home/task/station-task-apply/station-task-apply.component.html index 9dd6671..d9b3566 100644 --- a/src/app/home/task/station-task-apply/station-task-apply.component.html +++ b/src/app/home/task/station-task-apply/station-task-apply.component.html @@ -121,13 +121,14 @@ {{i.name}} + + + + {{i.name}} +
- - {{i.name}} @@ -137,21 +138,21 @@ {{i.name}} + + + + {{i.name}} + - - {{i.name}} - - {{isSupervisor ? '协助机构' : '协助人员'}} + {{isSupervisor ? '协助机构/人员' : '协助人员'}}
diff --git a/src/app/home/task/station-task-apply/station-task-apply.component.ts b/src/app/home/task/station-task-apply/station-task-apply.component.ts index 19544f9..9e562a9 100644 --- a/src/app/home/task/station-task-apply/station-task-apply.component.ts +++ b/src/app/home/task/station-task-apply/station-task-apply.component.ts @@ -70,7 +70,7 @@ export class StationTaskApplyComponent implements OnInit { CompanyName: this.searchForm.unitname, AssitantOrganizationId: this.searchForm.or, CreatorId: this.isSupervisor ? this.userId : null,//如果是检查员需要传CreatorId只针对这个账户 如果是救援站就不需要 - CreationTypes:['申领任务'], + CreationTypes: ['申领任务'], OrganizationId: this.OrganizationId, PageNumber: this.PageNumber, PageSize: this.PageSize @@ -139,10 +139,9 @@ export class StationTaskApplyComponent implements OnInit { //获得所有检查员 supervisorList = [] - mainsupervisorList = [] - assitantsupervisorList = [] + async getSupervisor() { - var p = new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { this.http.get('/api/Users/Inspectors').subscribe((data: any) => { console.log('检查员列表', data) data.forEach(element => { @@ -154,7 +153,23 @@ export class StationTaskApplyComponent implements OnInit { resolve(data) }) }) - return p + } + + mainsupervisorList = [] + assitantsupervisorList = [] + getSupervisortype(type) { + let params = { + inspectorType: type + } + this.http.get('/api/Users/Inspectors', { + params: params + }).subscribe((data: any) => { + if (type == 'main') { + this.mainsupervisorList = data + } else { + this.assitantsupervisorList = data + } + }) } //获得除了检查员的其他用户 @@ -210,6 +225,10 @@ export class StationTaskApplyComponent implements OnInit { setTimeout(() => { this.rollStart() }, 0); + + //获得主协调查人员 + this.getSupervisortype('main') + this.getSupervisortype('assisted') } messageList = [1, 1, 1, 1, 1] @@ -268,22 +287,45 @@ export class StationTaskApplyComponent implements OnInit { supervisorList: JSON.parse(JSON.stringify(this.supervisorList)), organizationList: JSON.parse(JSON.stringify(this.organizationList)), users: JSON.parse(JSON.stringify(this.users)), - nodes: JSON.parse(JSON.stringify(this.nodes)) + nodes: JSON.parse(JSON.stringify(this.nodes)), + mainsupervisorList: JSON.parse(JSON.stringify(this.mainsupervisorList)), + assitantsupervisorList: JSON.parse(JSON.stringify(this.assitantsupervisorList)) }, nzOnOk: async () => { console.log(instance.validateForm.value) if (instance.validateForm.valid && instance.selectedUnitData.id) { + if (instance.taskType == '双随机') { + if (!instance.validateForm.value.main || !instance.validateForm.value.assist) { + this.message.create('warning', '请填写检查人员!'); + return false + } + } + await new Promise((resolve, reject) => { let selectedMonth = this.selectedMonth < 10 ? "0" + this.selectedMonth : this.selectedMonth; let selectedTime = this.selectedYear + '-' + selectedMonth + '-' + '01' + let supervisorIds + let assitantOrganizationIds + if (this.isSupervisor) { + if (instance.taskType == '双随机') { + supervisorIds = [instance.validateForm.value.main, instance.validateForm.value.assist] + } else { + supervisorIds = [] + } + assitantOrganizationIds = instance.validateForm.value.organization + } else { + supervisorIds = instance.validateForm.value.organization + assitantOrganizationIds = [] + } + let body = { month: selectedTime, taskName: instance.validateForm.value.taskname, taskType: instance.validateForm.value.taskname, companyId: instance.selectedUnitData.id, organizationId: this.OrganizationId, - supervisorIds: this.isSupervisor ? [] : instance.validateForm.value.organization, - assitantOrganizationIds: this.isSupervisor ? instance.validateForm.value.organization : [], + supervisorIds: supervisorIds, + assitantOrganizationIds: assitantOrganizationIds, creationType: '申领任务', approvalStatus: '待处理' } diff --git a/src/theme.less b/src/theme.less index 2f5141a..cbc3dad 100644 --- a/src/theme.less +++ b/src/theme.less @@ -90,4 +90,4 @@ label{ margin-bottom: 6px; } -} \ No newline at end of file +} From 34d42d58ee7626b7b5601bb3438aab48e644013c Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Wed, 31 Aug 2022 20:47:40 +0800 Subject: [PATCH 3/4] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=8F=E5=A4=A7=E6=97=B6=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E5=BC=B9=E5=87=BA=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.module.ts | 9 +- .../select-unit/select-unit.component.html | 0 .../select-unit/select-unit.component.scss | 53 +++++ .../select-unit/select-unit.component.ts | 17 ++ .../commonComponents/test/test.component.html | 1 + .../commonComponents/test/test.component.scss | 0 .../test/test.component.spec.ts | 25 +++ .../commonComponents/test/test.component.ts | 15 ++ .../apply/apply.component.html | 45 ++-- .../apply/apply.component.ts | 200 +++++++++++++----- .../station-task-apply.component.html | 9 +- .../station-task-execution.component.html | 11 +- .../station-task-execution.component.ts | 19 +- .../zhi-indicators.component.html | 191 +++++++++++------ .../zhi-indicators.component.ts | 188 ++++++++++------ src/app/method.service.ts | 47 ++++ 16 files changed, 626 insertions(+), 204 deletions(-) create mode 100644 src/app/commonComponents/select-unit/select-unit.component.html create mode 100644 src/app/commonComponents/select-unit/select-unit.component.scss create mode 100644 src/app/commonComponents/select-unit/select-unit.component.ts create mode 100644 src/app/commonComponents/test/test.component.html create mode 100644 src/app/commonComponents/test/test.component.scss create mode 100644 src/app/commonComponents/test/test.component.spec.ts create mode 100644 src/app/commonComponents/test/test.component.ts create mode 100644 src/app/method.service.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index af1315e..4919b50 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -17,10 +17,15 @@ import { ConfigFormDataService } from './service/configFormData.service'; import { registerLocaleData } from '@angular/common'; import { NzModalModule } from 'ng-zorro-antd/modal'; import zh from '@angular/common/locales/zh'; +import { MethodService } from './method.service'; +import { SelectUnitComponent } from './commonComponents/select-unit/select-unit.component'; +import { TestComponent } from './commonComponents/test/test.component'; registerLocaleData(zh); @NgModule({ declarations: [ - AppComponent + AppComponent, + SelectUnitComponent, + TestComponent ], imports: [ BrowserModule, @@ -35,7 +40,7 @@ registerLocaleData(zh); ], // providers: [httpInterceptorProviders, CacheTokenService, TreeService, ConfigFormDataService, // { provide: RouteReuseStrategy, useClass: CustomReuseStrategy }], - providers: [httpInterceptorProviders, CacheTokenService, TreeService, ConfigFormDataService], + providers: [httpInterceptorProviders, CacheTokenService, TreeService, ConfigFormDataService, MethodService], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/src/app/commonComponents/select-unit/select-unit.component.html b/src/app/commonComponents/select-unit/select-unit.component.html new file mode 100644 index 0000000..e69de29 diff --git a/src/app/commonComponents/select-unit/select-unit.component.scss b/src/app/commonComponents/select-unit/select-unit.component.scss new file mode 100644 index 0000000..7d1c75b --- /dev/null +++ b/src/app/commonComponents/select-unit/select-unit.component.scss @@ -0,0 +1,53 @@ +.selectUnitPopover { + width: 550px; + height: 492px; + + nz-form-item { + margin: 12px 0; + } + + display: flex; + flex-direction: column; + + .popoverTitle { + display: flex; + align-items: center; + + span { + color: #C7CAD0; + cursor: pointer; + } + + .selectedspan { + color: #2C4DC0; + } + } + + .popoverContent { + flex: 1; + display: flex; + flex-direction: column; + overflow: hidden; + + .popoverContentitem { + flex: 1; + overflow-y: auto; + display: flex; + flex-direction: column; + + p { + text-align: center; + } + } + } + + .popoverBtn { + display: flex; + justify-content: flex-end; + margin-top: 16px; + + button { + margin-left: 18px; + } + } +} diff --git a/src/app/commonComponents/select-unit/select-unit.component.ts b/src/app/commonComponents/select-unit/select-unit.component.ts new file mode 100644 index 0000000..83b4486 --- /dev/null +++ b/src/app/commonComponents/select-unit/select-unit.component.ts @@ -0,0 +1,17 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-select-unit', + templateUrl: './select-unit.component.html', + styleUrls: ['./select-unit.component.scss'] +}) +export class SelectUnitComponent implements OnInit { + + constructor() { } + + + complaint + ngOnInit(): void { + } + +} diff --git a/src/app/commonComponents/test/test.component.html b/src/app/commonComponents/test/test.component.html new file mode 100644 index 0000000..941f267 --- /dev/null +++ b/src/app/commonComponents/test/test.component.html @@ -0,0 +1 @@ +

test works!

diff --git a/src/app/commonComponents/test/test.component.scss b/src/app/commonComponents/test/test.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/commonComponents/test/test.component.spec.ts b/src/app/commonComponents/test/test.component.spec.ts new file mode 100644 index 0000000..e0f9bcc --- /dev/null +++ b/src/app/commonComponents/test/test.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TestComponent } from './test.component'; + +describe('TestComponent', () => { + let component: TestComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ TestComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(TestComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/commonComponents/test/test.component.ts b/src/app/commonComponents/test/test.component.ts new file mode 100644 index 0000000..db9004b --- /dev/null +++ b/src/app/commonComponents/test/test.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-test', + templateUrl: './test.component.html', + styleUrls: ['./test.component.scss'] +}) +export class TestComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/home/task/station-task-apply/apply/apply.component.html b/src/app/home/task/station-task-apply/apply/apply.component.html index 226607b..5311375 100644 --- a/src/app/home/task/station-task-apply/apply/apply.component.html +++ b/src/app/home/task/station-task-apply/apply/apply.component.html @@ -53,11 +53,19 @@ +

+ + + + + 更多 + +

-
+ @@ -65,32 +73,41 @@ placeholder="请输入单位名称" [ngModelOptions]="{standalone: true}" /> +
- + - +
- {{ node.title }}
- - - - - - + + + + +
+ + + {{ node.title }} + +
diff --git a/src/app/home/task/station-task-apply/apply/apply.component.ts b/src/app/home/task/station-task-apply/apply/apply.component.ts index 4cf7a98..37f5e05 100644 --- a/src/app/home/task/station-task-apply/apply/apply.component.ts +++ b/src/app/home/task/station-task-apply/apply/apply.component.ts @@ -6,6 +6,7 @@ import { TreeService } from 'src/app/service/tree.service'; import { Observable, of } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzFormatEmitEvent, NzTreeNodeOptions } from 'ng-zorro-antd/tree'; @Component({ selector: 'app-apply', templateUrl: './apply.component.html', @@ -36,14 +37,15 @@ export class ApplyComponent implements OnInit { assist: [null] }); this.newTree = this.nodes + this.getCompanies() + this.getAllOrganization() - - Promise.all([this.getCompanies(), this.getAllOrganization()]) - .then((results) => { - let arr = [...JSON.parse(JSON.stringify(this.allOrList)), ...JSON.parse(JSON.stringify(this.unitList))] - let nodes = [...this.toTree.toTree(arr)] - this.unitPopover.nodes = JSON.parse(JSON.stringify(nodes)) - }); + // Promise.all([this.getCompanies(), this.getAllOrganization()]) + // .then((results) => { + // let arr = [...JSON.parse(JSON.stringify(this.allOrList)), ...JSON.parse(JSON.stringify(this.unitList))] + // let nodes = [...this.toTree.toTree(arr)] + // this.unitPopover.nodes = JSON.parse(JSON.stringify(nodes)) + // }); } @@ -67,47 +69,24 @@ export class ApplyComponent implements OnInit { element.title = element.name element.selectable = false element.disableCheckbox = true + element.datatype = '机构' + element.level == 'squadron' ? element.disableCheckbox = false : null + }); - this.allOrList = JSON.parse(JSON.stringify(data.items)) - console.log(111, this.allOrList) - this.allOrList.forEach(element => { + data.items.forEach(element => { if (element.id == JSON.parse(sessionStorage.getItem('userData')).organizationId) { element.parentId = null } }); + this.allOrList = JSON.parse(JSON.stringify(data.items)) + this.nodes = [...this.toTree.toTree(JSON.parse(JSON.stringify(data.items)))] + this.unitPopover.nodes = JSON.parse(JSON.stringify(this.nodes)) + console.log(6666, data.items) resolve(data) }) }) } - unitList - async getCompanies(incomingData?: any) { - let params = { - CompanyName: incomingData ? incomingData.search1 : '', - OrganizationId: JSON.parse(sessionStorage.getItem('userData')).organizationId, - PageNumber: 1, - PageSize: 9999 - } - return new Promise((resolve, reject) => { - this.http.get('/api/Companies', { - params: params - }).subscribe((data: any) => { - data.items.forEach(element => { - element.label = element.companyName - element.value = element.id - element.parentId = element.organizationId - element.key = element.id - element.title = element.companyName - element.level = 4 - }); - this.unitList = data.items - this.unitPopover.unitList = JSON.parse(JSON.stringify(this.unitList)) - - - resolve(data) - }) - }) - } selectedUnitData = { @@ -118,19 +97,18 @@ export class ApplyComponent implements OnInit { e ? e.stopPropagation() : null let arr = [...data.search1Value, ...data.search2Value] let arrSet = [...new Set(arr)] - + console.log(arrSet) + console.log(this.unitPopover) if (arrSet.length > 1) { this.message.create('warning', '只能选择一个单位'); return } else { - this.unitList.forEach(element => { - if (element.id == arrSet[0]) { - this.selectedUnitData.name = element.companyName - this.selectedUnitData.id = element.id - } - }); - console.log(this.selectedUnitData) - console.log(this.unitPopover) + this.http.get(`/api/Companies/${arrSet[0]}`).subscribe((data: any) => { + console.log(data) + this.selectedUnitData.name = data.companyName + this.selectedUnitData.id = data.id + }) + this.unitPopover.isPopover = false } } @@ -149,6 +127,8 @@ export class ApplyComponent implements OnInit { data: [ ],//表格数据 nodes: [], + nodes2: [],//查询后展示的tree + isnodes: true, unitList: [] } isPopover(data, e?: any) { @@ -161,10 +141,132 @@ export class ApplyComponent implements OnInit { } //搜索框提交 submitForm(data): void { - console.log(data) data.unitList = [] + this.PageNumber = 1 this.getCompanies(data) } + totalCount: number + unitList = [] + PageNumber = 1 + async getCompanies(incomingData?: any) { + let params = { + CompanyName: incomingData ? incomingData.search1 : '', + PageNumber: this.PageNumber, + PageSize: 50 + } + return new Promise((resolve, reject) => { + this.http.get('/api/Companies', { + params: params + }).subscribe((data: any) => { + this.moreDataLoading = false + this.totalCount = data.totalCount + data.items.forEach(element => { + element.label = element.companyName + element.value = element.id + element.parentId = element.organizationId + element.key = element.id + element.title = element.companyName + element.level = 4 + }); + this.unitList = data.items + + this.unitPopover.unitList = this.unitPopover.unitList.concat(JSON.parse(JSON.stringify(data.items))); + this.unitPopover.unitList = [...this.unitPopover.unitList] + + resolve(data) + }) + }) + } + + moreDataLoading = false + + moreData() { + this.moreDataLoading = true + this.PageNumber += 1 + this.getCompanies() + } + onExpandChange(e: NzFormatEmitEvent): void { + const node = e.node; + if (node && node.getChildren().length === 0 && node.isExpanded) { + this.loadNode(node.origin.id).then(data => { + node.addChildren(data); + }); + } + } + + loadNode(id): Promise { + return new Promise(resolve => { + let params = { + OrganizationId: id, + PageNumber: 1, + PageSize: 9999 + } + this.http.get('/api/Companies', { + params: params + }).subscribe((data: any) => { + console.log(data.items) + data.items.forEach(element => { + element.key = element.id + element.title = element.companyName + element.level = 4 + element.isLeaf = true + }); + resolve(data.items) + }) + }); + } + + async getCompaniesByName(incomingData) { + console.log(incomingData.search2Value) + if (incomingData.search2) { + incomingData.isnodes = false + let params = { + CompanyName: incomingData.search2, + PageNumber: this.PageNumber, + PageSize: 9999 + } + return new Promise((resolve, reject) => { + this.http.get('/api/Companies', { + params: params + }).subscribe((data: any) => { + this.moreDataLoading = false + this.totalCount = data.totalCount + data.items.forEach(element => { + element.label = element.companyName + element.value = element.id + element.parentId = element.organizationId + element.key = element.id + element.title = element.companyName + element.level = 4 + element.isLeaf = true + incomingData.search2Value.forEach(item => { + item == element.id ? element.isChecked = true : null + }); + }); + if (data.items.length == 0) { + this.message.create('warning', '没有查询到任何单位'); + incomingData.isnodes = true + return + } + let allOrList = JSON.parse(JSON.stringify(this.allOrList)) + allOrList.forEach(element => { + element.expanded = true + }); + let arr = [...allOrList, ...data.items] + incomingData.nodes2 = [...this.toTree.toTree(arr)] + + resolve(data) + }) + }) + } else { + + // incomingData.search2Value = [] + incomingData.isnodes = true + } + + } + + log(data) { let arr = [] data.unitList.forEach(item => { @@ -173,6 +275,7 @@ export class ApplyComponent implements OnInit { data.search1Value = arr } orcheckbox(data, $event, node) { + // search2NameValue if ($event) { data.search2Value.push(node.origin.id) } else { @@ -183,6 +286,7 @@ export class ApplyComponent implements OnInit { index-- } } + } } } diff --git a/src/app/home/task/station-task-apply/station-task-apply.component.html b/src/app/home/task/station-task-apply/station-task-apply.component.html index d9b3566..002d85f 100644 --- a/src/app/home/task/station-task-apply/station-task-apply.component.html +++ b/src/app/home/task/station-task-apply/station-task-apply.component.html @@ -49,15 +49,16 @@
-
+ @@ -368,32 +404,40 @@ placeholder="请输入单位名称" [ngModelOptions]="{standalone: true}" /> +
- + - +
- {{ node.title }}
- - - - - - + + + + +
+ + + {{ node.title }} + +
@@ -457,10 +501,11 @@ - + - {{o.name}} @@ -543,13 +588,19 @@
- +

+ + + + + 更多 + +

-
+ @@ -557,32 +608,40 @@ placeholder="请输入单位名称" [ngModelOptions]="{standalone: true}" /> +
- + - +
- {{ node.title }}
- - - - - - + + + + +
+ + + {{ node.title }} + +
diff --git a/src/app/home/task/zhi-indicators/zhi-indicators.component.ts b/src/app/home/task/zhi-indicators/zhi-indicators.component.ts index 2308eb2..d61f871 100644 --- a/src/app/home/task/zhi-indicators/zhi-indicators.component.ts +++ b/src/app/home/task/zhi-indicators/zhi-indicators.component.ts @@ -105,6 +105,7 @@ export class ZhiIndicatorsComponent implements OnInit { this.rehearsal.data = [] } + //投诉举报 complaint = { name: '投诉举报', @@ -121,6 +122,8 @@ export class ZhiIndicatorsComponent implements OnInit { data: [ ],//表格数据 nodes: [], + nodes2: [],//查询后展示的tree + isnodes: true, unitList: [] } @@ -139,6 +142,8 @@ export class ZhiIndicatorsComponent implements OnInit { selectedMenu: 1,//选择单位气泡卡片 data: [],//表格数据 nodes: [], + nodes2: [],//查询后展示的tree + isnodes: true, unitList: [] } @@ -158,6 +163,8 @@ export class ZhiIndicatorsComponent implements OnInit { selectedMenu: 1,//选择单位气泡卡片 data: [],//表格数据 nodes: [], + nodes2: [],//查询后展示的tree + isnodes: true, unitList: [] } @@ -177,16 +184,14 @@ export class ZhiIndicatorsComponent implements OnInit { selectedMenu: 1,//选择单位气泡卡片 data: [],//表格数据 nodes: [], + nodes2: [],//查询后展示的tree + isnodes: true, unitList: [] } - PageNumber - moreData() { - this.PageNumber += 1 - this.getCompanies() - } + log(data) { @@ -215,12 +220,6 @@ export class ZhiIndicatorsComponent implements OnInit { } - //搜索框提交 - submitForm(data): void { - data.unitList = [] - this.PageNumber = 1 - this.getCompanies(data) - } // 弹出 tab popoverMenuSelect(data, type) { @@ -231,18 +230,26 @@ export class ZhiIndicatorsComponent implements OnInit { } + //搜索框提交 + submitForm(data): void { + data.unitList = [] + this.PageNumber = 1 + this.getCompanies(data) + } totalCount: number unitList = [] + PageNumber = 1 async getCompanies(incomingData?: any) { let params = { CompanyName: incomingData ? incomingData.search1 : '', - PageNumber: 1, - PageSize: 99999 + PageNumber: this.PageNumber, + PageSize: 50 } return new Promise((resolve, reject) => { this.http.get('/api/Companies', { params: params }).subscribe((data: any) => { + this.moreDataLoading = false this.totalCount = data.totalCount data.items.forEach(element => { element.label = element.companyName @@ -254,35 +261,42 @@ export class ZhiIndicatorsComponent implements OnInit { }); this.unitList = data.items - if (incomingData && incomingData.name == '投诉举报') { - this.complaint.unitList = JSON.parse(JSON.stringify(this.unitList)) - } else if (incomingData && incomingData.name == '行政许可') { - this.permission.unitList = JSON.parse(JSON.stringify(this.unitList)) - } else if (incomingData && incomingData.name == '双随机') { - this.doubleRandom.unitList = JSON.parse(JSON.stringify(this.unitList)) - } else if (incomingData && incomingData.name == '熟悉演练') { - this.rehearsal.unitList = JSON.parse(JSON.stringify(this.unitList)) - } else { - this.complaint.unitList = JSON.parse(JSON.stringify(this.unitList)) - this.permission.unitList = JSON.parse(JSON.stringify(this.unitList)) - this.doubleRandom.unitList = JSON.parse(JSON.stringify(this.unitList)) - this.rehearsal.unitList = JSON.parse(JSON.stringify(this.unitList)) - } - - // this.complaint.unitList = this.complaint.unitList.concat(JSON.parse(JSON.stringify(data.items))); - // this.complaint.unitList = [...this.complaint.unitList] - // this.permission.unitList = this.permission.unitList.concat(JSON.parse(JSON.stringify(data.items))); - // this.permission.unitList = [...this.permission.unitList] - // this.doubleRandom.unitList = this.doubleRandom.unitList.concat(JSON.parse(JSON.stringify(data.items))); - // this.doubleRandom.unitList = [...this.doubleRandom.unitList] - // this.rehearsal.unitList = this.rehearsal.unitList.concat(JSON.parse(JSON.stringify(data.items))); - // this.rehearsal.unitList = [...this.rehearsal.unitList] + // if (incomingData && incomingData.name == '投诉举报') { + // this.complaint.unitList = JSON.parse(JSON.stringify(this.unitList)) + // } else if (incomingData && incomingData.name == '行政许可') { + // this.permission.unitList = JSON.parse(JSON.stringify(this.unitList)) + // } else if (incomingData && incomingData.name == '双随机') { + // this.doubleRandom.unitList = JSON.parse(JSON.stringify(this.unitList)) + // } else if (incomingData && incomingData.name == '熟悉演练') { + // this.rehearsal.unitList = JSON.parse(JSON.stringify(this.unitList)) + // } else { + // this.complaint.unitList = JSON.parse(JSON.stringify(this.unitList)) + // this.permission.unitList = JSON.parse(JSON.stringify(this.unitList)) + // this.doubleRandom.unitList = JSON.parse(JSON.stringify(this.unitList)) + // this.rehearsal.unitList = JSON.parse(JSON.stringify(this.unitList)) + // } + + this.complaint.unitList = this.complaint.unitList.concat(JSON.parse(JSON.stringify(data.items))); + this.complaint.unitList = [...this.complaint.unitList] + this.permission.unitList = this.permission.unitList.concat(JSON.parse(JSON.stringify(data.items))); + this.permission.unitList = [...this.permission.unitList] + this.doubleRandom.unitList = this.doubleRandom.unitList.concat(JSON.parse(JSON.stringify(data.items))); + this.doubleRandom.unitList = [...this.doubleRandom.unitList] + this.rehearsal.unitList = this.rehearsal.unitList.concat(JSON.parse(JSON.stringify(data.items))); + this.rehearsal.unitList = [...this.rehearsal.unitList] resolve(data) }) }) } + moreDataLoading = false + + moreData() { + this.moreDataLoading = true + this.PageNumber += 1 + this.getCompanies() + } allOrList: any nodes @@ -302,12 +316,20 @@ export class ZhiIndicatorsComponent implements OnInit { element.disableCheckbox = true element.datatype = '机构' element.level == 'squadron' ? element.disableCheckbox = false : null + }); + this.allOrList = JSON.parse(JSON.stringify(data.items)) + this.nodes = [...this.toTree.toTree(JSON.parse(JSON.stringify(data.items)))] + this.complaint.nodes = JSON.parse(JSON.stringify(this.nodes)) + this.permission.nodes = JSON.parse(JSON.stringify(this.nodes)) + this.doubleRandom.nodes = JSON.parse(JSON.stringify(this.nodes)) + this.rehearsal.nodes = JSON.parse(JSON.stringify(this.nodes)) resolve(data) }) }) } + //获得除了检查员的其他用户 users async getUsers() { @@ -448,17 +470,17 @@ export class ZhiIndicatorsComponent implements OnInit { }); // this.getUsers() - - - Promise.all([this.getCompanies(), this.getAllOrganization()]) - .then((results) => { - let arr = [...JSON.parse(JSON.stringify(this.allOrList)), ...JSON.parse(JSON.stringify(this.unitList))] - this.nodes = [...this.toTree.toTree(arr)] - this.complaint.nodes = JSON.parse(JSON.stringify(this.nodes)) - this.permission.nodes = JSON.parse(JSON.stringify(this.nodes)) - this.doubleRandom.nodes = JSON.parse(JSON.stringify(this.nodes)) - this.rehearsal.nodes = JSON.parse(JSON.stringify(this.nodes)) - }); + this.getCompanies() + this.getAllOrganization() + // Promise.all([this.getCompanies(), this.getAllOrganization()]) + // .then((results) => { + // let arr = [...JSON.parse(JSON.stringify(this.allOrList)), ...JSON.parse(JSON.stringify(this.unitList))] + // this.nodes = [...this.toTree.toTree(arr)] + // this.complaint.nodes = JSON.parse(JSON.stringify(this.nodes)) + // this.permission.nodes = JSON.parse(JSON.stringify(this.nodes)) + // this.doubleRandom.nodes = JSON.parse(JSON.stringify(this.nodes)) + // this.rehearsal.nodes = JSON.parse(JSON.stringify(this.nodes)) + // }); this.getTaskList('投诉举报') @@ -567,7 +589,6 @@ export class ZhiIndicatorsComponent implements OnInit { }) } - async getTaskList(TaskType, carddata?: any) { TaskType == '投诉举报' ? this.complaint.isLoading = true : this.permission.isLoading = true // carddata ? carddata.isLoading = true : null @@ -620,22 +641,12 @@ export class ZhiIndicatorsComponent implements OnInit { // console.log('毁灭了') // this.doubleRandom.isPopover = false } - - nzEvent(event: NzFormatEmitEvent): any { - if (event.node.origin.companyName) { - return new Promise((resolve, reject) => { - resolve() - }) - } - if (event.node.origin.level === 'squadron' && !event.node.origin.companyName) { - const node = event.node; - console.log(node?.getChildren()) - console.log(888) - if (node?.getChildren().length === 0) { - this.loadNode(event.node.origin.id).then(data => { - node.addChildren(data); - }); - } + onExpandChange(e: NzFormatEmitEvent): void { + const node = e.node; + if (node && node.getChildren().length === 0 && node.isExpanded) { + this.loadNode(node.origin.id).then(data => { + node.addChildren(data); + }); } } @@ -654,12 +665,61 @@ export class ZhiIndicatorsComponent implements OnInit { element.key = element.id element.title = element.companyName element.level = 4 + element.isLeaf = true }); resolve(data.items) }) }); } + async getCompaniesByName(incomingData) { + // incomingData.search2Value + console.log(incomingData.search2Value) + if (incomingData.search2) { + incomingData.isnodes = false + let params = { + CompanyName: incomingData.search2, + PageNumber: this.PageNumber, + PageSize: 9999 + } + return new Promise((resolve, reject) => { + this.http.get('/api/Companies', { + params: params + }).subscribe((data: any) => { + this.moreDataLoading = false + this.totalCount = data.totalCount + data.items.forEach(element => { + element.label = element.companyName + element.value = element.id + element.parentId = element.organizationId + element.key = element.id + element.title = element.companyName + element.level = 4 + element.isLeaf = true + incomingData.search2Value.forEach(item => { + item == element.id ? element.isChecked = true : null + }); + }); + if (data.items.length == 0) { + this.message.create('warning', '没有查询到任何单位'); + incomingData.isnodes = true + return + } + let allOrList = JSON.parse(JSON.stringify(this.allOrList)) + allOrList.forEach(element => { + element.expanded = true + }); + let arr = [...allOrList, ...data.items] + incomingData.nodes2 = [...this.toTree.toTree(arr)] + + resolve(data) + }) + }) + } else { + incomingData.isnodes = true + } + + } assitantsupervisorList mainsupervisorList diff --git a/src/app/method.service.ts b/src/app/method.service.ts new file mode 100644 index 0000000..b807d2c --- /dev/null +++ b/src/app/method.service.ts @@ -0,0 +1,47 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class MethodService { + + constructor() { } + + /***倒计时 + @param {number} nowtime 当前时间时间戳 + @param {number} endtime 结束时间时间戳 + @example: countdown('当前时间时间戳', '结束时间时间戳', callback); +*/ + + timer = null + + countdown(nowtime, endtime, callback) { + var times = parseInt(String((endtime - nowtime) / 1000)); + this.timer = setInterval(function () { + var day: any = 0, hour: any = 0, minute: any = 0, second: any = 0;//时间默认值 + if (times > 0) { + day = Math.floor(times / (60 * 60 * 24)); + hour = Math.floor(times / (60 * 60)) - (day * 24); + minute = Math.floor(times / 60) - (day * 24 * 60) - (hour * 60); + second = Math.floor(times) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60); + } + // if (day <= 9) day = '0' + day; + // if (hour <= 9) hour = '0' + hour; + // if (minute <= 9) minute = '0' + minute; + // if (second <= 9) second = '0' + second; + //console.log(minute+"分钟:"+second+"秒"); + // var new_time = day + '天' + hour + '小时' + minute + '分' + second + '秒'; + typeof callback == "function" ? callback({ day: day, hour: hour, minute: minute, second: second }) : ''; + times--; + }, 1000); + if (times <= 0) { + clearInterval(this.timer); + } + } + + cleartimer() { + clearTimeout(this.timer); + } + + +} From ad44b41aaa08ea208d90fbe316c38045739976bf Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Thu, 1 Sep 2022 08:45:24 +0800 Subject: [PATCH 4/4] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=8D=95=E4=BD=8D=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/home/task/station-task-apply/apply/apply.component.ts | 4 +++- src/app/home/task/zhi-indicators/zhi-indicators.component.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/home/task/station-task-apply/apply/apply.component.ts b/src/app/home/task/station-task-apply/apply/apply.component.ts index 37f5e05..2c6131d 100644 --- a/src/app/home/task/station-task-apply/apply/apply.component.ts +++ b/src/app/home/task/station-task-apply/apply/apply.component.ts @@ -187,10 +187,12 @@ export class ApplyComponent implements OnInit { } onExpandChange(e: NzFormatEmitEvent): void { const node = e.node; - if (node && node.getChildren().length === 0 && node.isExpanded) { + if (node && node.getChildren().length === 0 && node.isExpanded && node.origin.level == 'squadron') { this.loadNode(node.origin.id).then(data => { node.addChildren(data); }); + } else { + node.isLoading = false } } diff --git a/src/app/home/task/zhi-indicators/zhi-indicators.component.ts b/src/app/home/task/zhi-indicators/zhi-indicators.component.ts index d61f871..5d7263e 100644 --- a/src/app/home/task/zhi-indicators/zhi-indicators.component.ts +++ b/src/app/home/task/zhi-indicators/zhi-indicators.component.ts @@ -643,10 +643,12 @@ export class ZhiIndicatorsComponent implements OnInit { } onExpandChange(e: NzFormatEmitEvent): void { const node = e.node; - if (node && node.getChildren().length === 0 && node.isExpanded) { + if (node && node.getChildren().length === 0 && node.isExpanded && node.origin.level == 'squadron') { this.loadNode(node.origin.id).then(data => { node.addChildren(data); }); + } else { + node.isLoading = false } }