🐞 fix(ID1001342): 【电子商城&内部商城】-功能{添加剪样}:取消掉已经添加的剪样后刷新页面依然显示继续添加,
【【电子商城&内部商城】-功能{添加剪样}:取消掉已经添加的剪样后刷新页面依然显示继续添加,】 https://www.tapd.cn/53459131/bugtrace/bugs/view/1153459131001001342
This commit is contained in:
parent
20400ba978
commit
aa0734a2f9
@ -84,7 +84,7 @@ page {
|
||||
flex-flow: column nowrap;
|
||||
}
|
||||
.addButton {
|
||||
width: 30%;
|
||||
width: 250px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
|
||||
@ -169,6 +169,10 @@ const SampleCuttingList = () => {
|
||||
const [show, setShow] = useState(false)
|
||||
|
||||
const onClose = () => {
|
||||
const index = multipleSelection.current.findIndex(mul => mul.product_id === currentSelect.current.id)
|
||||
if (index !== -1) {
|
||||
multipleSelection.current[index].multipleSelection = productMultipleSelection
|
||||
}
|
||||
setShow(false)
|
||||
setProductMultipleSelection([])
|
||||
}
|
||||
@ -197,9 +201,6 @@ const SampleCuttingList = () => {
|
||||
}
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
onClose()
|
||||
}
|
||||
const handleAddProduct = () => {
|
||||
const index = multipleSelection.current.findIndex(mul => mul.product_id === currentSelect.current.id)
|
||||
if (index !== -1) {
|
||||
@ -212,7 +213,8 @@ const SampleCuttingList = () => {
|
||||
multipleSelection: productMultipleSelection,
|
||||
})
|
||||
}
|
||||
onClose()
|
||||
setShow(false)
|
||||
setProductMultipleSelection([])
|
||||
}
|
||||
const [productMultipleSelection, setProductMultipleSelection] = useState<SampleCuttingCache['multipleSelection']>([])
|
||||
|
||||
@ -263,7 +265,7 @@ const SampleCuttingList = () => {
|
||||
onClick={() => handleClickAddButton(item)}
|
||||
>
|
||||
{
|
||||
isAdd?.includes(item.id) || multipleSelection.current.some(mul => mul.product_id === item.id) ? '继续添加' : '添加'
|
||||
isAdd?.includes(item.id) || multipleSelection.current.find(mul => mul.product_id === item.id)?.multipleSelection.length ? '继续添加' : '添加'
|
||||
}
|
||||
</NormalButton>
|
||||
</View>
|
||||
@ -335,7 +337,7 @@ const SampleCuttingList = () => {
|
||||
round
|
||||
plain
|
||||
customStyles={{ width: '48%' }}
|
||||
onClick={handleClose}
|
||||
onClick={onClose}
|
||||
>
|
||||
取消
|
||||
</NormalButton>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user