Commit cbcb7f83 authored by beisir's avatar beisir

fix: 提交图片保存字段

parent cf4e1b32
...@@ -296,6 +296,13 @@ export const ProcessEditData = (data, row) => { ...@@ -296,6 +296,13 @@ export const ProcessEditData = (data, row) => {
return origin; return origin;
}, {}); }, {});
let commonImageList = data.commonImageList || [];
let cardImageList = [];
if (data.productType === 4) {
const [firstImg, ...towAfterImgList] = oneItem.imageList || [];
cardImageList = towAfterImgList || [];
commonImageList = [firstImg];
}
const SourceData = { const SourceData = {
state: row.state, state: row.state,
id: data.id, id: data.id,
...@@ -321,14 +328,14 @@ export const ProcessEditData = (data, row) => { ...@@ -321,14 +328,14 @@ export const ProcessEditData = (data, row) => {
}, },
infoImageData: { infoImageData: {
imageList, imageList,
cardImageList: oneItem.imageList || [], cardImageList,
commonImageList: data.commonImageList, commonImageList,
detailImageList: data.detailImageList, detailImageList: data.detailImageList,
}, },
skuList: data.skuList, skuList: data.skuList,
...servesItemParams, ...servesItemParams,
}; };
console.log('SourceData===============>', SourceData);
return SourceData; return SourceData;
}; };
......
...@@ -81,7 +81,7 @@ const filterItems = (type, props) => { ...@@ -81,7 +81,7 @@ const filterItems = (type, props) => {
return infoSpecData.items.map(item => { return infoSpecData.items.map(item => {
if (type === 4) { if (type === 4) {
// 如果为服务类商品,默认取cardImageList,cardImageList为必选项目 // 如果为服务类商品,默认取cardImageList,cardImageList为必选项目
item.imageList = cardImageList; item.imageList = [...commonImageList, ...cardImageList];
} else { } else {
// 如果为虚拟或实体商品,默认取自己{}中对应的的,没有则取公共图 // 如果为虚拟或实体商品,默认取自己{}中对应的的,没有则取公共图
const imgList = imageList[item.firstSpecValue] || []; const imgList = imageList[item.firstSpecValue] || [];
...@@ -104,6 +104,7 @@ export const filterSendData = (type, params) => { ...@@ -104,6 +104,7 @@ export const filterSendData = (type, params) => {
console.log('===============>生成数据', params); console.log('===============>生成数据', params);
const { infoMation, infoImageData } = params; const { infoMation, infoImageData } = params;
const items = filterItems(type, params); const items = filterItems(type, params);
const commonImageList = type === 4 ? [] : infoImageData.commonImageList;
return { return {
type, type,
items, items,
...@@ -115,7 +116,7 @@ export const filterSendData = (type, params) => { ...@@ -115,7 +116,7 @@ export const filterSendData = (type, params) => {
categoryId: infoMation.categoryId[2], categoryId: infoMation.categoryId[2],
afterAddressId: infoMation.afterAddressId, afterAddressId: infoMation.afterAddressId,
detailImageList: infoImageData.detailImageList, detailImageList: infoImageData.detailImageList,
commonImageList: infoImageData.commonImageList, commonImageList,
}; };
}; };
......
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