Browse Source

[新增]语音播报;管理员重置密码;

beijing
邵佳豪 2 years ago
parent
commit
fd0821cf65
  1. 6
      src/app/http-interceptors/base-interceptor.ts
  2. 11
      src/app/pages/home/home.component.ts
  3. 1
      src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.ts
  4. 6
      src/app/system-management/system-management.module.ts
  5. 17
      src/app/system-management/user/user.component.ts
  6. 5
      src/theme.less

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

@ -83,9 +83,9 @@ export class BaseInterceptor implements HttpInterceptor {
this.message.create('error', `请核对您的输入信息或格式是否正确!`);
}
if (error.status === 500) {
if(error.error.error.message){
this.message.create('error', `${error.error.error.details || error.error.error.message}`);
}else{
if (error.error.error.message) {
this.message.create('error', `${error.error.error.message || error.error.error.details}`);
} else {
this.message.create('error', `状态500`);
}
}

11
src/app/pages/home/home.component.ts

@ -267,6 +267,15 @@ export class HomeComponent implements OnInit {
//右下角消息弹窗
messageId = []
receiptOfNotification(userNotification) {
if (!window.speechSynthesis) {
this.message.create('warning', `该游览器不支持语音播报`);
} else {
let speakMsg = new SpeechSynthesisUtterance('请注意,收到一条新的预警信息,请及时处理!');
speakMsg.lang = "zh-CN";
speakMsg.rate = 1;
speakMsg.pitch = 1.5;
window.speechSynthesis.speak(speakMsg);
}
let obj = {
id: userNotification.notification.entityId,
messageId: this.notificationService.template(this.template!, { nzPlacement: 'bottomRight', nzClass: 'receiptOfNotification', nzDuration: 0, nzData: userNotification }).messageId
@ -574,7 +583,7 @@ export class HomeComponent implements OnInit {
} if (word.indexOf('sino') != -1 || word.indexOf('zhonghua') != -1) {
this.message.create('warning', '口令禁止包含 sinochem、sino、zhonghua (含大小写变体) 等中国中化相关字符');
return false
} else {
} else {
await new Promise((resolve, reject) => {
let body = {
currentPassword: instance.validateForm.value.oldpassword,

1
src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.ts

@ -769,6 +769,7 @@ export class OilUnloadingProcessListComponent implements OnInit {
nzContent: OilUnloadingProcessComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 1000,
nzKeyboard: false,
nzBodyStyle: {
'border': '1px solid #6d9cc7',
'border-radius': '0px',

6
src/app/system-management/system-management.module.ts

@ -47,6 +47,7 @@ import { MenusComponent } from './role/menus/menus.component';
import { PagesModule } from '../pages/pages.module';
import { WarningEventsComponent } from './organization/warning-events/warning-events.component';
import { NzSwitchModule } from 'ng-zorro-antd/switch';
import { NzNotificationModule } from 'ng-zorro-antd/notification';
@NgModule({
declarations: [OrganizationComponent, UserComponent, RoleComponent, NavigationComponent, AdduserComponent, EdituserComponent, AddroleComponent, EditroleComponent, AddorComponent, EditorComponent, AnalysisOfTheHostComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent, PushComponent, EditPushItemComponent, FileOfLicenseComponent, UpdateOfLicenseComponent, AddFileOfLicenseComponent, EditFileOfLicenseComponent, AddUpdateOfLicenseComponent, EditUpdateOfLicenseComponent, MenuComponent, AddmenuComponent, EditmenuComponent, MenusComponent, WarningEventsComponent],
imports: [
@ -70,9 +71,10 @@ import { NzSwitchModule } from 'ng-zorro-antd/switch';
NzTreeSelectModule,
NzCheckboxModule,
PagesModule,
NzSwitchModule
NzSwitchModule,
NzNotificationModule
],
entryComponents: [AdduserComponent, EdituserComponent, AddroleComponent, EditroleComponent, AddorComponent, EditorComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent, EditPushItemComponent, AddFileOfLicenseComponent, EditFileOfLicenseComponent, AddUpdateOfLicenseComponent, EditUpdateOfLicenseComponent, AddmenuComponent, EditmenuComponent, MenusComponent,WarningEventsComponent]
entryComponents: [AdduserComponent, EdituserComponent, AddroleComponent, EditroleComponent, AddorComponent, EditorComponent, AddhostComponent, EdithostComponent, AddcameraComponent, EditcameraComponent, EditPushItemComponent, AddFileOfLicenseComponent, EditFileOfLicenseComponent, AddUpdateOfLicenseComponent, EditUpdateOfLicenseComponent, AddmenuComponent, EditmenuComponent, MenusComponent, WarningEventsComponent]
})
export class SystemManagementModule { }

17
src/app/system-management/user/user.component.ts

@ -7,6 +7,7 @@ import { NzMessageService } from 'ng-zorro-antd/message';
import { HttpClient } from '@angular/common/http';
import { EdituserComponent } from './edituser/edituser.component';
import { TreeService } from 'src/app/service/tree.service';
import { NzNotificationService } from 'ng-zorro-antd/notification';
@Component({
selector: 'app-user',
templateUrl: './user.component.html',
@ -14,7 +15,7 @@ import { TreeService } from 'src/app/service/tree.service';
})
export class UserComponent implements OnInit {
validateForm!: FormGroup;
constructor(private fb: FormBuilder, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient, private toTree: TreeService) { }
constructor(private fb: FormBuilder, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient, private toTree: TreeService, private notification: NzNotificationService) { }
level
getAllUrl
@ -257,7 +258,7 @@ export class UserComponent implements OnInit {
//重置密码
resetPassword(item) {
console.log(item)
// console.log(item)
this.modal.confirm({
nzTitle: `确定要重置${item.userName}这个账户的密码吗?`,
nzOkText: '确定',
@ -266,8 +267,14 @@ export class UserComponent implements OnInit {
let body = {
userId: item.id
}
this.http.post('/api/services/app/User/ResetPassword', body).subscribe(data => {
this.http.post('/api/services/app/User/ResetPassword', body).subscribe((data: any) => {
this.message.create('success', '重置成功!');
console.log(data)
this.notification.blank(
'用户' + item.userName + '的密码重置成功',
'当前密码为:' + data.result.newPassword,
{ nzDuration: 0, nzPlacement: 'top', nzClass: 'resetPassword' }
);
})
},
nzCancelText: '取消',
@ -277,6 +284,10 @@ export class UserComponent implements OnInit {
});
}
//提交审核
audit(data, type) {
if (type && data.auditStatus == 5) {//提交审核

5
src/theme.less

@ -783,3 +783,8 @@
color: #000;
}
}
.resetPassword{
.ant-notification-close-icon{
color: #000;
}
}
Loading…
Cancel
Save