Commit c11fbc7b authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:商品规格图片满足800*800、处理单属性多选显示异常

parent 27b4f3d2
......@@ -317,33 +317,46 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
const constructedPrarams = () => {
let _paramsArray: any[] = [];
// console.log('生成传输数据', combineAttributeArray, attributeObjArr, attributeValObjArr, tableDataSource)
Array.isArray(combineAttributeArray) ? combineAttributeArray.map((item, index)=>{ // 非数组情况下默认无组合 从table数据中获取 // 当属性减少的时候 这个combine数组还是之前的
Array.isArray(combineAttributeArray) ? combineAttributeArray.map((item, index)=>{ // 非数组情况下默认无组合 从table数据中获取 // 当属性减少的时候 这个combine数组还是之前的 /* code1 */
let _tempArr: any = []
Array.isArray(item) ? item.map((_item, _index) => {
console.log(item, '0')
Array.isArray(item) ? item.map((_item, _index) => { /* code2 */
console.log(item, _item, '1')
let _tempObject: any = {};
/* 新格式 */
_tempObject.customerAttribute = {
id: attributeObjArr[_index].customerAttributeId,
name: attributeObjArr[_index].attributeName
}
_tempObject.customerAttributeValue = {
id: attributeValObjArr.map(item =>item.find(_ => _.value===_item)).filter(__ => __)[0].id,
id: attributeValObjArr.map(__item => __item.find(_ => _.value===_item)).filter(__ => __)[0].id,
value: item[_index]
}
_tempArr.push(_tempObject)
}) : _tempArr.push({
/* 新格式 */
customerAttribute: {
id: attributeObjArr[0].customerAttributeId,
name: attributeObjArr[0].attributeName
},
customerAttributeValue: {
id: attributeValObjArr[0][0].id,
value: item.toString()
}
})
_paramsArray.push({goodsId: _tableDataSource[index] ? _tableDataSource[index]['对应货品'] : 0, attributeAndValueList: _tempArr, unitPrice: _tableDataSource[index]&&_tableDataSource[index]['单价']}) /*带上货品id 带上单价*/
}) : _paramsArray.push({goodsId: _tableDataSource[0] ? _tableDataSource[0]['对应货品'] : 0, attributeAndValueList: [], unitPrice: _tableDataSource[0]&&_tableDataSource[0]['单价']}) /*带上货品id 带上单价*/
}) : ( /* code3 */
// ** 可能是单一多选 attributeValObjArr可能为多个
_tempArr.push({
customerAttribute: {
id: attributeObjArr[0].customerAttributeId,
name: attributeObjArr[0].attributeName
},
customerAttributeValue: {
id: attributeValObjArr[0][index].id, // 只有一行属性,多选情况下
value: item.toString()
}
})
) /* code3 end */ /* code2 end */
_paramsArray.push({
goodsId: _tableDataSource[index] ? _tableDataSource[index]['对应货品'] : 0,
attributeAndValueList: _tempArr,
unitPrice: _tableDataSource[index]&&_tableDataSource[index]['单价']
}) /*带上货品id 带上单价*/
}) : _paramsArray.push({
goodsId: _tableDataSource[0] ? _tableDataSource[0]['对应货品'] : 0,
attributeAndValueList: [],
unitPrice: _tableDataSource[0]&&_tableDataSource[0]['单价']
}) /*带上货品id 带上单价*/ /* code1 end */
setPriceAttributeParams(_paramsArray)
// console.log(_paramsArray,'params')
}
......
......@@ -124,7 +124,7 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
let _URL = window.URL || window.webkitURL;
let img = new Image();
img.onload = function() {
let valid = img.width < width && img.height < height;
let valid = img.width <= width && img.height <= height;
valid ? resolve() : reject();
};
img.src = _URL.createObjectURL(file);
......
......@@ -40,7 +40,7 @@ const Trademark: React.FC<{}> = () => {
render: (text: any, record: any) => <span className="commonPickColor" onClick={() => handleSee(record)}>{text}&nbsp;<EyeOutlined /></span>
},
{
title: '申请时间',
title: '申请审核时间',
dataIndex: 'applyTime',
key: 'applyTime',
render: (text: any, record: any) => text && moment(text).format('YYYY-MM-DD HH:mm:ss')
......
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