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
@@ -246,14 +246,14 @@ describe('CarrierScheduleQueryPanel loading states', () => {
expect(wrapper.findAll('button').some((button) => button.text().includes('人工补录节点'))).toBe(false)
})
it('keeps the form context and dialog-scoped idempotency key when a conflict is retried', async () => {
it.each([false, true])('keeps form inputs and the dialog-scoped retry key with dense=%s', async (dense) => {
vi.mocked(listCarrierScheduleQueries).mockResolvedValue({ records: [{ ...queryView, query: { ...queryView.query, resultPortScheduleId: null }, expired: false }], page: 1, size: 200, total: 1, pages: 1 })
const currentDetail = { containerBookingId: '3', currentNode: null, currentNodeAt: null, nodes: [] }
vi.mocked(getCarrierScheduleQuery).mockResolvedValue({ query: { ...queryView, query: { ...queryView.query, resultPortScheduleId: null } }, nodes: [], exceptions: [], histories: [] })
vi.mocked(appendContainerShippingNode)
.mockRejectedValueOnce(new ApiResponseError('版本冲突', 'A0409', 409, null, 'req-409', 'trace-409'))
.mockResolvedValueOnce(currentDetail)
const wrapper = mount(CarrierScheduleQueryPanel, { props: { oceanBookingId: '2', containerBookingId: '3' }, global: { plugins: [ElementPlus, pinia] } })
const wrapper = mount(CarrierScheduleQueryPanel, { props: { dense, cabinetNo: 'CAB-3', containerNo: 'CONT-3', oceanBookingId: '2', containerBookingId: '3' }, global: { plugins: [ElementPlus, pinia] } })
await flushPromises()
await wrapper.findAll('button').find((button) => button.text().includes('人工补录节点'))!.trigger('click')
@@ -266,12 +266,21 @@ describe('CarrierScheduleQueryPanel loading states', () => {
await wrapper.findComponent({ name: 'AppDialog' }).vm.$emit('confirm'); await flushPromises()
expect(wrapper.text()).toContain('补录未成功,已保留当前填写内容')
expect(wrapper.text()).toContain('req-409'); expect(wrapper.text()).toContain('trace-409')
const dialog = wrapper.findComponent({ name: 'AppDialog' })
expect(dialog.props('title')).toBe('人工补录船节点 · CAB-3')
if (dense) {
await dialog.get('[aria-label="展开全屏"]').trigger('click')
expect(dialog.find('.el-dialog.is-fullscreen').exists()).toBe(true)
expect(dialog.find('textarea').element.value).toBe('船司官网人工核验')
}
await wrapper.findComponent({ name: 'AppDialog' }).vm.$emit('confirm'); await flushPromises()
const first = vi.mocked(appendContainerShippingNode).mock.calls[0]!
const second = vi.mocked(appendContainerShippingNode).mock.calls[1]!
expect(first[1]).toBeTruthy(); expect(second[1]).toBe(first[1])
expect(second[2]).toEqual(first[2])
expect(second[2]).not.toHaveProperty('cabinetNo')
wrapper.unmount()
expect(second[2]).toMatchObject({ standardNode: 'IN_TRANSIT', estimatedAt: '2026-08-22T10:00:00', actualAt: null, locationCode: 'PACIFIC', locationName: 'Pacific Ocean', reason: '船司官网人工核验', observedAt: expect.any(String) })
})