From 08fac66fe1afeac12b0155605dc1f1f1182fb322 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Wed, 14 Oct 2026 18:19:27 +0800 Subject: [PATCH] feat(selfop): add volume ranking and refine turnover presentation --- .../components/DashboardCharts.test.ts | 11 +++ .../components/DashboardTrend.vue | 8 +- .../components/InventoryTurnoverView.test.ts | 46 +++++++-- .../components/InventoryTurnoverView.vue | 99 ++++++++++++++----- src/modules/self-operated/operation-matrix.md | 10 ++ .../self-operated/pages/OverviewView.test.ts | 7 +- .../self-operated/pages/OverviewView.vue | 6 +- .../self-operated/turnoverNavigation.test.ts | 2 +- .../self-operated/turnoverNavigation.ts | 2 +- .../turnoverPresentation.test.ts | 8 +- .../self-operated/turnoverPresentation.ts | 32 +++--- src/modules/self-operated/turnoverSorting.ts | 2 + src/modules/self-operated/turnoverTypes.ts | 4 +- 13 files changed, 177 insertions(+), 60 deletions(-) diff --git a/src/modules/self-operated/components/DashboardCharts.test.ts b/src/modules/self-operated/components/DashboardCharts.test.ts index 06d82946..ec78ee0d 100644 --- a/src/modules/self-operated/components/DashboardCharts.test.ts +++ b/src/modules/self-operated/components/DashboardCharts.test.ts @@ -10,6 +10,17 @@ function point(date: string, value: number | null, dataStatus = 'COMPLETE'): Dai return { businessDate: date, outboundQuantity: dataStatus === 'COMPLETE' ? value : null, observedQuantity: value, dataStatus, reasonCodes: [], quantityUnit: 'PCS' } } describe('dashboard chart integrity and interaction', () => { + it('keeps dates and line explanations behind the description action', async () => { + const wrapper = mount(DashboardTrend, { props: { points: [point('2026-10-01', 2)] }, slots: { explanation: '

统计日期示例

' } }) + expect(wrapper.text()).not.toContain('统计日期示例') + expect(wrapper.text()).not.toContain('实线/实心点') + await wrapper.findAll('button').find(button => button.text() === '说明')!.trigger('click') + expect(wrapper.text()).toContain('统计日期示例') + expect(wrapper.text()).toContain('实线/实心点') + await wrapper.setProps({ points: [point('2026-10-02', 3)] }) + expect(wrapper.find('[role=dialog]').exists()).toBe(false) + wrapper.unmount() + }) it('fills only contiguous known segments and keeps unknown days unavailable for drilldown', async () => { const wrapper = mount(DashboardTrend, { props: { points: [point('2026-10-01', 2), point('2026-10-02', 4), point('2026-10-03', null, 'UNKNOWN'), point('2026-10-04', 1, 'PARTIAL')] } }) const chart = wrapper.findComponent({ name: 'VChart' }) diff --git a/src/modules/self-operated/components/DashboardTrend.vue b/src/modules/self-operated/components/DashboardTrend.vue index 3360c2eb..41fae0d3 100644 --- a/src/modules/self-operated/components/DashboardTrend.vue +++ b/src/modules/self-operated/components/DashboardTrend.vue @@ -19,10 +19,12 @@ function selectChart(event: ECElementEvent) { const point = props.points[event.d