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

This commit is contained in:
wangshiming
2022-01-25 13:10:49 +08:00
18 changed files with 262 additions and 297 deletions

View File

@ -41,7 +41,8 @@ const APPINIT_PROVIDES = [
deps: [StartupService],
multi: true
},
{ provide: DEFAULT_CURRENCY_CODE, useValue: '¥' }
{ provide: DEFAULT_CURRENCY_CODE, useValue: '¥' },
AuthGuard
];
// #endregion
@ -53,6 +54,7 @@ import { RoutesModule } from './routes/routes.module';
import { SharedModule } from './shared/shared.module';
import { STWidgetModule } from './shared/widget/st-widget.module';
import { registerLocaleData } from '@angular/common';
import { AuthGuard } from './core/guards/auth.guard';
@NgModule({
declarations: [AppComponent],

View File

@ -1,55 +1,51 @@
import { Inject, Injectable, Injector } from '@angular/core';
import {
ActivatedRouteSnapshot,
CanActivate,
CanActivateChild,
CanLoad,
Route,
Router,
RouterStateSnapshot,
UrlSegment,
UrlTree
} from '@angular/router';
import { sysConf } from '@conf/sys.conf';
import { CoreService } from '@core';
import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, RouterStateSnapshot } from '@angular/router';
import { ACLGuard, ACLService } from '@delon/acl';
import { EAUserService } from '@shared';
import { MenuService } from '@delon/theme';
import { BaseService, EAUserService } from '@shared';
import { Observable, of } from 'rxjs';
import { map } from 'rxjs/operators';
const auths = ['YUNLI-CART-SEARCH', 'YUNLI-CART-DAOCHU', 'YUNLI-CART-DETAIL'];
const auths = ['YUNLI-CART-SEARCH', 'YUNLI-CART-DAOC1HU', 'YUNLI-CART-DETAIL', 'YUNLI-CART-AUDIT-SEARCH'];
@Injectable()
export class AuthGuard implements CanActivate, CanActivateChild, CanLoad {
constructor(srv: ACLService, router: Router, private eaUserSrv: CoreService, private router2: Router, private inject: Injector) {}
canLoad(route: Route, segments: UrlSegment[]): boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree> {
console.log(route);
throw true;
}
export class AuthGuard implements CanActivate, CanActivateChild {
constructor(private srv: ACLService, private baseService: BaseService, private menuService: MenuService) {}
canActivate(route: ActivatedRouteSnapshot, _state: RouterStateSnapshot | null): Observable<boolean> {
const canOpen = this.eaUserSrv.loginStatus;
if (!canOpen) {
this.router2.navigate([sysConf.login_url], {
queryParams: {
returnUrl: _state?.url
}
});
return of(!canOpen);
if (Object.keys(route.params)?.length > 0 || !route.routeConfig?.path) {
return this.handle();
} else {
return this.handle(_state?.url);
}
return of(true);
}
canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {
const canOpen = this.eaUserSrv.loginStatus;
if (!canOpen) {
this.router2.navigate([sysConf.login_url], {
queryParams: {
returnUrl: state?.url
}
});
return of(!canOpen);
return this.handle(this.settingRoute(childRoute.params, state.url));
}
private handle(route?: string): Observable<boolean> {
if (!route) {
return of(true);
}
return of(true);
console.log(route);
return this.baseService.request('/api/mdc/cuc/functionButton/getPermissionsCodeoByLink', { link: route }).pipe(
map(_ => {
this.srv.setAbility(auths);
this.menuService.resume();
return true;
})
);
}
private settingRoute(params: any, route: string) {
let _route = route;
for (const key of Object.keys(params)) {
if (_route.indexOf(params[key]) > -1) {
_route = _route.replace(params[key], ':id');
}
}
return _route;
}
}

View File

@ -11,10 +11,16 @@ import { environment } from '@env/environment';
// #region NG-ALAIN Config
const alainConfig: AlainConfig = {
st: { modal: { size: 'lg' } },
st: {
req: { method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' } },
res: { reName: { list: 'data.records', total: 'data.total' } },
page: { show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] },
modal: { size: 'lg' }
},
sf: { button: { search: '查询' } },
pageHeader: { homeI18n: 'home', recursiveBreadcrumb: true },
auth: { login_url: '/dashboard' }
auth: { login_url: '/passport/login' },
acl: { guard_url: '/' }
};
const alainModules = [AlainThemeModule.forRoot(), DelonACLModule.forRoot()];

View File

@ -13,16 +13,8 @@
<div nz-row nzGutter="8">
<!-- 查询字段小于或等于3个时不显示伸缩按钮 -->
<div nz-col nzSpan="24" *ngIf="queryFieldCount <= 4">
<sf
#sf
[schema]="schema"
[ui]="ui"
[mode]="'search'"
[disabled]="!sf?.valid"
[loading]="service.http.loading"
(formSubmit)="st?.load(1)"
(formReset)="resetSF()"
></sf>
<sf #sf [schema]="schema" [ui]="ui" [mode]="'search'" [disabled]="!sf?.valid" [loading]="service.http.loading"
(formSubmit)="st?.load(1)" (formReset)="resetSF()"></sf>
</div>
<!-- 查询字段大于3个时根据展开状态调整布局 -->
@ -37,7 +29,8 @@
</sf>
</div>
<div nz-col [nzSpan]="_$expand ? 24 : 6" [class.text-right]="_$expand">
<button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="service.http.loading"
(click)="st?.load(1)">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
@ -50,26 +43,13 @@
<nz-card class="content-box" nzBordered>
<div style="position: relative">
<nz-alert
nzType="info"
[nzMessage]="'当前共' + st?.total + '行记录已选择' + selectedRows.length + ''"
nzShowIcon
[ngStyle]="{ margin: '0 0 1rem 0' }"
>
<nz-alert nzType="info" [nzMessage]="'当前共' + st?.total + '行记录已选择' + selectedRows.length + ''" nzShowIcon
[ngStyle]="{ margin: '0 0 1rem 0' }">
</nz-alert>
</div>
<st
#st
[data]="service.$api_listDetailed_page"
[columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading"
[scroll]="{ x: '1200px', y: '370px' }"
(change)="stChange($event)"
>
<st #st [data]="service.$api_listDetailed_page" [columns]="columns" [req]="{ params: reqParams }"
[loading]="service.http.loading" [scroll]="{ x: '1200px', y: '370px' }" (change)="stChange($event)">
<ng-template st-row="contractCode" let-item let-index="index">
<a [routerLink]="'/contract-management/index/detail/' + item.id">{{ item?.contractCode }}</a>
</ng-template>
@ -80,13 +60,9 @@
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="80">
<se [col]="1" label="备注">
<textarea
nz-input
rows="3"
placeholder="同意可以不用填写原因 ,拒绝必须说明原因"
style="width: 325px; margin-left: 14px"
></textarea>
<textarea nz-input rows="3" placeholder="同意可以不用填写原因 ,拒绝必须说明原因"
style="width: 325px; margin-left: 14px"></textarea>
</se>
</div>
</div>
</ng-template>
</ng-template>

View File

@ -20,7 +20,7 @@ export class BasicSettingComponent implements OnInit {
}
getTypeList() {
this.service.request(this.service.$api_get_config_tree, { configFullKey: 'sys.config' }).subscribe((res: Array<any>) => {
this.service.request(this.service.$api_get_config_tree, { configFullKey: 'sys.config', extendType: 0 }).subscribe((res: Array<any>) => {
if (res?.length > 0) {
const typeData = res.find(config => config.configFullKey === 'sys.config');
if (typeData) {
@ -50,7 +50,6 @@ export class BasicSettingComponent implements OnInit {
}
saveAction(params: any) {
this.service.request(this.service.$api_update_config_batch, params).subscribe(res => {
if (res) {
this.service.msgSrv.success('修改配置成功');

View File

@ -74,11 +74,11 @@ export class RequestedInvoiceModalComponent implements OnInit {
{ title: '承运司机', index: 'driverinfo', width: 170 },
{
title: '总费用',
index: 'vatmoney',
index: 'billkpmoney',
width: 90,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vatmoney }) }
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.billkpmoney }) }
},
{
title: '运输费',

View File

@ -1,31 +0,0 @@
/*
* @Author: your name
* @Date: 2021-12-07 17:30:18
* @LastEditTime: 2021-12-09 17:47:33
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\vehicle\components\list\img-view\img-view.component.spec.ts
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { VehicleImgViewComponent } from './img-view.component';
describe('VehicleImgViewComponent', () => {
let component: VehicleImgViewComponent;
let fixture: ComponentFixture<VehicleImgViewComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [VehicleImgViewComponent],
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(VehicleImgViewComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -7,69 +7,47 @@
* @FilePath: \tms-obc-web\src\app\routes\usercenter\components\freight\list\list.component.html
-->
<!-- 页头 -->
<page-header-wrapper ></page-header-wrapper>
<page-header-wrapper></page-header-wrapper>
<nz-card>
<!-- 搜索区 -->
<!-- 搜索表单 -->
<div nz-row nzGutter="8">
<!-- 查询字段小于或等于3个时不显示伸缩按钮 -->
<div nz-col nzSpan="24" *ngIf="queryFieldCount <= 4">
<sf
#sf
[schema]="schema"
[ui]="ui"
[mode]="'search'"
[disabled]="!sf?.valid"
(formSubmit)="st?.load(1)"
(formReset)="resetSF()"
></sf>
<div nz-col [nzSpan]="_$expand ? 24 : 18">
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
</div>
<div nz-col [nzSpan]="_$expand ? 24 : 6" class="text-right">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button nzType="primary" [disabled]="service.http.loading" (click)="exportFire()" acl
[acl-ability]="'YUNLI-CART-DAOCHU'">导出</button>
<button nz-button [disabled]="service.http.loading" (click)="resetSF()">重置</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
<!-- [loading]="service.http.loading" -->
<!-- 查询字段大于3个时根据展开状态调整布局 -->
<ng-container *ngIf="queryFieldCount > 4">
<div nz-col [nzSpan]="_$expand ? 24 : 18">
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
</div>
<div nz-col [nzSpan]="_$expand ? 24 : 6" class="text-right">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button nzType="primary" [disabled]="service.http.loading" (click)="exportFire()">导出</button>
<button nz-button [disabled]="service.http.loading"(click)="resetSF()">重置</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</ng-container>
</div>
</nz-card>
<nz-card>
<!-- 数据列表 -->
<!-- [data]="service.$api_get_supplier_page" -->
<st
#st
[bordered]="true"
[scroll]="{ x: '1200px' }"
[columns]="columns"
[data]='service.$api_get_operate_list'
<st #st [bordered]="true" [scroll]="{ x: '1200px' }" [columns]="columns" [data]='service.$api_get_operate_list'
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' }, process: dataProcess }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading"
>
[loading]="service.http.loading">
<ng-template st-row="carLength" let-item let-index="index">
<div>{{item?.carModelLabel }}-{{item?.carLengthLabel? item?.carLengthLabel + '米' : ''}}-{{ item?.carLoad? item?.carLoad + '吨' : ''}}</div>
<div>{{item?.carModelLabel }}-{{item?.carLengthLabel? item?.carLengthLabel + '米' : ''}}-{{ item?.carLoad?
item?.carLoad + '吨' : ''}}</div>
</ng-template>
<ng-template st-row="isSelf" let-item let-index="index">
<div>
{{ item?.isSelf ? '是' : '否' }}
<div>
{{ item?.isSelf ? '是' : '否' }}
</div>
</ng-template>
<ng-template st-row="putOnRecord" let-item let-index="index">
<div>
{{ item?.putOnRecord ? '是' : '否' }}
<div>
{{ item?.putOnRecord ? '是' : '否' }}
</div>
</ng-template>
<ng-template st-row="approvalAuditStatus" let-item let-index="index">
@ -89,4 +67,4 @@
<nz-tag *elseBlock nzColor="success">正常</nz-tag>
</ng-template>
</st>
</nz-card>
</nz-card>

View File

@ -1,31 +0,0 @@
/*
* @Author: your name
* @Date: 2021-12-01 20:05:59
* @LastEditTime: 2021-12-01 20:35:33
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\vehicle\components\list\list.component.spec.ts
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { VehicleComponentsListComponent } from './list.component';
describe('VehicleComponentsListComponent', () => {
let component: VehicleComponentsListComponent;
let fixture: ComponentFixture<VehicleComponentsListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [VehicleComponentsListComponent],
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(VehicleComponentsListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -9,11 +9,10 @@ import { map } from 'rxjs/operators';
import { VehicleService } from '../../../vehicle/services/vehicle.service';
@Component({
selector: 'app-Vehicle-components-list',
templateUrl: './list.component.html',
templateUrl: './list.component.html'
})
export class VehicleComponentsListComponent implements OnInit {
_$expand = false;
url = `/rule?_allow_anonymous=true`;
ui!: SFUISchema;
schema!: SFSchema;
@ -22,19 +21,13 @@ export class VehicleComponentsListComponent implements OnInit {
@ViewChild('sf', { static: false }) sf!: SFComponent;
constructor(public service: VehicleService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {}
/**
* 查询字段个数navigate
*/
get queryFieldCount(): number {
return Object.keys(this.schema?.properties || {}).length;
}
/**
* 查询参数
*/
get reqParams() {
const params: any = {
...(this.sf && this.sf.value),
...(this.sf && this.sf.value)
};
if (this.sf?.value.effectiveDate) {
params.effectiveDateStart = this.sf?.value.effectiveDate[0];
@ -45,14 +38,10 @@ export class VehicleComponentsListComponent implements OnInit {
return params;
}
get selectedRows() {
return this.st?.list.filter((item) => item.checked) || [];
}
ngOnInit() {
this.initSF();
this.initST();
this.ar.url.subscribe((params) => {
this.ar.url.subscribe(params => {
this.st?.load(1);
});
}
@ -68,8 +57,8 @@ export class VehicleComponentsListComponent implements OnInit {
expand: {
type: 'boolean',
ui: {
hidden: true,
},
hidden: true
}
},
carNo: {
title: '车牌号',
@ -91,9 +80,6 @@ export class VehicleComponentsListComponent implements OnInit {
} else {
return of([]);
}
},
visibleIf: {
_$expand: (value: boolean) => value
}
} as SFSelectWidgetSchema
},
@ -103,20 +89,20 @@ export class VehicleComponentsListComponent implements OnInit {
ui: {
widget: 'dict-select',
containsAllLable: true,
params: { dictKey: 'car:color' },
},
params: { dictKey: 'car:color' }
}
},
carStatus: {
title: '运营状态',
type: 'string',
enum: [
{ label: '空闲', value: 0 },
{ label: '运输中', value: 1 },
{ label: '运输中', value: 1 }
],
ui: {
allowClear: true,
widget: 'select',
},
widget: 'select'
}
},
carModel: {
title: '车型',
@ -126,36 +112,36 @@ export class VehicleComponentsListComponent implements OnInit {
params: { dictKey: 'car:model' },
containsAllLable: true,
visibleIf: {
expand: (value: boolean) => value,
},
},
expand: (value: boolean) => value
}
}
},
carLength: {
title: '车长',
type: 'string',
ui: {
ui: {
widget: 'dict-select',
params: { dictKey: 'car:length' },
containsAllLable: true,
visibleIf: {
expand: (value: boolean) => value,
},
},
expand: (value: boolean) => value
}
}
},
isSelf: {
type: 'string',
title: '是否挂靠',
enum: [
{ label: '是', value: 1 },
{ label: '否', value: 0 },
{ label: '否', value: 0 }
],
ui: {
widget: 'select',
allowClear: true,
visibleIf: {
expand: (value: boolean) => value,
},
},
expand: (value: boolean) => value
}
}
},
driverLicenseStatus: {
type: 'string',
@ -163,16 +149,16 @@ export class VehicleComponentsListComponent implements OnInit {
enum: [
{ label: '正常', value: 1 },
{ label: '即将到期', value: 2 },
{ label: '已到期', value: 3},
{ label: '已到期', value: 3 }
],
default: '',
ui: {
widget: 'select',
allowClear: true,
visibleIf: {
expand: (value: boolean) => value,
},
},
expand: (value: boolean) => value
}
}
},
roadTransportStatus: {
type: 'string',
@ -180,16 +166,16 @@ export class VehicleComponentsListComponent implements OnInit {
enum: [
{ label: '正常', value: 1 },
{ label: '即将到期', value: 2 },
{ label: '已到期', value: 3},
{ label: '已到期', value: 3 }
],
ui: {
widget: 'select',
allowClear: true,
visibleIf: {
expand: (value: boolean) => value,
},
},
},
expand: (value: boolean) => value
}
}
}
// putOnRecord: {
// type: 'string',
// title: '是否已备案',
@ -204,7 +190,7 @@ export class VehicleComponentsListComponent implements OnInit {
// },
// },
// },
},
}
};
this.ui = { '*': { spanLabelFixed: 130, grid: { span: 8, gutter: 4 }, enter: () => this.st.load() } };
}
@ -212,43 +198,47 @@ export class VehicleComponentsListComponent implements OnInit {
initST() {
this.columns = [
// { title: '', type: 'checkbox', className: 'text-center' },
{ title: '车牌号', width:'150px', className: 'text-center', index: 'carNo' },
{ title: '车牌颜色', width:'150px', className: 'text-center', index: 'carNoColorLabel' },
{ title: '车型-车长-载重',width:'150px', className: 'text-center', render: 'carLength' },
{ title: '运营状态',width:'150px', className: 'text-center', index: 'carStatus',
type: 'badge',
badge: {
true: { text: '运输中', color: 'success' },
false: { text: '空闲', color: 'default' },
{ title: '车牌号', width: '150px', className: 'text-center', index: 'carNo' },
{ title: '车牌颜色', width: '150px', className: 'text-center', index: 'carNoColorLabel' },
{ title: '车型-车长-载重', width: '150px', className: 'text-center', render: 'carLength' },
{
title: '运营状态',
width: '150px',
className: 'text-center',
index: 'carStatus',
type: 'badge',
badge: {
true: { text: '运输中', color: 'success' },
false: { text: '空闲', color: 'default' }
}
},
},
{
title: '行驶证到期状态',
width:'180px',
width: '180px',
className: 'text-center',
index: 'driverLicenseStatus',
type: 'badge',
badge: {
1: { text: '正常', color: 'success' },
2: { text: '即将到期', color: 'warning' },
3: { text: '已到期', color: 'error' },
},
3: { text: '已到期', color: 'error' }
}
},
{
title: '道运证到期状态',
width:'180px',
width: '180px',
className: 'text-center',
index: 'roadTransportStatus',
type: 'badge',
badge: {
1: { text: '正常', color: 'success' },
2: { text: '即将到期', color: 'warning' },
3: { text: '已到期', color: 'error' },
},
3: { text: '已到期', color: 'error' }
}
},
{ title: '所有人',width:'150px', className: 'text-center', index: 'carOwner' },
{ title: '是否挂靠', width:'150px', className: 'text-center', render: 'isSelf', },
{ title: '挂靠协议', width:'150px', className: 'text-center', render: 'approvalAuditStatus' },
{ title: '所有人', width: '150px', className: 'text-center', index: 'carOwner' },
{ title: '是否挂靠', width: '150px', className: 'text-center', render: 'isSelf' },
{ title: '挂靠协议', width: '150px', className: 'text-center', render: 'approvalAuditStatus' },
// { title: '是否已备案', className: 'text-center', render: 'putOnRecord', },
{
@ -259,20 +249,19 @@ export class VehicleComponentsListComponent implements OnInit {
buttons: [
{
text: '查看',
click: (item) => {
this.router.navigate(['./detail', item.id], { relativeTo: this.ar,queryParams: { carId: item.carId } });
click: item => {
this.router.navigate(['./detail', item.id], { relativeTo: this.ar, queryParams: { carId: item.carId } });
// this.router.navigate(['./view', item.id], { relativeTo: this.ar, queryParams: { tenantId: item.tenantId } });
},
},
}
}
// {
// text: '申请备案',
// click: (item) => {
// },
// },
],
},
]
}
];
}
expandToggle() {
@ -280,7 +269,7 @@ export class VehicleComponentsListComponent implements OnInit {
this.sf?.setValue('/expand', this._$expand);
}
creat() {
this.router.navigate(['./new',], { relativeTo: this.ar });
this.router.navigate(['./new'], { relativeTo: this.ar });
}
/**
* 重置表单
@ -291,6 +280,6 @@ export class VehicleComponentsListComponent implements OnInit {
}
// 导出
exportFire() {
this.service.downloadFile(this.service.$api_carLicense_export, this.reqParams );
this.service.downloadFile(this.service.$api_carLicense_export, this.reqParams);
}
}

View File

@ -8,23 +8,41 @@
*/
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ACLGuard, ACLGuardType } from '@delon/acl';
import { AuthGuard } from 'src/app/core/guards/auth.guard';
import { VehicleComponentsAuditComponent } from './components/audit/audit.component';
import { VehicleComponentsAuditDetailComponent } from './components/audit/detail/detail.component';
import { VehicleComponentsListDetailComponent } from './components/list/detail/detail.component';
import { VehicleComponentsListComponent } from './components/list/list.component';
const routes: Routes = [
{ path: 'list', component: VehicleComponentsListComponent },
{ path: 'list/detail/:id', component: VehicleComponentsListDetailComponent },
{ path: 'audit', component: VehicleComponentsAuditComponent },
{ path: 'audit/detail/:id', component: VehicleComponentsAuditDetailComponent },
{
path: '',
canActivate: [AuthGuard],
canActivateChild: [AuthGuard],
children: [
{
path: 'list',
component: VehicleComponentsListComponent,
data: { guard: { ability: ['YUNLI-CART-SEARCH'] } as ACLGuardType }
},
{
path: 'list/detail/:id',
component: VehicleComponentsListDetailComponent,
data: { guard: { ability: ['YUNLI-CART-DETAIL'] } as ACLGuardType }
},
{
path: 'audit',
component: VehicleComponentsAuditComponent,
data: { guard: { ability: ['YUNLI-CART--AUDIT-SEARCH1'] } as ACLGuardType }
},
{ path: 'audit/detail/:id', component: VehicleComponentsAuditDetailComponent }
]
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
exports: [RouterModule]
})
export class VehicleRoutingModule {}

