From 982c97ab82f3beb1b4febcf014562eda34b9fc05 Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期二, 29 九月 2026 17:59:41 +0800
Subject: [PATCH] feat(ui): 江苏商贸品牌视觉与首页/登录页改版

---
 src/views/wxcp/activity/data.ts |  240 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 240 insertions(+), 0 deletions(-)

diff --git a/src/views/wxcp/activity/data.ts b/src/views/wxcp/activity/data.ts
new file mode 100644
index 0000000..da4118e
--- /dev/null
+++ b/src/views/wxcp/activity/data.ts
@@ -0,0 +1,240 @@
+import type { VbenFormSchema } from '#/adapter/form';
+import type { VxeTableGridOptions } from '#/adapter/vxe-table';
+import type { WxCpActivityApi } from '#/api/wxcp/activity';
+
+import {
+  ACTIVITY_STATUS_OPTIONS,
+  PUSH_SCOPE_OPTIONS,
+  PUSH_STATUS_OPTIONS,
+  SIGNUP_STATUS_OPTIONS,
+} from '../data';
+
+/** 琛ㄥ崟绫诲瀷 */
+export type ActivityFormType = 'create' | 'update' | 'detail';
+
+const DATETIME_PROPS = {
+  showTime: true,
+  valueFormat: 'YYYY-MM-DD HH:mm:ss',
+  format: 'YYYY-MM-DD HH:mm:ss',
+} as const;
+
+/** 娲诲姩琛ㄥ崟 */
+export function useActivityFormSchema(
+  formType: ActivityFormType,
+): VbenFormSchema[] {
+  const readonly = formType === 'detail';
+  return [
+    {
+      fieldName: 'id',
+      component: 'Input',
+      dependencies: { triggerFields: [''], show: () => false },
+    },
+    {
+      fieldName: 'title',
+      label: '娲诲姩鏍囬',
+      component: 'Input',
+      componentProps: {
+        placeholder: '璇疯緭鍏ユ椿鍔ㄦ爣棰�',
+        disabled: readonly,
+      },
+      rules: 'required',
+      formItemClass: 'col-span-2',
+    },
+    {
+      fieldName: 'location',
+      label: '娲诲姩鍦扮偣',
+      component: 'Input',
+      componentProps: { placeholder: '濡傦細鍏徃澶т細璁', disabled: readonly },
+      formItemClass: 'col-span-2',
+    },
+    {
+      fieldName: 'startTime',
+      label: '娲诲姩寮�濮�',
+      component: 'DatePicker',
+      componentProps: { ...DATETIME_PROPS, disabled: readonly },
+    },
+    {
+      fieldName: 'endTime',
+      label: '娲诲姩缁撴潫',
+      component: 'DatePicker',
+      componentProps: { ...DATETIME_PROPS, disabled: readonly },
+    },
+    {
+      fieldName: 'signupStartTime',
+      label: '鎶ュ悕寮�濮�',
+      component: 'DatePicker',
+      componentProps: { ...DATETIME_PROPS, disabled: readonly },
+    },
+    {
+      fieldName: 'signupEndTime',
+      label: '鎶ュ悕鎴',
+      component: 'DatePicker',
+      componentProps: { ...DATETIME_PROPS, disabled: readonly },
+    },
+    {
+      fieldName: 'signupLimit',
+      label: '鎶ュ悕涓婇檺',
+      component: 'InputNumber',
+      componentProps: {
+        placeholder: '涓嶉檺璇峰~ 0',
+        min: 0,
+        class: 'w-full',
+        disabled: readonly,
+      },
+      rules: 'required',
+      help: '濉� 0 琛ㄧず涓嶉檺鍚嶉',
+    },
+    {
+      fieldName: 'coverUrl',
+      label: '灏侀潰鍥�',
+      component: 'Input',
+      componentProps: { placeholder: '灏侀潰鍥惧湴鍧�锛堥�夊~锛�', disabled: readonly },
+      formItemClass: 'col-span-2',
+    },
+    {
+      fieldName: 'content',
+      label: '娲诲姩璇︽儏',
+      component: 'Textarea',
+      componentProps: {
+        rows: 4,
+        placeholder: '娲诲姩浠嬬粛銆佹敞鎰忎簨椤圭瓑锛堟姤鍚嶉〉鎸夌函鏂囨湰灞曠ず锛�',
+        disabled: readonly,
+      },
+      formItemClass: 'col-span-2',
+    },
+    {
+      fieldName: 'remark',
+      label: '澶囨敞',
+      component: 'Textarea',
+      componentProps: { rows: 2, placeholder: '鍐呴儴澶囨敞锛屼笉灞曠ず缁欐垚鍛�', disabled: readonly },
+      formItemClass: 'col-span-2',
+    },
+  ];
+}
+
+/** 娲诲姩鎼滅储琛ㄥ崟 */
+export function useActivitySearchFormSchema(): VbenFormSchema[] {
+  return [
+    {
+      fieldName: 'title',
+      label: '娲诲姩鏍囬',
+      component: 'Input',
+      componentProps: { allowClear: true, placeholder: '璇疯緭鍏ユ椿鍔ㄦ爣棰�' },
+    },
+    {
+      fieldName: 'status',
+      label: '鐘舵��',
+      component: 'Select',
+      componentProps: {
+        allowClear: true,
+        options: ACTIVITY_STATUS_OPTIONS,
+        placeholder: '璇烽�夋嫨鐘舵��',
+      },
+    },
+    {
+      fieldName: 'pushStatus',
+      label: '鎺ㄩ�佺姸鎬�',
+      component: 'Select',
+      componentProps: {
+        allowClear: true,
+        options: PUSH_STATUS_OPTIONS,
+        placeholder: '璇烽�夋嫨鎺ㄩ�佺姸鎬�',
+      },
+    },
+  ];
+}
+
+/** 娲诲姩鍒楄〃瀛楁 */
+export function useActivityGridColumns(): VxeTableGridOptions<WxCpActivityApi.Activity>['columns'] {
+  return [
+    {
+      field: 'title',
+      title: '娲诲姩鏍囬',
+      minWidth: 200,
+      slots: { default: 'title' },
+    },
+    { field: 'location', title: '娲诲姩鍦扮偣', minWidth: 140 },
+    { field: 'startTime', title: '娲诲姩寮�濮�', width: 170 },
+    { field: 'endTime', title: '娲诲姩缁撴潫', width: 170 },
+    {
+      field: 'signupCount',
+      title: '鎶ュ悕/涓婇檺',
+      width: 110,
+      slots: { default: 'signupCount' },
+    },
+    {
+      field: 'status',
+      title: '鐘舵��',
+      width: 90,
+      slots: { default: 'status' },
+    },
+    {
+      field: 'pushStatus',
+      title: '鎺ㄩ��',
+      width: 90,
+      slots: { default: 'pushStatus' },
+    },
+    { field: 'createTime', title: '鍒涘缓鏃堕棿', width: 170 },
+    { title: '鎿嶄綔', width: 300, fixed: 'right', slots: { default: 'actions' } },
+  ];
+}
+
+/** 鎶ュ悕璁板綍鎼滅储琛ㄥ崟 */
+export function useSignupSearchFormSchema(): VbenFormSchema[] {
+  return [
+    {
+      fieldName: 'name',
+      label: '濮撳悕',
+      component: 'Input',
+      componentProps: { allowClear: true, placeholder: '璇疯緭鍏ュ鍚�' },
+    },
+    {
+      fieldName: 'mobile',
+      label: '鎵嬫満鍙�',
+      component: 'Input',
+      componentProps: { allowClear: true, placeholder: '璇疯緭鍏ユ墜鏈哄彿' },
+    },
+    {
+      fieldName: 'status',
+      label: '鐘舵��',
+      component: 'Select',
+      componentProps: {
+        allowClear: true,
+        options: SIGNUP_STATUS_OPTIONS,
+        placeholder: '璇烽�夋嫨鐘舵��',
+      },
+    },
+  ];
+}
+
+/** 鎶ュ悕璁板綍鍒楄〃瀛楁 */
+export function useSignupGridColumns(): VxeTableGridOptions<WxCpActivityApi.Signup>['columns'] {
+  return [
+    { field: 'name', title: '濮撳悕', minWidth: 100 },
+    { field: 'mobile', title: '鎵嬫満鍙�', width: 130 },
+    { field: 'deptName', title: '閮ㄩ棬', minWidth: 120 },
+    { field: 'wxUserId', title: '浼佷笟寰俊璐﹀彿', minWidth: 110 },
+    {
+      field: 'content',
+      title: '鍙備笌璇存槑',
+      minWidth: 160,
+      slots: { default: 'content' },
+    },
+    {
+      field: 'attachment',
+      title: '闄勪欢',
+      width: 80,
+      slots: { default: 'attachment' },
+    },
+    {
+      field: 'status',
+      title: '鐘舵��',
+      width: 90,
+      slots: { default: 'status' },
+    },
+    { field: 'signupTime', title: '鎶ュ悕鏃堕棿', width: 170 },
+    { field: 'checkInTime', title: '绛惧埌鏃堕棿', width: 170 },
+    { title: '鎿嶄綔', width: 150, fixed: 'right', slots: { default: 'actions' } },
+  ];
+}
+

--
Gitblit v1.9.3