From 74968d658c6fa16ad219ea23dfbe0e69244cb893 Mon Sep 17 00:00:00 2001 From: heqinghang Date: Mon, 21 Mar 2022 10:31:06 +0800 Subject: [PATCH 1/2] 666 --- .../components/edit/edit.component.ts | 34 ++++++++----------- .../components/list/list.component.html | 2 +- .../components/list/list.component.ts | 16 +++++---- .../services/level-config.service.ts | 8 +++++ 4 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/app/routes/partner/level-config/components/edit/edit.component.ts b/src/app/routes/partner/level-config/components/edit/edit.component.ts index 35bc59a3..c21bb292 100644 --- a/src/app/routes/partner/level-config/components/edit/edit.component.ts +++ b/src/app/routes/partner/level-config/components/edit/edit.component.ts @@ -38,19 +38,15 @@ export class ParterLevelConfigEditComponent implements OnInit { title: '', ui: { hidden: true } }, - name: { - title: '合伙人等级', + gradeName: { + title: '等级名称', type: 'string', - enum: [ - { label: '管理员', value: '1'}, - ], - ui: { - widget: 'select', - placeholder:'请选择', - visibleIf: { name2: (value: string) => value === '1' } - } as SFSelectWidgetSchema, }, - name3: { + sortId: { + title: '排序', + type: 'string', + }, + remark: { type: 'string', title: '备注', maxLength: 50, @@ -61,7 +57,7 @@ export class ParterLevelConfigEditComponent implements OnInit { } as SFTextareaWidgetSchema, }, }, - required: ['name1', 'name2'] + required: ['gradeName', 'sortId', 'remark'] }; this.ui = { '*': { @@ -77,12 +73,12 @@ export class ParterLevelConfigEditComponent implements OnInit { save() { this.sf.validator({ emitError: true }); if(!this.sf.valid) return; - // this.service.request('', { ...this.sf.value }).subscribe(res => { - // if (res) { - // this.modalRef.destroy(true); - // } else { - // this.service.msgSrv.error(res.msg); - // } - // }); + this.service.request(this.service.$api_save, { ...this.sf.value }).subscribe(res => { + if (res) { + this.modalRef.destroy(true); + } else { + this.service.msgSrv.error(res.msg); + } + }); } } diff --git a/src/app/routes/partner/level-config/components/list/list.component.html b/src/app/routes/partner/level-config/components/list/list.component.html index fd0078d8..e6f50f99 100644 --- a/src/app/routes/partner/level-config/components/list/list.component.html +++ b/src/app/routes/partner/level-config/components/list/list.component.html @@ -15,7 +15,7 @@ Date: Mon, 21 Mar 2022 10:34:18 +0800 Subject: [PATCH 2/2] 666 --- .../components/edit/edit.component.ts | 22 ++++++++++++++----- .../services/channel-sales.service.ts | 3 ++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/app/routes/partner/channel-sales/components/edit/edit.component.ts b/src/app/routes/partner/channel-sales/components/edit/edit.component.ts index 143c8f4f..3ba33a79 100644 --- a/src/app/routes/partner/channel-sales/components/edit/edit.component.ts +++ b/src/app/routes/partner/channel-sales/components/edit/edit.component.ts @@ -81,16 +81,26 @@ export class ParterChannelSalesEditComponent implements OnInit { default: '0', }, roleIds: { - title: '', + title: '角色', type: 'string', - enum: [ - { label: '管理员', value: '1'}, - ], ui: { widget: 'select', - placeholder:'授权角色', + placeholder: '授权角色', + mode: 'multiple', + maxMultipleCount: 5, + asyncData: () => { + return this.service.request(this.service.$api_getAppRoleList).pipe( + map((res: any) => { + return res + .filter((role: any) => role.roleCode !== 'Administrator') + .map((item: any) => { + return { label: item.roleName, value: item.id }; + }); + }) + ); + }, visibleIf: { isAuthorization: (value: string) => value === '1' } - } as SFSelectWidgetSchema, + }, }, remark: { type: 'string', diff --git a/src/app/routes/partner/channel-sales/services/channel-sales.service.ts b/src/app/routes/partner/channel-sales/services/channel-sales.service.ts index 28a32b02..358ef4f2 100644 --- a/src/app/routes/partner/channel-sales/services/channel-sales.service.ts +++ b/src/app/routes/partner/channel-sales/services/channel-sales.service.ts @@ -13,7 +13,8 @@ export class ChannelSalesService extends BaseService { $api_getPage = '/api/mdc/channelSalesManagement/list/page'; // OA员工模糊查询 $api_fuzzyQuery = '/api/mdc/channelSalesManagement/fuzzyQuery'; - + // 获取角色列表 + $api_getAppRoleList = '/api/mdc/cuc/roleInfo/getRoleList'; constructor(public injector: Injector) {