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

diff --git a/src/views/im/manager/face/pack/data.ts b/src/views/im/manager/face/pack/data.ts
new file mode 100644
index 0000000..143dfbe
--- /dev/null
+++ b/src/views/im/manager/face/pack/data.ts
@@ -0,0 +1,375 @@
+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';
+import { getRangePickerDefaultProps } from '#/utils';
+
+/** 琛ㄦ儏鍖呰〃鍗� */
+export function usePackFormSchema(): VbenFormSchema[] {
+  return [
+    {
+      fieldName: 'id',
+      component: 'Input',
+      dependencies: {
+        triggerFields: [''],
+        show: () => false,
+      },
+    },
+    {
+      fieldName: 'icon',
+      label: '灏侀潰',
+      component: 'ImageUpload',
+      componentProps: {
+        maxNumber: 1,
+      },
+    },
+    {
+      fieldName: 'name',
+      label: '鍚嶇О',
+      component: 'Input',
+      componentProps: {
+        maxlength: 64,
+        placeholder: '璇疯緭鍏ヨ〃鎯呭寘鍚嶇О',
+      },
+      rules: 'required',
+    },
+    {
+      fieldName: 'sort',
+      label: '鎺掑簭',
+      component: 'InputNumber',
+      componentProps: {
+        min: 0,
+        max: 9999,
+      },
+      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 usePackGridFormSchema(): VbenFormSchema[] {
+  return [
+    {
+      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: '璇烽�夋嫨鐘舵��',
+      },
+    },
+    {
+      fieldName: 'createTime',
+      label: '鍒涘缓鏃堕棿',
+      component: 'RangePicker',
+      componentProps: {
+        ...getRangePickerDefaultProps(),
+        allowClear: true,
+      },
+    },
+  ];
+}
+
+/** 琛ㄦ儏鍖呭瓧娈� */
+export function usePackGridColumns(): VxeTableGridOptions['columns'] {
+  return [
+    { type: 'checkbox', width: 40 },
+    {
+      field: 'id',
+      title: '缂栧彿',
+      width: 100,
+    },
+    {
+      field: 'icon',
+      title: '灏侀潰',
+      width: 80,
+      slots: { default: 'icon' },
+    },
+    {
+      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: 240,
+      fixed: 'right',
+      slots: { default: 'actions' },
+    },
+  ];
+}
+
+/** 琛ㄦ儏琛ㄥ崟 */
+export function useItemFormSchema(): VbenFormSchema[] {
+  return [
+    {
+      fieldName: 'id',
+      component: 'Input',
+      dependencies: {
+        triggerFields: [''],
+        show: () => false,
+      },
+    },
+    {
+      fieldName: 'packId',
+      component: 'Input',
+      dependencies: {
+        triggerFields: [''],
+        show: () => false,
+      },
+    },
+    {
+      fieldName: 'url',
+      label: '琛ㄦ儏鍥�',
+      component: 'ImageUpload',
+      componentProps: {
+        maxNumber: 1,
+      },
+      rules: 'required',
+    },
+    {
+      fieldName: 'name',
+      label: '琛ㄦ儏鍚�',
+      component: 'Input',
+      componentProps: {
+        maxlength: 64,
+        placeholder: '璇疯緭鍏ヨ〃鎯呭悕',
+      },
+    },
+    {
+      fieldName: 'width',
+      label: '瀹藉害',
+      component: 'InputNumber',
+      componentProps: {
+        min: 1,
+        max: 2048,
+      },
+      rules: 'required',
+    },
+    {
+      fieldName: 'height',
+      label: '楂樺害',
+      component: 'InputNumber',
+      componentProps: {
+        min: 1,
+        max: 2048,
+      },
+      rules: 'required',
+    },
+    {
+      fieldName: 'sort',
+      label: '鎺掑簭',
+      component: 'InputNumber',
+      componentProps: {
+        min: 0,
+        max: 9999,
+      },
+      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 useItemGridFormSchema(): VbenFormSchema[] {
+  return [
+    {
+      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 useItemGridColumns(): VxeTableGridOptions['columns'] {
+  return [
+    { type: 'checkbox', width: 40 },
+    {
+      field: 'id',
+      title: '缂栧彿',
+      width: 80,
+    },
+    {
+      field: 'url',
+      title: '琛ㄦ儏鍥�',
+      width: 80,
+      slots: { default: 'image' },
+    },
+    {
+      field: 'name',
+      title: '琛ㄦ儏鍚�',
+      minWidth: 140,
+    },
+    {
+      title: '灏哄',
+      width: 120,
+      slots: { default: 'size' },
+    },
+    {
+      field: 'sort',
+      title: '鎺掑簭',
+      width: 80,
+    },
+    {
+      field: 'status',
+      title: '鐘舵��',
+      width: 100,
+      cellRender: {
+        name: 'CellDict',
+        props: { type: DICT_TYPE.COMMON_STATUS },
+      },
+    },
+    {
+      title: '鎿嶄綔',
+      width: 160,
+      fixed: 'right',
+      slots: { default: 'actions' },
+    },
+  ];
+}
+
+/** 鐢ㄦ埛琛ㄦ儏鎼滅储琛ㄥ崟 */
+export function useUserItemGridFormSchema(): VbenFormSchema[] {
+  return [
+    {
+      fieldName: 'userId',
+      label: '鐢ㄦ埛缂栧彿',
+      component: 'InputNumber',
+      componentProps: {
+        allowClear: true,
+        placeholder: '璇疯緭鍏ョ敤鎴风紪鍙�',
+      },
+    },
+    {
+      fieldName: 'name',
+      label: '琛ㄦ儏鍚�',
+      component: 'Input',
+      componentProps: {
+        allowClear: true,
+        placeholder: '璇疯緭鍏ヨ〃鎯呭悕',
+      },
+    },
+    {
+      fieldName: 'createTime',
+      label: '娣诲姞鏃堕棿',
+      component: 'RangePicker',
+      componentProps: {
+        ...getRangePickerDefaultProps(),
+        allowClear: true,
+      },
+    },
+  ];
+}
+
+/** 鐢ㄦ埛琛ㄦ儏瀛楁 */
+export function useUserItemGridColumns(): VxeTableGridOptions['columns'] {
+  return [
+    {
+      field: 'id',
+      title: '缂栧彿',
+      width: 100,
+    },
+    {
+      field: 'url',
+      title: '琛ㄦ儏鍥�',
+      width: 80,
+      slots: { default: 'image' },
+    },
+    {
+      field: 'name',
+      title: '琛ㄦ儏鍚�',
+      minWidth: 140,
+    },
+    {
+      title: '鎵�灞炵敤鎴�',
+      minWidth: 180,
+      slots: { default: 'user' },
+    },
+    {
+      title: '灏哄',
+      width: 120,
+      slots: { default: 'size' },
+    },
+    {
+      field: 'createTime',
+      title: '娣诲姞鏃堕棿',
+      minWidth: 180,
+      formatter: 'formatDateTime',
+    },
+    {
+      title: '鎿嶄綔',
+      width: 100,
+      fixed: 'right',
+      slots: { default: 'actions' },
+    },
+  ];
+}

--
Gitblit v1.9.3