feat(pl): 展示各装送段用证配置与独立占用明细并保留历史计量口径。

This commit is contained in:
wuzilong committed 2026-11-01 22:54:51 +08:00
1 parent 706260ff7a
commit b764eb02a7
10 files changed
+497 -40

No files matched your search

@@ -38,6 +38,7 @@ function pageHarness(kind: 'quota' | 'legal', props: any = { mobile: true }) {
...Object.fromEntries(
Object.entries(vue).filter(([key]) => /^[a-zA-Z_$][\w$]*$/.test(key) && key !== 'default')
),
useElementSize: () => ({ width: vue.ref(900) }),
useListTableViewportHeight: () => ({ tableHeight: vue.ref(400) }),
useServerColumnFilters,
usePersistedListColumns,
@@ -47,6 +48,7 @@ function pageHarness(kind: 'quota' | 'legal', props: any = { mobile: true }) {
onBeforeUnmount: (fn: Function) => unmount.push(fn),
request: { get: (url: string, options: any) => queue(lists, { url, ...options.params }) },
pickBxData: (value: any) => value,
planQuotaApi: { get: (id: string) => queue(gets, id) },
legalDocumentApi: {
list: (params: any) => queue(lists, params),
get: (id: string) => queue(gets, id),
@@ -330,3 +332,21 @@ test('legal: read-only permission prevents writes even when detail contains atta
assert.equal(h.writes.length, 0)
h.stop()
})
test('plan expansion loads on demand, preserves total during refresh and ignores previous tenant', async () => {
const h = pageHarness('quota', { mobile: false }),
s = h.state
s.total.value = 45
const refresh = s.load()
assert.equal(s.total.value, 45)
h.lists[0].resolve({ list: [{ id: 'plan' }], total: 45 })
await refresh
s.expand({ id: 'plan' }, [{ id: 'plan' }])
assert.equal(h.gets.length, 1)
assert.deepEqual(s.expandedIds.value, ['plan'])
h.user.getUserInfo.tenantNo = 'other'
h.gets[0].resolve({ planId: 'plan', sourceOptions: [], usages: [] })
await flush()
assert.deepEqual(Object.keys(s.details), [])
h.stop()
})