提交 af391b01 作者: 龚洪江

Merge branch 'master' into develop

...@@ -14,4 +14,4 @@ patches: ...@@ -14,4 +14,4 @@ patches:
images: images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG - name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly/admin newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly/admin
newTag: 794a651d8a2ae19cb46bf37a8e434a4f8040a80f newTag: 3018428edaf6324b1a6b636ac94c4202918e3b9c
...@@ -249,9 +249,7 @@ const SkuAddOrEditModal: FC<ModalProps & selfProps> = ({ ...@@ -249,9 +249,7 @@ const SkuAddOrEditModal: FC<ModalProps & selfProps> = ({
//新增一行规格值 //新增一行规格值
const addSkuDataRowClick = () => { const addSkuDataRowClick = () => {
const list = [ const tableItem = {
...tableData,
{
id: Math.random(), id: Math.random(),
channelPrice: 0, channelPrice: 0,
partNo: '', partNo: '',
...@@ -261,17 +259,11 @@ const SkuAddOrEditModal: FC<ModalProps & selfProps> = ({ ...@@ -261,17 +259,11 @@ const SkuAddOrEditModal: FC<ModalProps & selfProps> = ({
specValueName: '', specValueName: '',
stock: 0, stock: 0,
fileList: [], fileList: [],
}, };
]; setTableData([...tableData, tableItem]);
setTableData(list); //设置价格显示默认值
const obj = list.reduce((pre: any, cur: any) => { const obj = Object.create(null);
Object.getOwnPropertyNames(cur).forEach((key: string) => { obj[`showPrice${tableItem.id}`] = 1;
if (['showPrice'].includes(key)) {
pre[key + cur.id] = cur[key];
}
});
return pre;
}, {});
goodsSpecValuesForm.setFieldsValue(obj); goodsSpecValuesForm.setFieldsValue(obj);
}; };
//移除一行规格值 //移除一行规格值
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论