优化
This commit is contained in:
@@ -383,8 +383,8 @@ function setPage(value: number) {
|
||||
.data-table :deep(.el-table th.el-table__cell) { font-size: var(--cc-list-table-font-size); font-weight: var(--cc-list-table-header-font-weight); }
|
||||
.data-table :deep(.el-table .el-button) { font-size: var(--cc-list-action-font-size); }
|
||||
.data-table :deep(.el-table__empty-text) { font-size: var(--cc-list-table-font-size); }
|
||||
.data-table__toolbar { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--cc-border); }
|
||||
.data-table__toolbar.is-compact { min-height: 56px; justify-content: flex-end; padding: 8px 14px; }
|
||||
.data-table__toolbar { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: var(--admin-space-5, 12px); padding: var(--admin-space-2, 6px) var(--admin-space-5, 12px); border-bottom: 1px solid var(--cc-border); }
|
||||
.data-table__toolbar.is-compact { justify-content: flex-end; }
|
||||
.data-table__toolbar-start { min-width: 0; flex: 1; }
|
||||
.data-table__toolbar-start :deep(h2) { margin: 0; color: var(--cc-text); font-size: 16px; line-height: 1.4; }
|
||||
.data-table__toolbar-start :deep(p) { margin: 4px 0 0; color: var(--cc-muted); font-size: 12px; line-height: 1.5; }
|
||||
@@ -406,8 +406,6 @@ function setPage(value: number) {
|
||||
.data-table :deep(.data-table__system-cell .el-button + .el-dropdown) { margin-left: var(--cc-list-action-sibling-margin, 8px); }
|
||||
|
||||
@media (min-width: 1920px) {
|
||||
.data-table__toolbar { min-height: 64px; gap: 12px; padding: 10px 14px; }
|
||||
.data-table__toolbar.is-compact { min-height: 50px; padding: 6px 12px; }
|
||||
.data-table__toolbar-actions,
|
||||
.data-table__business-actions,
|
||||
.data-table__utility-actions,
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { CONTAINER_SPECIFICATIONS, DEFAULT_CONTAINER_TYPE, containerSpecification } from './containerSpecifications'
|
||||
|
||||
describe('container specifications', () => {
|
||||
it('uses the three confirmed container types and defaults to 40HQ', () => {
|
||||
expect(CONTAINER_SPECIFICATIONS.map((item) => item.type)).toEqual(['40GP', '40HQ', '45HQ'])
|
||||
expect(DEFAULT_CONTAINER_TYPE).toBe('40HQ')
|
||||
})
|
||||
|
||||
it('keeps practical loading ranges and the common cargo weight limit', () => {
|
||||
expect(CONTAINER_SPECIFICATIONS.map(({ type, recommendedMinCbm, capacityCbm, maxWeightKg }) => (
|
||||
{ type, recommendedMinCbm, capacityCbm, maxWeightKg }
|
||||
))).toEqual([
|
||||
{ type: '40GP', recommendedMinCbm: 56, capacityCbm: 58, maxWeightKg: 19500 },
|
||||
{ type: '40HQ', recommendedMinCbm: 65, capacityCbm: 68, maxWeightKg: 19500 },
|
||||
{ type: '45HQ', recommendedMinCbm: 82, capacityCbm: 86, maxWeightKg: 19500 },
|
||||
])
|
||||
expect(containerSpecification('40hc')).toBeNull()
|
||||
})
|
||||
})
|
||||
@@ -1,12 +1,13 @@
|
||||
export const CONTAINER_SPECIFICATIONS = [
|
||||
{ type: '20GP', capacityCbm: 33, maxWeightKg: 28000 },
|
||||
{ type: '40GP', capacityCbm: 67, maxWeightKg: 28000 },
|
||||
{ type: '40HC', capacityCbm: 76, maxWeightKg: 28000 },
|
||||
{ type: '40NR', capacityCbm: 67, maxWeightKg: 28000 },
|
||||
{ type: '45HC', capacityCbm: 86, maxWeightKg: 28000 },
|
||||
{ type: '40GP', recommendedMinCbm: 56, capacityCbm: 58, maxWeightKg: 19500, description: '美线电商较少使用,通常优先选择 40HQ' },
|
||||
{ type: '40HQ', recommendedMinCbm: 65, capacityCbm: 68, maxWeightKg: 19500, description: '轻泡货首选,适合家居、玩具、日用品' },
|
||||
{ type: '45HQ', recommendedMinCbm: 82, capacityCbm: 86, maxWeightKg: 19500, description: '抛货量大时考虑,底盘和海外仓预约资源较少' },
|
||||
] as const
|
||||
|
||||
export const DEFAULT_CONTAINER_TYPE = '40HQ' as const
|
||||
|
||||
export type ContainerSpecification = (typeof CONTAINER_SPECIFICATIONS)[number]
|
||||
export type ContainerType = ContainerSpecification['type']
|
||||
|
||||
export function containerSpecification(containerType: string | null | undefined): ContainerSpecification | null {
|
||||
const normalized = String(containerType || '').trim().toUpperCase()
|
||||
|
||||
Reference in New Issue
Block a user