edit
This commit is contained in:
@ -31,7 +31,7 @@ export class StaffManagementComponent implements OnInit {
|
|||||||
{ title: '', index: 'key', type: 'checkbox' },
|
{ title: '', index: 'key', type: 'checkbox' },
|
||||||
{ title: '员工姓名', index: 'name' },
|
{ title: '员工姓名', index: 'name' },
|
||||||
{ title: '手机号码', index: 'telephone' },
|
{ title: '手机号码', index: 'telephone' },
|
||||||
{ title: '角色', render: 'description' },
|
{ title: '角色', index: 'roleName' },
|
||||||
{
|
{
|
||||||
title: '最后登录时间',
|
title: '最后登录时间',
|
||||||
index: 'lastLoginDate',
|
index: 'lastLoginDate',
|
||||||
@ -136,7 +136,7 @@ export class StaffManagementComponent implements OnInit {
|
|||||||
staffAction(item?: any) {
|
staffAction(item?: any) {
|
||||||
const modal = this.nzModalService.create({
|
const modal = this.nzModalService.create({
|
||||||
nzContent: SystemStaffStaffModalComponent,
|
nzContent: SystemStaffStaffModalComponent,
|
||||||
nzComponentParams: item ? { i: { ...item } } : { i: { userId: 0 } },
|
nzComponentParams: item ? { i: { ...item, roleId: (item.roleId as string)?.split(',') || [] } } : { i: { userId: 0 } },
|
||||||
nzFooter: null
|
nzFooter: null
|
||||||
});
|
});
|
||||||
modal.afterClose.subscribe(res => {
|
modal.afterClose.subscribe(res => {
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
|
|||||||
import { _HttpClient } from '@delon/theme';
|
import { _HttpClient } from '@delon/theme';
|
||||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||||
|
import { map } from 'rxjs/operators';
|
||||||
import { SystemService } from '../../../services/system.service';
|
import { SystemService } from '../../../services/system.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -53,22 +54,24 @@ export class SystemStaffStaffModalComponent implements OnInit {
|
|||||||
placeholder: '请选择员工角色',
|
placeholder: '请选择员工角色',
|
||||||
mode: 'multiple',
|
mode: 'multiple',
|
||||||
maxMultipleCount: 5,
|
maxMultipleCount: 5,
|
||||||
// asyncData: () => {
|
asyncData: () => {
|
||||||
// return this.service.request(this.service.$api_getAppRoleList).pipe(
|
return this.service.request(this.service.$api_getAppRoleList).pipe(
|
||||||
// map((res: any) => {
|
map((res: any) => {
|
||||||
// this.roleList = res;
|
this.roleList = res;
|
||||||
// return res.map((item: any) => {
|
return res.map((item: any) => {
|
||||||
// return { label: item.roleName, value: item.id };
|
return { label: item.roleName, value: item.id };
|
||||||
// });
|
});
|
||||||
// }),
|
}),
|
||||||
// );
|
);
|
||||||
// },
|
},
|
||||||
change: (i: any) => {
|
change: (i: any) => {
|
||||||
this.sf.value.roleIds = i;
|
console.log(i);
|
||||||
this.sf?.setValue('/roleIds', i);
|
|
||||||
|
// this.sf.value.roleIds = i;
|
||||||
|
// this.sf?.setValue('/roleIds', i);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
default: staff?.roleIds
|
default: staff?.roleId
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
required: ['staffName', 'telephone']
|
required: ['staffName', 'telephone']
|
||||||
@ -90,7 +93,6 @@ export class SystemStaffStaffModalComponent implements OnInit {
|
|||||||
const params: any = {
|
const params: any = {
|
||||||
...this.sf.value,
|
...this.sf.value,
|
||||||
enterpriseId: 0,
|
enterpriseId: 0,
|
||||||
roleId: []
|
|
||||||
};
|
};
|
||||||
this.service.request(this.service.$api_add_staff, params).subscribe(res => {
|
this.service.request(this.service.$api_add_staff, params).subscribe(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
@ -102,7 +104,6 @@ export class SystemStaffStaffModalComponent implements OnInit {
|
|||||||
const params: any = {
|
const params: any = {
|
||||||
appUserId: this.i.appUserId,
|
appUserId: this.i.appUserId,
|
||||||
...this.sf.value,
|
...this.sf.value,
|
||||||
roleId: []
|
|
||||||
};
|
};
|
||||||
this.service.request(this.service.$api_edit_staff, params).subscribe(res => {
|
this.service.request(this.service.$api_edit_staff, params).subscribe(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|||||||
@ -34,6 +34,8 @@ export class SystemService extends BaseService {
|
|||||||
$api_dalete_role = '/api/mdc/cuc/roleInfo/removeRoleInfo';
|
$api_dalete_role = '/api/mdc/cuc/roleInfo/removeRoleInfo';
|
||||||
// 获取角色详情
|
// 获取角色详情
|
||||||
$api_getRoleInfo = '/api/mdc/cuc/roleInfo/getRoleInfo';
|
$api_getRoleInfo = '/api/mdc/cuc/roleInfo/getRoleInfo';
|
||||||
|
// 获取角色列表
|
||||||
|
$api_getAppRoleList = '/api/mdc/cuc/roleInfo/getRoleList';
|
||||||
|
|
||||||
// 查询字典选项列表
|
// 查询字典选项列表
|
||||||
$api_get_dict_page = '/api/mdc/pbc/dictItems/list/page';
|
$api_get_dict_page = '/api/mdc/pbc/dictItems/list/page';
|
||||||
|
|||||||
Reference in New Issue
Block a user