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

diff --git a/src/views/im/manager/channel/list/data.ts b/src/views/im/manager/channel/list/data.ts
new file mode 100644
index 0000000..b182db3
--- /dev/null
+++ b/src/views/im/manager/channel/list/data.ts
@@ -0,0 +1,157 @@
+import type { VbenFormSchema } from '#/adapter/form'
+import type { VxeTableGridOptions } from '#/adapter/vxe-table'
+
+import { CommonStatusEnum, DICT_TYPE } from '#/packages/constants/src'
+import { getDictOptions } from '#/packages/effects/hooks/src'
+
+import { z } from '#/adapter/form'
+
+/** 鏂板/淇敼鐨勮〃鍗� */
+export function useFormSchema(): VbenFormSchema[] {
+  return [
+    {
+      fieldName: 'id',
+      component: 'Input',
+      dependencies: {
+        triggerFields: [''],
+        show: () => false
+      }
+    },
+    {
+      fieldName: 'code',
+      label: '棰戦亾缂栫爜',
+      component: 'Input',
+      componentProps: {
+        placeholder: '濡� system_notice'
+      },
+      rules: z
+        .string({ message: '棰戦亾缂栫爜涓嶈兘涓虹┖' })
+        .regex(/^[a-z][a-z0-9_]*$/, '鍙兘鐢卞皬鍐欏瓧姣� / 鏁板瓧 / 涓嬪垝绾跨粍鎴愶紝涓斾互瀛楁瘝寮�澶�')
+    },
+    {
+      fieldName: 'name',
+      label: '棰戦亾鍚嶇О',
+      component: 'Input',
+      componentProps: {
+        placeholder: '濡� 绯荤粺鍏憡'
+      },
+      rules: 'required'
+    },
+    {
+      fieldName: 'avatar',
+      label: '棰戦亾澶村儚',
+      component: 'ImageUpload',
+      componentProps: {
+        maxNumber: 1
+      },
+      rules: 'required'
+    },
+    {
+      fieldName: 'sort',
+      label: '鎺掑簭',
+      component: 'InputNumber',
+      componentProps: {
+        min: 0
+      },
+      rules: z.number().default(0)
+    },
+    {
+      fieldName: 'status',
+      label: '鐘舵��',
+      component: 'RadioGroup',
+      componentProps: {
+        options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
+        buttonStyle: 'solid',
+        optionType: 'button'
+      },
+      rules: z.number().default(CommonStatusEnum.ENABLE)
+    }
+  ]
+}
+
+/** 鍒楄〃鐨勬悳绱㈣〃鍗� */
+export function useGridFormSchema(): VbenFormSchema[] {
+  return [
+    {
+      fieldName: 'code',
+      label: '缂栫爜',
+      component: 'Input',
+      componentProps: {
+        allowClear: true,
+        placeholder: '棰戦亾涓氬姟鐮�'
+      }
+    },
+    {
+      fieldName: 'name',
+      label: '鍚嶇О',
+      component: 'Input',
+      componentProps: {
+        allowClear: true,
+        placeholder: '棰戦亾鍚嶇О'
+      }
+    },
+    {
+      fieldName: 'status',
+      label: '鐘舵��',
+      component: 'Select',
+      componentProps: {
+        allowClear: true,
+        options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
+        placeholder: '璇烽�夋嫨鐘舵��'
+      }
+    }
+  ]
+}
+
+/** 鍒楄〃鐨勫瓧娈� */
+export function useGridColumns(): VxeTableGridOptions['columns'] {
+  return [
+    {
+      field: 'id',
+      title: '缂栧彿',
+      width: 80
+    },
+    {
+      field: 'avatar',
+      title: '澶村儚',
+      width: 80,
+      slots: { default: 'avatar' }
+    },
+    {
+      field: 'code',
+      title: '缂栫爜',
+      minWidth: 160
+    },
+    {
+      field: 'name',
+      title: '鍚嶇О',
+      minWidth: 140
+    },
+    {
+      field: 'sort',
+      title: '鎺掑簭',
+      width: 80
+    },
+    {
+      field: 'status',
+      title: '鐘舵��',
+      width: 100,
+      cellRender: {
+        name: 'CellDict',
+        props: { type: DICT_TYPE.COMMON_STATUS }
+      }
+    },
+    {
+      field: 'createTime',
+      title: '鍒涘缓鏃堕棿',
+      minWidth: 180,
+      formatter: 'formatDateTime'
+    },
+    {
+      title: '鎿嶄綔',
+      width: 160,
+      fixed: 'right',
+      slots: { default: 'actions' }
+    }
+  ]
+}

--
Gitblit v1.9.3