Commit 22f66055 authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复 echo 属性存在时,还回填了默认地址的问题

parent 919dd2ff
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-05 10:28:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-12-02 15:35:07
* @LastEditTime: 2021-12-02 18:09:57
* @Description: 地址选择 FormItem
*/
import React, { useState, useEffect, useMemo, useRef } from 'react';
......@@ -218,6 +218,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
&& value
&& value.id
&& !listArr.find((item) => item.id === value.id)
&& !echo
) {
if (!('value' in props)) {
setInternalValue(undefined);
......@@ -226,7 +227,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
triggerChange(undefined);
}
if (isDefaultAddress && defaultItem && !disabled && editable && !actionFlagRef.current) {
if (isDefaultAddress && defaultItem && !disabled && editable && !actionFlagRef.current && !echo) {
const { shipperName, receiverName, ...rest } = defaultItem;
const next = {
name: shipperName || receiverName,
......@@ -378,7 +379,6 @@ const AddressSelect: React.FC<IProps> = (props) => {
flag: true,
};
});
handleVisibleDrawer(false);
}
setSubmitLoading(false);
} catch (error) {
......@@ -428,7 +428,6 @@ const AddressSelect: React.FC<IProps> = (props) => {
flag: true,
};
});
handleVisibleDrawer(false);
}
setSubmitLoading(false);
} catch (error) {
......@@ -440,6 +439,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
setInternalValue(next);
}
triggerChange(next);
handleVisibleDrawer(false);
};
const useFields = (): any => (
......
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