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,16 +1,21 @@
<script lang="ts" setup>
import type { OnActionClickParams, VxeTableGridOptions } from '#/adapter/vxe-table';
import type {
OnActionClickParams,
VxeTableGridOptions,
} from '#/adapter/vxe-table';
import type { SystemNoticeApi } from '#/api/system/notice';
import { Page, useVbenModal } from '@vben/common-ui';
import { Button, message } from 'ant-design-vue';
import { Plus } from '@vben/icons';
import Form from './modules/form.vue';
import { $t } from '#/locales';
import { Button, message } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { getNoticePage, deleteNotice, pushNotice } from '#/api/system/notice';
import { deleteNotice, getNoticePage, pushNotice } from '#/api/system/notice';
import { $t } from '#/locales';
import { useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
const [FormModal, formModalApi] = useVbenModal({
connectedComponent: Form,
@@ -46,7 +51,7 @@ async function onDelete(row: SystemNoticeApi.SystemNotice) {
key: 'action_process_msg',
});
onRefresh();
} catch (error) {
} catch {
hideLoading();
}
}
@@ -64,7 +69,7 @@ async function onPush(row: SystemNoticeApi.SystemNotice) {
content: $t('ui.actionMessage.operationSuccess'),
key: 'action_process_msg',
});
} catch (error) {
} catch {
hideLoading();
}
}
@@ -75,14 +80,14 @@ function onActionClick({
row,
}: OnActionClickParams<SystemNoticeApi.SystemNotice>) {
switch (code) {
case 'edit': {
onEdit(row);
break;
}
case 'delete': {
onDelete(row);
break;
}
case 'edit': {
onEdit(row);
break;
}
case 'push': {
onPush(row);
break;
@@ -92,7 +97,7 @@ function onActionClick({
const [Grid, gridApi] = useVbenVxeGrid({
formOptions: {
schema: useGridFormSchema()
schema: useGridFormSchema(),
},
gridOptions: {
columns: useGridColumns(onActionClick),
@@ -125,11 +130,15 @@ const [Grid, gridApi] = useVbenVxeGrid({
<FormModal @success="onRefresh" />
<Grid table-title="公告列表">
<template #toolbar-tools>
<Button type="primary" @click="onCreate" v-access:code="['system:notice:create']">
<Button
type="primary"
@click="onCreate"
v-access:code="['system:notice:create']"
>
<Plus class="size-5" />
{{ $t('ui.actionTitle.create', ['公告']) }}
</Button>
</template>
</Grid>
</Page>
</template>
</template>