This commit is contained in:
@@ -36,11 +36,18 @@
|
||||
@refresh="handleRefresh"
|
||||
>
|
||||
<template #left>
|
||||
<ElButton type="primary" @click="showAllocateDialog">授权卡</ElButton>
|
||||
<ElButton
|
||||
type="primary"
|
||||
@click="showAllocateDialog"
|
||||
v-permission="'enterprise_cards:allocate'"
|
||||
>
|
||||
授权卡
|
||||
</ElButton>
|
||||
<ElButton
|
||||
type="warning"
|
||||
:disabled="selectedCards.length === 0"
|
||||
@click="showRecallDialog"
|
||||
v-permission="'enterprise_cards:batch_recall'"
|
||||
>
|
||||
批量回收
|
||||
</ElButton>
|
||||
@@ -215,6 +222,7 @@
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import type { SearchFormItem } from '@/types'
|
||||
import { useCheckedColumns } from '@/composables/useCheckedColumns'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import ArtButtonTable from '@/components/core/forms/ArtButtonTable.vue'
|
||||
import { BgColorEnum } from '@/enums/appEnum'
|
||||
@@ -228,6 +236,8 @@
|
||||
|
||||
defineOptions({ name: 'EnterpriseCards' })
|
||||
|
||||
const { hasAuth } = useAuth()
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const loading = ref(false)
|
||||
@@ -537,19 +547,33 @@
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
formatter: (row: EnterpriseCardItem) => {
|
||||
return h('div', { style: 'display: flex; gap: 8px;' }, [
|
||||
row.network_status === 0
|
||||
? h(ArtButtonTable, {
|
||||
const buttons = []
|
||||
|
||||
if (row.network_status === 0) {
|
||||
// 停机状态,显示复机按钮
|
||||
if (hasAuth('enterprise_cards:resume')) {
|
||||
buttons.push(
|
||||
h(ArtButtonTable, {
|
||||
text: '复机',
|
||||
iconClass: BgColorEnum.SUCCESS,
|
||||
onClick: () => handleResume(row)
|
||||
})
|
||||
: h(ArtButtonTable, {
|
||||
)
|
||||
}
|
||||
} else {
|
||||
// 开机状态,显示停机按钮
|
||||
if (hasAuth('enterprise_cards:suspend')) {
|
||||
buttons.push(
|
||||
h(ArtButtonTable, {
|
||||
text: '停机',
|
||||
iconClass: BgColorEnum.ERROR,
|
||||
onClick: () => handleSuspend(row)
|
||||
})
|
||||
])
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return h('div', { style: 'display: flex; gap: 8px;' }, buttons)
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user