| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { VbenFormSchema } from '#/adapter/form'; |
| | | import type { VxeTableGridOptions } from '#/adapter/vxe-table'; |
| | | |
| | | import { markRaw } from 'vue'; |
| | | |
| | | import { DICT_TYPE } from '#/packages/constants/src'; |
| | | import { getDictOptions } from '#/packages/effects/hooks/src'; |
| | | |
| | | import { getRangePickerDefaultProps } from '#/utils'; |
| | | import { GroupSelect } from '#/views/im/manager/group/components'; |
| | | import { UserSelect } from '#/views/system/user/components'; |
| | | |
| | | /** 群æç´¢è¡¨å */ |
| | | export function useGroupGridFormSchema(): VbenFormSchema[] { |
| | | return [ |
| | | { |
| | | fieldName: 'name', |
| | | label: '群åç§°', |
| | | component: 'Input', |
| | | componentProps: { |
| | | allowClear: true, |
| | | placeholder: '请è¾å
¥ç¾¤åç§°', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'ownerUserId', |
| | | label: '群主', |
| | | component: markRaw(UserSelect), |
| | | componentProps: { |
| | | placeholder: 'è¯·éæ©ç¾¤ä¸»', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'status', |
| | | label: 'ç¾¤ç¶æ', |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | options: getDictOptions(DICT_TYPE.IM_GROUP_STATUS, 'number'), |
| | | placeholder: 'è¯·éæ©ç¾¤ç¶æ', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'banned', |
| | | label: 'æ¯å¦å°ç¦', |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'), |
| | | placeholder: 'è¯·éæ©å°ç¦ç¶æ', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'createTime', |
| | | label: 'å建æ¶é´', |
| | | component: 'RangePicker', |
| | | componentProps: { |
| | | ...getRangePickerDefaultProps(), |
| | | allowClear: true, |
| | | }, |
| | | }, |
| | | ]; |
| | | } |
| | | |
| | | /** 群åè¡¨åæ®µ */ |
| | | export function useGroupGridColumns(): VxeTableGridOptions['columns'] { |
| | | return [ |
| | | { |
| | | field: 'id', |
| | | title: 'ç¼å·', |
| | | width: 100, |
| | | }, |
| | | { |
| | | field: 'avatar', |
| | | title: '头å', |
| | | width: 80, |
| | | slots: { default: 'avatar' }, |
| | | }, |
| | | { |
| | | field: 'name', |
| | | title: '群åç§°', |
| | | minWidth: 160, |
| | | }, |
| | | { |
| | | title: '群主', |
| | | minWidth: 180, |
| | | slots: { default: 'owner' }, |
| | | }, |
| | | { |
| | | field: 'memberCount', |
| | | title: 'æåæ°', |
| | | width: 90, |
| | | }, |
| | | { |
| | | field: 'status', |
| | | title: 'ç¾¤ç¶æ', |
| | | width: 100, |
| | | cellRender: { |
| | | name: 'CellDict', |
| | | props: { type: DICT_TYPE.IM_GROUP_STATUS }, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'banned', |
| | | title: 'å°ç¦ç¶æ', |
| | | width: 120, |
| | | slots: { default: 'banned' }, |
| | | }, |
| | | { |
| | | field: 'mutedAll', |
| | | title: 'å
¨ç¾¤ç¦è¨', |
| | | width: 100, |
| | | slots: { default: 'mutedAll' }, |
| | | }, |
| | | { |
| | | field: 'createTime', |
| | | title: 'å建æ¶é´', |
| | | minWidth: 180, |
| | | formatter: 'formatDateTime', |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | width: 320, |
| | | fixed: 'right', |
| | | slots: { default: 'actions' }, |
| | | }, |
| | | ]; |
| | | } |
| | | |
| | | /** å 群ç³è¯·æç´¢è¡¨å */ |
| | | export function useGroupRequestGridFormSchema(): VbenFormSchema[] { |
| | | return [ |
| | | { |
| | | fieldName: 'groupId', |
| | | label: '群', |
| | | component: markRaw(GroupSelect), |
| | | }, |
| | | { |
| | | fieldName: 'userId', |
| | | label: 'ç³è¯·äºº', |
| | | component: markRaw(UserSelect), |
| | | componentProps: { |
| | | placeholder: 'è¯·éæ©ç³è¯·äºº', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'inviterUserId', |
| | | label: 'é请人', |
| | | component: markRaw(UserSelect), |
| | | componentProps: { |
| | | placeholder: 'è¯·éæ©é请人', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'handleResult', |
| | | label: 'å¤çç»æ', |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | options: getDictOptions(DICT_TYPE.IM_GROUP_REQUEST_HANDLE_RESULT, 'number'), |
| | | placeholder: 'è¯·éæ©å¤çç»æ', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'addSource', |
| | | label: 'å å
¥æ¥æº', |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | options: getDictOptions(DICT_TYPE.IM_GROUP_ADD_SOURCE, 'number'), |
| | | placeholder: 'è¯·éæ©å å
¥æ¥æº', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'createTime', |
| | | label: 'å建æ¶é´', |
| | | component: 'RangePicker', |
| | | componentProps: { |
| | | ...getRangePickerDefaultProps(), |
| | | allowClear: true, |
| | | }, |
| | | }, |
| | | ]; |
| | | } |
| | | |
| | | /** å 群ç³è¯·åè¡¨åæ®µ */ |
| | | export function useGroupRequestGridColumns(): VxeTableGridOptions['columns'] { |
| | | return [ |
| | | { |
| | | field: 'id', |
| | | title: 'ç¼å·', |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: '群', |
| | | minWidth: 180, |
| | | slots: { default: 'group' }, |
| | | }, |
| | | { |
| | | title: 'ç³è¯·äºº / 被é请人', |
| | | minWidth: 200, |
| | | slots: { default: 'user' }, |
| | | }, |
| | | { |
| | | title: 'é请人', |
| | | minWidth: 180, |
| | | slots: { default: 'inviter' }, |
| | | }, |
| | | { |
| | | field: 'applyContent', |
| | | title: 'ç³è¯·çç±', |
| | | minWidth: 160, |
| | | }, |
| | | { |
| | | field: 'addSource', |
| | | title: 'å å
¥æ¥æº', |
| | | width: 120, |
| | | cellRender: { |
| | | name: 'CellDict', |
| | | props: { type: DICT_TYPE.IM_GROUP_ADD_SOURCE }, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'handleResult', |
| | | title: 'å¤çç»æ', |
| | | width: 110, |
| | | cellRender: { |
| | | name: 'CellDict', |
| | | props: { type: DICT_TYPE.IM_GROUP_REQUEST_HANDLE_RESULT }, |
| | | }, |
| | | }, |
| | | { |
| | | title: 'å¤ç人', |
| | | minWidth: 180, |
| | | slots: { default: 'handler' }, |
| | | }, |
| | | { |
| | | field: 'handleContent', |
| | | title: 'å¤ççç±', |
| | | minWidth: 140, |
| | | }, |
| | | { |
| | | field: 'handleTime', |
| | | title: 'å¤çæ¶é´', |
| | | minWidth: 180, |
| | | formatter: 'formatDateTime', |
| | | }, |
| | | { |
| | | field: 'createTime', |
| | | title: 'å建æ¶é´', |
| | | minWidth: 180, |
| | | formatter: 'formatDateTime', |
| | | }, |
| | | ]; |
| | | } |