View File

@ -14,6 +14,9 @@
<h2 style="font-weight: 800;">{{selectedTab?.name}}</h2>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="labelWidth">
<!-- <se col="1">
<app-freight-table></app-freight-table>
</se> -->
<se [label]="item.name" *ngFor="let item of configList" col="1">
<ng-container [ngSwitch]="item.itemType">
<ng-container *ngSwitchCase="1">
@ -37,36 +40,30 @@
<div class="d-flex" style="align-items: center;justify-content: space-between;">
<input type="time" [(ngModel)]="item.itemValue.startTime" placeHolder="开始时间"
style="margin-left: 23px;">
<!-- <nz-time-picker nzFormat="HH:mm" nzPlaceHolder="开始时间"
[(ngModel)]="item.itemValue.startTime" style="margin-left: 23px;">
</nz-time-picker> -->
<label class="ml-sm mr-sm"> --</label>
<input type="time" [(ngModel)]="item.itemValue.endTime" placeHolder="结束时间"
style="margin-left: 0;" class=" mr-xl">
<!-- <nz-time-picker nzFormat="HH:mm" nzPlaceHolder="结束时间"
[(ngModel)]="item.itemValue.endTime">
</nz-time-picker> -->
</div>
</ng-container>
<ng-container *ngSwitchCase="6">
<div class="d-flex" style="align-items: center;justify-content: space-between;">
<nz-radio-group [(ngModel)]="item.itemValue.radio" class="mr-xl">
<label nz-radio [nzValue]="0" class="ml-xl">{{item.remark?.[0] ||
'否'}}</label>
<label nz-radio [nzValue]="1" class="ml-xl">{{item.remark?.[1] ||
'是'}}</label>
</nz-radio-group>
<input type="time" [(ngModel)]="item.itemValue.startTime" placeHolder="开始时间"
style="margin-left: 23px;">
<label class="ml-sm mr-sm"> --</label>
<input type="time" [(ngModel)]="item.itemValue.endTime" placeHolder="结束时间"
style="margin-left: 0;" class=" mr-xl">
</div>
</ng-container>
</ng-container>
<!-- <ng-container *ngFor="let item of item.extend">
<ng-container [ngSwitch]="item">
<ng-container *ngSwitchCase="1">
<button nz-button nzType="default">配置网络货运</button>
</ng-container>
<ng-container *ngSwitchCase="2">
<button nz-button nzType="default">配置货主</button>
</ng-container>
<ng-container *ngSwitchCase="3">
<button nz-button nzType="default">配置司机</button>
</ng-container>
<ng-container *ngSwitchCase="4">
<button nz-button nzType="default">配置车队长</button>
</ng-container>
<ng-container *ngSwitchDefault></ng-container>
</ng-container>
</ng-container> -->
</se>
</div>
</div>

