This commit is contained in:
2026-10-21 14:30:33 +08:00
parent 3953453090
commit 8498798a9c
47 changed files with 791 additions and 409 deletions
+37 -9
View File
@@ -46,6 +46,7 @@ const overseasConsumers = [
'overseas-warehouse/components/DeliveryDocumentsDialog.vue',
]
const overseasBusinessConsumers = [
'overseas-business/components/TransportDemandForm.vue',
'overseas-business/pages/PurchaseOrdersView.vue', 'overseas-business/pages/PurchaseOrderDetailView.vue',
'overseas-business/pages/PurchaseOrderEditView.vue', 'overseas-business/pages/TransportOrdersView.vue',
'overseas-business/pages/TruckOrderDetailView.vue',
@@ -217,6 +218,23 @@ const cssRoot = (css: string) => {
}
describe('approved Admin density ownership', () => {
it('lets local transport editors fill the workspace and keeps form density in shared primitives', () => {
const editor = read('modules/overseas-business/pages/TransportOrderFormView.vue')
const demand = parse(read('modules/overseas-business/components/TransportDemandForm.vue')).descriptor
const css = demand.styles.map(style => style.content).join('\n')
const layout = read('modules/overseas-business/overseasBusinessDensity.css')
expect(editor).toContain('overseas-transport-editor')
expect(editor).toContain('transport-customer-section density-form-section')
expect(layout).toMatch(/\.admin-density\.overseas-business-editor\s*\{\s*width: 100%;\s*\}/)
expect(layout).toMatch(/:not\(\.overseas-transport-editor\)\s*\{\s*max-width: 1120px;/)
expect(demand.template!.content).toContain('admin-density admin-workbench density-form')
expect(demand.template!.content.match(/<FormSection class="density-form-section"/g)).toHaveLength(3)
expect(css).not.toMatch(/max-width|--el-component-size|font-size|el-form-item__label|margin-bottom/)
expect(css).toContain('repeat(2, minmax(0, 1fr))')
expect(css).toContain('repeat(3, minmax(0, 1fr))')
expect(css).toContain('repeat(4, minmax(0, 1fr))')
})
it('separates shared list filters with the same 5px radius across density themes', () => {
const declarations = (source: string, selector: string) => {
const values: Record<string, string> = {}
@@ -785,10 +803,14 @@ describe('approved Admin density ownership', () => {
}
const domestic = read('modules/unified-orders/pages/UnifiedOrdersView.vue')
const overseasShell = read('modules/overseas-warehouse/components/OverseasDetailShell.vue')
const truckDetail = read('modules/overseas-business/pages/TruckOrderDetailView.vue')
for (const className of ['density-detail-header', 'density-detail-heading', 'density-detail-title']) {
expect(domestic).toContain(className)
expect(overseasShell).toContain(className)
expect(truckDetail).toContain(className)
}
expect(truckDetail).toContain('density-detail-layout')
expect(truckDetail).toContain('density-descriptions')
expect(domestic).toContain('density-detail-overview')
expect(read('modules/overseas-warehouse/pages/LastMileOrderDetailView.vue')).toContain('density-detail-overview')
})
@@ -1274,14 +1296,25 @@ describe('approved Admin density ownership', () => {
expect(source).not.toContain('<DispatchResourceFields')
expect(source).toContain('<SmartDispatchCargoBoard')
expect(source).toContain('label-position="left" label-width="130px"')
expect(source).toContain('class="density-dialog-section dispatch-setup"')
expect(source).toContain('class="density-dialog-section dispatch-draft-toolbar"')
expect(source).toContain('class="dispatch-context-toolbar"')
expect(source).not.toContain('class="density-dialog-section dispatch-draft-toolbar"')
expect(source).toContain('<template #vehicle-controls>')
expect(source).toContain('class="density-form dispatch-setup-fields"')
expect(source).not.toContain('data-tone="work"')
expect(source).not.toContain('data-tone="summary"')
expect(source).not.toContain('data-tone="source"')
expect(board).toContain('class="dispatch-cargo-board"')
expect(board).toContain('class="density-table cargo-board-table"')
const boardCss = parse(board).descriptor.styles.map(style => style.content).join('\n')
const orderViewport = boardCss.match(/\.cargo-board-table-wrap\s*\{([^}]+)\}/)?.[1] || ''
const palletViewport = boardCss.match(/\.cargo-board-pallet-list\s*\{([^}]+)\}/)?.[1] || ''
for (const viewport of [orderViewport, palletViewport]) {
expect(viewport).toContain('max-height:')
expect(viewport).not.toMatch(/(?:^|;)\s*height:/)
}
expect(boardCss).not.toContain('min-height: 74px')
expect(source).not.toContain('admin-density-workspace')
expect(board).toContain('aria-label="待排订单"')
expect(board).toContain('aria-label="托盘明细"')
expect(board).toContain('aria-label="车辆装载"')
@@ -1293,10 +1326,9 @@ describe('approved Admin density ownership', () => {
expect(fields).toContain('density-table density-table--editable dispatch-resource-table')
expect(fields).toContain('class="resource-grid"')
})
it('keeps dispatch workflow, delivery arrangements and owned evidence on shared compact sections', () => {
it('keeps dispatch workflow and owned evidence on shared compact sections', () => {
const workflow = read('modules/overseas-warehouse/components/DispatchWorkflowDialog.vue')
const cargo = read('modules/overseas-warehouse/components/SmartDispatchExistingCargo.vue')
const arrangement = read('modules/overseas-warehouse/components/DispatchArrangeFields.vue')
const evidence = read('modules/overseas-warehouse/components/DispatchEvidenceFiles.vue')
expect(workflow).toContain(':fullscreenable="width !== \'560px\'"')
expect(workflow).toContain('<DispatchResourceFields continuous')
@@ -1309,17 +1341,13 @@ describe('approved Admin density ownership', () => {
expect(cargo).toContain('aria-label="当前排车货物"')
for (const tone of ['source', 'work']) {
expect(workflow).toContain(`data-tone="${tone}"`)
expect(arrangement).toContain(`data-tone="${tone}"`)
}
expect(workflow).not.toMatch(/max-height="(?:380|420)"/)
expect(arrangement).not.toContain('max-height="240"')
expect(arrangement).toContain('density-table density-table--editable arrange-editor-table')
expect(arrangement).toContain('本组新增费用')
expect(evidence).toContain('class="density-table dispatch-evidence-table"')
expect(evidence).toContain('fullscreenable :loading="previewLoading"')
expect(evidence).toContain('<LoadErrorState')
expect(evidence).toContain('<LineClampText')
for (const source of [workflow, arrangement, evidence]) {
for (const source of [workflow, evidence]) {
const styles = parse(source).descriptor.styles.map(style => style.content).join('\n')
expect(styles).not.toMatch(/background:|border-left:|font-size:/)
}