Browse Source

[完善]9.14文档修改8条14条

beijing
邵佳豪 2 years ago
parent
commit
e39fc5f8ca
  1. 9
      src/app/pages/login/login.component.ts
  2. 2
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.html
  3. 8
      src/app/system-management/user/edituser/edituser.component.html
  4. 8
      src/app/system-management/user/edituser/edituser.component.scss
  5. 73
      src/app/system-management/user/edituser/edituser.component.ts
  6. 4
      src/app/system-management/user/user.component.html
  7. 42
      src/app/system-management/user/user.component.ts

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

@ -104,7 +104,7 @@ export class LoginComponent implements OnInit {
sessionStorage.setItem("3dSceneData", JSON.stringify(data.result))
this.init3D = data.result.hasBuildingInfo
})
})
}
@ -148,12 +148,15 @@ export class LoginComponent implements OnInit {
sessionStorage.setItem('isDefaultPassword', JSON.stringify(data.result.user.isDefaultPassword))
sessionStorage.setItem('isPasswordExpired', JSON.stringify(data.result.user.isPasswordExpired))
this.isLoading = false;
if (data.result.user.organization.isGasStation) {
if (!data.result.user.organization) {
this.message.create('error', `当前用户没有组织机构信息`);
return
}
if (data.result.user.organization.isGasStation) {
await this.getGasStationBaseInfo()
if (data.result.user.menus[0].name == "数字油站" && data.result.user.menus.length == 1 && !this.init3D) {
this.message.create('error', `当前用户油站未开通3D且仅分配油站菜单`);
return
}
}
//记住密码

2
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.html

@ -84,7 +84,7 @@
</div>
</nz-modal>
<span
*ngIf="!data.handleTime && isMisinformation && (data.appealStatus == 0 || data.appealStatus == 3 || data.appealStatus == 4)"
*ngIf="isMisinformation && (data.appealStatus == 0 || data.appealStatus == 3 || data.appealStatus == 4)"
style="color: #FF4B65;cursor: pointer;margin-right: 20px;" (click)="misinformation()">误报</span>
<span
*ngIf="!data.handleTime && isSubmit && (data.appealStatus == 0 || data.appealStatus == 3 || data.appealStatus == 4)"

8
src/app/system-management/user/edituser/edituser.component.html

@ -61,4 +61,12 @@
</nz-form-control>
</nz-form-item>
</form>
<div class="btnbox">
<button [nzLoading]="isLoading" nz-button nzType="default" (click)="cancel()">取消</button>
<button [nzLoading]="isLoading" nz-button nzType="primary" (click)="ok()" [disabled]="data.auditStatus == 1">确定</button>
<button [nzLoading]="isLoading" nz-button nzType="primary" (click)="audit(true)"
*ngIf="data.auditStatus == 0 || data.auditStatus == 3 || data.auditStatus == 4 || data.auditStatus == 5">提交审核</button>
<button [nzLoading]="isLoading" nz-button nzType="primary" (click)="audit(false)"
*ngIf="data.auditStatus == 1">撤销审核</button>
</div>
</div>

8
src/app/system-management/user/edituser/edituser.component.scss

@ -0,0 +1,8 @@
.btnbox{
display: flex;
justify-content: flex-end;
box-sizing: border-box;
button{
margin-left: 6px;
}
}

73
src/app/system-management/user/edituser/edituser.component.ts

@ -3,6 +3,7 @@ import { NzModalRef } from 'ng-zorro-antd/modal';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
import { TreeService } from 'src/app/service/tree.service';
import { NzMessageService } from 'ng-zorro-antd/message';
@Component({
selector: 'app-edituser',
@ -15,8 +16,9 @@ export class EdituserComponent implements OnInit {
@Input() listOfData?: any;
@Input() listOfData2?: any;
@Input() nodes?: any;
@Input() editUrl?: any;
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService) { }
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService, private message: NzMessageService) { }
ngOnInit(): void {
console.log(this.data)
@ -25,7 +27,7 @@ export class EdituserComponent implements OnInit {
this.data.roleNames.forEach(element => {
if (element.indexOf('LEVEL') != -1) {
roleData2.push(element)
}else{
} else {
roleData1.push(element)
}
});
@ -108,5 +110,72 @@ export class EdituserComponent implements OnInit {
})
})
}
isLoading = false
//确定
async ok() {
this.isLoading = true
if (this.validateForm.valid) {
return await new Promise(resolve => {
for (let index = 0; index < this.validateForm.value.role2.length; index++) {
const element = this.validateForm.value.role2[index];
if (element.indexOf('HANDLE') != -1) {
this.validateForm.value.role2.splice(index, 1)
index--
}
}
let roleNames = [...this.validateForm.value.role, ...this.validateForm.value.role2]
let body = {
id: this.data.id,
userName: this.validateForm.value.account,
name: this.validateForm.value.name,
organizationUnitId: this.validateForm.value.organization,
roleNames: roleNames,
phoneNumber: this.validateForm.value.phonenum,
isActive: true
}
this.http.put(this.editUrl, body).subscribe((data:any) => {
resolve(data)
this.data.auditStatus = data.result.auditStatus
this.isLoading = false
this.message.create('success', '保存成功!');
}, err => {
resolve(err)
this.isLoading = false
this.message.create('warning', '保存失败');
})
})
} else {
this.message.create('warning', '请填写完整!');
}
}
//取消
cancel() {
this.modal.destroy();
}
//提交审核
async audit(type) {
if (type && this.data.auditStatus == 5) {//提交审核
this.message.create('warning', '审核完成的不能重复提交,请编辑后提交');
return
}
if(type){
await this.ok()
}
this.isLoading = true
let url
type ? url = '/api/services/app/EdittingUser/Commit' : url = '/api/services/app/EdittingUser/Uncommit'
this.http.post(url, '', {
params: {
id: this.data.id
}
}).subscribe((data: any) => {
this.data.auditStatus = data.result.auditStatus
this.isLoading = false
this.message.create('success', type ? '提交审核成功' : '撤销审核成功');
}, err => {
this.isLoading = false
this.message.create('error', type ? '提交审核失败' : '撤销审核失败');
})
}
}