View File

@ -1,7 +1,7 @@
import { Component, OnInit, EventEmitter, Input, Output } from '@angular/core';
import { BaseService } from '@shared';
const JSONTYPE = new Set([5]);
const JSONTYPE = new Set([5,6]);
@Component({
selector: 'app-dynamic-setting-h5',
templateUrl: './dynamic-setting-h5.component.html',

View File

@ -5,10 +5,11 @@ import { SHARED_ZORRO_MODULES } from '../../shared-zorro.module';
import { SHARED_DELON_MODULES } from '../../shared-delon.module';
import { FormsModule } from '@angular/forms';
import { DynamicSettingModalComponent } from './dynamic-setting-modal/dynamic-setting-modal.component';
import { FreightTableComponent } from './freight-table/freight-table.component';
const COMPONENTS = [DynamicSettingH5Component, DynamicSettingModalComponent, FreightTableComponent];
@NgModule({
declarations: [DynamicSettingH5Component, DynamicSettingModalComponent],
declarations: [...COMPONENTS],
imports: [CommonModule, FormsModule, SHARED_ZORRO_MODULES, SHARED_DELON_MODULES],
exports: [DynamicSettingH5Component]
exports: [...COMPONENTS]
})
export class DynamicSettingModule {}

View File

@ -0,0 +1,22 @@
<nz-table #groupingTable [nzData]="data" nzBordered nzSize="small" [nzFrontPagination]="false"
[nzScroll]="{ x: '500px' }" [nzShowPagination]="false">
<thead>
<tr>
<th nzWidth="200px" nzAlign="center">公里数</th>
<th nzWidth="130px" nzAlign="center">计算方式</th>
<th nzWidth="200px" nzAlign="center" *ngFor="let item of headers">车长(米)</th>
<th nzWidth="60px" nzAlign="center" nzRight>操作</th>
</tr>
<tr>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of groupingTable.data">
<td nzWidth="200px" nzAlign="center">{{ item.startKm }} - {{ item.endKm }}</td>
<td nzWidth="130px" nzAlign="center">{{ item.computeMode }}</td>
<td nzWidth="200px" nzAlign="center" *ngFor="let node of item.configValue">最高{{ node.maxPrice }} 预警{{
node.ewPrice }}</td>
<td nzWidth="60px" nzAlign="center" nzRight>删除</td>
</tr>
</tbody>
</nz-table>

View File

@ -0,0 +1,38 @@
import { Component, OnInit } from '@angular/core';
import { BaseService } from '@shared';
@Component({
selector: 'app-freight-table',
templateUrl: './freight-table.component.html',
styleUrls: ['./freight-table.component.less']
})
export class FreightTableComponent implements OnInit {
data: any[] = [];
headers: any[] = [];
constructor(public service: BaseService) {}
ngOnInit(): void {
this.loadHeaders();
this.loadData();
}
loadHeaders() {
this.service.request('/api/mdc/cuc/freightConfigItem/list').subscribe(res => {
if (res) {
this.headers = res;
}
});
}
loadData() {
this.service.request('/api/mdc/cuc/freightConfig/list').subscribe(res => {
if (res) {
this.data = res;
}
});
}
changeEndLength(event: any, i: number) {
console.log(event, i);
}
}

View File

@ -103,7 +103,12 @@
},
{
"text": "车辆审核列表",
"link": "/vehicle/audit"
"link": "/vehicle/audit",
"acl": {
"ability": [
"YUNLI-CART-AUDIT-SEARCH"
]
}
},
{
"hide": true,