|
|
@ -10,6 +10,7 @@ import {ValidatorsService} from '../../../services/validators.service'; |
|
|
|
import {LocalStorageService} from '../../../services/local-storage.service'; |
|
|
|
import {LocalStorageService} from '../../../services/local-storage.service'; |
|
|
|
import {environment} from '../../../../environments/environment'; |
|
|
|
import {environment} from '../../../../environments/environment'; |
|
|
|
import { ADMIN_INFO_OBJECT } from '../../../services/local-storage.namespace'; |
|
|
|
import { ADMIN_INFO_OBJECT } from '../../../services/local-storage.namespace'; |
|
|
|
|
|
|
|
import {CommonsService} from "../../../services/commons.service"; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-system-user', |
|
|
|
selector: 'app-system-user', |
|
|
@ -52,9 +53,12 @@ export class SystemUserComponent implements OnInit { |
|
|
|
// tslint:disable-next-line:variable-name
|
|
|
|
// tslint:disable-next-line:variable-name
|
|
|
|
BTN_systemuser_delete; |
|
|
|
BTN_systemuser_delete; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
userLabelArray = []; |
|
|
|
|
|
|
|
|
|
|
|
constructor( |
|
|
|
constructor( |
|
|
|
private location: PlatformLocation, // 路径
|
|
|
|
private location: PlatformLocation, // 路径
|
|
|
|
private http: HttpClient, // http请求
|
|
|
|
private http: HttpClient, // http请求
|
|
|
|
|
|
|
|
private commonsService: CommonsService, |
|
|
|
private message: NzMessageService, // 信息提示
|
|
|
|
private message: NzMessageService, // 信息提示
|
|
|
|
private fb: FormBuilder, // 表单
|
|
|
|
private fb: FormBuilder, // 表单
|
|
|
|
private modalService: NzModalService, // 对话框
|
|
|
|
private modalService: NzModalService, // 对话框
|
|
|
@ -85,13 +89,18 @@ export class SystemUserComponent implements OnInit { |
|
|
|
loginName: [null, [Validators.required, ValidatorsService.minLength(3), ValidatorsService.maxLength(20)]], |
|
|
|
loginName: [null, [Validators.required, ValidatorsService.minLength(3), ValidatorsService.maxLength(20)]], |
|
|
|
password: [null, [Validators.required, ValidatorsService.minLength(6), ValidatorsService.maxLength(40)]], |
|
|
|
password: [null, [Validators.required, ValidatorsService.minLength(6), ValidatorsService.maxLength(40)]], |
|
|
|
telephone: [null], |
|
|
|
telephone: [null], |
|
|
|
|
|
|
|
label: [null], |
|
|
|
roleId: [null, [Validators.required]], |
|
|
|
roleId: [null, [Validators.required]], |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 调用请求方法
|
|
|
|
// 调用请求方法
|
|
|
|
this.goRequest(); |
|
|
|
this.goRequest(); |
|
|
|
// 调用请求政策下拉列表
|
|
|
|
// 调用请求政策下拉列表
|
|
|
|
this.goRequestpoducetList(); |
|
|
|
this.goRequestpoducetList(); |
|
|
|
this.goRequestCompanyList(); |
|
|
|
this.goRequestCompanyList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getUserLabel(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -117,6 +126,13 @@ export class SystemUserComponent implements OnInit { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询用户标签
|
|
|
|
|
|
|
|
getUserLabel() { |
|
|
|
|
|
|
|
this.commonsService.getDictionary('USER_LABEL', data => { |
|
|
|
|
|
|
|
this.userLabelArray = data['return_data']; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 获取部门列表
|
|
|
|
// 获取部门列表
|
|
|
|
goRequestCompanyList() { |
|
|
|
goRequestCompanyList() { |
|
|
|
this.http.get(this.WEB_SERVE_URL + '/bsOrganization/getOrganizationList?companyId=' + this.store.get(ADMIN_INFO_OBJECT)['bsCompany'].id).subscribe(data => { |
|
|
|
this.http.get(this.WEB_SERVE_URL + '/bsOrganization/getOrganizationList?companyId=' + this.store.get(ADMIN_INFO_OBJECT)['bsCompany'].id).subscribe(data => { |
|
|
@ -193,6 +209,7 @@ export class SystemUserComponent implements OnInit { |
|
|
|
password: value.password, |
|
|
|
password: value.password, |
|
|
|
telephone: value.telephone, |
|
|
|
telephone: value.telephone, |
|
|
|
roleId: value.roleId, |
|
|
|
roleId: value.roleId, |
|
|
|
|
|
|
|
labelIdArray: value.label |
|
|
|
}; |
|
|
|
}; |
|
|
|
this.isOkLoading = true; |
|
|
|
this.isOkLoading = true; |
|
|
|
this.http.post(this.WEB_SERVE_URL + '/secUser/addUser', params).subscribe(data => { |
|
|
|
this.http.post(this.WEB_SERVE_URL + '/secUser/addUser', params).subscribe(data => { |
|
|
@ -246,6 +263,7 @@ export class SystemUserComponent implements OnInit { |
|
|
|
this.secUser.password = value.password; |
|
|
|
this.secUser.password = value.password; |
|
|
|
this.secUser.telephone = value.telephone; |
|
|
|
this.secUser.telephone = value.telephone; |
|
|
|
this.secUser.roleId = value.roleId; |
|
|
|
this.secUser.roleId = value.roleId; |
|
|
|
|
|
|
|
this.secUser.labelIdArray = value.label; |
|
|
|
|
|
|
|
|
|
|
|
this.http.post(this.WEB_SERVE_URL + '/secUser/editUser', this.secUser).subscribe(data => { |
|
|
|
this.http.post(this.WEB_SERVE_URL + '/secUser/editUser', this.secUser).subscribe(data => { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
@ -262,6 +280,7 @@ export class SystemUserComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
// 修改取消按钮
|
|
|
|
// 修改取消按钮
|
|
|
|
handleCancelEdit(): void { |
|
|
|
handleCancelEdit(): void { |
|
|
|
|
|
|
|
this.validateForm.reset(); |
|
|
|
this.isVisibleEdit = false; |
|
|
|
this.isVisibleEdit = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -283,6 +302,11 @@ export class SystemUserComponent implements OnInit { |
|
|
|
this.http.get(this.WEB_SERVE_URL + '/secUser/getUserView?userId=' + userId).subscribe(data => { |
|
|
|
this.http.get(this.WEB_SERVE_URL + '/secUser/getUserView?userId=' + userId).subscribe(data => { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
this.secUser = data['return_data']; |
|
|
|
this.secUser = data['return_data']; |
|
|
|
|
|
|
|
const labelIdArray = []; |
|
|
|
|
|
|
|
for (const labelId of this.secUser['labelIdArray']) { |
|
|
|
|
|
|
|
labelIdArray.push(String(labelId)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.validateForm.patchValue({ label: labelIdArray}); |
|
|
|
this.avatarImg = data['return_data']['avatar']; |
|
|
|
this.avatarImg = data['return_data']['avatar']; |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|