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
6ed948d7
Commit
6ed948d7
authored
Mar 31, 2022
by
Bill
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix418' into 'v2-220418'
处理组件TableOperation按钮权限没传入、CircleCheckbox换行优化问题、商品新增编辑批量设置价格无效的问题 See merge request linkseeks-design/pro-platform!90
parents
c97d3974
bf7e0392
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
19 deletions
+33
-19
index.tsx
src/components/TableOperation/index.tsx
+3
-3
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+3
-1
priceAttributeForm.tsx
...commodity/products/addProductsItem/priceAttributeForm.tsx
+19
-8
productAttributeForm.tsx
...mmodity/products/addProductsItem/productAttributeForm.tsx
+2
-2
selectGoodsForm.tsx
...es/commodity/products/addProductsItem/selectGoodsForm.tsx
+4
-4
index.less
...s/commodity/products/components/circleCheckbox/index.less
+2
-1
No files found.
src/components/TableOperation/index.tsx
View file @
6ed948d7
...
...
@@ -38,7 +38,7 @@ const TableOperation: React.FC<TableOperationProps> = (props) => {
Object
.
values
(
buttonTextFieldMap
).
filter
(
Boolean
).
length
>
2
?
<>
<
AuthButton
btnCode=
{
buttonPermissionsMap
[
keyNames
[
0
]]
}
>
<
AuthButton
btnCode=
{
(
buttonPermissionsMap
&&
buttonPermissionsMap
[
keyNames
[
0
]])
||
'DevTest'
}
>
<
Button
type=
'link'
onClick=
{
operationHandler
[
keyNames
[
0
]]
}
>
{
keyNames
[
0
]
}
</
Button
>
</
AuthButton
>
...
...
@@ -49,7 +49,7 @@ const TableOperation: React.FC<TableOperationProps> = (props) => {
keyNames
.
slice
(
1
,
keyNames
.
length
).
map
((
item
,
i
)
=>
buttonTextFieldMap
[
item
]
?
(
<
Menu
.
Item
key=
{
`menuItem${i}`
}
>
<
AuthButton
btnCode=
{
buttonPermissionsMap
[
item
]
}
>
<
AuthButton
btnCode=
{
(
buttonPermissionsMap
&&
buttonPermissionsMap
[
item
])
||
'DevTest'
}
>
<
Button
type=
'link'
onClick=
{
operationHandler
[
item
]
}
>
{
item
}
</
Button
>
</
AuthButton
>
</
Menu
.
Item
>
...
...
@@ -65,7 +65,7 @@ const TableOperation: React.FC<TableOperationProps> = (props) => {
:
keyNames
.
map
((
item
,
i
)
=>
(
buttonTextFieldMap
[
item
]
?
<
AuthButton
btnCode=
{
buttonPermissionsMap
[
item
]
}
key=
{
`btnItem${i}`
}
>
<
AuthButton
btnCode=
{
(
buttonPermissionsMap
&&
buttonPermissionsMap
[
item
])
||
'DevTest'
}
key=
{
`btnItem${i}`
}
>
<
Button
type=
'link'
onClick=
{
operationHandler
[
item
]
}
>
{
item
}
</
Button
>
</
AuthButton
>
:
null
))
...
...
src/pages/commodity/products/addProducts.tsx
View file @
6ed948d7
...
...
@@ -105,7 +105,9 @@ const AddProducts: React.FC<{}> = (props) => {
item
[
next
?.
id
]
=
next
;
return
item
},
{}))
:
[]
setSelectedGoods
(
selectGoods
)
// 过滤掉草稿里面id为0的货品项
setSelectedGoods
(
selectGoods
.
filter
(
item
=>
item
[
'id'
]
!==
0
))
}
}
makeDraftRequest
()
...
...
src/pages/commodity/products/addProductsItem/priceAttributeForm.tsx
View file @
6ed948d7
...
...
@@ -225,6 +225,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
let
{
_attributeNameArr
,
_attributeValueArr
,
_temp_attributeObjArr
,
_temp_attributeValObjArr
}
=
needObject
console
.
log
(
selectedGoods
,
'selectedGoods'
)
if
(
selectedGoods
.
length
>
0
)
{
// 编辑情况下 select货品列表可能会采用接口数据
_col
.
push
({
title
:
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.goodsName'
}),
...
...
@@ -270,6 +271,7 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
key
:
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.unitPrice'
}),
width
:
200
,
render
:
(
text
,
record
)
=>
{
console
.
log
(
record
,
'record'
)
let
_priceRange
=
_tableDataSource
[
record
[
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.index'
})]][
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.unitPrice'
})]
if
(
!
_priceRange
||
JSON
.
stringify
(
_priceRange
)
===
'{}'
)
return
null
return
Object
.
keys
(
_priceRange
).
map
((
v
,
i
)
=>
{
...
...
@@ -569,19 +571,28 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
[
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.planPrice'
})]:
ladderPrice
?
[...
assistantUniqueLadderPrice
]
:
assistantUniquePrice
,
[
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.assistantUniquePriceRate'
})]:
assistantUniquePriceRate
}
let
newTabeData
=
[
...
_tableDataSource
]
let
newTabeData
=
[]
if
(
isBatchSetting
)
{
// 判断是否批量设置价格
// _tableDataSource.map(_item => _item[intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.unitPrice' })] = _priceRange)
_tableDataSource
.
forEach
(
_item
=>
{
_item
[
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.unitPrice'
})]
=
_priceRange
_item
[
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.planPrice'
})]
=
ladderPrice
?
[...
assistantUniqueLadderPrice
]
:
assistantUniquePrice
_item
[
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.assistantUniquePriceRate'
})]
=
assistantUniquePriceRate
let
__item
=
{...
_item
}
__item
[
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.unitPrice'
})]
=
_priceRange
__item
[
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.planPrice'
})]
=
ladderPrice
?
[...
assistantUniqueLadderPrice
]
:
assistantUniquePrice
__item
[
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.assistantUniquePriceRate'
})]
=
assistantUniquePriceRate
newTabeData
.
push
(
__item
)
})
}
else
{
newTabeData
[
curretSetPriceRow
[
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.index'
})]]
=
_row
_tableDataSource
.
forEach
(
_item
=>
{
if
(
_item
[
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.index'
})]
===
curretSetPriceRow
[
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.priceAttributeForm.index'
})])
{
newTabeData
.
push
(
_row
)
}
else
{
newTabeData
.
push
({...
_item
})
}
})
// newTabeData[curretSetPriceRow[intl.formatMessage({ id: 'commodity.products.addProductsItem.priceAttributeForm.index' })]] = _row
}
_tableDataSource
=
newTabeData
setTableDataSource
(
_tableDataSource
)
_tableDataSource
=
[...
newTabeData
]
console
.
log
(
_tableDataSource
,
'_tableDataSource'
,
newTabeData
)
setTableDataSource
([...
_tableDataSource
])
})
}
...
...
src/pages/commodity/products/addProductsItem/productAttributeForm.tsx
View file @
6ed948d7
...
...
@@ -309,7 +309,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
<
CircleCheckbox
onChange=
{
(
v
)
=>
onChange
(
v
,
attrItem
)
}
options=
{
attrItem
.
customerAttributeValueList
}
expandOperation=
{
<
Button
style=
{
{
marginLeft
:
8
}
}
type=
"dashed"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
addAtttributeValue
(
attrItem
)
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.productAttributeForm.circleCheckbox.addButton'
})
}
</
Button
>
}
expandOperation=
{
<
Button
style=
{
{
marginLeft
:
8
,
marginTop
:
8
}
}
type=
"dashed"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
addAtttributeValue
(
attrItem
)
}
>
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.productAttributeForm.circleCheckbox.addButton'
})
}
</
Button
>
}
/>
</
Form
.
Item
>
)
...
...
@@ -353,7 +353,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
<
Tabs
defaultActiveKey=
"1"
tabPosition=
"left"
>
{
dataSource
?.
length
>
0
&&
dataSource
.
map
(
attributeItem
=>
!
productInfoByEdit
?.
isUpdateAttribute
&&
(
attributeItem
?.
createTime
>
productInfoByEdit
?.
createTime
)
?
null
:
<
TabPane
tab=
{
attributeItem
.
name
}
key=
{
attributeItem
.
id
}
>
!
productInfoByEdit
?.
isUpdateAttribute
&&
(
attributeItem
?.
createTime
>
productInfoByEdit
?.
createTime
)
?
null
:
<
TabPane
tab=
{
attributeItem
.
name
}
key=
{
attributeItem
.
id
}
forceRender=
{
true
}
>
{
renderTabPanchildren
(
attributeItem
)
}
...
...
src/pages/commodity/products/addProductsItem/selectGoodsForm.tsx
View file @
6ed948d7
...
...
@@ -42,12 +42,12 @@ const SelectGoodsForm: React.FC<{}> = (props) => {
item
[
next
.
id
]
=
next
;
return
item
},
{}))
if
(
goodsArr
?.
length
>
0
)
{
const
filterGoods
=
goodsArr
.
filter
(
item
=>
item
[
'id'
]
!==
0
)
if
(
filterGoods
?.
length
>
0
)
{
setIsChecked
(
true
)
setIsSelectGoods
(
true
)
//@ts-ignore
setSelectedGoodsRowKeys
(
goodsArr
.
map
(
__
=>
__
.
id
))
ProductStore
.
setSelectedGoods
(
goodsArr
)
setSelectedGoodsRowKeys
(
filterGoods
.
map
(
__
=>
__
.
id
))
ProductStore
.
setSelectedGoods
(
filterGoods
)
}
}
},
[
productInfoByEdit
])
...
...
src/pages/commodity/products/components/circleCheckbox/index.less
View file @
6ed948d7
...
...
@@ -4,13 +4,14 @@
.circleCheckboxUl {
list-style: none;
display: flex;
flex-wrap: wrap;
.circleCheckboxUlLi {
// height: 32px;
line-height: 32px;
background: #F5F6F7;
text-align: center;
border-radius: 4px;
margin:
0
8px;
margin:
8px
8px;
padding: 0px 16px;
cursor: pointer;
span {
...
...
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