优化
This commit is contained in:
@@ -149,10 +149,13 @@ describe('PalletsView', () => {
|
||||
page: 1, size: 20,
|
||||
})
|
||||
expect(wrapper.text()).toContain('TP-001')
|
||||
expect(wrapper.text()).toContain('义乌收货仓')
|
||||
expect(wrapper.text()).toContain('CN-YW-01')
|
||||
expect(wrapper.text()).toContain('木托盘')
|
||||
expect(wrapper.text()).toContain('1.2 m³')
|
||||
expect(wrapper.text()).toContain('8 kg')
|
||||
expect(wrapper.text()).toContain('黄色')
|
||||
expect(wrapper.find('.data-table').text()).not.toContain('黄色')
|
||||
expect(wrapper.find('.data-table').text()).not.toContain('标准川字托盘')
|
||||
expect(wrapper.text()).not.toContain('更新时间')
|
||||
const tableToolbar = wrapper.find('.table-panel .data-table__toolbar')
|
||||
expect(tableToolbar.exists()).toBe(true)
|
||||
@@ -168,7 +171,9 @@ describe('PalletsView', () => {
|
||||
expect(wrapper.text()).not.toContain('租户')
|
||||
expect(wrapper.find('.data-table').exists()).toBe(true)
|
||||
expect(wrapper.find('.table-actions.pallet-row-actions').exists()).toBe(true)
|
||||
expect(wrapper.findAll('thead th').map((item) => item.text().trim())[0]).toBe('操作')
|
||||
expect(wrapper.findAll('thead th').map((item) => item.text().trim())).toEqual([
|
||||
'操作', '托盘编码', '所属仓库', '托盘类型', '托盘容积(m³)', '托盘重量(kg)',
|
||||
])
|
||||
})
|
||||
|
||||
it('queries all customers explicitly without adding a customer id', async () => {
|
||||
|
||||
@@ -128,11 +128,12 @@ const { captureBaseline } = useUnsavedWorkRegistration({
|
||||
const columns: DataTableColumn[] = [
|
||||
{ key: 'actions', label: '操作', minWidth: 224, fixed: 'left', slotName: 'actions' },
|
||||
{ key: 'pallet', label: '托盘编码', minWidth: 190, slotName: 'pallet' },
|
||||
{ key: 'warehouse', label: '所属仓库', minWidth: 210, slotName: 'warehouse' },
|
||||
{ key: 'palletType', prop: 'palletType', label: '托盘类型', minWidth: 140 },
|
||||
{ key: 'capacity', label: '托盘容积(m³)', minWidth: 160, slotName: 'capacity' },
|
||||
{ key: 'weight', label: '托盘重量(kg)', minWidth: 160, slotName: 'weight' },
|
||||
{ key: 'color', prop: 'color', label: '颜色', minWidth: 120 },
|
||||
{ key: 'remark', label: '备注', minWidth: 220, slotName: 'remark' },
|
||||
{ key: 'color', prop: 'color', label: '颜色', minWidth: 120, defaultVisible: false },
|
||||
{ key: 'remark', label: '备注', minWidth: 220, slotName: 'remark', defaultVisible: false },
|
||||
]
|
||||
|
||||
function apiId(value: string) {
|
||||
@@ -434,6 +435,9 @@ onMounted(() => {
|
||||
<template #pallet="{ row }">
|
||||
<div class="pallet-cell"><span><Boxes :size="18" /></span><strong>{{ (row as PlatformPalletResource).palletCode }}</strong></div>
|
||||
</template>
|
||||
<template #warehouse="{ row }">
|
||||
<div class="stacked-value"><strong>{{ warehouseFor((row as PlatformPalletResource).warehouseId)?.warehouseName || '—' }}</strong><small>{{ warehouseFor((row as PlatformPalletResource).warehouseId)?.warehouseCode || '—' }}</small></div>
|
||||
</template>
|
||||
<template #capacity="{ row }"><strong>{{ formatCapacity((row as PlatformPalletResource).capacityCbm) }}</strong></template>
|
||||
<template #weight="{ row }"><strong>{{ formatWeight((row as PlatformPalletResource).weightKg) }}</strong></template>
|
||||
<template #remark="{ row }"><span class="remark-text">{{ (row as PlatformPalletResource).remark || '—' }}</span></template>
|
||||
@@ -551,6 +555,9 @@ onMounted(() => {
|
||||
.pallet-row-actions { gap: 8px; white-space: nowrap; }
|
||||
.pallet-row-actions :deep(.el-button + .el-button) { margin-left: 0; }
|
||||
.pallet-cell { display: flex; align-items: center; gap: 10px; }
|
||||
.stacked-value { display: grid; min-width: 0; gap: 3px; }
|
||||
.stacked-value strong, .stacked-value small { overflow-wrap: anywhere; }
|
||||
.stacked-value small { color: var(--cc-muted); font-size: 11px; }
|
||||
.pallet-cell > span, .detail-hero > span { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 8px; background: var(--el-color-primary-light-9); color: var(--cc-primary); }
|
||||
.pallet-cell > span { width: 34px; height: 34px; }
|
||||
.remark-text { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.55; }
|
||||
|
||||
Reference in New Issue
Block a user