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/notice/data.ts | 118 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 118 insertions(+), 0 deletions(-)
diff --git a/src/views/wxcp/notice/data.ts b/src/views/wxcp/notice/data.ts
new file mode 100644
index 0000000..470b00d
--- /dev/null
+++ b/src/views/wxcp/notice/data.ts
@@ -0,0 +1,118 @@
+import type { VbenFormSchema } from '#/adapter/form';
+import type { VxeTableGridOptions } from '#/adapter/vxe-table';
+import type { WxCpNoticeApi } from '#/api/wxcp/notice';
+
+import { NOTICE_STATUS_OPTIONS, PUSH_STATUS_OPTIONS } from '../data';
+
+/** 琛ㄥ崟绫诲瀷 */
+export type NoticeFormType = 'create' | 'update' | 'detail';
+
+/** 閫氱煡琛ㄥ崟 */
+export function useNoticeFormSchema(formType: NoticeFormType): 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: 'content',
+ label: '閫氱煡姝f枃',
+ component: 'Textarea',
+ componentProps: {
+ rows: 8,
+ placeholder: '璇疯緭鍏ラ�氱煡姝f枃',
+ disabled: readonly,
+ },
+ rules: 'required',
+ help: '鎺ㄩ�佹椂瓒呰繃 600 瀛椾細鑷姩鎴柇锛屽缓璁妸鍏抽敭淇℃伅鏀惧墠闈�',
+ formItemClass: 'col-span-2',
+ },
+ {
+ fieldName: 'remark',
+ label: '澶囨敞',
+ component: 'Textarea',
+ componentProps: { rows: 2, placeholder: '鍐呴儴澶囨敞锛屼笉鎺ㄩ��', disabled: readonly },
+ formItemClass: 'col-span-2',
+ },
+ ];
+}
+
+/** 閫氱煡鎼滅储琛ㄥ崟 */
+export function useNoticeSearchFormSchema(): VbenFormSchema[] {
+ return [
+ {
+ fieldName: 'title',
+ label: '閫氱煡鏍囬',
+ component: 'Input',
+ componentProps: { allowClear: true, placeholder: '璇疯緭鍏ラ�氱煡鏍囬' },
+ },
+ {
+ fieldName: 'status',
+ label: '鐘舵��',
+ component: 'Select',
+ componentProps: {
+ allowClear: true,
+ options: NOTICE_STATUS_OPTIONS,
+ placeholder: '璇烽�夋嫨鐘舵��',
+ },
+ },
+ {
+ fieldName: 'pushStatus',
+ label: '鎺ㄩ�佺姸鎬�',
+ component: 'Select',
+ componentProps: {
+ allowClear: true,
+ options: PUSH_STATUS_OPTIONS,
+ placeholder: '璇烽�夋嫨鎺ㄩ�佺姸鎬�',
+ },
+ },
+ ];
+}
+
+/** 閫氱煡鍒楄〃瀛楁 */
+export function useNoticeGridColumns(): VxeTableGridOptions<WxCpNoticeApi.Notice>['columns'] {
+ return [
+ {
+ field: 'title',
+ title: '閫氱煡鏍囬',
+ minWidth: 220,
+ slots: { default: 'title' },
+ },
+ {
+ field: 'content',
+ title: '姝f枃鎽樿',
+ minWidth: 260,
+ slots: { default: 'content' },
+ },
+ {
+ field: 'status',
+ title: '鐘舵��',
+ width: 90,
+ slots: { default: 'status' },
+ },
+ {
+ field: 'pushScopeName',
+ title: '鎺ㄩ�佽寖鍥�',
+ width: 110,
+ },
+ {
+ field: 'pushStatus',
+ title: '鎺ㄩ��',
+ width: 90,
+ slots: { default: 'pushStatus' },
+ },
+ { field: 'pushTime', title: '鎺ㄩ�佹椂闂�', width: 170 },
+ { field: 'createTime', title: '鍒涘缓鏃堕棿', width: 170 },
+ { title: '鎿嶄綔', width: 220, fixed: 'right', slots: { default: 'actions' } },
+ ];
+}
--
Gitblit v1.9.3