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) {
|
async function handleDelete(row: MallRewardActivityApi.RewardActivity) {
|
||||||
const loadingInstance = ElLoading.service({
|
const loadingInstance = ElLoading.service({
|
||||||
text: $t('ui.actionMessage.deleting', [row.name]),
|
text: $t('ui.actionMessage.deleting', [row.name]),
|
||||||
@@ -120,16 +121,16 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: $t('common.edit'),
|
label: $t('common.edit'),
|
||||||
type: 'link',
|
type: 'primary',
|
||||||
|
link: true,
|
||||||
icon: ACTION_ICON.EDIT,
|
icon: ACTION_ICON.EDIT,
|
||||||
auth: ['promotion:reward-activity:update'],
|
auth: ['promotion:reward-activity:update'],
|
||||||
onClick: handleEdit.bind(null, row),
|
onClick: handleEdit.bind(null, row),
|
||||||
},
|
},
|
||||||
// TODO @puhui999:下面两个按钮,type、danger 属性无效,应该是 el 不是这个哈。
|
|
||||||
{
|
{
|
||||||
label: '关闭',
|
label: '关闭',
|
||||||
type: 'link',
|
type: 'danger',
|
||||||
danger: true,
|
link: true,
|
||||||
icon: ACTION_ICON.CLOSE,
|
icon: ACTION_ICON.CLOSE,
|
||||||
auth: ['promotion:reward-activity:close'],
|
auth: ['promotion:reward-activity:close'],
|
||||||
ifShow: row.status === CommonStatusEnum.ENABLE,
|
ifShow: row.status === CommonStatusEnum.ENABLE,
|
||||||
@@ -140,8 +141,8 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: $t('common.delete'),
|
label: $t('common.delete'),
|
||||||
type: 'link',
|
type: 'danger',
|
||||||
danger: true,
|
link: true,
|
||||||
icon: ACTION_ICON.DELETE,
|
icon: ACTION_ICON.DELETE,
|
||||||
auth: ['promotion:reward-activity:delete'],
|
auth: ['promotion:reward-activity:delete'],
|
||||||
popConfirm: {
|
popConfirm: {
|
||||||
|
|||||||
@@ -72,22 +72,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
item.limit = convertToInteger(item.limit || 0);
|
item.limit = convertToInteger(item.limit || 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
switch (data.productScope) {
|
// productScopeValues 已通过 data.ts 中的 dependencies.trigger 自动同步到表单值中
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await (data.id
|
await (data.id
|
||||||
? updateRewardActivity(data as MallRewardActivityApi.RewardActivity)
|
? updateRewardActivity(data as MallRewardActivityApi.RewardActivity)
|
||||||
: createRewardActivity(data as MallRewardActivityApi.RewardActivity));
|
: createRewardActivity(data as MallRewardActivityApi.RewardActivity));
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ onMounted(async () => {
|
|||||||
<span class="text-gray-500">送</span>
|
<span class="text-gray-500">送</span>
|
||||||
<ElInputNumber
|
<ElInputNumber
|
||||||
v-model="item.giveCount"
|
v-model="item.giveCount"
|
||||||
class="!w-20"
|
class="!w-32"
|
||||||
:min="0"
|
:min="0"
|
||||||
:step="1"
|
:step="1"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -58,8 +58,7 @@ function handleDelete(ruleIndex: number) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!-- TODO @puhui999:这里报错了;idea -->
|
<ElRow :gutter="16">
|
||||||
<ElRow :gutter="[16, 16]">
|
|
||||||
<template v-if="formData.rules">
|
<template v-if="formData.rules">
|
||||||
<ElCol v-for="(rule, index) in formData.rules" :key="index" :span="24">
|
<ElCol v-for="(rule, index) in formData.rules" :key="index" :span="24">
|
||||||
<ElCard size="small" class="rounded-lg">
|
<ElCard size="small" class="rounded-lg">
|
||||||
@@ -174,9 +173,9 @@ function handleDelete(ruleIndex: number) {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- 添加规则按钮 -->
|
<!-- 添加规则按钮 -->
|
||||||
<Col :span="24" class="mt-2">
|
<ElCol :span="24" class="mt-2">
|
||||||
<Button type="primary" @click="handleAdd">+ 添加优惠规则</Button>
|
<ElButton type="primary" @click="handleAdd">+ 添加优惠规则</ElButton>
|
||||||
</Col>
|
</ElCol>
|
||||||
|
|
||||||
<!-- 提示信息 -->
|
<!-- 提示信息 -->
|
||||||
<ElCol :span="24" class="mt-2">
|
<ElCol :span="24" class="mt-2">
|
||||||
|
|||||||
Reference in New Issue
Block a user