From 9dbafb2a30d8c0d65e1cf91a25ee8ab74c79cb08 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Wed, 11 May 2022 19:27:21 +0800 Subject: [PATCH] fix bug --- proxy.conf.js | 4 +- .../components/edit/edit.component.ts | 49 ++++++------------- 2 files changed, 16 insertions(+), 37 deletions(-) diff --git a/proxy.conf.js b/proxy.conf.js index 000f97b3..b9211e38 100644 --- a/proxy.conf.js +++ b/proxy.conf.js @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-01-18 09:51:21 * @LastEditors : Shiming - * @LastEditTime : 2022-05-11 13:29:32 + * @LastEditTime : 2022-05-11 19:19:55 * @FilePath : \\tms-obc-web\\proxy.conf.js * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -30,7 +30,7 @@ module.exports = { // }, '//api': { target: { - host: 'tms-api-test.eascs.com', + host: 'tms-api-dev.eascs.com', protocol: 'https:', port: 443 }, 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 f0bcfeed..27bd17ea 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 @@ -47,31 +47,25 @@ export class ParterChannelSalesEditComponent implements OnInit { if (!this.sts) { this.service.request(this.service.$api_getChannelSalesInfo, { id: this.i?.id }).subscribe(res => { const List: any = []; - const List2: any = []; const List3: any = []; if (res) { let value1 = Object.assign({}, res); delete value1.employeeVO; let value = res.employeeVO; List.push({ label: value.empName + '/' + value.empNo, value: value.empNo }); - List2.push({ label: value.roleName, value: value.id }); res.roleInfoVOList.forEach((element: any) => { - List2.push({ label: element.roleName, value: element.id }); List3.push(element.id); }); setTimeout(() => { if (this.sf) { - console.log(this.sf.getProperty('/employeeVO')!.schema); - this.sf.getProperty('/employeeVO')!.schema.enum = List; this.sf.getProperty('/employeeVO')!.widget.reset(List); - - this.sf.getProperty('/roleIds')!.schema.enum = List2; - this.sf.getProperty('/roleIds')!.widget.reset(List2); } if (value.empNo) { this.sf.setValue('/employeeVO', value.empNo); - this.sf.setValue('/roleIds', value.List3); + console.log(List3); + + this.sf.setValue('/roleIds', List3); this.currentOAItem = value; this.sf.setValue('/phoneNumber', res.telephone); } @@ -79,21 +73,6 @@ export class ParterChannelSalesEditComponent implements OnInit { this.record = value1; } }); - } else { - this.service.request(this.service.$api_getAppRoleList).subscribe(res => { - if (res) { - let List: any = []; - res.forEach((element: any) => { - List.push({ label: element.roleName, value: element.id }); - }); - console.log(List); - setTimeout(() => { - if (this.sf) { - this.sf.getProperty('/roleIds')!.schema.enum = List; - this.sf.getProperty('/roleIds')!.widget.reset(List); - } - } )} - }); } } initSF() { @@ -193,17 +172,17 @@ export class ParterChannelSalesEditComponent implements OnInit { 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 }; - // }); - // }) - // ); - // }, + 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' } } },