You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

60 lines
1.6 KiB

<template>
<div>
<BasicTable @register="registerTable">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
2 years ago
icon: IconEnum.DELETE,
color: 'error',
label: '强退',
popConfirm: {
title: '是否确认强退',
placement: 'left',
confirm: handleDelete.bind(null, record)
}
}
]"
/>
</template>
</template>
</BasicTable>
</div>
</template>
<script lang="ts" setup name="Token">
2 years ago
import { useI18n } from '@/hooks/web/useI18n'
2 years ago
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteAccessTokenApi, getAccessTokenPageApi } from '@/api/system/oauth2/token'
import { columns, searchFormSchema } from './token.data'
import { useMessage } from '@/hooks/web/useMessage'
2 years ago
const { t } = useI18n()
const { createMessage } = useMessage()
const [registerTable, { reload }] = useTable({
title: 'Token列表',
api: getAccessTokenPageApi,
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema
},
useSearchForm: true,
showTableSetting: true,
showIndexColumn: false,
actionColumn: {
width: 60,
2 years ago
title: t('common.action'),
dataIndex: 'action',
fixed: 'right'
}
})
async function handleDelete(record: Recordable) {
await deleteAccessTokenApi(record.id)
2 years ago
createMessage.success(t('common.delSuccessText'))
reload()
}
</script>