刘向辉 2 years ago
parent
commit
fb0921cf5b
  1. 6
      src/app/http-interceptors/base-interceptor.ts
  2. 4
      src/app/pages/change-password/change-password.component.ts
  3. 22
      src/app/pages/home/home.component.ts
  4. 7
      src/app/pages/license/file-category/file-category.component.ts
  5. 5
      src/app/pages/license/histories/histories.component.ts
  6. 5
      src/app/pages/license/inform/inform.component.ts
  7. 5
      src/app/pages/license/update-category/update-category.component.ts
  8. 53
      src/app/pages/login/forget/forget.component.html
  9. 26
      src/app/pages/login/forget/forget.component.scss
  10. 144
      src/app/pages/login/forget/forget.component.ts
  11. 16
      src/app/pages/login/login.component.ts
  12. 3
      src/app/pages/pages.module.ts
  13. 1
      src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.ts
  14. 1
      src/app/system-management/push/push.component.scss
  15. 18
      src/app/system-management/push/push.component.ts
  16. 6
      src/app/system-management/system-management.module.ts
  17. 17
      src/app/system-management/user/user.component.ts
  18. 4
      src/styles.scss
  19. 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`);
}
}

4
src/app/pages/change-password/change-password.component.ts

@ -33,7 +33,7 @@ export class MyValidators extends Validators {
return null;
}
return isPassword(value) ? null : { mobile: { 'zh-cn': `长度 12 位以上,包含①大写字母、②小写字母、③数字、④特殊字符四种中的三种组合`, en: `Password phone number is not valid` } };
return isPassword(value) ? null : { mobile: { 'zh-cn': `长度至少 8 位,必须包含大写字母、小写字母、数字、符号四种中的三种,且口令禁止包含 sinochem、sino、zhonghua (含大小写变体) 等中国中化相关字符`, en: `Password phone number is not valid` } };
}
}
@ -41,5 +41,5 @@ function isEmptyInputValue(value: NzSafeAny): boolean {
return value == null || value.length === 0;
}
function isPassword(value: string): boolean {
return typeof value === 'string' && /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]{12,99}$/.test(value);
return typeof value === 'string' && /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)(?!.*[sS][iI][nN][oO].*)(?!.*[zZ][hH][oO][nN][gG][hH][uU][aA].*)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]{8,99}$/.test(value);
}

22
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
@ -503,13 +512,12 @@ export class HomeComponent implements OnInit {
}
}
}
// this.router.navigate([this.menuList2[0].url])
if (this.menuList2[0].url) {
window.open(this.menuList2[0].url)
} else {
if (this.menuList2.length == 0) {
this.message.create('warning', '未分配系统管理菜单');
return
} else {
window.open(this.menuList2[0].url)
}
}
goback() {
this.router.navigate(['/plan'])
@ -568,9 +576,13 @@ export class HomeComponent implements OnInit {
nzComponentParams: {},
nzOnOk: async () => {
if (instance.validateForm.valid) {
let word = JSON.parse(JSON.stringify(instance.validateForm.value.newpassword)).toLowerCase()
if (instance.validateForm.value.newpassword != instance.validateForm.value.affirmpassword) {
this.message.create('warning', '两次密码输入不一致!');
return false
} if (word.indexOf('sino') != -1 || word.indexOf('zhonghua') != -1) {
this.message.create('warning', '口令禁止包含 sinochem、sino、zhonghua (含大小写变体) 等中国中化相关字符');
return false
} else {
await new Promise((resolve, reject) => {
let body = {

7
src/app/pages/license/file-category/file-category.component.ts

@ -22,7 +22,10 @@ export class FileCategoryComponent implements OnInit {
tableScrollHeight
resizeListener
ngOnInit(): void {
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px'
setTimeout(() => {
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px'
}, 0);
// 页面监听
this.resizeListener = fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => {
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px'
@ -152,7 +155,7 @@ export class FileCategoryComponent implements OnInit {
});
})
})
}
}
}
});
const instance = modal.getContentComponent();

5
src/app/pages/license/histories/histories.component.ts

@ -21,7 +21,10 @@ export class HistoriesComponent implements OnInit {
tableScrollHeight
resizeListener
ngOnInit(): void {
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px'
setTimeout(() => {
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px'
}, 0);
// 页面监听
this.resizeListener = fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => {
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px'

5
src/app/pages/license/inform/inform.component.ts

@ -18,7 +18,10 @@ export class InformComponent implements OnInit {
resizeListener
ngOnInit(): void {
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px'
setTimeout(() => {
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px'
}, 0);
// 页面监听
this.resizeListener = fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => {

5
src/app/pages/license/update-category/update-category.component.ts

@ -23,7 +23,10 @@ export class UpdateCategoryComponent implements OnInit {
tableScrollHeight
resizeListener
ngOnInit(): void {
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px'
setTimeout(() => {
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px'
}, 0);
// 页面监听
this.resizeListener = fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => {
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px'

53
src/app/pages/login/forget/forget.component.html

@ -0,0 +1,53 @@
<div class="box">
<div class="step1" *ngIf="currentStep == 1">
<form nz-form [formGroup]="validateForm" (ngSubmit)="step1()">
<nz-form-item>
<nz-form-label nzRequired nzFor="">请输入要修改密码的账号</nz-form-label>
<nz-form-control>
<input autocomplete="off" nz-input formControlName="account" id="account" />
</nz-form-control>
</nz-form-item>
<div class="btn">
<button type="submit" nz-button nzType="primary">下一步</button>
</div>
</form>
</div>
<div class="step2" *ngIf="currentStep == 2">
<div class="phonebox">
该账号绑定的手机号为:{{phoneNum}} <button [nzLoading]="codeCountDown != 0" type="button" nz-button nzType="primary"
(click)="code()">{{ codeCountDown == 0 ? '点击获取验证码' : codeCountDown + '秒后可重新获取'}}</button>
</div>
<form nz-form [formGroup]="validateForm2" (ngSubmit)="step2()">
<nz-form-item>
<nz-form-label nzRequired nzFor="">请输入验证码</nz-form-label>
<nz-form-control>
<input autocomplete="off" nz-input formControlName="code" id="code" />
</nz-form-control>
</nz-form-item>
<div class="btn">
<button type="submit" nz-button nzType="primary">下一步</button>
</div>
</form>
</div>
<div class="step3" *ngIf="currentStep == 3">
<form nz-form [formGroup]="validateForm3" (ngSubmit)="step3()">
<nz-form-item>
<!-- <nz-form-label nzRequired nzFor="">请输入新密码</nz-form-label> -->
<nz-form-control>
<input name="newpassword" nz-input type="password" formControlName="newpassword"
placeholder="请输入新密码" autocomplete="off" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<!-- <nz-form-label nzRequired nzFor="">确认新密码</nz-form-label> -->
<nz-form-control>
<input name="affirmpassword" nz-input type="password" formControlName="affirmpassword"
placeholder="确认新密码" autocomplete="new-password" />
</nz-form-control>
</nz-form-item>
<div class="btn">
<button type="submit" nz-button nzType="primary">确定</button>
</div>
</form>
</div>
</div>

26
src/app/pages/login/forget/forget.component.scss

@ -0,0 +1,26 @@
.step1,
.step2 {
nz-form-item {
display: flex;
flex-direction: column;
nz-form-label {
text-align: left;
}
}
.btn {
width: 100%;
text-align: center;
margin-top: 50px;
}
}
.step3 {
.btn {
width: 100%;
text-align: center;
margin-top: 10px;
}
}

144
src/app/pages/login/forget/forget.component.ts

@ -0,0 +1,144 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators, AbstractControl } from '@angular/forms';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzSafeAny } from 'ng-zorro-antd/core/types';
import { HttpClient } from '@angular/common/http';
import { NzModalRef } from 'ng-zorro-antd/modal';
@Component({
selector: 'app-forget',
templateUrl: './forget.component.html',
styleUrls: ['./forget.component.scss']
})
export class ForgetComponent implements OnInit {
validateForm!: FormGroup;
validateForm2!: FormGroup;
validateForm3!: FormGroup;
constructor(private fb: FormBuilder, private message: NzMessageService, private http: HttpClient, private modal: NzModalRef) { }
ngOnInit(): void {
this.validateForm = this.fb.group({
account: [null, [Validators.required]]
});
this.validateForm2 = this.fb.group({
code: [null, [Validators.required]]
});
const { password } = MyValidators;
this.validateForm3 = this.fb.group({
newpassword: [null, [Validators.required, password]],
affirmpassword: [null, [Validators.required, password]]
});
}
currentStep = 1
phoneNum: string
step1() {
console.log(this.validateForm)
if (this.validateForm.invalid) {
this.message.create('warning', '请填写完整');
} else {
this.http.get('/api/services/app/User/GetPhoneNumber', {
params: {
userName: this.validateForm.value.account
}
}).subscribe({
next: (data: any) => {
this.phoneNum = data.result
this.currentStep = 2
}
})
}
}
//发送验证码
codeCountDown = 0
code() {
let params = {
userName: this.validateForm.value.account,
}
this.http.post('/api/services/app/User/SendVerificationCode', null, { params: params }).subscribe({
next: (data: any) => {
this.message.create('success', '已发送');
//按钮倒计时
this.codeCountDown = 30
let codesetInterval = setInterval(() => {
this.codeCountDown = this.codeCountDown - 1
if (this.codeCountDown == 0) {
clearInterval(codesetInterval)
}
}, 1000);
}
})
}
step2() {
if (this.validateForm2.invalid) {
this.message.create('warning', '请填写完整');
} else {
console.log(this.validateForm.value.account)
let params = {
userName: this.validateForm.value.account,
code: this.validateForm2.value.code
}
this.http.get('/api/services/app/User/VerifyVerificationCode', { params: params }).subscribe({
next: (data: any) => {
this.currentStep = 3
}
})
}
}
step3() {
if (this.validateForm3.valid) {
let word = JSON.parse(JSON.stringify(this.validateForm3.value.newpassword)).toLowerCase()
if (this.validateForm3.value.newpassword != this.validateForm3.value.affirmpassword) {
this.message.create('warning', '两次密码输入不一致!');
return false
} if (word.indexOf('sino') != -1 || word.indexOf('zhonghua') != -1) {
this.message.create('warning', '口令禁止包含 sinochem、sino、zhonghua (含大小写变体) 等中国中化相关字符');
return false
} else {
let body = {
userName: this.validateForm.value.account,
code: this.validateForm2.value.code,
newPassword: this.validateForm3.value.newpassword,
}
this.http.post('/api/services/app/User/ChangePasswordBySms', body).subscribe(data => {
this.message.create('success', '修改成功!');
this.modal.close()
return true
}, err => {
return false
})
}
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
}
export type MyErrorsOptions = { 'zh-cn': string; en: string } & Record<string, NzSafeAny>;
export type MyValidationErrors = Record<string, MyErrorsOptions>;
export class MyValidators extends Validators {
static password(control: AbstractControl): MyValidationErrors | null {
const value = control.value;
if (isEmptyInputValue(value)) {
return null;
}
return isPassword(value) ? null : { mobile: { 'zh-cn': `长度至少 8 位,必须包含大写字母、小写字母、数字、符号四种中的三种,且口令禁止包含 sinochem、sino、zhonghua (含大小写变体) 等中国中化相关字符`, en: `Password phone number is not valid` } };
}
}
function isEmptyInputValue(value: NzSafeAny): boolean {
return value == null || value.length === 0;
}
function isPassword(value: string): boolean {
return typeof value === 'string' && /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)(?!.*[sS][iI][nN][oO].*)(?!.*[zZ][hH][oO][nN][gG][hH][uU][aA].*)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]{8,99}$/.test(value);
}

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

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, ViewContainerRef } from '@angular/core';
import { HttpClient } from '@angular/common/http'
import { Router, ActivatedRoute } from '@angular/router'
import { CacheTokenService } from '../../service/cache-token.service'//引入服务
@ -8,6 +8,8 @@ import { Base64 } from 'js-base64';
import { NzNotificationService } from 'ng-zorro-antd/notification';
import { NzSafeAny } from 'ng-zorro-antd/core/types';
import { SelectedMenu } from 'src/app/service/selectedMenu.service';
import { NzModalService } from 'ng-zorro-antd/modal';
import { ForgetComponent } from './forget/forget.component';
// import { THIS_EXPR } from '@angular/compiler/src/output/output_ast';
declare var abp: any
@ -20,7 +22,7 @@ export class LoginComponent implements OnInit {
validateForm!: FormGroup;
passwordValidateForm!: FormGroup;
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService, private fb: FormBuilder, private message: NzMessageService, private notificationService: NzNotificationService, private selectedMenu: SelectedMenu) {
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService, private fb: FormBuilder, private message: NzMessageService, private notificationService: NzNotificationService, private selectedMenu: SelectedMenu, private modal: NzModalService, private viewContainerRef: ViewContainerRef) {
const { password } = MyValidators;
this.validateForm = this.fb.group({
userName: [null, [Validators.required]],
@ -234,7 +236,15 @@ export class LoginComponent implements OnInit {
return menuList
}
forget() {
this.message.create('warning', `请联系管理员`);
// this.message.create('warning', `请联系管理员`);
this.modal.create({
nzTitle: '忘记密码',
nzContent: ForgetComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 288,
nzComponentParams: {},
nzFooter: null
});
}
}

3
src/app/pages/pages.module.ts

@ -89,10 +89,11 @@ import { RecordsNavComponent } from './records/records-nav/records-nav.component
import { UserDetailsComponent } from './audit/audit-ing/user-details/user-details.component';
import { AppealDetailsComponent } from './audit/audit-ing/appeal-details/appeal-details.component';
import { SystemModelComponent } from './home/system-model/system-model.component';
import { ForgetComponent } from './login/forget/forget.component';
@NgModule({
declarations: [LoginComponent, RegisterComponent, HomeComponent, PlanComponent, TodayWarningComponent, CriminalRecordsComponent,
TodayWarningAdminComponent, CriminalRecordsAdminComponent, LeftDomainComponent, EquipmentInfoComponent, OilStationInfoComponent,
AddequipmentComponent, EditequipmentComponent, PlanAdminComponent, GetOutOfLineDetailsComponent, DispositionComponent, OilUnloadingProcessComponent, HomePageComponent, OilUnloadingProcessListComponent, ChangePasswordComponent, FacilitySortPipe, WarningStatisticsListComponent, DisposeequipmentComponent, NavBarComponent, InformComponent, UpdateCategoryComponent, FileCategoryComponent, HistoriesComponent, EditUpdateCategoryComponent, DetailsUpdateCategoryComponent, EditFileCategoryComponent, DetailsFileCategoryComponent, PdfWordLookComponent, OilStationListComponent, UpdateLicenseListComponent, FileLicenseListComponent, AuditNavComponent, AuditIngComponent, AuditRecordComponent, AuditInformTimeComponent, AuditDisposeComponent, EditInformTimeComponent, AuditDetailsInformTimeComponent, auditStatusPipe, GasBaseInfoComponent, notificationContent, licenseViolationType, handleState, AnnualInspectionComponent, EditAnnualInspectionComponent, RecordsNavComponent, UserDetailsComponent, AppealDetailsComponent, fileName, SystemModelComponent],
AddequipmentComponent, EditequipmentComponent, PlanAdminComponent, GetOutOfLineDetailsComponent, DispositionComponent, OilUnloadingProcessComponent, HomePageComponent, OilUnloadingProcessListComponent, ChangePasswordComponent, FacilitySortPipe, WarningStatisticsListComponent, DisposeequipmentComponent, NavBarComponent, InformComponent, UpdateCategoryComponent, FileCategoryComponent, HistoriesComponent, EditUpdateCategoryComponent, DetailsUpdateCategoryComponent, EditFileCategoryComponent, DetailsFileCategoryComponent, PdfWordLookComponent, OilStationListComponent, UpdateLicenseListComponent, FileLicenseListComponent, AuditNavComponent, AuditIngComponent, AuditRecordComponent, AuditInformTimeComponent, AuditDisposeComponent, EditInformTimeComponent, AuditDetailsInformTimeComponent, auditStatusPipe, GasBaseInfoComponent, notificationContent, licenseViolationType, handleState, AnnualInspectionComponent, EditAnnualInspectionComponent, RecordsNavComponent, UserDetailsComponent, AppealDetailsComponent, fileName, SystemModelComponent, ForgetComponent],
imports: [

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',

1
src/app/system-management/push/push.component.scss

@ -66,6 +66,7 @@
color: #000D21;
font-family: synormal;
font-weight: 400;
text-align: left;
}
tr:nth-child(odd) {
background-color:rgba(145, 204, 255, 0.16);

18
src/app/system-management/push/push.component.ts

@ -144,7 +144,7 @@ export class PushComponent implements OnInit {
},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
await new Promise((resolve, reject) => {
console.log('表单信息', instance.validateForm)
let body = {
id: item.id,
@ -152,11 +152,17 @@ export class PushComponent implements OnInit {
// handleRoleIds: instance.validateForm.value.handle,
smsPushRoleIds: instance.validateForm.value.note
}
this.http.put('/api/services/app/Violation/UpdateRoles', body).subscribe(data => {
resolve(data)
this.message.create('success', '修改成功!');
this.getViolation()
return true
this.http.put('/api/services/app/Violation/UpdateRoles', body).subscribe({
next: data => {
resolve(data)
this.message.create('success', '修改成功!');
this.getViolation()
return true
},
error: err => {
this.message.create('success', '修改失败!');
reject(err)
}
})
})
} else {

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) {//提交审核

4
src/styles.scss

@ -291,7 +291,9 @@ h1 {
//可展开面板
.ant-collapse-header {
//可展开面板
padding: 0 0 0 25px;
// padding: 0 0 0 25px;
padding: 0;
padding-left: 5px;
height: 30px;
line-height: 28px;
background: linear-gradient(360deg, #000D21 0%, rgba(0, 59, 110, 0.8) 100%);

5
src/theme.less

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