🦀️ fix: 修复bug

This commit is contained in:
wangsongsole 2024-02-29 16:24:38 +08:00
parent 25769fa66d
commit 933937036d
1 changed files with 3 additions and 4 deletions

View File

@ -82,10 +82,9 @@ const Combining = forwardRef((props, ref) => {
useEffect(() => { useEffect(() => {
if (propsData && propsData !== "") { if (propsData && propsData !== "") {
initProps() initProps()
} else {
sessionStorage.setItem("knockGoldData", JSON.stringify([]))
} }
console.log(sessionStorage.getItem("KeyPcType"))
sessionStorage.setItem("knockGoldData", JSON.stringify([]))
}, []) }, [])
useImperativeHandle(ref, () => ({ useImperativeHandle(ref, () => ({
@ -144,7 +143,6 @@ const Combining = forwardRef((props, ref) => {
/* 商品提交 */ /* 商品提交 */
async function productSubmit() { async function productSubmit() {
const validator = await knockGoldRef.current.submit() const validator = await knockGoldRef.current.submit()
if (validator) { if (validator) {
const list = JSON.parse(sessionStorage.getItem("knockGoldData")) const list = JSON.parse(sessionStorage.getItem("knockGoldData"))
const tableData = list.map((item) => { const tableData = list.map((item) => {
@ -181,6 +179,7 @@ const Combining = forwardRef((props, ref) => {
obj.checked = true obj.checked = true
return obj return obj
}) })
sessionStorage.setItem("knockGoldData", JSON.stringify(lj_arr.filter((item) => item.origin)))
let arr = map(lj_arr, (res) => { let arr = map(lj_arr, (res) => {
let obj = {} let obj = {}