From 1df2c007c16c1b8eaffa420a6875c786b18ecfe3 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Fri, 2 Sep 2022 17:22:08 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E6=96=B0=E5=A2=9E=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E9=80=9A=E7=9F=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.module.ts | 11 ++-- src/app/auth.guard.ts | 5 +- src/app/home/home.module.ts | 8 ++- src/app/home/nav/nav.component.html | 41 ++++++++++--- src/app/home/nav/nav.component.scss | 44 +++++++++---- src/app/home/nav/nav.component.ts | 45 ++++++++++++-- .../system-management/user/user.component.ts | 1 - .../plan-adjustment.component.ts | 2 +- .../da-subordinate-audit.component.html | 2 +- .../apply/apply.component.ts | 5 +- .../station-task-apply.component.html | 6 +- .../station-task-apply.component.ts | 20 +++--- .../station-task-execution.component.html | 2 +- .../station-task-execution.component.ts | 14 ++--- .../station-weekly-plan.component.html | 13 ++-- .../station-weekly-plan.component.scss | 7 ++- .../station-weekly-plan.component.ts | 61 ++++++++++++------- .../zhi-indicators.component.html | 4 +- .../zhi-indicators.component.ts | 8 +-- src/app/http-interceptors/base-interceptor.ts | 1 - src/app/service/configFormData.service.ts | 10 --- src/app/{ => service}/method.service.ts | 27 ++++++-- src/app/service/new-task-message.service.ts | 28 +++++++++ src/theme.less | 11 ++++ 24 files changed, 255 insertions(+), 121 deletions(-) delete mode 100644 src/app/service/configFormData.service.ts rename src/app/{ => service}/method.service.ts (79%) create mode 100644 src/app/service/new-task-message.service.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 4919b50..fdd822e 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -11,14 +11,11 @@ import { CacheTokenService } from './service/cache-token.service' import { NzNotificationModule } from 'ng-zorro-antd/notification'; import { NzMessageModule } from 'ng-zorro-antd/message'; import { TreeService } from './service/tree.service'; -import { RouteReuseStrategy } from '@angular/router'; -import { CustomReuseStrategy } from './CustomReuseStrategy'; -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 { MethodService } from './service/method.service'; +import { SelectUnitComponent } from './commonComponents/select-unit/select-unit.component'; import { TestComponent } from './commonComponents/test/test.component'; registerLocaleData(zh); @NgModule({ @@ -38,9 +35,9 @@ registerLocaleData(zh); NzMessageModule, NzModalModule ], - // providers: [httpInterceptorProviders, CacheTokenService, TreeService, ConfigFormDataService, + // providers: [httpInterceptorProviders, CacheTokenService, TreeService, // { provide: RouteReuseStrategy, useClass: CustomReuseStrategy }], - providers: [httpInterceptorProviders, CacheTokenService, TreeService, ConfigFormDataService, MethodService], + providers: [httpInterceptorProviders, CacheTokenService, TreeService, MethodService], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/src/app/auth.guard.ts b/src/app/auth.guard.ts index 10df7d8..25b154a 100644 --- a/src/app/auth.guard.ts +++ b/src/app/auth.guard.ts @@ -14,14 +14,11 @@ export class AuthGuard implements CanActivate { // 路由守卫 canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { // console.log('路由守卫',next.data) - // if(next.data.permission == 'xxxx'){ - // return true; - // } return this.checkLogin(); } checkLogin(): boolean { - // console.log('xxxxxxxxxxxx') + // 判断本地有没有token const token = sessionStorage.getItem('token'); diff --git a/src/app/home/home.module.ts b/src/app/home/home.module.ts index 08f291f..db7db92 100644 --- a/src/app/home/home.module.ts +++ b/src/app/home/home.module.ts @@ -64,6 +64,9 @@ import { TaskDetailsComponent } from './task/station-weekly-plan/task-details/ta import { EditOrComponent } from './task/zhi-indicators/edit-or/edit-or.component'; import { NzInputNumberModule } from 'ng-zorro-antd/input-number'; import { CreateTaskComponent } from './task/station-weekly-plan/create-task/create-task.component'; +import { NzNotificationModule } from 'ng-zorro-antd/notification'; +import { NzBadgeModule } from 'ng-zorro-antd/badge'; +import { NzListModule } from 'ng-zorro-antd/list'; @NgModule({ declarations: [ NavComponent, @@ -133,7 +136,10 @@ import { CreateTaskComponent } from './task/station-weekly-plan/create-task/crea NzCardModule, NzUploadModule, NzToolTipModule, - NzInputNumberModule + NzInputNumberModule, + NzNotificationModule, + NzBadgeModule, + NzListModule ], entryComponents: [AddroleComponent, EditroleComponent, AdduserComponent, EdituserComponent, AddorComponent, EditorComponent, ApplyComponent, ApplyLookComponent, LookTaskComponent, AllotPersonComponent, EditOrComponent, CreateTaskComponent] }) diff --git a/src/app/home/nav/nav.component.html b/src/app/home/nav/nav.component.html index 2404a09..30cb638 100644 --- a/src/app/home/nav/nav.component.html +++ b/src/app/home/nav/nav.component.html @@ -19,16 +19,37 @@
任务分配
diff --git a/src/app/home/task/station-weekly-plan/station-weekly-plan.component.scss b/src/app/home/task/station-weekly-plan/station-weekly-plan.component.scss
index 3882aa4..19c1c37 100644
--- a/src/app/home/task/station-weekly-plan/station-weekly-plan.component.scss
+++ b/src/app/home/task/station-weekly-plan/station-weekly-plan.component.scss
@@ -115,10 +115,13 @@
align-items: flex-start;
flex: 1;
box-sizing: border-box;
-
+ nz-badge{
+ width: 80%;
+ color: #fff;
+ }
.panelheadername {
- width: 80%;
+ width: 100%;
height: 46px;
line-height: 46px;
text-align: center;
diff --git a/src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts b/src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts
index 39d3a31..d1ee327 100644
--- a/src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts
+++ b/src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts
@@ -10,7 +10,8 @@ import { TaskDetailsComponent } from './task-details/task-details.component';
import { CreateTaskComponent } from './create-task/create-task.component';
import { differenceInCalendarDays, setHours } from 'date-fns'
import { PlanAdjustmentComponent } from '../da-oneself-plan/plan-adjustment/plan-adjustment.component';
-import { MethodService } from 'src/app/method.service';
+import { MethodService } from 'src/app/service/method.service';
+import { NewTaskMessageService } from 'src/app/service/new-task-message.service';
@Component({
selector: 'app-station-weekly-plan',
templateUrl: './station-weekly-plan.component.html',
@@ -18,7 +19,7 @@ import { MethodService } from 'src/app/method.service';
})
export class StationWeeklyPlanComponent implements OnInit {
- constructor(private http: HttpClient, private modal: NzModalService, private message: NzMessageService, private viewContainerRef: ViewContainerRef, private methodService: MethodService) { }
+ constructor(private http: HttpClient, private modal: NzModalService, private message: NzMessageService, private viewContainerRef: ViewContainerRef, public methodService: MethodService, private newTaskMessage: NewTaskMessageService) { }
OrganizationId
userId
isSupervisor
@@ -79,6 +80,7 @@ export class StationWeeklyPlanComponent implements OnInit {
openDetails(data, type) {
data.isDetails = type
+ data.badgeNum = 0
}
radioChange(e, i, element) {
@@ -146,24 +148,24 @@ export class StationWeeklyPlanComponent implements OnInit {
}
cardData = [
- { name: '双随机', isDetails: false, isLoading: false, background: '#1D9DFF', icon: 'suiji.png', passed: 0, inspected: 0, percentage: 0, data: [] },
- { name: '行政许可', isDetails: false, isLoading: false, background: '#42B983', icon: 'xuke.png', passed: 0, inspected: 0, percentage: 0, data: [] },
- { name: '熟悉演练', isDetails: false, isLoading: false, background: '#9D80FF', icon: 'yanlian.png', passed: 0, inspected: 0, percentage: 0, data: [] },
- { name: '联络指导', isDetails: false, isLoading: false, background: '#5483EA', icon: 'zhidao.png', passed: 0, inspected: 0, percentage: 0, data: [] },
- { name: '消防宣传', isDetails: false, isLoading: false, background: '#FF5D2A', icon: 'xuanchuan.png', passed: 0, inspected: 0, percentage: 0, data: [] },
- { name: '投诉举报', isDetails: false, isLoading: false, background: '#5087FF', icon: 'tousu.png', passed: 0, inspected: 0, percentage: 0, data: [] },
- { name: '火灾调查', isDetails: false, isLoading: false, background: '#FF404D', icon: 'huozai.png', passed: 0, inspected: 0, percentage: 0, data: [] }
+ { name: '双随机', badgeNum: 0, isDetails: false, isLoading: false, background: '#1D9DFF', icon: 'suiji.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '行政许可', badgeNum: 0, isDetails: false, isLoading: false, background: '#42B983', icon: 'xuke.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '熟悉演练', badgeNum: 0, isDetails: false, isLoading: false, background: '#9D80FF', icon: 'yanlian.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '联络指导', badgeNum: 0, isDetails: false, isLoading: false, background: '#5483EA', icon: 'zhidao.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '消防宣传', badgeNum: 0, isDetails: false, isLoading: false, background: '#FF5D2A', icon: 'xuanchuan.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '投诉举报', badgeNum: 0, isDetails: false, isLoading: false, background: '#5087FF', icon: 'tousu.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '火灾调查', badgeNum: 0, isDetails: false, isLoading: false, background: '#FF404D', icon: 'huozai.png', passed: 0, inspected: 0, percentage: 0, data: [] }
]
//初始化数据
initializeData() {
this.cardData = [
- { name: '双随机', isDetails: false, isLoading: false, background: '#1D9DFF', icon: 'suiji.png', passed: 0, inspected: 0, percentage: 0, data: [] },
- { name: '行政许可', isDetails: false, isLoading: false, background: '#42B983', icon: 'xuke.png', passed: 0, inspected: 0, percentage: 0, data: [] },
- { name: '熟悉演练', isDetails: false, isLoading: false, background: '#9D80FF', icon: 'yanlian.png', passed: 0, inspected: 0, percentage: 0, data: [] },
- { name: '联络指导', isDetails: false, isLoading: false, background: '#5483EA', icon: 'zhidao.png', passed: 0, inspected: 0, percentage: 0, data: [] },
- { name: '消防宣传', isDetails: false, isLoading: false, background: '#FF5D2A', icon: 'xuanchuan.png', passed: 0, inspected: 0, percentage: 0, data: [] },
- { name: '投诉举报', isDetails: false, isLoading: false, background: '#5087FF', icon: 'tousu.png', passed: 0, inspected: 0, percentage: 0, data: [] },
- { name: '火灾调查', isDetails: false, isLoading: false, background: '#FF404D', icon: 'huozai.png', passed: 0, inspected: 0, percentage: 0, data: [] }
+ { name: '双随机', badgeNum: 0, isDetails: false, isLoading: false, background: '#1D9DFF', icon: 'suiji.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '行政许可', badgeNum: 0, isDetails: false, isLoading: false, background: '#42B983', icon: 'xuke.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '熟悉演练', badgeNum: 0, isDetails: false, isLoading: false, background: '#9D80FF', icon: 'yanlian.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '联络指导', badgeNum: 0, isDetails: false, isLoading: false, background: '#5483EA', icon: 'zhidao.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '消防宣传', badgeNum: 0, isDetails: false, isLoading: false, background: '#FF5D2A', icon: 'xuanchuan.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '投诉举报', badgeNum: 0, isDetails: false, isLoading: false, background: '#5087FF', icon: 'tousu.png', passed: 0, inspected: 0, percentage: 0, data: [] },
+ { name: '火灾调查', badgeNum: 0, isDetails: false, isLoading: false, background: '#FF404D', icon: 'huozai.png', passed: 0, inspected: 0, percentage: 0, data: [] }
]
this.stationData.forEach(element => {
@@ -190,7 +192,7 @@ export class StationWeeklyPlanComponent implements OnInit {
let params = {
Month: selectedTime,
SupervisorId: this.isSupervisor ? this.userId : null,
- AssitantOrganizationId: this.isSupervisor ? null : this.OrganizationId,
+ assistantOrganizationId: this.isSupervisor ? null : this.OrganizationId,
PageNumber: this.PageNumber,
PageSize: this.PageSize,
approvalStatuses: ['待处理', '通过', '驳回', '待检查', '已检查']
@@ -232,7 +234,7 @@ export class StationWeeklyPlanComponent implements OnInit {
Month: selectedTime,
approvalStatuses: ['通过', '待检查', '已检查'],
SupervisorId: this.isSupervisor ? this.userId : null,
- AssitantOrganizationId: this.isSupervisor ? null : this.OrganizationId,
+ assistantOrganizationId: this.isSupervisor ? null : this.OrganizationId,
PageNumber: this.PageNumber,
PageSize: this.PageSize
}
@@ -382,13 +384,26 @@ export class StationWeeklyPlanComponent implements OnInit {
this.rollStart()
}, 0);
- //滚动消息
- this.methodService.getNotifications().then((data: any) => {
- this.messageList = data
- })
+
+
+ this.newTaskMessage.getMessage().subscribe((data: any) => {
+ console.log('具体任务信息', data);
+ this.cardData.forEach((item: any) => {
+ if (item.name == data.taskType) {
+ item.data.unshift(data)
+ if (!item.isDetails) {
+ item.badgeNum += 1
+ }
+ if (data.approvalStatus == '通过') {
+ item.passed += 1
+ this.getTaskListPass(this.stationData[0])
+ }
+ }
+ })
+ });
+
}
- messageList = []
timer
rollStart() {
var ROLL_SPEED = 100
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 75e0558..3664e72 100644
--- a/src/app/home/task/zhi-indicators/zhi-indicators.component.html
+++ b/src/app/home/task/zhi-indicators/zhi-indicators.component.html
@@ -148,7 +148,7 @@
/{{i.name}}
-
+
/{{i.name}}
@@ -314,7 +314,7 @@
/{{i.name}}
-
+
/{{i.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 5d7263e..cb84d07 100644
--- a/src/app/home/task/zhi-indicators/zhi-indicators.component.ts
+++ b/src/app/home/task/zhi-indicators/zhi-indicators.component.ts
@@ -365,7 +365,7 @@ export class ZhiIndicatorsComponent implements OnInit {
nzWidth: 660,
nzMaskClosable: false,
nzComponentParams: {
- selectedData: [...item.supervisorIds, ...item.assitantOrganizationIds],
+ selectedData: [...item.supervisorIds, ...item.assistantOrganizationIds],
organizationList: JSON.parse(JSON.stringify(this.allOrList)),
// users: JSON.parse(JSON.stringify(this.users)),
supervisorList: [...JSON.parse(JSON.stringify(this.assitantsupervisorList)), ...JSON.parse(JSON.stringify(this.mainsupervisorList))]
@@ -375,13 +375,13 @@ export class ZhiIndicatorsComponent implements OnInit {
await new Promise((resolve, reject) => {
console.log(instance.nzTreeComponent.getCheckedNodeList())
let supervisorIds = []
- let assitantOrganizationIds = []
+ let assistantOrganizationIds = []
instance.nzTreeComponent.getCheckedNodeList().forEach(item => {
- item.origin.datatype == '机构' ? assitantOrganizationIds.push(item.key) : supervisorIds.push(item.key)
+ item.origin.datatype == '机构' ? assistantOrganizationIds.push(item.key) : supervisorIds.push(item.key)
})
let body = {
supervisorIds: supervisorIds,
- assitantOrganizationIds: assitantOrganizationIds
+ assistantOrganizationIds: assistantOrganizationIds
}
this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({
next: async (data: any) => {
diff --git a/src/app/http-interceptors/base-interceptor.ts b/src/app/http-interceptors/base-interceptor.ts
index 02bc6ca..8163235 100644
--- a/src/app/http-interceptors/base-interceptor.ts
+++ b/src/app/http-interceptors/base-interceptor.ts
@@ -26,7 +26,6 @@ export class BaseInterceptor implements HttpInterceptor {
}
req = req.clone({ params });
// debugger
- // console.log('xxxxxx',req)
let newReq = req.clone({
url: req.hadBaseurl ? `${req.url}` : `${req.url}`,
});
diff --git a/src/app/service/configFormData.service.ts b/src/app/service/configFormData.service.ts
deleted file mode 100644
index 3f02089..0000000
--- a/src/app/service/configFormData.service.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Injectable } from '@angular/core';
-
-@Injectable()
-export class ConfigFormDataService {
- tableData: any//摄像头列表数据
- config1: any//配置文件
- config2: any//配置文件
- config3: any//配置文件
- config4: any//配置文件
-}
\ No newline at end of file
diff --git a/src/app/method.service.ts b/src/app/service/method.service.ts
similarity index 79%
rename from src/app/method.service.ts
rename to src/app/service/method.service.ts
index 2a1329c..d5b5fd5 100644
--- a/src/app/method.service.ts
+++ b/src/app/service/method.service.ts
@@ -8,14 +8,12 @@ export class MethodService {
constructor(private http: HttpClient) { }
+ timer = null
/***倒计时
@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 () {
@@ -44,15 +42,34 @@ export class MethodService {
clearTimeout(this.timer);
}
- //获得播报消息
+
+ /**
+ * @params 消息列表
+ */
+ notificationsList
+ /**
+ * @returns 获得消息列表
+ */
async getNotifications() {
return new Promise