From 27cd042df9aca0383a49f3514bc21958dd890912 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 29 六月 2026 15:42:23 +0800
Subject: [PATCH] 银川 1.联调产品维护页面 2.添加IM即时通讯模块

---
 src/views/im/manager/friend/data.ts |  264 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 264 insertions(+), 0 deletions(-)

diff --git a/src/views/im/manager/friend/data.ts b/src/views/im/manager/friend/data.ts
new file mode 100644
index 0000000..a4e94d5
--- /dev/null
+++ b/src/views/im/manager/friend/data.ts
@@ -0,0 +1,264 @@
+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',
+    },
+  ];
+}

--
Gitblit v1.9.3