4
src/app/system-management/user/user.component.html

@ -99,9 +99,9 @@
<td class="operation">
<a (click)="editUser(data)">编辑</a>
<a (click)="resetPassword(data)">重置密码</a>
<a (click)="audit(data,true)"
<!-- <a (click)="audit(data,true)"
*ngIf="data.auditStatus == 0 || data.auditStatus == 3 || data.auditStatus == 4 || data.auditStatus == 5">提交审核</a>
<a (click)="audit(data,false)" *ngIf="data.auditStatus == 1">撤销审核</a>
<a (click)="audit(data,false)" *ngIf="data.auditStatus == 1">撤销审核</a> -->
<a *ngIf="!data.isActive" class="greenColor2" (click)="cancel(data,true)">启用</a>
<a *ngIf="data.isActive" class="redColor" (click)="cancel(data,false)">停用</a>
<a class="redColor" (click)="delete(data)">注销</a>

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

@ -241,52 +241,18 @@ export class UserComponent implements OnInit {
nzContent: EdituserComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 460,
nzFooter: null,
nzMaskClosable: false,
nzComponentParams: {
data: data,
listOfData: this.listOfData,
listOfData2: this.listOfData2,
nodes: this.nodes
},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
for (let index = 0; index < instance.validateForm.value.role2.length; index++) {
const element = instance.validateForm.value.role2[index];
if (element.indexOf('HANDLE') != -1) {
instance.validateForm.value.role2.splice(index, 1)
index--
}
}
let roleNames = [...instance.validateForm.value.role, ...instance.validateForm.value.role2]
let body = {
id: data.id,
userName: instance.validateForm.value.account,
name: instance.validateForm.value.name,
organizationUnitId: instance.validateForm.value.organization,
roleNames: roleNames,
phoneNumber: instance.validateForm.value.phonenum,
isActive: true
}
this.http.put(this.editUrl, body).subscribe(data => {
resolve(data)
this.message.create('success', '编辑成功!');
this.getAllUsers()
return true
}, err => {
resolve(err)
this.message.create('warning', '编辑失败');
return false
})
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
nodes: this.nodes,
editUrl:this.editUrl
}
});
const instance = modal.getContentComponent();
modal.afterClose.subscribe(result => this.getAllUsers());
}
//重置密码

Loading…
Cancel
Save