feat: 表格按钮调整

This commit is contained in:
caiyuchao
2025-07-09 14:53:51 +08:00
parent 04017748a5
commit 8dea248137
3 changed files with 60 additions and 60 deletions

View File

@@ -6,12 +6,11 @@ import type {
import type { CustomerApi } from '#/api/license/customer'; import type { CustomerApi } from '#/api/license/customer';
import { Page, useVbenModal } from '@vben/common-ui'; import { Page, useVbenModal } from '@vben/common-ui';
import { Download, Plus } from '@vben/icons';
import { downloadFileFromBlobPart } from '@vben/utils'; import { downloadFileFromBlobPart } from '@vben/utils';
import { Button, message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter/vxe-table'; import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { import {
deleteCustomer, deleteCustomer,
exportCustomer, exportCustomer,
@@ -128,23 +127,24 @@ const [Grid, gridApi] = useVbenVxeGrid({
<Grid :table-title="$t('customer.customerList')"> <Grid :table-title="$t('customer.customerList')">
<template #toolbar-tools> <template #toolbar-tools>
<Button <TableAction
type="primary" :actions="[
@click="onCreate" {
v-access:code="['license:customer:create']" label: $t('ui.actionTitle.create', [$t('customer.customer')]),
> type: 'primary',
<Plus class="size-5" /> icon: ACTION_ICON.ADD,
{{ $t('ui.actionTitle.create', [$t('customer.customer')]) }} auth: ['license:customer:create'],
</Button> onClick: onCreate,
<Button },
type="primary" {
class="ml-2" label: $t('ui.actionTitle.export'),
@click="onExport" type: 'primary',
v-access:code="['license:customer:export']" icon: ACTION_ICON.DOWNLOAD,
> auth: ['license:customer:export'],
<Download class="size-5" /> onClick: onExport,
{{ $t('ui.actionTitle.export') }} },
</Button> ]"
/>
</template> </template>
</Grid> </Grid>
</Page> </Page>

View File

@@ -6,12 +6,11 @@ import type {
import type { LicenseApi } from '#/api/license/license'; import type { LicenseApi } from '#/api/license/license';
import { Page, useVbenModal } from '@vben/common-ui'; import { Page, useVbenModal } from '@vben/common-ui';
import { Download, Plus } from '@vben/icons';
import { downloadFileFromBlobPart } from '@vben/utils'; import { downloadFileFromBlobPart } from '@vben/utils';
import { Button, message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter/vxe-table'; import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { import {
deleteLicense, deleteLicense,
exportLicense, exportLicense,
@@ -133,23 +132,24 @@ const [Grid, gridApi] = useVbenVxeGrid({
<Grid :table-title="$t('license.list')"> <Grid :table-title="$t('license.list')">
<template #toolbar-tools> <template #toolbar-tools>
<Button <TableAction
type="primary" :actions="[
@click="onCreate" {
v-access:code="['license:license:create']" label: $t('ui.actionTitle.create', ['License']),
> type: 'primary',
<Plus class="size-5" /> icon: ACTION_ICON.ADD,
{{ $t('ui.actionTitle.create', ['License']) }} auth: ['license:license:create'],
</Button> onClick: onCreate,
<Button },
type="primary" {
class="ml-2" label: $t('ui.actionTitle.export'),
@click="onExport" type: 'primary',
v-access:code="['license:license:export']" icon: ACTION_ICON.DOWNLOAD,
> auth: ['license:license:export'],
<Download class="size-5" /> onClick: onExport,
{{ $t('ui.actionTitle.export') }} },
</Button> ]"
/>
</template> </template>
</Grid> </Grid>
</Page> </Page>

View File

@@ -6,12 +6,11 @@ import type {
import type { ProjectApi } from '#/api/license/project'; import type { ProjectApi } from '#/api/license/project';
import { Page, useVbenModal } from '@vben/common-ui'; import { Page, useVbenModal } from '@vben/common-ui';
import { Download, Plus } from '@vben/icons';
import { downloadFileFromBlobPart } from '@vben/utils'; import { downloadFileFromBlobPart } from '@vben/utils';
import { Button, message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter/vxe-table'; import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { import {
deleteProject, deleteProject,
exportProject, exportProject,
@@ -127,23 +126,24 @@ const [Grid, gridApi] = useVbenVxeGrid({
<Grid :table-title="$t('project.list')"> <Grid :table-title="$t('project.list')">
<template #toolbar-tools> <template #toolbar-tools>
<Button <TableAction
type="primary" :actions="[
@click="onCreate" {
v-access:code="['license:project:create']" label: $t('ui.actionTitle.create', [$t('project.project')]),
> type: 'primary',
<Plus class="size-5" /> icon: ACTION_ICON.ADD,
{{ $t('ui.actionTitle.create', [$t('project.project')]) }} auth: ['license:project:create'],
</Button> onClick: onCreate,
<Button },
type="primary" {
class="ml-2" label: $t('ui.actionTitle.export'),
@click="onExport" type: 'primary',
v-access:code="['license:project:export']" icon: ACTION_ICON.DOWNLOAD,
> auth: ['license:project:export'],
<Download class="size-5" /> onClick: onExport,
{{ $t('ui.actionTitle.export') }} },
</Button> ]"
/>
</template> </template>
</Grid> </Grid>
</Page> </Page>