diff --git a/apps/web-ele/src/views/mall/promotion/seckill/activity/data.ts b/apps/web-ele/src/views/mall/promotion/seckill/activity/data.ts index a572eb4cb..b9e3a1d5d 100644 --- a/apps/web-ele/src/views/mall/promotion/seckill/activity/data.ts +++ b/apps/web-ele/src/views/mall/promotion/seckill/activity/data.ts @@ -59,8 +59,8 @@ export function useFormSchema(): VbenFormSchema[] { component: 'DatePicker', componentProps: { placeholder: '请选择活动开始时间', - showTime: false, - format: 'YYYY-MM-DD', + type: 'datetime', + format: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', class: 'w-full', }, @@ -72,8 +72,8 @@ export function useFormSchema(): VbenFormSchema[] { component: 'DatePicker', componentProps: { placeholder: '请选择活动结束时间', - showTime: false, - format: 'YYYY-MM-DD', + type: 'datetime', + format: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', class: 'w-full', }, @@ -85,7 +85,7 @@ export function useFormSchema(): VbenFormSchema[] { component: 'ApiSelect', componentProps: { placeholder: '请选择秒杀时段', - mode: 'multiple', + multiple: true, api: getSimpleSeckillConfigList, labelField: 'name', valueField: 'id', @@ -137,6 +137,12 @@ export function useFormSchema(): VbenFormSchema[] { }, formItemClass: 'col-span-2', }, + { + fieldName: 'spuId', + label: '秒杀商品', + component: 'Input', + formItemClass: 'col-span-2', + }, ]; } diff --git a/apps/web-ele/src/views/mall/promotion/seckill/activity/index.vue b/apps/web-ele/src/views/mall/promotion/seckill/activity/index.vue index d2c387912..8ac8f397d 100644 --- a/apps/web-ele/src/views/mall/promotion/seckill/activity/index.vue +++ b/apps/web-ele/src/views/mall/promotion/seckill/activity/index.vue @@ -4,8 +4,7 @@ import type { MallSeckillActivityApi } from '#/api/mall/promotion/seckill/seckil import { onMounted } from 'vue'; -import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; -import { $t } from '@vben/locales'; +import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; import { ElLoading, ElMessage, ElTag } from 'element-plus'; @@ -16,6 +15,7 @@ import { getSeckillActivityPage, } from '#/api/mall/promotion/seckill/seckillActivity'; import { getSimpleSeckillConfigList } from '#/api/mall/promotion/seckill/seckillConfig'; +import { $t } from '#/locales'; import { useGridColumns, useGridFormSchema } from './data'; import { formatConfigNames, formatTimeRange, setConfigList } from './formatter'; @@ -45,10 +45,16 @@ function handleCreate() { /** 关闭活动 */ async function handleClose(row: MallSeckillActivityApi.SeckillActivity) { - await confirm('确认关闭该秒杀活动吗?'); - await closeSeckillActivity(row.id as number); - ElMessage.success('关闭成功'); - handleRefresh(); + const loadingInstance = ElLoading.service({ + text: '活动关闭中...', + }); + try { + await closeSeckillActivity(row.id as number); + ElMessage.success('关闭成功'); + handleRefresh(); + } finally { + loadingInstance.close(); + } } /** 删除活动 */ @@ -84,10 +90,6 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, }, }, - // TODO @puhui999:antd 没有,是不是要统一哈。 - cellConfig: { - height: 250, - }, rowConfig: { keyField: 'id', isHover: true, @@ -165,8 +167,10 @@ onMounted(async () => { link: true, auth: ['promotion:seckill-activity:close'], ifShow: row.status === 0, - // TODO @puhui999:antd 这里是 popConfirm,看看要不要统一 - onClick: handleClose.bind(null, row), + popConfirm: { + title: '确认关闭该秒杀活动吗?', + confirm: handleClose.bind(null, row), + }, }, { label: $t('common.delete'), diff --git a/apps/web-ele/src/views/mall/promotion/seckill/activity/modules/form.vue b/apps/web-ele/src/views/mall/promotion/seckill/activity/modules/form.vue index 1ca3ec4a0..6575f396a 100644 --- a/apps/web-ele/src/views/mall/promotion/seckill/activity/modules/form.vue +++ b/apps/web-ele/src/views/mall/promotion/seckill/activity/modules/form.vue @@ -1,13 +1,20 @@ - - - + + + + + + + + 选择商品 + - - - - 秒杀活动商品: - - - 选择商品 - - - 已选择: {{ spuName }} - - + + + + + + + + + + + + + + + + + + + + - - - - - - - 商品图片 - SKU 名称 - 原价(元) - 秒杀库存 - 秒杀价格(元) - - - - - - - - - {{ sku.skuName }} - - - ¥{{ (sku.price / 100).toFixed(2) }} - - - - - - - - - - - - - - - - - + + +