Commit 6c43376a authored by Bill's avatar Bill

fix: 装修页添加uuid解决formilyValue 无法重新设置问题

parent 6cbd3a90
......@@ -143,4 +143,24 @@ export const ACTIVITY_LIST = [
ACTIVITY_ATTEMPT
] as const
export const ACTIVITY_NAME_TO_NUMBER = {
[ACTIVITY_SPECIALOFFER]: ACTIVITY_SPECIALOFFER_NUMBER,
[ACTIVITY_PLUMMET]: ACTIVITY_PLUMMET_NUMBER,
[ACTIVITY_DISCOUNT]: ACTIVITY_DISCOUNT_NUMBER,
[ACTIVITY_FULLQUANTITYSUB]: ACTIVITY_FULLQUANTITYSUB_NUMBER,
[ACTIVITY_FULLQUANTITYDISCOUNT]: ACTIVITY_FULLQUANTITYDISCOUNT_NUMBER,
[ACTIVITY_FULLMONEYSUB]: ACTIVITY_FULLMONEYSUB_NUMBER,
[ACTIVITY_FULLMONEYDISCOUNT]: ACTIVITY_FULLMONEYDISCOUNT_NUMBER,
[ACTIVITY_GIVEPRODUCT]: ACTIVITY_GIVEPRODUCT_NUMBER,
[ACTIVITY_GIVECOUPON]: ACTIVITY_GIVECOUPON_NUMBER,
[ACTIVITY_MOREPIECE]: ACTIVITY_MOREPIECE_NUMBER,
[ACTIVITY_COMBINATION]: ACTIVITY_COMBINATION_NUMBER,
[ACTIVITY_GROUPPURCHASE]: ACTIVITY_GROUPPURCHASE_NUMBER,
[ACTIVITY_BARGAIN]: ACTIVITY_BARGAIN_NUMBER,
[ACTIVITY_SECKILL]: ACTIVITY_SECKILL_NUMBER,
[ACTIVITY_FULLSWAP]: ACTIVITY_FULLSWAP_NUMBER,
[ACTIVITY_BUYSWAP]: ACTIVITY_BUYSWAP_NUMBER,
[ACTIVITY_PRESALE]: ACTIVITY_PRESALE_NUMBER,
[ACTIVITY_SETMEAL]: ACTIVITY_SETMEAL_NUMBER,
[ACTIVITY_ATTEMPT]: ACTIVITY_ATTEMPT_NUMBER
} as const
\ No newline at end of file
......@@ -74,7 +74,7 @@ interface ItemIprops {
}
const CouponItem: React.FC<ItemIprops> = (props: ItemIprops) => {
const Item: React.FC<ItemIprops> = (props: ItemIprops) => {
// const intl = useIntl();
const { children, className, ...other} = props;
const { onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver, getOperateState, ...rest} = other;
......@@ -86,13 +86,19 @@ const CouponItem: React.FC<ItemIprops> = (props: ItemIprops) => {
return (
<div className={cx(styles.item)}>
<div {...divProps} className={className}>
<CouponsItem money={denomination} isnull={!isNotNull} typeName={typeName} tag={tag} info={`${intl.formatMessage({ id: 'activityPage.fill' })+useConditionMoney+intl.formatMessage({ id: 'activityPage.availableUse' })}`} className={styles.couponItem} />
<CouponsItem
money={denomination}
isnull={!isNotNull}
typeName={typeName}
tag={tag}
info={`${intl.formatMessage({ id: 'activityPage.fill' })+useConditionMoney+intl.formatMessage({ id: 'activityPage.availableUse' })}`}
className={styles.couponItem} />
</div>
</div>
);
};
Coupon.Item = CouponItem;
Coupon.Item = Item;
export default Coupon;
......@@ -14,7 +14,7 @@ import FormilyProduct from '../EditPanelFormily/FormilyProduct';
import useGetSameKeys from '../../common/hooks/useGetSameKeys';
import NiceForm from '@/components/NiceForm';
import FormilyUpload from '@/components/UploadFiles/FormilyUploadFiles';
import { useIntl} from 'umi'
import { useIntl } from 'umi'
type SettingPanelType = {
......@@ -152,7 +152,8 @@ const EditPanelForm = () => {
setFormValue({
product: {
...selectedInfo.props,
}
},
uuid: Math.random()
});
setSchema(activityProducts);
} else {
......@@ -169,7 +170,7 @@ const EditPanelForm = () => {
: propsMapToValue?.[componentType];
setSchema(tempSchema);
setFormValue(tempFormValue);
setFormValue({...tempFormValue, uuid: Math.random()});
}
/** 16 种活动,请求是需要带上活动类型 */
const activityType = ACTIVITY_MAP[componentType] ? { activityType: ACTIVITY_MAP[componentType] } : {};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment