Browse Source

[新增]用户禁用

非煤矿山灾害智能感知和预警系统
邵佳豪 2 years ago
parent
commit
f9b2e29282
  1. 17
      src/app/home/system-management/user/user.component.html
  2. 14
      src/app/home/system-management/user/user.component.ts
  3. 3
      src/app/home/task/station-task-execution/station-task-execution.component.ts
  4. 4
      src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts
  5. 2
      src/app/pages/login/login.component.ts
  6. 4
      src/styles.scss

17
src/app/home/system-management/user/user.component.html

@ -39,7 +39,8 @@
<th>角色</th>
<th>职位</th>
<th>创建时间</th>
<th [width]="'20%'">操作</th>
<th>状态</th>
<th [width]="'18%'">操作</th>
</tr>
</thead>
<tbody>
@ -66,11 +67,19 @@
<td>
{{item.creationTime | date:"yyyy-MM-dd"}}
</td>
<td>
<ng-container *ngIf="item.enabled; else elseTemplate">
<span class="green">已启用</span>
</ng-container>
<ng-template #elseTemplate>
<span class="red">已禁用</span>
</ng-template>
</td>
<td class="operation">
<a (click)="editUser(item)">编辑</a>
<a (click)=" (item)">编辑</a>
<a (click)="resetPassword(item)">重置密码</a>
<!-- <a *ngIf="!item.enabled" class="green" (click)="cancel(item,true)">启用</a>
<a *ngIf="item.enabled" class="redColor" (click)="cancel(item,false)">禁用</a> -->
<a *ngIf="!item.enabled" class="green" (click)="cancel(item,true)">启用</a>
<a *ngIf="item.enabled" class="orange" (click)="cancel(item,false)">禁用</a>
<a class="red" (click)="delete(item)">删除</a>
</td>
</tr>

14
src/app/home/system-management/user/user.component.ts

@ -247,7 +247,19 @@ export class UserComponent implements OnInit {
}
//禁用
cancel(item, type) {
this.isLoading = true
let body = {
enabled: type
}
this.http.patch(`/api/Users/${item.id}`, body).subscribe({
next: (data) => {
this.isLoading = false
item.enabled = type
},
error: (err) => {
this.isLoading = false
}
})
}
delete(item) {
this.modal.confirm({

3
src/app/home/task/station-task-execution/station-task-execution.component.ts

@ -322,7 +322,6 @@ export class StationTaskExecutionComponent implements OnInit {
}
look(item) {
console.log(item)
if (item.approvalStatus == '待检查') {
@ -372,8 +371,6 @@ export class StationTaskExecutionComponent implements OnInit {
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
}
ischat = false
taskId
openchat(item) {

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

@ -189,13 +189,13 @@ export class StationWeeklyPlanComponent implements OnInit {
let isShow = true
if (element.creationType == '申领任务') {
if (this.isSupervisor) {//检查员
if ((element.taskType == '熟悉演练') ||
if (element.taskType == '熟悉演练' ||
(element.taskType == '联络指导' && element.approvalStatus == '待处理' && element.relatedTaskId == null)
) {
isShow = false
}
} else {//消防站
if ((element.taskType == '联络指导') ||
if (element.taskType == '联络指导' ||
(element.taskType == '熟悉演练' && element.approvalStatus == '待处理' && element.relatedTaskId == null) ||
(element.taskType == '双随机' && element.relatedTaskId == null)) {
isShow = false

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

@ -20,7 +20,7 @@ export class LoginComponent implements OnInit {
userName: [null, [Validators.required]],
password: [null, [Validators.required]],
remember: [null],
autologin: [null],
autologin: [null]
});
//如果本地储存了账号密码信息,那就回显在输入框
let account = localStorage.getItem('account')

4
src/styles.scss

@ -128,6 +128,10 @@ app-root {
color: #FF0000 !important;
}
.orange{
color: orange !important;
}
.forbid {
color: gray !important;

Loading…
Cancel
Save