mirror of
https://gitee.com/yudaocode/yudao-ui-admin-vben.git
synced 2025-12-30 10:32:25 +00:00
feat:【ele】【mall】rewardActivity 代码对齐 antd
This commit is contained in:
@@ -54,6 +54,7 @@ async function handleClose(row: MallRewardActivityApi.RewardActivity) {
|
||||
}
|
||||
}
|
||||
|
||||
/** 删除满减送活动 */
|
||||
async function handleDelete(row: MallRewardActivityApi.RewardActivity) {
|
||||
const loadingInstance = ElLoading.service({
|
||||
text: $t('ui.actionMessage.deleting', [row.name]),
|
||||
@@ -120,16 +121,16 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
:actions="[
|
||||
{
|
||||
label: $t('common.edit'),
|
||||
type: 'link',
|
||||
type: 'primary',
|
||||
link: true,
|
||||
icon: ACTION_ICON.EDIT,
|
||||
auth: ['promotion:reward-activity:update'],
|
||||
onClick: handleEdit.bind(null, row),
|
||||
},
|
||||
// TODO @puhui999:下面两个按钮,type、danger 属性无效,应该是 el 不是这个哈。
|
||||
{
|
||||
label: '关闭',
|
||||
type: 'link',
|
||||
danger: true,
|
||||
type: 'danger',
|
||||
link: true,
|
||||
icon: ACTION_ICON.CLOSE,
|
||||
auth: ['promotion:reward-activity:close'],
|
||||
ifShow: row.status === CommonStatusEnum.ENABLE,
|
||||
@@ -140,8 +141,8 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
},
|
||||
{
|
||||
label: $t('common.delete'),
|
||||
type: 'link',
|
||||
danger: true,
|
||||
type: 'danger',
|
||||
link: true,
|
||||
icon: ACTION_ICON.DELETE,
|
||||
auth: ['promotion:reward-activity:delete'],
|
||||
popConfirm: {
|
||||
|
||||
@@ -72,22 +72,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
item.limit = convertToInteger(item.limit || 0);
|
||||
}
|
||||
});
|
||||
switch (data.productScope) {
|
||||
// TODO @puhui999:是不是也可以类似优惠劵的处理策略哈;
|
||||
case PromotionProductScopeEnum.CATEGORY.scope: {
|
||||
const categoryIds = data.productCategoryIds;
|
||||
data.productScopeValues = Array.isArray(categoryIds)
|
||||
? categoryIds
|
||||
: categoryIds
|
||||
? [categoryIds]
|
||||
: [];
|
||||
break;
|
||||
}
|
||||
case PromotionProductScopeEnum.SPU.scope: {
|
||||
data.productScopeValues = data.productSpuIds;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// productScopeValues 已通过 data.ts 中的 dependencies.trigger 自动同步到表单值中
|
||||
await (data.id
|
||||
? updateRewardActivity(data as MallRewardActivityApi.RewardActivity)
|
||||
: createRewardActivity(data as MallRewardActivityApi.RewardActivity));
|
||||
|
||||
@@ -130,7 +130,7 @@ onMounted(async () => {
|
||||
<span class="text-gray-500">送</span>
|
||||
<ElInputNumber
|
||||
v-model="item.giveCount"
|
||||
class="!w-20"
|
||||
class="!w-32"
|
||||
:min="0"
|
||||
:step="1"
|
||||
/>
|
||||
|
||||
@@ -58,8 +58,7 @@ function handleDelete(ruleIndex: number) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- TODO @puhui999:这里报错了;idea -->
|
||||
<ElRow :gutter="[16, 16]">
|
||||
<ElRow :gutter="16">
|
||||
<template v-if="formData.rules">
|
||||
<ElCol v-for="(rule, index) in formData.rules" :key="index" :span="24">
|
||||
<ElCard size="small" class="rounded-lg">
|
||||
@@ -174,9 +173,9 @@ function handleDelete(ruleIndex: number) {
|
||||
</template>
|
||||
|
||||
<!-- 添加规则按钮 -->
|
||||
<Col :span="24" class="mt-2">
|
||||
<Button type="primary" @click="handleAdd">+ 添加优惠规则</Button>
|
||||
</Col>
|
||||
<ElCol :span="24" class="mt-2">
|
||||
<ElButton type="primary" @click="handleAdd">+ 添加优惠规则</ElButton>
|
||||
</ElCol>
|
||||
|
||||
<!-- 提示信息 -->
|
||||
<ElCol :span="24" class="mt-2">
|
||||
|
||||
Reference in New Issue
Block a user