feat: 站内信我的消息

This commit is contained in:
puhui999
2025-04-04 14:01:14 +08:00
parent b0b986c152
commit 663d3d0e9d
4 changed files with 356 additions and 0 deletions

View File

@@ -0,0 +1,98 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemNotifyMessageApi } from '#/api/system/notify/message';
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
/** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] {
return [
{
fieldName: 'readStatus',
label: '是否已读',
component: 'Select',
componentProps: {
allowClear: true,
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'),
placeholder: '请选择是否已读',
},
},
{
fieldName: 'createTime',
label: '发送时间',
component: 'RangePicker',
componentProps: {
allowClear: true,
},
},
];
}
/** 列表的字段 */
export function useGridColumns<T = SystemNotifyMessageApi.NotifyMessage>(
onActionClick: OnActionClickFn<T>,
): VxeTableGridOptions['columns'] {
return [
{
field: 'templateNickname',
title: '发送人',
minWidth: 180,
},
{
field: 'createTime',
title: '发送时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'templateType',
title: '类型',
minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE },
},
},
{
field: 'templateContent',
title: '消息内容',
minWidth: 300,
},
{
field: 'readStatus',
title: '是否已读',
minWidth: 100,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING },
},
},
{
field: 'readTime',
title: '阅读时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'operation',
title: '操作',
minWidth: 180,
align: 'center',
fixed: 'right',
cellRender: {
attrs: {
nameField: 'id',
nameTitle: '站内信',
onClick: onActionClick,
},
name: 'CellOperation',
options: [
{
code: 'view',
text: '查看',
},
],
},
},
];
}