Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
8a5a0130
Commit
8a5a0130
authored
Jul 28, 2022
by
beisir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 生成表格校验
parent
03acb249
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
424 additions
and
185 deletions
+424
-185
env.config.js
config/env.config.js
+7
-7
EditFormTable.tsx
src/pages/ServiceGoods/components/EditFormTable.tsx
+95
-91
FormPriceOrStock.tsx
src/pages/ServiceGoods/components/FormPriceOrStock.tsx
+192
-61
FormRuleSetting.tsx
src/pages/ServiceGoods/components/FormRuleSetting.tsx
+0
-1
context.js
src/pages/ServiceGoods/context.js
+3
-0
index.tsx
src/pages/ServiceGoods/index.tsx
+34
-25
utils.js
src/pages/ServiceGoods/utils.js
+93
-0
No files found.
config/env.config.js
View file @
8a5a0130
...
@@ -2,16 +2,16 @@ const isProduction = process.env.NODE_ENV === 'production';
...
@@ -2,16 +2,16 @@ const isProduction = process.env.NODE_ENV === 'production';
const
isPre
=
process
.
env
.
PRE_ENV
===
'
pre
'
;
const
isPre
=
process
.
env
.
PRE_ENV
===
'
pre
'
;
const
envAPi
=
{
const
envAPi
=
{
api
:
'
//backstms-yxm
.liangkebang.net
'
,
api
:
'
https://backstms-xyqb
.liangkebang.net
'
,
kdspOpApi
:
'
https://kdsp-operation-
yxm
.liangkebang.net
'
,
kdspOpApi
:
'
https://kdsp-operation-
xyqb
.liangkebang.net
'
,
kdspApi
:
'
https://sc-op-api-
yxm
.liangkebang.net
'
,
kdspApi
:
'
https://sc-op-api-
xyqb
.liangkebang.net
'
,
goodsApi
:
'
https://sc-op-api-
yxm
.liangkebang.net
'
,
goodsApi
:
'
https://sc-op-api-
xyqb
.liangkebang.net
'
,
querysApi
:
'
https://sc-settlement-api-
yxm
.liangkebang.net
'
,
querysApi
:
'
https://sc-settlement-api-
xyqb
.liangkebang.net
'
,
// goodsApi: '//192.168.188.111:7000',
// goodsApi: '//192.168.188.111:7000',
prologueDomain
:
'
https://mall-
yxm
.liangkebang.net
'
,
prologueDomain
:
'
https://mall-
xyqb
.liangkebang.net
'
,
// qiniuHost: 'https://appsync.lkbang.net',
// qiniuHost: 'https://appsync.lkbang.net',
qiniuHost
:
'
https://kdspstatic.q-gp.com/
'
,
qiniuHost
:
'
https://kdspstatic.q-gp.com/
'
,
opapiHost
:
'
https://opapi-
yxm
.liangkebang.net
'
,
opapiHost
:
'
https://opapi-
xyqb
.liangkebang.net
'
,
};
};
const
prodApi
=
{
const
prodApi
=
{
...
...
src/pages/ServiceGoods/components/EditFormTable.tsx
View file @
8a5a0130
...
@@ -5,16 +5,38 @@ import React, { useContext, useEffect, useRef, useState } from 'react';
...
@@ -5,16 +5,38 @@ import React, { useContext, useEffect, useRef, useState } from 'react';
const
EditableContext
=
React
.
createContext
<
FormInstance
<
any
>
|
null
>
(
null
);
const
EditableContext
=
React
.
createContext
<
FormInstance
<
any
>
|
null
>
(
null
);
interface
PropType
{
initData
:
any
[];
};
interface
Item
{
interface
Item
{
key
:
string
;
key
:
string
;
name
:
string
;
name
:
string
;
age
:
string
;
age
:
string
;
address
:
string
;
address
:
string
;
}
}
interface
EditableCellProps
{
rowIndex
:
number
;
title
:
React
.
ReactNode
;
editable
:
boolean
;
children
:
React
.
ReactNode
;
dataIndex
:
keyof
Item
;
record
:
Item
;
handleSave
:
(
record
:
Item
)
=>
void
;
}
interface
EditableRowProps
{
interface
EditableRowProps
{
index
:
number
;
index
:
number
;
}
}
interface
DataType
{
rowSpanCount
?:
number
;
supplyPrice
:
number
;
commissionRate
:
number
;
marketPrice
:
number
;
salePrice
:
number
;
stock
:
number
;
productStockWarning
:
number
;
}
type
EditableTableProps
=
Parameters
<
typeof
Table
>
[
0
];
type
ColumnTypes
=
Exclude
<
EditableTableProps
[
'
columns
'
],
undefined
>
;
const
EditableRow
:
React
.
FC
<
EditableRowProps
>
=
({
index
,
...
props
})
=>
{
const
EditableRow
:
React
.
FC
<
EditableRowProps
>
=
({
index
,
...
props
})
=>
{
// console.log('==========> index', props);
// console.log('==========> index', props);
...
@@ -29,15 +51,6 @@ const EditableRow: React.FC<EditableRowProps> = ({ index, ...props }) => {
...
@@ -29,15 +51,6 @@ const EditableRow: React.FC<EditableRowProps> = ({ index, ...props }) => {
);
);
};
};
interface
EditableCellProps
{
rowIndex
:
number
;
title
:
React
.
ReactNode
;
editable
:
boolean
;
children
:
React
.
ReactNode
;
dataIndex
:
keyof
Item
;
record
:
Item
;
handleSave
:
(
record
:
Item
)
=>
void
;
}
const
EditableCell
:
React
.
FC
<
EditableCellProps
>
=
(
props
)
=>
{
const
EditableCell
:
React
.
FC
<
EditableCellProps
>
=
(
props
)
=>
{
const
{
const
{
...
@@ -50,73 +63,61 @@ const EditableCell: React.FC<EditableCellProps> = (props) => {
...
@@ -50,73 +63,61 @@ const EditableCell: React.FC<EditableCellProps> = (props) => {
handleSave
,
handleSave
,
...
restProps
...
restProps
}
=
props
;
}
=
props
;
// console.log(props);
const
form
=
useContext
(
EditableContext
)
!
;
const
form
=
useContext
(
EditableContext
)
!
;
const
save
=
async
()
=>
{
const
save
=
async
()
=>
{
try
{
try
{
console
.
log
(
rowIndex
);
const
tableList
=
form
.
getFieldValue
(
'
tableList
'
);
const
{
tableList
}
=
await
form
.
validateFields
();
handleSave
(
tableList
);
handleSave
(
tableList
);
}
catch
(
errInfo
)
{
}
catch
(
errInfo
)
{
console
.
log
(
'
Save failed:
'
,
errInfo
);
console
.
log
(
'
Save failed:
'
,
errInfo
);
}
}
};
};
const
childNode
=
<
Form
.
Item
let
childNode
=
children
;
style=
{
{
margin
:
0
}
}
name=
{
[
'
tableList
'
,
rowIndex
,
dataIndex
]
}
if
(
editable
)
{
initialValue=
{
record
[
dataIndex
]
}
childNode
=
<
Form
.
Item
rules=
{
[
{
required
:
true
,
message
:
`${title} is required.`
}]
}
>
style=
{
{
margin
:
0
}
}
<
InputNumber
onBlur=
{
save
}
/>
name=
{
[
'
tableList
'
,
rowIndex
,
dataIndex
]
}
</
Form
.
Item
>
// initialValue={record[dataIndex]}
rules=
{
[{
required
:
true
,
message
:
`${title} is required.`
}]
}
>
<
InputNumber
onBlur=
{
save
}
/>
</
Form
.
Item
>
}
return
<
td
{
...
restProps
}
>
{
childNode
}
</
td
>;
return
<
td
{
...
restProps
}
>
{
childNode
}
</
td
>;
};
};
type
EditableTableProps
=
Parameters
<
typeof
Table
>
[
0
];
interface
DataType
{
supplyPrice
:
number
;
commissionRate
:
number
;
marketPrice
:
number
;
salePrice
:
number
;
stock
:
number
;
productStockWarning
:
number
;
}
type
ColumnTypes
=
Exclude
<
EditableTableProps
[
'
columns
'
],
undefined
>
;
const
EditFormTable
:
React
.
FC
=
()
=>
{
const
[
dataSource
,
setDataSource
]
=
useState
<
DataType
[]
>
([
const
EditFormTable
=
(
props
:
PropType
)
=>
{
{
supplyPrice
:
100
,
const
{
initData
}
=
props
;
commissionRate
:
20
,
// console.log(initData);
marketPrice
:
32
,
const
[
dataSource
,
setDataSource
]
=
useState
<
DataType
[]
>
([]);
salePrice
:
100
,
stock
:
100
,
productStockWarning
:
100
,
},
{
supplyPrice
:
100
,
commissionRate
:
20
,
marketPrice
:
32
,
salePrice
:
100
,
stock
:
100
,
productStockWarning
:
100
,
}
]);
// const form = useContext(EditableContext)!;
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
[
count
,
setCount
]
=
useState
(
2
);
useEffect
(()
=>
{
console
.
log
(
'
==============>坚听initData
'
,
initData
);
form
.
setFieldsValue
({
tableList
:
initData
,
});
setDataSource
(
initData
);
},
[
initData
])
const
handleDelete
=
(
key
:
React
.
Key
)
=>
{
const
newData
=
dataSource
.
filter
(
item
=>
item
.
key
!==
key
);
setDataSource
(
newData
);
};
const
defaultColumns
:
(
ColumnTypes
[
number
]
&
{
editable
?:
boolean
;
dataIndex
:
string
})[]
=
[
const
defaultColumns
:
(
ColumnTypes
[
number
]
&
{
editable
?:
boolean
;
dataIndex
:
string
})[]
=
[
{
title
:
'
一级规格
'
,
dataIndex
:
'
firstSpecValue
'
,
},
{
title
:
'
二级规格
'
,
dataIndex
:
'
secondSpecValue
'
,
},
{
{
title
:
'
供货价
'
,
title
:
'
供货价
'
,
dataIndex
:
'
supplyPrice
'
,
dataIndex
:
'
supplyPrice
'
,
...
@@ -149,23 +150,17 @@ const EditFormTable: React.FC = () => {
...
@@ -149,23 +150,17 @@ const EditFormTable: React.FC = () => {
},
},
];
];
const
handleAdd
=
()
=>
{
const
handleAdd
=
async
()
=>
{
console
.
log
(
form
.
getFieldsValue
());
try
{
// const newData: DataType = {
const
{
tableList
}
=
await
form
.
validateFields
();
// key: count,
console
.
log
(
tableList
);
// supplyPrice: 200,
}
catch
(
errInfo
)
{
// commissionRate: 20,
console
.
log
(
'
Save failed:
'
,
errInfo
);
// marketPrice: 32,
}
// salePrice: 100,
// stock: 100,
// productStockWarning: 100,
// };
// setDataSource([...dataSource, newData]);
// setCount(count + 1);
};
};
const
handleSave
=
(
row
:
DataType
[])
=>
{
const
handleSave
=
(
row
:
DataType
[])
=>
{
console
.
log
(
'
============>row
'
,
row
);
//
console.log('============>row', row);
// const newData = [...dataSource];
// const newData = [...dataSource];
// const index = newData.findIndex(item => row.key === item.key);
// const index = newData.findIndex(item => row.key === item.key);
// const item = newData[index];
// const item = newData[index];
...
@@ -175,28 +170,32 @@ const EditFormTable: React.FC = () => {
...
@@ -175,28 +170,32 @@ const EditFormTable: React.FC = () => {
// });
// });
setDataSource
([...
row
]);
setDataSource
([...
row
]);
};
};
const
components
=
{
body
:
{
row
:
EditableRow
,
cell
:
EditableCell
,
},
};
// 根据这里做判断渲染表格
// 根据这里做判断渲染表格
const
columns
=
defaultColumns
.
map
((
col
,
colIndex
)
=>
{
const
columns
=
defaultColumns
.
map
((
col
,
colIndex
)
=>
{
if
(
!
col
.
editable
)
{
// if (!col.editable) {
return
col
;
// return col;
}
// }
return
{
return
{
...
col
,
...
col
,
onCell
:
(
record
:
DataType
,
rowIndex
:
number
)
=>
({
onCell
:
(
record
:
DataType
,
rowIndex
:
number
)
=>
{
record
,
let
rowSpan
=
null
;
rowIndex
,
if
(
col
.
dataIndex
===
'
firstSpecValue
'
)
{
editable
:
col
.
editable
,
// console.log(record, rowSpan);
dataIndex
:
col
.
dataIndex
,
rowSpan
=
record
.
rowSpanCount
?
record
.
rowSpanCount
:
0
;
title
:
col
.
title
,
}
handleSave
,
}),
return
({
rowSpan
,
record
,
rowIndex
,
editable
:
col
.
editable
,
dataIndex
:
col
.
dataIndex
,
title
:
col
.
title
,
handleSave
,
});
}
};
};
});
});
...
@@ -205,12 +204,17 @@ const EditFormTable: React.FC = () => {
...
@@ -205,12 +204,17 @@ const EditFormTable: React.FC = () => {
<
Button
onClick=
{
handleAdd
}
type=
"primary"
style=
{
{
marginBottom
:
16
}
}
>
<
Button
onClick=
{
handleAdd
}
type=
"primary"
style=
{
{
marginBottom
:
16
}
}
>
Add a row
Add a row
</
Button
>
</
Button
>
<
Form
form=
{
form
}
component=
{
false
}
>
<
Form
form=
{
form
}
scrollToFirstError
component=
{
false
}
>
<
EditableContext
.
Provider
value=
{
form
}
>
<
EditableContext
.
Provider
value=
{
form
}
>
<
Table
<
Table
pagination=
{
false
}
pagination=
{
false
}
size=
"small"
size=
"small"
components=
{
components
}
components=
{
{
body
:
{
row
:
EditableRow
,
cell
:
EditableCell
,
},
}
}
bordered
bordered
dataSource=
{
dataSource
}
dataSource=
{
dataSource
}
rowKey=
{
(
row
,
rowInd
)
=>
rowInd
}
rowKey=
{
(
row
,
rowInd
)
=>
rowInd
}
...
...
src/pages/ServiceGoods/components/FormPriceOrStock.tsx
View file @
8a5a0130
This diff is collapsed.
Click to expand it.
src/pages/ServiceGoods/components/FormRuleSetting.tsx
View file @
8a5a0130
...
@@ -42,7 +42,6 @@ const FormRuleSetting = forwardRef((props: { editData: any }, ref) => {
...
@@ -42,7 +42,6 @@ const FormRuleSetting = forwardRef((props: { editData: any }, ref) => {
const
[
commonImageList
,
setCommonImageList
]
=
useState
([]);
const
[
commonImageList
,
setCommonImageList
]
=
useState
([]);
const
[
detailImageList
,
setDetailImageList
]
=
useState
([]);
const
[
detailImageList
,
setDetailImageList
]
=
useState
([]);
useEffect
(()
=>
{
useEffect
(()
=>
{
console
.
log
(
id
);
if
(
+
id
!==
0
)
{
if
(
+
id
!==
0
)
{
console
.
log
();
console
.
log
();
if
(
!
Object
.
keys
(
editData
).
length
)
return
;
if
(
!
Object
.
keys
(
editData
).
length
)
return
;
...
...
src/pages/ServiceGoods/context.js
0 → 100644
View file @
8a5a0130
import
React
from
'
react
'
;
export
const
ServiceContext
=
React
.
createContext
(
null
);
src/pages/ServiceGoods/index.tsx
View file @
8a5a0130
...
@@ -12,7 +12,13 @@ import FormPriceOrStock from './components/FormPriceOrStock';
...
@@ -12,7 +12,13 @@ import FormPriceOrStock from './components/FormPriceOrStock';
import
FormRuleSetting
from
'
./components/FormRuleSetting
'
;
import
FormRuleSetting
from
'
./components/FormRuleSetting
'
;
import
FormSettlementOthers
from
'
./components/FormSettlementOthers
'
;
import
FormSettlementOthers
from
'
./components/FormSettlementOthers
'
;
import
commonStyle
from
'
./common.less
'
;
import
commonStyle
from
'
./common.less
'
;
import
{
getProductDetail
,
merchantCategoryGetAll
,
merchantBrandList
,
merchantSpecList
}
from
'
./service
'
;
import
{
getProductDetail
,
merchantCategoryGetAll
,
merchantBrandList
,
merchantSpecList
,
}
from
'
./service
'
;
import
{
ServiceContext
}
from
'
./context
'
;
/**
/**
* 服务商品改造-商品模块
* 服务商品改造-商品模块
...
@@ -28,9 +34,9 @@ const ServiceGoods = options => {
...
@@ -28,9 +34,9 @@ const ServiceGoods = options => {
const
settingRef
=
useRef
(
null
);
const
settingRef
=
useRef
(
null
);
const
settleOtrRef
=
useRef
(
null
);
const
settleOtrRef
=
useRef
(
null
);
const
[
isEdit
,
setIsEdit
]
=
useState
(
false
);
const
[
productType
,
setProductType
]
=
useState
(
1
);
const
[
productType
,
setProductType
]
=
useState
(
1
);
const
[
pageLoading
,
setPageLoading
]
=
useState
(
false
);
const
[
pageLoading
,
setPageLoading
]
=
useState
(
false
);
const
[
categoryList
,
setCategoryList
]
=
useState
([]);
// 获取三级类目
const
[
categoryList
,
setCategoryList
]
=
useState
([]);
// 获取三级类目
const
[
brandList
,
setBrandList
]
=
useState
([]);
// 获取商品牌
const
[
brandList
,
setBrandList
]
=
useState
([]);
// 获取商品牌
const
[
specList
,
setSpecList
]
=
useState
([]);
// 规格列表
const
[
specList
,
setSpecList
]
=
useState
([]);
// 规格列表
...
@@ -91,10 +97,11 @@ const ServiceGoods = options => {
...
@@ -91,10 +97,11 @@ const ServiceGoods = options => {
useEffect
(()
=>
{
useEffect
(()
=>
{
(
async
()
=>
{
(
async
()
=>
{
setPageLoading
(
true
);
setPageLoading
(
true
);
await
getMerchantCategory
();
//
await getMerchantCategory();
await
getMerchantBrandList
();
//
await getMerchantBrandList();
await
getMerchantSpecList
();
await
getMerchantSpecList
();
if
(
pageId
!==
0
)
{
if
(
pageId
!==
0
)
{
setIsEdit
(
true
);
await
getProductDetailResponse
();
await
getProductDetailResponse
();
}
}
setPageLoading
(
false
);
setPageLoading
(
false
);
...
@@ -105,27 +112,29 @@ const ServiceGoods = options => {
...
@@ -105,27 +112,29 @@ const ServiceGoods = options => {
<
Spin
tip=
"正在加载..."
spinning=
{
pageLoading
}
delay=
{
100
}
>
<
Spin
tip=
"正在加载..."
spinning=
{
pageLoading
}
delay=
{
100
}
>
<
PageHeaderWrapper
className=
{
commonStyle
.
header
}
>
<
PageHeaderWrapper
className=
{
commonStyle
.
header
}
>
<
WrapperContainer
>
<
WrapperContainer
>
<
Title
title=
"商品类型"
/>
<
ServiceContext
.
Provider
value=
{
{
pageId
,
isEdit
}
}
>
<
TaskTypeSelect
productType=
{
productType
}
onChange=
{
productChange
}
/>
<
Title
title=
"商品类型"
/>
<
TaskTypeSelect
productType=
{
productType
}
onChange=
{
productChange
}
/>
<
Title
title=
"商品基本信息编辑"
/>
<
FormInformationBasic
<
Title
title=
"商品基本信息编辑"
/>
ref=
{
basicRef
}
<
FormInformationBasic
editData=
{
editData
}
ref=
{
basicRef
}
categoryList=
{
categoryList
}
editData=
{
editData
}
brandList=
{
brandList
}
categoryList=
{
categoryList
}
/>
brandList=
{
brandList
}
/>
<
Title
title=
"价格与库存"
/>
<
FormPriceOrStock
ref=
{
stockRef
}
specList=
{
specList
}
editData=
{
editData
}
/>
<
Title
title=
"价格与库存"
/>
<
FormPriceOrStock
ref=
{
stockRef
}
specList=
{
specList
}
editData=
{
editData
}
/>
<
Title
title=
"规则设置"
/>
<
FormRuleSetting
ref=
{
settingRef
}
editData=
{
editData
}
/>
<
Title
title=
"规则设置"
/>
<
FormRuleSetting
ref=
{
settingRef
}
editData=
{
editData
}
/>
<
FormSettlementOthers
ref=
{
settleOtrRef
}
editData=
{
editData
}
/>
<
Button
type=
"primary"
onClick=
{
submitEvent
}
>
<
FormSettlementOthers
ref=
{
settleOtrRef
}
editData=
{
editData
}
/>
Register
<
Button
type=
"primary"
onClick=
{
submitEvent
}
>
</
Button
>
Register
</
Button
>
</
ServiceContext
.
Provider
>
</
WrapperContainer
>
</
WrapperContainer
>
</
PageHeaderWrapper
>
</
PageHeaderWrapper
>
</
Spin
>
</
Spin
>
...
...
src/pages/ServiceGoods/utils.js
0 → 100644
View file @
8a5a0130
import
{
ConsoleSqlOutlined
}
from
'
@ant-design/icons
'
;
export
const
cleanArray
=
actual
=>
{
const
newArray
=
[];
// eslint-disable-next-line no-plusplus
for
(
let
i
=
0
;
i
<
actual
.
length
;
i
++
)
{
if
(
actual
[
i
])
{
newArray
.
push
(
actual
[
i
]);
}
}
return
newArray
;
};
const
createInitProduct
=
(
skuItem
,
isCreate
)
=>
{
if
(
isCreate
&&
Object
.
keys
(
skuItem
).
length
>
5
)
{
return
skuItem
;
}
return
{
// firstSpecValue: '',
// secondSpecValue: '',
weight
:
null
,
productStockWarning
:
null
,
marketPrice
:
null
,
supplyPrice
:
null
,
stock
:
null
,
thirdSkuNo
:
null
,
skuLink
:
null
,
};
};
const
initData
=
{
// firstSpecValue: '',
// secondSpecValue: '',
weight
:
null
,
productStockWarning
:
null
,
marketPrice
:
null
,
supplyPrice
:
null
,
stock
:
null
,
thirdSkuNo
:
null
,
skuLink
:
null
,
};
const
createSecondProduct
=
(
secondSpecList
,
initItem
,
secondSpec
,
dataSource
,
callback
)
=>
{
secondSpecList
.
forEach
(
secondItem
=>
{
console
.
log
(
'
============>
'
,
Object
.
keys
(
secondItem
));
const
specSecond
=
Object
.
keys
(
secondItem
).
length
<
2
?
{
firstSpecId
:
initItem
.
firstSpecId
,
firstSpecValue
:
initItem
.
firstSpecValue
,
...
initData
,
}
:
Object
.
assign
({},
initItem
);
// 继承fist参数
if
(
callback
)
{
callback
(
specSecond
);
}
specSecond
.
secondSpecId
=
secondSpec
;
specSecond
.
secondSpecValue
=
secondItem
.
secondSpecValue
;
dataSource
.
push
(
specSecond
);
});
};
export
const
createProductData
=
({
firstValues
,
secondValues
,
firstSpecId
,
secondSpecId
})
=>
{
console
.
log
(
firstValues
,
secondValues
);
const
countRowSpan
=
{};
const
dataSource
=
[];
if
(
firstValues
.
length
)
{
firstValues
.
forEach
((
fisrtItem
,
index
)
=>
{
const
specFirst
=
createInitProduct
(
fisrtItem
,
true
);
specFirst
.
firstSpecId
=
firstSpecId
;
specFirst
.
firstSpecValue
=
fisrtItem
.
firstSpecValue
;
if
(
secondValues
.
length
)
{
createSecondProduct
(
secondValues
,
specFirst
,
secondSpecId
,
dataSource
,
specSecond
=>
{
if
(
!
countRowSpan
[
specFirst
.
firstSpecValue
])
{
countRowSpan
[
specFirst
.
firstSpecValue
]
=
true
;
specSecond
.
rowSpanCount
=
secondValues
.
length
;
}
});
return
;
}
dataSource
.
push
(
specFirst
);
});
}
else
if
(
secondValues
.
length
)
{
// const childData = createInitProduct();
createSecondProduct
(
secondValues
,
initData
,
secondSpecId
,
dataSource
);
}
else
{
const
specFirst
=
createInitProduct
();
dataSource
.
push
(
specFirst
);
}
return
dataSource
;
};
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