edit
This commit is contained in:
@ -3,6 +3,7 @@ import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
|
||||
import { _HttpClient } from '@delon/theme';
|
||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { SystemService } from '../../../services/system.service';
|
||||
|
||||
@Component({
|
||||
@ -53,22 +54,24 @@ export class SystemStaffStaffModalComponent implements OnInit {
|
||||
placeholder: '请选择员工角色',
|
||||
mode: 'multiple',
|
||||
maxMultipleCount: 5,
|
||||
// asyncData: () => {
|
||||
// return this.service.request(this.service.$api_getAppRoleList).pipe(
|
||||
// map((res: any) => {
|
||||
// this.roleList = res;
|
||||
// return res.map((item: any) => {
|
||||
// return { label: item.roleName, value: item.id };
|
||||
// });
|
||||
// }),
|
||||
// );
|
||||
// },
|
||||
asyncData: () => {
|
||||
return this.service.request(this.service.$api_getAppRoleList).pipe(
|
||||
map((res: any) => {
|
||||
this.roleList = res;
|
||||
return res.map((item: any) => {
|
||||
return { label: item.roleName, value: item.id };
|
||||
});
|
||||
}),
|
||||
);
|
||||
},
|
||||
change: (i: any) => {
|
||||
this.sf.value.roleIds = i;
|
||||
this.sf?.setValue('/roleIds', i);
|
||||
console.log(i);
|
||||
|
||||
// this.sf.value.roleIds = i;
|
||||
// this.sf?.setValue('/roleIds', i);
|
||||
}
|
||||
},
|
||||
default: staff?.roleIds
|
||||
default: staff?.roleId
|
||||
}
|
||||
},
|
||||
required: ['staffName', 'telephone']
|
||||
@ -90,7 +93,6 @@ export class SystemStaffStaffModalComponent implements OnInit {
|
||||
const params: any = {
|
||||
...this.sf.value,
|
||||
enterpriseId: 0,
|
||||
roleId: []
|
||||
};
|
||||
this.service.request(this.service.$api_add_staff, params).subscribe(res => {
|
||||
if (res) {
|
||||
@ -102,7 +104,6 @@ export class SystemStaffStaffModalComponent implements OnInit {
|
||||
const params: any = {
|
||||
appUserId: this.i.appUserId,
|
||||
...this.sf.value,
|
||||
roleId: []
|
||||
};
|
||||
this.service.request(this.service.$api_edit_staff, params).subscribe(res => {
|
||||
if (res) {
|
||||
|
||||
Reference in New Issue
Block a user