From 23aca9dbfe793451b7631e310d52273a58a33b3b Mon Sep 17 00:00:00 2001
From: hurui <177768073@qq.com>
Date: Tue, 5 Jul 2022 16:41:34 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../system-user/system-user.component.html | 19 +++++++++++++++
.../system-user/system-user.component.ts | 24 +++++++++++++++++++
2 files changed, 43 insertions(+)
diff --git a/src/app/admin/system/system-user/system-user.component.html b/src/app/admin/system/system-user/system-user.component.html
index 53ca746..437fc0b 100644
--- a/src/app/admin/system/system-user/system-user.component.html
+++ b/src/app/admin/system/system-user/system-user.component.html
@@ -61,6 +61,7 @@
+
@@ -235,5 +245,14 @@
+
+ 通知权限
+
+
+
+
+
+
+
diff --git a/src/app/admin/system/system-user/system-user.component.ts b/src/app/admin/system/system-user/system-user.component.ts
index 828f54e..86a6b3f 100644
--- a/src/app/admin/system/system-user/system-user.component.ts
+++ b/src/app/admin/system/system-user/system-user.component.ts
@@ -10,6 +10,7 @@ import {ValidatorsService} from '../../../services/validators.service';
import {LocalStorageService} from '../../../services/local-storage.service';
import {environment} from '../../../../environments/environment';
import { ADMIN_INFO_OBJECT } from '../../../services/local-storage.namespace';
+import {CommonsService} from "../../../services/commons.service";
@Component({
selector: 'app-system-user',
@@ -52,9 +53,12 @@ export class SystemUserComponent implements OnInit {
// tslint:disable-next-line:variable-name
BTN_systemuser_delete;
+ userLabelArray = [];
+
constructor(
private location: PlatformLocation, // 路径
private http: HttpClient, // http请求
+ private commonsService: CommonsService,
private message: NzMessageService, // 信息提示
private fb: FormBuilder, // 表单
private modalService: NzModalService, // 对话框
@@ -85,13 +89,18 @@ export class SystemUserComponent implements OnInit {
loginName: [null, [Validators.required, ValidatorsService.minLength(3), ValidatorsService.maxLength(20)]],
password: [null, [Validators.required, ValidatorsService.minLength(6), ValidatorsService.maxLength(40)]],
telephone: [null],
+ label: [null],
roleId: [null, [Validators.required]],
});
+
+
// 调用请求方法
this.goRequest();
// 调用请求政策下拉列表
this.goRequestpoducetList();
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() {
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,
telephone: value.telephone,
roleId: value.roleId,
+ labelIdArray: value.label
};
this.isOkLoading = true;
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.telephone = value.telephone;
this.secUser.roleId = value.roleId;
+ this.secUser.labelIdArray = value.label;
this.http.post(this.WEB_SERVE_URL + '/secUser/editUser', this.secUser).subscribe(data => {
if (data['return_code'] === '000000') {
@@ -262,6 +280,7 @@ export class SystemUserComponent implements OnInit {
// 修改取消按钮
handleCancelEdit(): void {
+ this.validateForm.reset();
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 => {
if (data['return_code'] === '000000') {
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'];
} else {