This commit is contained in:
wangshiming
2022-05-11 19:27:21 +08:00
parent b66f4fa656
commit 9dbafb2a30
2 changed files with 16 additions and 37 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2022-01-18 09:51:21 * @Date : 2022-01-18 09:51:21
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-05-11 13:29:32 * @LastEditTime : 2022-05-11 19:19:55
* @FilePath : \\tms-obc-web\\proxy.conf.js * @FilePath : \\tms-obc-web\\proxy.conf.js
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -30,7 +30,7 @@ module.exports = {
// }, // },
'//api': { '//api': {
target: { target: {
host: 'tms-api-test.eascs.com', host: 'tms-api-dev.eascs.com',
protocol: 'https:', protocol: 'https:',
port: 443 port: 443
}, },

View File

@ -47,31 +47,25 @@ export class ParterChannelSalesEditComponent implements OnInit {
if (!this.sts) { if (!this.sts) {
this.service.request(this.service.$api_getChannelSalesInfo, { id: this.i?.id }).subscribe(res => { this.service.request(this.service.$api_getChannelSalesInfo, { id: this.i?.id }).subscribe(res => {
const List: any = []; const List: any = [];
const List2: any = [];
const List3: any = []; const List3: any = [];
if (res) { if (res) {
let value1 = Object.assign({}, res); let value1 = Object.assign({}, res);
delete value1.employeeVO; delete value1.employeeVO;
let value = res.employeeVO; let value = res.employeeVO;
List.push({ label: value.empName + '/' + value.empNo, value: value.empNo }); List.push({ label: value.empName + '/' + value.empNo, value: value.empNo });
List2.push({ label: value.roleName, value: value.id });
res.roleInfoVOList.forEach((element: any) => { res.roleInfoVOList.forEach((element: any) => {
List2.push({ label: element.roleName, value: element.id });
List3.push(element.id); List3.push(element.id);
}); });
setTimeout(() => { setTimeout(() => {
if (this.sf) { if (this.sf) {
console.log(this.sf.getProperty('/employeeVO')!.schema);
this.sf.getProperty('/employeeVO')!.schema.enum = List; this.sf.getProperty('/employeeVO')!.schema.enum = List;
this.sf.getProperty('/employeeVO')!.widget.reset(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) { if (value.empNo) {
this.sf.setValue('/employeeVO', 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.currentOAItem = value;
this.sf.setValue('/phoneNumber', res.telephone); this.sf.setValue('/phoneNumber', res.telephone);
} }
@ -79,21 +73,6 @@ export class ParterChannelSalesEditComponent implements OnInit {
this.record = value1; 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() { initSF() {
@ -193,17 +172,17 @@ export class ParterChannelSalesEditComponent 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) => {
// return res return res
// .filter((role: any) => role.roleCode !== 'Administrator') .filter((role: any) => role.roleCode !== 'Administrator')
// .map((item: any) => { .map((item: any) => {
// return { label: item.roleName, value: item.id }; return { label: item.roleName, value: item.id };
// }); });
// }) })
// ); );
// }, },
visibleIf: { isAuthorization: (value: string) => value === '1' } visibleIf: { isAuthorization: (value: string) => value === '1' }
} }
}, },