From 3f6c4053765edcb203dc3f87344b53e130de7502 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 16 Oct 2025 14:00:53 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=B8=85=E7=90=86=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=9A=84=20buttonStyle:=20'solid',=20=E3=80=90ele?= =?UTF-8?q?=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/mall/promotion/banner/data.ts | 46 +++++++++++------ .../src/views/mall/promotion/banner/index.vue | 20 +++++--- .../mall/promotion/banner/modules/form.vue | 5 +- .../views/_core/profile/modules/base-info.vue | 2 - apps/web-ele/src/views/infra/config/data.ts | 2 - .../src/views/infra/demo/demo01/data.ts | 2 - .../src/views/infra/demo/demo03/erp/data.ts | 2 - .../src/views/infra/demo/demo03/inner/data.ts | 2 - .../views/infra/demo/demo03/normal/data.ts | 2 - .../src/views/infra/fileConfig/data.ts | 6 --- .../src/views/mall/product/brand/data.ts | 2 - .../src/views/mall/product/category/data.ts | 2 - .../mall/promotion/article/category/data.ts | 2 - .../src/views/mall/promotion/article/data.ts | 6 --- .../src/views/mall/promotion/banner/data.ts | 51 +++++++++++-------- .../src/views/mall/promotion/banner/index.vue | 16 ++++-- .../mall/promotion/banner/modules/form.vue | 5 +- .../mall/promotion/coupon/template/data.ts | 2 - .../mall/promotion/seckill/config/data.ts | 2 - .../views/mall/trade/delivery/express/data.ts | 2 - .../trade/delivery/expressTemplate/data.ts | 2 - .../mall/trade/delivery/pickUpStore/data.ts | 2 - .../src/views/mall/trade/order/data.ts | 2 - apps/web-ele/src/views/member/group/data.ts | 2 - apps/web-ele/src/views/member/level/data.ts | 2 - .../src/views/member/signin/config/data.ts | 2 - apps/web-ele/src/views/member/user/data.ts | 8 --- .../views/pay/wallet/rechargePackage/data.ts | 2 - apps/web-ele/src/views/system/dept/data.ts | 2 - apps/web-ele/src/views/system/dict/data.ts | 4 -- .../src/views/system/mail/account/data.ts | 4 -- .../src/views/system/mail/template/data.ts | 2 - apps/web-ele/src/views/system/menu/data.ts | 8 --- apps/web-ele/src/views/system/notice/data.ts | 4 -- .../src/views/system/notify/template/data.ts | 2 - .../src/views/system/oauth2/client/data.ts | 2 - apps/web-ele/src/views/system/post/data.ts | 2 - apps/web-ele/src/views/system/role/data.ts | 2 - .../src/views/system/sms/channel/data.ts | 2 - .../src/views/system/sms/template/data.ts | 2 - .../src/views/system/social/client/data.ts | 4 -- apps/web-ele/src/views/system/tenant/data.ts | 2 - .../src/views/system/tenantPackage/data.ts | 2 - apps/web-ele/src/views/system/user/data.ts | 4 -- 44 files changed, 89 insertions(+), 160 deletions(-) diff --git a/apps/web-antd/src/views/mall/promotion/banner/data.ts b/apps/web-antd/src/views/mall/promotion/banner/data.ts index ae1a8eab0..f1b166ee4 100644 --- a/apps/web-antd/src/views/mall/promotion/banner/data.ts +++ b/apps/web-antd/src/views/mall/promotion/banner/data.ts @@ -1,17 +1,19 @@ -import type { VbenFormSchema } from '#/adapter/form'; -import type { VxeGridPropTypes } from '#/adapter/vxe-table'; +import type { VxeTableGridOptions } from '@vben/plugins/vxe-table'; -import { DICT_TYPE } from '@vben/constants'; +import type { VbenFormSchema } from '#/adapter/form'; + +import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; import { getDictOptions } from '@vben/hooks'; +import { z } from '#/adapter/form'; import { getRangePickerDefaultProps } from '#/utils'; /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { return [ { - component: 'Input', fieldName: 'id', + component: 'Input', dependencies: { triggerFields: [''], show: () => false, @@ -19,14 +21,20 @@ export function useFormSchema(): VbenFormSchema[] { }, { fieldName: 'title', - label: 'Banner标题', + label: 'Banner 标题', component: 'Input', + componentProps: { + placeholder: '请输入 Banner 标题', + }, rules: 'required', }, { fieldName: 'picUrl', label: '图片地址', component: 'ImageUpload', + componentProps: { + placeholder: '请上传图片', + }, rules: 'required', }, { @@ -44,6 +52,9 @@ export function useFormSchema(): VbenFormSchema[] { fieldName: 'url', label: '跳转地址', component: 'Input', + componentProps: { + placeholder: '请输入跳转地址', + }, rules: 'required', }, { @@ -65,7 +76,7 @@ export function useFormSchema(): VbenFormSchema[] { buttonStyle: 'solid', optionType: 'button', }, - rules: 'required', + rules: z.number().default(CommonStatusEnum.ENABLE), }, { fieldName: 'memo', @@ -84,18 +95,18 @@ export function useGridFormSchema(): VbenFormSchema[] { return [ { fieldName: 'title', - label: 'Banner标题', + label: 'Banner 标题', component: 'Input', componentProps: { - placeholder: '请输入Banner标题', + placeholder: '请输入 Banner 标题', }, }, { fieldName: 'status', - label: '状态', + label: '活动状态', component: 'Select', componentProps: { - placeholder: '请选择状态', + placeholder: '请选择活动状态', options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), }, }, @@ -112,16 +123,17 @@ export function useGridFormSchema(): VbenFormSchema[] { } /** 表格列配置 */ -export function useGridColumns(): VxeGridPropTypes.Columns { +export function useGridColumns(): VxeTableGridOptions['columns'] { return [ { title: 'Banner标题', field: 'title', + minWidth: 100, }, { title: '图片', field: 'picUrl', - width: 80, + minWidth: 80, cellRender: { name: 'CellImage', }, @@ -129,7 +141,7 @@ export function useGridColumns(): VxeGridPropTypes.Columns { { title: '状态', field: 'status', - width: 150, + minWidth: 150, cellRender: { name: 'CellDictTag', props: { @@ -140,7 +152,7 @@ export function useGridColumns(): VxeGridPropTypes.Columns { { title: '定位', field: 'position', - width: 150, + minWidth: 150, cellRender: { name: 'CellDictTag', props: { @@ -151,21 +163,23 @@ export function useGridColumns(): VxeGridPropTypes.Columns { { title: '跳转地址', field: 'url', + minWidth: 200, }, { title: '创建时间', field: 'createTime', - width: 180, + minWidth: 180, formatter: 'formatDateTime', }, { title: '排序', field: 'sort', - width: 100, + minWidth: 100, }, { title: '描述', field: 'memo', + minWidth: 150, }, { title: '操作', diff --git a/apps/web-antd/src/views/mall/promotion/banner/index.vue b/apps/web-antd/src/views/mall/promotion/banner/index.vue index e80f7f3a6..6b8549437 100644 --- a/apps/web-antd/src/views/mall/promotion/banner/index.vue +++ b/apps/web-antd/src/views/mall/promotion/banner/index.vue @@ -2,7 +2,7 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MallBannerApi } from '#/api/mall/market/banner'; -import { Page, useVbenModal } from '@vben/common-ui'; +import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; import { message } from 'ant-design-vue'; @@ -23,17 +23,17 @@ function handleRefresh() { gridApi.query(); } -/** 创建Banner */ +/** 创建 Banner */ function handleCreate() { formModalApi.setData(null).open(); } -/** 编辑Banner */ +/** 编辑 Banner */ function handleEdit(row: MallBannerApi.Banner) { formModalApi.setData(row).open(); } -/** 删除Banner */ +/** 删除 Banner */ async function handleDelete(row: MallBannerApi.Banner) { const hideLoading = message.loading({ content: $t('ui.actionMessage.deleting', [row.title]), @@ -41,9 +41,7 @@ async function handleDelete(row: MallBannerApi.Banner) { }); try { await deleteBanner(row.id as number); - message.success({ - content: $t('ui.actionMessage.deleteSuccess', [row.title]), - }); + message.success($t('ui.actionMessage.deleteSuccess', [row.title])); handleRefresh(); } finally { hideLoading(); @@ -71,6 +69,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, rowConfig: { keyField: 'id', + isHover: true, }, toolbarConfig: { refresh: true, @@ -82,6 +81,13 @@ const [Grid, gridApi] = useVbenVxeGrid({