Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop

This commit is contained in:
wangshiming
2022-02-10 09:53:47 +08:00
5 changed files with 23 additions and 17 deletions

View File

@ -41,15 +41,20 @@ export class AuthGuard extends ACLGuard {
} }
canActivate(route: ActivatedRouteSnapshot, _state: RouterStateSnapshot): Observable<boolean> { canActivate(route: ActivatedRouteSnapshot, _state: RouterStateSnapshot): Observable<boolean> {
if (Object.keys(route.params)?.length > 0 || !route.routeConfig?.path) { // if (Object.keys(route.params)?.length > 0 || !route.routeConfig?.path) {
return this.handle(route, _state, 1); // return super.canActivate(route, _state);
} else { // } else {
return this.handle(route, _state, 1, _state?.url); // return super.canActivate(route, _state);
} // }
return super.canActivate(route, _state);
} }
canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> { canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {
return this.handle(childRoute, state, 2, this.settingRoute(childRoute.params, state.url)); if (childRoute.routeConfig?.loadChildren) {
return super.canActivateChild(childRoute, state);
} else {
return this.handle(childRoute, state, 2, this.settingRoute(childRoute.params, state.url));
}
} }
private handle(route: ActivatedRouteSnapshot, state: RouterStateSnapshot, type: 1 | 2, router?: string): Observable<boolean> { private handle(route: ActivatedRouteSnapshot, state: RouterStateSnapshot, type: 1 | 2, router?: string): Observable<boolean> {
@ -65,11 +70,6 @@ export class AuthGuard extends ACLGuard {
return this.baseService.request('/api/mdc/cuc/functionButton/getUserFunctionButton', { link: router }).pipe( return this.baseService.request('/api/mdc/cuc/functionButton/getUserFunctionButton', { link: router }).pipe(
switchMap(res => { switchMap(res => {
if (res) { if (res) {
// if (router === '/ticket/invoice-requested') {
// this.srv1.setAbility(['TICKET-INVOICE-REQUESTED-list']);
// } else {
// this.srv1.setAbility(res.abilities || []);
// }
this.srv1.setAbility(res.abilities || []); this.srv1.setAbility(res.abilities || []);
this.menuService.resume(); this.menuService.resume();
} }
@ -82,6 +82,12 @@ export class AuthGuard extends ACLGuard {
); );
} }
/**
* 根据参数拼接原始路由
* @param params 参数
* @param route 实际路由
* @returns
*/
private settingRoute(params: any, route: string) { private settingRoute(params: any, route: string) {
let _route = route; let _route = route;
if (_route.indexOf('?') > -1) { if (_route.indexOf('?') > -1) {

View File

@ -1,6 +1,6 @@
<div nz-dropdown [nzDropdownMenu]="userMenu" nzPlacement="bottomRight" class="alain-pro__header-item"> <div nz-dropdown [nzDropdownMenu]="userMenu" nzPlacement="bottomRight" class="alain-pro__header-item">
<nz-avatar [nzSrc]="settings.user.avatar" nzSize="small" class="mr-sm"></nz-avatar> <nz-avatar [nzSrc]="settings.user.avatar" nzSize="small" class="mr-sm"></nz-avatar>
{{ settings.user.name }} {{ settings.user.realName }}
</div> </div>
<nz-dropdown-menu #userMenu="nzDropdownMenu"> <nz-dropdown-menu #userMenu="nzDropdownMenu">
<div nz-menu class="width-sm"> <div nz-menu class="width-sm">

View File

@ -180,7 +180,7 @@ export class FreightComponentsListComponent implements OnInit {
{ title: '网络货运人', className: 'text-center', index: 'netTranName' }, { title: '网络货运人', className: 'text-center', index: 'netTranName' },
{ title: '常用服务', className: 'text-center', index: 'oftenUsedServices', type: 'enum', enum: { 10: '整车发货', 20: '大宗发货' } }, { title: '常用服务', className: 'text-center', index: 'oftenUsedServices', type: 'enum', enum: { 10: '整车发货', 20: '大宗发货' } },
{ title: '推广业务员', className: 'text-center', render: 'promotersTelephone' }, { title: '推广业务员', className: 'text-center', render: 'promotersTelephone' },
{ title: '注册渠道', className: 'text-center', index: 'source', type: 'enum', enum: { 1: '用户注册', 2: '货主添加' } }, { title: '注册渠道', className: 'text-center', index: 'source', type: 'enum', enum: { 1: '货主注册', 2: '平台添加' } },
{ {
title: '企业状态', title: '企业状态',
className: 'text-center', className: 'text-center',

View File

@ -152,14 +152,13 @@ export class FreightComponentsUserComponent implements OnInit {
placeholder: '请输入' placeholder: '请输入'
} }
}, },
certificationStatus: { stateLocked: {
type: 'string', type: 'string',
title: '状态', title: '状态',
enum: [ enum: [
{ label: '全部', value: '' }, { label: '全部', value: '' },
{ label: '待审核', value: 0 }, { label: '正常', value: 0 },
{ label: '正常', value: 1 }, { label: '冻结', value: 1 }
{ label: '冻结', value: 2 }
], ],
default: '', default: '',
ui: { ui: {

View File

@ -61,6 +61,7 @@
}, },
{ {
"text": "货主员工详情", "text": "货主员工详情",
"hide": true,
"icon": "anticon anticon-dashboard", "icon": "anticon anticon-dashboard",
"link": "/usercenter/freight/user/view/:id" "link": "/usercenter/freight/user/view/:id"
} }