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/message/data.ts |  254 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 254 insertions(+), 0 deletions(-)

diff --git a/src/views/im/manager/message/data.ts b/src/views/im/manager/message/data.ts
new file mode 100644
index 0000000..af92764
--- /dev/null
+++ b/src/views/im/manager/message/data.ts
@@ -0,0 +1,254 @@
+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 usePrivateGridFormSchema(): VbenFormSchema[] {
+  return [
+    {
+      fieldName: 'senderId',
+      label: '鍙戦�佷汉',
+      component: markRaw(UserSelect),
+      componentProps: {
+        placeholder: '璇烽�夋嫨鍙戦�佷汉',
+      },
+    },
+    {
+      fieldName: 'receiverId',
+      label: '鎺ユ敹浜�',
+      component: markRaw(UserSelect),
+      componentProps: {
+        placeholder: '璇烽�夋嫨鎺ユ敹浜�',
+      },
+    },
+    {
+      fieldName: 'type',
+      label: '鍐呭绫诲瀷',
+      component: 'Select',
+      componentProps: {
+        allowClear: true,
+        options: getDictOptions(DICT_TYPE.IM_CONTENT_TYPE, 'number'),
+        placeholder: '璇烽�夋嫨鍐呭绫诲瀷',
+      },
+    },
+    {
+      fieldName: 'content',
+      label: '娑堟伅鍐呭',
+      component: 'Input',
+      componentProps: {
+        allowClear: true,
+        placeholder: '璇疯緭鍏ユ秷鎭唴瀹�',
+      },
+    },
+    {
+      fieldName: 'sendTime',
+      label: '鍙戦�佹椂闂�',
+      component: 'RangePicker',
+      componentProps: {
+        ...getRangePickerDefaultProps(),
+        allowClear: true,
+      },
+    },
+  ];
+}
+
+/** 绉佽亰娑堟伅瀛楁 */
+export function usePrivateGridColumns(showReadColumns: boolean): VxeTableGridOptions['columns'] {
+  return [
+    {
+      field: 'id',
+      title: '缂栧彿',
+      width: 100,
+    },
+    {
+      title: '鍙戦�佷汉',
+      minWidth: 160,
+      slots: { default: 'sender' },
+    },
+    {
+      title: '鎺ユ敹浜�',
+      minWidth: 160,
+      slots: { default: 'receiver' },
+    },
+    {
+      field: 'type',
+      title: '绫诲瀷',
+      width: 100,
+      cellRender: {
+        name: 'CellDict',
+        props: { type: DICT_TYPE.IM_CONTENT_TYPE },
+      },
+    },
+    {
+      title: '鍐呭棰勮',
+      minWidth: 260,
+      align: 'left',
+      slots: { default: 'content' },
+    },
+    ...(showReadColumns
+      ? [
+          {
+            field: 'status',
+            title: '鐘舵��',
+            width: 100,
+            cellRender: {
+              name: 'CellDict',
+              props: { type: DICT_TYPE.IM_MESSAGE_STATUS },
+            },
+          },
+          {
+            field: 'receiptStatus',
+            title: '鍥炴墽',
+            width: 110,
+            cellRender: {
+              name: 'CellDict',
+              // 鍥炴墽鐘舵�侊紙绉佽亰 / 缇よ亰鍏辩敤 im_message_receipt_status锛夛紝涓庢簮绔�屽洖鎵с�嶅垪瀵归綈
+              props: { type: DICT_TYPE.IM_MESSAGE_RECEIPT_STATUS },
+            },
+          },
+        ]
+      : []),
+    {
+      field: 'sendTime',
+      title: '鍙戦�佹椂闂�',
+      minWidth: 180,
+      formatter: 'formatDateTime',
+    },
+    {
+      title: '鎿嶄綔',
+      width: 100,
+      fixed: 'right',
+      slots: { default: 'actions' },
+    },
+  ];
+}
+
+/** 缇よ亰娑堟伅鎼滅储琛ㄥ崟 */
+export function useGroupGridFormSchema(): VbenFormSchema[] {
+  return [
+    {
+      fieldName: 'groupId',
+      label: '缇�',
+      component: markRaw(GroupSelect),
+    },
+    {
+      fieldName: 'senderId',
+      label: '鍙戦�佷汉',
+      component: markRaw(UserSelect),
+      componentProps: {
+        placeholder: '璇烽�夋嫨鍙戦�佷汉',
+      },
+    },
+    {
+      fieldName: 'type',
+      label: '鍐呭绫诲瀷',
+      component: 'Select',
+      componentProps: {
+        allowClear: true,
+        options: getDictOptions(DICT_TYPE.IM_CONTENT_TYPE, 'number'),
+        placeholder: '璇烽�夋嫨鍐呭绫诲瀷',
+      },
+    },
+    {
+      fieldName: 'content',
+      label: '娑堟伅鍐呭',
+      component: 'Input',
+      componentProps: {
+        allowClear: true,
+        placeholder: '璇疯緭鍏ユ秷鎭唴瀹�',
+      },
+    },
+    {
+      fieldName: 'sendTime',
+      label: '鍙戦�佹椂闂�',
+      component: 'RangePicker',
+      componentProps: {
+        ...getRangePickerDefaultProps(),
+        allowClear: true,
+      },
+    },
+  ];
+}
+
+/** 缇よ亰娑堟伅瀛楁 */
+export function useGroupGridColumns(showReadColumns: boolean): VxeTableGridOptions['columns'] {
+  return [
+    {
+      field: 'id',
+      title: '缂栧彿',
+      width: 100,
+    },
+    {
+      title: '缇�',
+      minWidth: 160,
+      slots: { default: 'group' },
+    },
+    {
+      title: '鍙戦�佷汉',
+      minWidth: 160,
+      slots: { default: 'sender' },
+    },
+    {
+      field: 'type',
+      title: '绫诲瀷',
+      width: 100,
+      cellRender: {
+        name: 'CellDict',
+        props: { type: DICT_TYPE.IM_CONTENT_TYPE },
+      },
+    },
+    {
+      title: '@鐢ㄦ埛',
+      minWidth: 180,
+      slots: { default: 'atUsers' },
+    },
+    {
+      title: '鍐呭棰勮',
+      minWidth: 260,
+      align: 'left',
+      slots: { default: 'content' },
+    },
+    ...(showReadColumns
+      ? [
+          {
+            field: 'status',
+            title: '鐘舵��',
+            width: 100,
+            cellRender: {
+              name: 'CellDict',
+              props: { type: DICT_TYPE.IM_MESSAGE_STATUS },
+            },
+          },
+          {
+            field: 'receiptStatus',
+            title: '鍥炴墽',
+            width: 110,
+            cellRender: {
+              name: 'CellDict',
+              props: { type: DICT_TYPE.IM_MESSAGE_RECEIPT_STATUS },
+            },
+          },
+        ]
+      : []),
+    {
+      field: 'sendTime',
+      title: '鍙戦�佹椂闂�',
+      minWidth: 180,
+      formatter: 'formatDateTime',
+    },
+    {
+      title: '鎿嶄綔',
+      width: 100,
+      fixed: 'right',
+      slots: { default: 'actions' },
+    },
+  ];
+}

--
Gitblit v1.9.3