reactor:【system 系统管理】notify/message 进一步统一代码风格

This commit is contained in:
YunaiV
2025-09-06 16:13:49 +08:00
parent 94d778c0df
commit 11f507ed2b
5 changed files with 47 additions and 56 deletions

View File

@@ -4,12 +4,11 @@ import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { formatDateTime } from '@vben/utils';
import { DictTag } from '#/components/dict-tag';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { getRangePickerDefaultProps } from '#/utils';
/** 列表的搜索表单 */
@@ -74,10 +73,12 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'id',
title: '编号',
minWidth: 100,
},
{
field: 'userType',
title: '用户类型',
minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.USER_TYPE },
@@ -86,22 +87,27 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'userId',
title: '用户编号',
minWidth: 100,
},
{
field: 'templateCode',
title: '模板编码',
minWidth: 120,
},
{
field: 'templateNickname',
title: '发送人名称',
minWidth: 180,
},
{
field: 'templateContent',
title: '模版内容',
minWidth: 200,
},
{
field: 'templateParams',
title: '模版参数',
minWidth: 180,
formatter: ({ cellValue }) => {
try {
return JSON.stringify(cellValue);
@@ -113,6 +119,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'templateType',
title: '模版类型',
minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE },
@@ -121,6 +128,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'readStatus',
title: '是否已读',
minWidth: 100,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING },
@@ -129,11 +137,13 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'readTime',
title: '阅读时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'createTime',
title: '创建时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{

View File

@@ -6,6 +6,7 @@ import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { getNotifyMessagePage } from '#/api/system/notify/message';
import { $t } from '#/locales';
import { useGridColumns, useGridFormSchema } from './data';
import Detail from './modules/detail.vue';
@@ -16,7 +17,7 @@ const [DetailModal, detailModalApi] = useVbenModal({
});
/** 刷新表格 */
function onRefresh() {
function handleRefresh() {
gridApi.query();
}
@@ -46,6 +47,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
},
rowConfig: {
keyField: 'id',
isHover: true,
},
toolbarConfig: {
refresh: true,
@@ -58,10 +60,10 @@ const [Grid, gridApi] = useVbenVxeGrid({
<template>
<Page auto-content-height>
<template #doc>
<DocAlert title="短信配置" url="https://doc.iocoder.cn/sms/" />
<DocAlert title="站内信" url="https://doc.iocoder.cn/notify/" />
</template>
<DetailModal @success="onRefresh" />
<DetailModal @success="handleRefresh" />
<Grid table-title="站内信列表">
<template #actions="{ row }">
<TableAction