From b64a0deae5b5d33f9e20671a68936b27f0b9b00b Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 21 七月 2026 18:03:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_pro2.0' into dev_pro2.0
---
src/views/im/manager/group/data.ts | 255 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 255 insertions(+), 0 deletions(-)
diff --git a/src/views/im/manager/group/data.ts b/src/views/im/manager/group/data.ts
new file mode 100644
index 0000000..f3f58cb
--- /dev/null
+++ b/src/views/im/manager/group/data.ts
@@ -0,0 +1,255 @@
+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',
+ },
+ ];
+}
--
Gitblit v1.9.3