优化
This commit is contained in:
@@ -39,7 +39,7 @@ function mountView() {
|
||||
AdminPage: { template: '<main><slot /></main>' },
|
||||
ListPageLayout: { template: '<section><slot name="toolbar" /><slot name="state" /><slot /></section>' },
|
||||
QueryToolbar: { template: '<div />' },
|
||||
DataTable: { name: 'DataTable', props: ['data', 'columns'], emits: ['selection-change'], template: '<section><slot name="toolbar-actions" /><button data-testid="select" @click="$emit(\'selection-change\', data)">勾选两票</button><template v-for="row in data" :key="row.orderId"><slot name="actions" :row="row" /><slot name="inboundCode" :row="row" /></template></section>' },
|
||||
DataTable: { name: 'DataTable', props: ['data', 'columns', 'rowClassName'], emits: ['selection-change'], template: '<section><slot name="toolbar-actions" /><button data-testid="select" @click="$emit(\'selection-change\', data)">勾选两票</button><template v-for="row in data" :key="row.orderId"><slot name="actions" :row="row" /><slot name="inboundCode" :row="row" /></template></section>' },
|
||||
AppDialog: { name: 'AppDialog', props: ['modelValue', 'confirmText', 'confirmDisabled', 'confirmLoading'], emits: ['confirm', 'update:modelValue'], methods: { close() { this.$emit('update:modelValue', false) } }, template: '<section v-if="modelValue"><slot /><slot name="footer" :close="close" :submitting="confirmLoading"><button data-testid="dialog-confirm" :disabled="confirmDisabled" @click="$emit(\'confirm\')">{{ confirmText }}</button></slot></section>' },
|
||||
ApiErrorMeta: { props: ['details'], template: '<div>{{ details.code }} {{ details.requestId }} {{ details.traceId }}</div>' },
|
||||
CopyButton: { props: ['value', 'label'], template: '<button :data-copy="value">复制 ID</button>' },
|
||||
@@ -199,6 +199,19 @@ describe('UnifiedOrdersView co-load group behavior', () => {
|
||||
expect(wrapper.text()).not.toContain('5001')
|
||||
})
|
||||
|
||||
it('highlights rows in a current co-load group but not cancelled groups', async () => {
|
||||
const activeRow = { ...rows[0], coLoadGroup: { status: 'ACTIVE', memberCount: 2, memberInboundCodes: ['IN-1', 'IN-2'] } }
|
||||
const cancelledRow = { ...rows[1], coLoadGroup: { status: 'CANCELLED', memberCount: 2, memberInboundCodes: ['IN-1', 'IN-2'] } }
|
||||
vi.mocked(listPlatformUnifiedOrders).mockResolvedValue({ records: [activeRow, cancelledRow], page: 1, size: 20, total: 2, pages: 1 })
|
||||
const wrapper = mountView()
|
||||
await flushPromises()
|
||||
const rowClassName = wrapper.findComponent({ name: 'DataTable' }).props('rowClassName') as (scope: { row: UnifiedOrderResource }) => string
|
||||
|
||||
expect(rowClassName({ row: activeRow })).toBe('is-coload-group-row')
|
||||
expect(rowClassName({ row: cancelledRow })).toBe('')
|
||||
expect(rowClassName({ row: rows[0] })).toBe('')
|
||||
})
|
||||
|
||||
it('cancels an ACTIVE group by the clicked member inbound code and preserves dialog error evidence', async () => {
|
||||
const rowsWithGroup = rows.map((row) => ({ ...row, coLoadGroup: { status: 'ACTIVE', memberCount: 2, memberInboundCodes: ['IN-1', 'IN-2'] } }))
|
||||
vi.mocked(listPlatformUnifiedOrders).mockResolvedValue({ records: rowsWithGroup, page: 1, size: 20, total: 2, pages: 1 })
|
||||
|
||||
Reference in New Issue
Block a user