reactor:【system 系统管理】notifymessage、operatelog、socialuser

This commit is contained in:
YunaiV
2025-09-10 09:53:55 +08:00
parent 6bf1392edf
commit b3a4a91a25
14 changed files with 433 additions and 239 deletions

View File

@@ -1,11 +1,17 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemSocialUserApi } from '#/api/system/social/user';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { getRangePickerDefaultProps } from '#/utils';
import { DictTag } from '#/components/dict-tag';
/** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] {
return [
@@ -99,3 +105,60 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
},
];
}
/** 详情页的字段 */
export function useDetailSchema(): DescriptionItemSchema[] {
return [
{
field: 'type',
label: '社交平台',
content: (data: SystemSocialUserApi.SocialUser) => {
return h(DictTag, {
type: DICT_TYPE.SYSTEM_SOCIAL_TYPE,
value: data?.type,
});
},
},
{
field: 'nickname',
label: '用户昵称',
},
{
field: 'avatar',
label: '用户头像',
content: (data: SystemSocialUserApi.SocialUser) => {
if (data?.avatar) {
return h('img', {
src: data.avatar,
style: 'width: 30px; height: 30px; cursor: pointer;',
onClick: () => {
// 可以添加图片预览功能
window.open(data.avatar, '_blank');
},
});
}
return '无';
},
},
{
field: 'token',
label: '社交 token',
},
{
field: 'rawTokenInfo',
label: '原始 Token 数据',
},
{
field: 'rawUserInfo',
label: '原始 User 数据',
},
{
field: 'code',
label: '最后一次的认证 code',
},
{
field: 'state',
label: '最后一次的认证 state',
},
];
}