| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 { UserSelect } from '#/views/system/user/components'; |
| | | |
| | | /** 好åå
³ç³»æç´¢è¡¨å */ |
| | | export function useFriendGridFormSchema(): VbenFormSchema[] { |
| | | return [ |
| | | { |
| | | fieldName: 'userId', |
| | | label: 'ç¨æ·', |
| | | component: markRaw(UserSelect), |
| | | }, |
| | | { |
| | | fieldName: 'friendUserId', |
| | | label: '好å', |
| | | component: markRaw(UserSelect), |
| | | componentProps: { |
| | | placeholder: 'è¯·éæ©å¥½å', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'status', |
| | | label: '好åç¶æ', |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | options: getDictOptions(DICT_TYPE.IM_FRIEND_STATUS, 'number'), |
| | | placeholder: 'è¯·éæ©å¥½åç¶æ', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'silent', |
| | | label: 'å
ææ°', |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'), |
| | | placeholder: 'è¯·éæ©å
ææ°ç¶æ', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'addTime', |
| | | label: 'æ·»å æ¶é´', |
| | | component: 'RangePicker', |
| | | componentProps: { |
| | | ...getRangePickerDefaultProps(), |
| | | allowClear: true, |
| | | }, |
| | | }, |
| | | ]; |
| | | } |
| | | |
| | | /** 好åå
³ç³»åè¡¨åæ®µ */ |
| | | export function useFriendGridColumns(): VxeTableGridOptions['columns'] { |
| | | return [ |
| | | { |
| | | field: 'id', |
| | | title: 'ç¼å·', |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: 'ç¨æ·', |
| | | minWidth: 180, |
| | | slots: { default: 'user' }, |
| | | }, |
| | | { |
| | | title: '好å', |
| | | minWidth: 180, |
| | | slots: { default: 'friend' }, |
| | | }, |
| | | { |
| | | field: 'displayName', |
| | | title: '夿³¨', |
| | | minWidth: 120, |
| | | }, |
| | | { |
| | | field: 'addSource', |
| | | title: 'æ·»å æ¥æº', |
| | | width: 120, |
| | | cellRender: { |
| | | name: 'CellDict', |
| | | props: { type: DICT_TYPE.IM_FRIEND_ADD_SOURCE }, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'silent', |
| | | title: 'å
ææ°', |
| | | width: 90, |
| | | cellRender: { |
| | | name: 'CellDict', |
| | | props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'pinned', |
| | | title: '置顶', |
| | | width: 80, |
| | | cellRender: { |
| | | name: 'CellDict', |
| | | props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'blocked', |
| | | title: 'æé»', |
| | | width: 80, |
| | | cellRender: { |
| | | name: 'CellDict', |
| | | props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'status', |
| | | title: 'ç¶æ', |
| | | width: 100, |
| | | cellRender: { |
| | | name: 'CellDict', |
| | | props: { type: DICT_TYPE.IM_FRIEND_STATUS }, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'addTime', |
| | | title: 'æ·»å æ¶é´', |
| | | minWidth: 180, |
| | | formatter: 'formatDateTime', |
| | | }, |
| | | { |
| | | field: 'deleteTime', |
| | | title: 'å 餿¶é´', |
| | | minWidth: 180, |
| | | formatter: 'formatDateTime', |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | width: 120, |
| | | fixed: 'right', |
| | | slots: { default: 'actions' }, |
| | | }, |
| | | ]; |
| | | } |
| | | |
| | | /** 好åç³è¯·æç´¢è¡¨å */ |
| | | export function useFriendRequestGridFormSchema(): VbenFormSchema[] { |
| | | return [ |
| | | { |
| | | fieldName: 'fromUserId', |
| | | label: 'åèµ·æ¹', |
| | | component: markRaw(UserSelect), |
| | | componentProps: { |
| | | placeholder: 'è¯·éæ©åèµ·æ¹', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'toUserId', |
| | | label: 'æ¥æ¶æ¹', |
| | | component: markRaw(UserSelect), |
| | | componentProps: { |
| | | placeholder: 'è¯·éæ©æ¥æ¶æ¹', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'handleResult', |
| | | label: 'å¤çç»æ', |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | options: getDictOptions(DICT_TYPE.IM_FRIEND_REQUEST_HANDLE_RESULT, 'number'), |
| | | placeholder: 'è¯·éæ©å¤çç»æ', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'addSource', |
| | | label: 'æ·»å æ¥æº', |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | options: getDictOptions(DICT_TYPE.IM_FRIEND_ADD_SOURCE, 'number'), |
| | | placeholder: 'è¯·éæ©æ·»å æ¥æº', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'createTime', |
| | | label: 'å建æ¶é´', |
| | | component: 'RangePicker', |
| | | componentProps: { |
| | | ...getRangePickerDefaultProps(), |
| | | allowClear: true, |
| | | }, |
| | | }, |
| | | ]; |
| | | } |
| | | |
| | | /** 好åç³è¯·åè¡¨åæ®µ */ |
| | | export function useFriendRequestGridColumns(): VxeTableGridOptions['columns'] { |
| | | return [ |
| | | { |
| | | field: 'id', |
| | | title: 'ç¼å·', |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: 'åèµ·æ¹', |
| | | minWidth: 180, |
| | | slots: { default: 'fromUser' }, |
| | | }, |
| | | { |
| | | title: 'æ¥æ¶æ¹', |
| | | minWidth: 180, |
| | | slots: { default: 'toUser' }, |
| | | }, |
| | | { |
| | | field: 'applyContent', |
| | | title: 'ç³è¯·çç±', |
| | | minWidth: 160, |
| | | }, |
| | | { |
| | | field: 'displayName', |
| | | title: '夿³¨', |
| | | minWidth: 120, |
| | | }, |
| | | { |
| | | field: 'addSource', |
| | | title: 'æ·»å æ¥æº', |
| | | width: 120, |
| | | cellRender: { |
| | | name: 'CellDict', |
| | | props: { type: DICT_TYPE.IM_FRIEND_ADD_SOURCE }, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'handleResult', |
| | | title: 'å¤çç»æ', |
| | | width: 110, |
| | | cellRender: { |
| | | name: 'CellDict', |
| | | props: { type: DICT_TYPE.IM_FRIEND_REQUEST_HANDLE_RESULT }, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'handleContent', |
| | | title: 'å¤ççç±', |
| | | minWidth: 140, |
| | | }, |
| | | { |
| | | field: 'handleTime', |
| | | title: 'å¤çæ¶é´', |
| | | minWidth: 180, |
| | | formatter: 'formatDateTime', |
| | | }, |
| | | { |
| | | field: 'createTime', |
| | | title: 'å建æ¶é´', |
| | | minWidth: 180, |
| | | formatter: 'formatDateTime', |
| | | }, |
| | | ]; |
| | | } |