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
@@ -100,9 +100,14 @@ describe('FeeItemsView public master data and access', () => {
})
it('keeps all three row actions visible without a premature more menu', () => {
expect(source).toContain('size="small" plain type="primary"')
expect(source).toContain('size="small"\n plain\n :type=')
expect(source).toContain('size="small" plain type="danger"')
expect(source).toContain('<Pencil :size="15" />编辑')
expect(source).toContain('<Power :size="15" />')
expect(source).toContain('<Trash2 :size="15" />删除')
expect(source).not.toContain('MoreHorizontal')
expect(source).not.toContain("access.can('firstleg:fee-item:edit')\" link")
expect(source).not.toContain("access.can('firstleg:fee-item:delete')\" link")
})
})
+4 -3
View File
@@ -372,16 +372,17 @@ onMounted(() => {
</template>
<template #actions="{ row }">
<div v-if="access.can('firstleg:fee-item:edit') || access.can('firstleg:fee-item:delete')" class="table-actions">
<el-button v-if="access.can('firstleg:fee-item:edit')" link type="primary" :disabled="loading || editorLoading" @click="openEdit(row as PlatformFeeItemResource)"><Pencil :size="15" />编辑</el-button>
<el-button v-if="access.can('firstleg:fee-item:edit')" size="small" plain type="primary" :disabled="loading || editorLoading" @click="openEdit(row as PlatformFeeItemResource)"><Pencil :size="15" />编辑</el-button>
<el-button
v-if="access.can('firstleg:fee-item:edit')"
link
size="small"
plain
:type="(row as PlatformFeeItemResource).status === 'ACTIVE' ? 'warning' : 'success'"
:loading="statusLoadingIds.has(String((row as PlatformFeeItemResource).id))"
:disabled="loading"
@click="requestStatusChange(row as PlatformFeeItemResource)"
><Power :size="15" />{{ (row as PlatformFeeItemResource).status === 'ACTIVE' ? '停用' : '启用' }}</el-button>
<el-button v-if="access.can('firstleg:fee-item:delete')" link type="danger" :disabled="loading" @click="requestDelete(row as PlatformFeeItemResource)"><Trash2 :size="15" />删除</el-button>
<el-button v-if="access.can('firstleg:fee-item:delete')" size="small" plain type="danger" :disabled="loading" @click="requestDelete(row as PlatformFeeItemResource)"><Trash2 :size="15" />删除</el-button>
</div>
<span v-else class="muted-value">仅查看</span>
</template>