This commit is contained in:
@@ -127,7 +127,6 @@
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { useCheckedColumns } from '@/composables/useCheckedColumns'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import { normalizeApiError } from '@/utils/business/apiError'
|
||||
import { AUGUST_PERMISSIONS } from '@/config/constants'
|
||||
import type { SearchFormItem } from '@/types'
|
||||
import type {
|
||||
@@ -143,6 +142,8 @@
|
||||
|
||||
const canCreate = computed(() => hasAuth(perms.ruleCreate))
|
||||
const canUpdate = computed(() => hasAuth(perms.ruleUpdate))
|
||||
const canEnable = computed(() => hasAuth(perms.ruleEnable))
|
||||
const canDisable = computed(() => hasAuth(perms.ruleDisable))
|
||||
|
||||
// ========== 列表数据 ==========
|
||||
|
||||
@@ -333,15 +334,16 @@
|
||||
handler: () => void
|
||||
type?: 'primary' | 'danger'
|
||||
}> = []
|
||||
if (!canUpdate.value) return actions
|
||||
actions.push({ label: '编辑', handler: () => openFormDialog('edit', row) })
|
||||
if (row.enabled) {
|
||||
if (canUpdate.value) {
|
||||
actions.push({ label: '编辑', handler: () => openFormDialog('edit', row) })
|
||||
}
|
||||
if (row.enabled && canDisable.value) {
|
||||
actions.push({
|
||||
label: '停用',
|
||||
handler: () => handleToggleEnabled(row, false),
|
||||
type: 'danger' as const
|
||||
})
|
||||
} else {
|
||||
} else if (!row.enabled && canEnable.value) {
|
||||
actions.push({
|
||||
label: '启用',
|
||||
handler: () => handleToggleEnabled(row, true),
|
||||
|
||||
Reference in New Issue
Block a user