mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 04:29:20 +08:00
fix: 修复推广费编辑弹窗 feeDate 类型错误导致 DatePicker 报错
This commit is contained in:
+9
-4
@@ -6,7 +6,9 @@ import type {
|
|||||||
} from '#/api/ecommerce/promotion-fee/types';
|
} from '#/api/ecommerce/promotion-fee/types';
|
||||||
import type { ShopVO } from '#/api/ecommerce/shop/types';
|
import type { ShopVO } from '#/api/ecommerce/shop/types';
|
||||||
|
|
||||||
import { onMounted, ref, watch } from 'vue';
|
import { nextTick, onMounted, ref, watch } from 'vue';
|
||||||
|
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
|
|
||||||
@@ -111,8 +113,10 @@ const feeTypeListLoading = ref(false);
|
|||||||
// 监听props变化
|
// 监听props变化
|
||||||
watch(
|
watch(
|
||||||
() => props.open,
|
() => props.open,
|
||||||
(newVal) => {
|
async (newVal) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
|
// 等渲染周期完成后再 open,避免 Slot 依赖追踪失效
|
||||||
|
await nextTick();
|
||||||
modalApi.open();
|
modalApi.open();
|
||||||
isEdit.value = !!props.promotionFeeData;
|
isEdit.value = !!props.promotionFeeData;
|
||||||
if (props.promotionFeeData) {
|
if (props.promotionFeeData) {
|
||||||
@@ -129,7 +133,9 @@ watch(
|
|||||||
clickCount: props.promotionFeeData.clickCount,
|
clickCount: props.promotionFeeData.clickCount,
|
||||||
impressionCount: props.promotionFeeData.impressionCount,
|
impressionCount: props.promotionFeeData.impressionCount,
|
||||||
conversionCount: props.promotionFeeData.conversionCount,
|
conversionCount: props.promotionFeeData.conversionCount,
|
||||||
feeDate: props.promotionFeeData.feeDate,
|
feeDate: props.promotionFeeData.feeDate
|
||||||
|
? dayjs(props.promotionFeeData.feeDate)
|
||||||
|
: undefined,
|
||||||
remark: props.promotionFeeData.remark || '',
|
remark: props.promotionFeeData.remark || '',
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
@@ -140,7 +146,6 @@ watch(
|
|||||||
modalApi.close();
|
modalApi.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true },
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// 加载店铺列表
|
// 加载店铺列表
|
||||||
|
|||||||
Reference in New Issue
Block a user