Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
c11fbc7b
Commit
c11fbc7b
authored
Sep 15, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:商品规格图片满足800*800、处理单属性多选显示异常
parent
27b4f3d2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
19 deletions
+32
-19
priceAttributeForm.tsx
...commodity/products/addProductsItem/priceAttributeForm.tsx
+30
-17
productImageForm.tsx
...s/commodity/products/addProductsItem/productImageForm.tsx
+1
-1
index.tsx
src/pages/trademark/index.tsx
+1
-1
No files found.
src/pages/commodity/products/addProductsItem/priceAttributeForm.tsx
View file @
c11fbc7b
...
...
@@ -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')
}
...
...
src/pages/commodity/products/addProductsItem/productImageForm.tsx
View file @
c11fbc7b
...
...
@@ -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
);
...
...
src/pages/trademark/index.tsx
View file @
c11fbc7b
...
...
@@ -40,7 +40,7 @@ const Trademark: React.FC<{}> = () => {
render
:
(
text
:
any
,
record
:
any
)
=>
<
span
className=
"commonPickColor"
onClick=
{
()
=>
handleSee
(
record
)
}
>
{
text
}
<
EyeOutlined
/></
span
>
},
{
title
:
'申请时间'
,
title
:
'申请
审核
时间'
,
dataIndex
:
'applyTime'
,
key
:
'applyTime'
,
render
:
(
text
:
any
,
record
:
any
)
=>
text
&&
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment