This commit is contained in:
2026-08-12 17:45:49 +08:00
parent 5b441626e9
commit 2a889a7d91
25 changed files with 154 additions and 29 deletions
@@ -73,6 +73,15 @@ enableAutoUnmount(afterEach)
afterAll(() => vi.unstubAllGlobals())
describe('ExpressCompaniesView query and table migration', () => {
it('renders edit and status as colored outlined buttons with prototype icons', () => {
expect(expressCompaniesSource).toContain('size="small"\n plain\n type="primary"')
expect(expressCompaniesSource).toContain('size="small"\n plain\n :disabled="loading"\n :type=')
expect(expressCompaniesSource).toContain('<Pencil :size="15" />编辑')
expect(expressCompaniesSource).toContain('<Power :size="15" />')
expect(expressCompaniesSource).not.toContain("access.can('platform:express:edit')\"\n link")
expect(expressCompaniesSource).not.toContain("access.can('platform:express:status')\"\n link")
})
it('keeps operation first and exposes the prototype business columns separately', () => {
const actionsIndex = expressCompaniesSource.indexOf("{ key: 'actions', label: '操作'")
const nameIndex = expressCompaniesSource.indexOf("{ key: 'company', label: '公司名称'")
@@ -314,7 +314,8 @@ onMounted(() => {
<div v-if="access.can('platform:express:edit') || access.can('platform:express:status')" class="table-actions">
<el-button
v-if="access.can('platform:express:edit')"
link
size="small"
plain
type="primary"
:disabled="loading"
:loading="editLoadingIds.has(String((row as PlatformExpressCompanyResource).id))"
@@ -322,7 +323,8 @@ onMounted(() => {
><Pencil :size="15" />编辑</el-button>
<el-button
v-if="access.can('platform:express:status')"
link
size="small"
plain
:disabled="loading"
:type="(row as PlatformExpressCompanyResource).status === 'ACTIVE' ? 'danger' : 'success'"
:loading="statusLoadingIds.has(String((row as PlatformExpressCompanyResource).id))"