style: system views code style

This commit is contained in:
xingyu4j
2025-04-22 11:25:11 +08:00
parent 4e1d6812ff
commit da3fd5b718
84 changed files with 1200 additions and 624 deletions

View File

@@ -1,19 +1,23 @@
<script lang="ts" setup>
import type { OnActionClickParams, VxeTableGridOptions } from '#/adapter/vxe-table';
import type {
OnActionClickParams,
VxeTableGridOptions,
} from '#/adapter/vxe-table';
import type { SystemTenantApi } from '#/api/system/tenant';
import { Page, useVbenModal } from '@vben/common-ui';
import { Button, message } from 'ant-design-vue';
import { Plus, Download } from '@vben/icons';
import Form from './modules/form.vue';
import { DocAlert } from '#/components/doc-alert';
import { Download, Plus } from '@vben/icons';
import { Button, message } from 'ant-design-vue';
import { $t } from '#/locales';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { getTenantPage, deleteTenant, exportTenant } from '#/api/system/tenant';
import { deleteTenant, exportTenant, getTenantPage } from '#/api/system/tenant';
import { DocAlert } from '#/components/doc-alert';
import { $t } from '#/locales';
import { downloadByData } from '#/utils/download';
import { useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
const [FormModal, formModalApi] = useVbenModal({
connectedComponent: Form,
@@ -66,14 +70,14 @@ function onActionClick({
row,
}: OnActionClickParams<SystemTenantApi.SystemTenant>) {
switch (code) {
case 'edit': {
onEdit(row);
break;
}
case 'delete': {
onDelete(row);
break;
}
case 'edit': {
onEdit(row);
break;
}
}
}
@@ -113,11 +117,20 @@ const [Grid, gridApi] = useVbenVxeGrid({
<FormModal @success="onRefresh" />
<Grid table-title="租户列表">
<template #toolbar-tools>
<Button type="primary" @click="onCreate" v-access:code="['system:tenant:create']">
<Button
type="primary"
@click="onCreate"
v-access:code="['system:tenant:create']"
>
<Plus class="size-5" />
{{ $t('ui.actionTitle.create', ['租户']) }}
</Button>
<Button type="primary" class="ml-2" @click="onExport" v-access:code="['system:tenant:export']">
<Button
type="primary"
class="ml-2"
@click="onExport"
v-access:code="['system:tenant:export']"
>
<Download class="size-5" />
{{ $t('ui.actionTitle.export') }}
</Button>