style(admin): unify dialog layouts and dense readonly presentation

This commit is contained in:
2026-10-20 10:11:31 +08:00
parent 7ff7c9914f
commit 3267679758
214 changed files with 10931 additions and 2654 deletions
@@ -1,5 +1,6 @@
import ElementPlus, { ElMessageBox } from 'element-plus'
import { AxiosError } from 'axios'
import AppDialog from '@/shared/components/AppDialog.vue'
import { createPinia, setActivePinia } from 'pinia'
import { createMemoryHistory, createRouter } from 'vue-router'
import { flushPromises, mount } from '@vue/test-utils'
@@ -75,7 +76,9 @@ describe('SmartLoadingWorkbenchView', () => {
expect(wrapper.text()).not.toContain('LP-99')
expect(wrapper.text()).toContain('IN-1')
expect(wrapper.text()).not.toContain('ORD-1')
expect(wrapper.text()).toContain('150% 容量上限')
expect(wrapper.text()).not.toContain('150% 容量上限')
await wrapper.get('button[aria-label="查看装柜说明"]').trigger('mouseenter')
await vi.waitFor(() => expect(document.body.textContent).toContain('150% 容量上限'))
})
it('shows the full inbound composition for an assigned sealed pallet', async () => {
@@ -189,6 +192,11 @@ describe('SmartLoadingWorkbenchView', () => {
expect(wrapper.findAll('.el-table__body-wrapper button').filter((button) => button.text() === '加入')).toHaveLength(1)
await wrapper.findAll('.el-table__body-wrapper button').find((button) => button.text() === '加入')!.trigger('click')
await flushPromises()
const dialog = wrapper.getComponent(AppDialog)
expect(dialog.props('title')).toBe('整组加入当前柜次 · CLG-9007199254740999')
expect(dialog.findComponent({ name: 'ElInputNumber' }).exists()).toBe(false)
await dialog.get('[aria-label="展开全屏"]').trigger('click')
expect(dialog.get('table[aria-label="同柜组成员"]').text()).toContain('ORD-1:IN-201、IN-203')
;([...document.body.querySelectorAll('button')].find((button) => button.textContent?.includes('确认整组分配')) as HTMLButtonElement).click()
await flushPromises()
expect(assignSmartLoadingGroup).toHaveBeenCalledWith(planResponse.id, '201', planResponse.version)
@@ -222,9 +230,14 @@ describe('SmartLoadingWorkbenchView', () => {
await wrapper.find('.el-table__body-wrapper button').trigger('click')
await flushPromises()
expect(document.body.textContent).toContain('本次计划装柜箱数')
const dialog = wrapper.getComponent(AppDialog)
expect(dialog.props('title')).toBe('按入仓码分配箱数 · IN-1')
const count = dialog.getComponent({ name: 'ElInputNumber' })
expect(count.props('max')).toBe(12)
count.vm.$emit('update:modelValue', 5)
;([...document.body.querySelectorAll('button')].find((button) => button.textContent?.trim() === '确认分配') as HTMLButtonElement).click()
await flushPromises()
expect(assignSmartLoadingItem).toHaveBeenCalledWith(planResponse.id, { inboundId: '2', packageCount: 1, expectedVersion: planResponse.version })
expect(assignSmartLoadingItem).toHaveBeenCalledWith(planResponse.id, { inboundId: '2', packageCount: 5, expectedVersion: planResponse.version })
expect(assignSmartLoadingGroup).not.toHaveBeenCalled()
wrapper.unmount()
})
@@ -245,6 +258,10 @@ describe('SmartLoadingWorkbenchView', () => {
await flushPromises()
expect(document.body.textContent).toContain('不可拆分单元整托加入')
expect(document.body.textContent).not.toContain('本次计划装柜箱数')
const dialog = wrapper.getComponent(AppDialog)
expect(dialog.props('title')).toBe('整托加入当前柜次 · DP-260908-0001')
await dialog.get('[aria-label="展开全屏"]').trigger('click')
expect(dialog.findComponent({ name: 'ElInputNumber' }).exists()).toBe(false)
;([...document.body.querySelectorAll('button')].find((button) => button.textContent?.trim() === '确认整托分配') as HTMLButtonElement).click()
await flushPromises()