fix: 完善上游 Sub2API 计费倍率探测与账号展示

This commit is contained in:
Tian Lee
2026-07-17 20:59:29 +08:00
committed by yardbirds0
parent bc50c9d013
commit d2585097f3
30 changed files with 1311 additions and 183 deletions
+30 -30
View File
@@ -130,38 +130,38 @@
]"
@click="column.sortable && handleSort(column.key)"
>
<slot
:name="`header-${column.key}`"
:column="column"
:sort-key="sortKey"
:sort-order="sortOrder"
>
<div :class="['flex items-center space-x-1', getHeaderContentAlignmentClass(column)]">
<div :class="['flex items-center space-x-1', getHeaderContentAlignmentClass(column)]">
<slot
:name="`header-${column.key}`"
:column="column"
:sort-key="sortKey"
:sort-order="sortOrder"
>
<span>{{ column.label }}</span>
<span
v-if="column.sortable"
class="inline-flex h-5 w-4 flex-col items-center justify-center"
aria-hidden="true"
</slot>
<span
v-if="column.sortable"
class="inline-flex h-5 w-4 flex-col items-center justify-center"
aria-hidden="true"
>
<svg
class="h-2.5 w-2.5"
:class="getSortIndicatorClass(column.key, 'asc')"
fill="currentColor"
viewBox="0 0 10 10"
>
<svg
class="h-2.5 w-2.5"
:class="getSortIndicatorClass(column.key, 'asc')"
fill="currentColor"
viewBox="0 0 10 10"
>
<path d="M5 2L1.5 6.5h7L5 2z" />
</svg>
<svg
class="-mt-0.5 h-2.5 w-2.5"
:class="getSortIndicatorClass(column.key, 'desc')"
fill="currentColor"
viewBox="0 0 10 10"
>
<path d="M5 8L1.5 3.5h7L5 8z" />
</svg>
</span>
</div>
</slot>
<path d="M5 2L1.5 6.5h7L5 2z" />
</svg>
<svg
class="-mt-0.5 h-2.5 w-2.5"
:class="getSortIndicatorClass(column.key, 'desc')"
fill="currentColor"
viewBox="0 0 10 10"
>
<path d="M5 8L1.5 3.5h7L5 8z" />
</svg>
</span>
</div>
</th>
</tr>
</thead>
@@ -60,12 +60,16 @@ describe('DataTable', () => {
],
defaultSortKey: 'name',
defaultSortOrder: 'asc'
},
slots: {
'header-name': '<span data-test="custom-name-header">Name</span>'
}
})
await wrapper.vm.$nextTick()
const nameHeader = wrapper.findAll('th')[0]
expect(nameHeader.find('[data-test="custom-name-header"]').exists()).toBe(true)
expect(nameHeader.attributes('aria-sort')).toBe('ascending')
expect(nameHeader.findAll('svg')).toHaveLength(2)
expect(nameHeader.findAll('svg')[0].classes()).toContain('text-primary-600')