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
* @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
},

View File

@ -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' }
}
},