Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
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
ReactWeb5
CivManage
Commits
c432831d
Commit
c432831d
authored
3 years ago
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '产品配置'
parent
01139da3
Pipeline
#45151
skipped with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
39 deletions
+39
-39
productConfig.jsx
src/pages/productCenter/productConfig/productConfig.jsx
+39
-39
No files found.
src/pages/productCenter/productConfig/productConfig.jsx
View file @
c432831d
...
...
@@ -13,42 +13,42 @@ const ProductConfig = props => {
const
[
flag
,
setFlag
]
=
useState
(
1
);
const
[
list
,
setList
]
=
useState
(
new
Set
());
// 默认展示第一项
useEffect
(()
=>
{
setLoading
(
true
);
getProductList
()
.
then
(
res
=>
{
const
{
code
}
=
res
;
if
(
code
===
0
)
{
const
{
data
:
{
AllProducts
,
UserProducts
},
}
=
res
;
// setProductList(AllProducts);
setUserProductsList
(
UserProducts
);
setProductObj
(
AllProducts
[
0
]);
AllProducts
.
map
(
i
=>
{
list
.
add
(
i
.
ProductType
);
});
let
a
=
[];
list
.
map
(
i
=>
{
a
.
push
(
i
);
});
let
aa
=
[];
a
.
map
((
i
,
j
)
=>
{
let
ad
=
[];
AllProducts
.
map
(
k
=>
{
if
(
k
.
ProductType
==
i
)
{
ad
.
push
(
k
);
}
});
aa
.
push
(
ad
);
});
setProductList
(
aa
);
}
})
.
finally
(()
=>
{
setLoading
(
false
);
});
},
[]);
//
useEffect(() => {
//
setLoading(true);
//
getProductList()
//
.then(res => {
//
const { code } = res;
//
if (code === 0) {
//
const {
//
data: { AllProducts, UserProducts },
//
} = res;
//
// setProductList(AllProducts);
//
setUserProductsList(UserProducts);
//
setProductObj(AllProducts[0]);
//
AllProducts.map(i => {
//
list.add(i.ProductType);
//
});
//
let a = [];
//
list.map(i => {
//
a.push(i);
//
});
//
let aa = [];
//
a.map((i, j) => {
//
let ad = [];
//
AllProducts.map(k => {
//
if (k.ProductType == i) {
//
ad.push(k);
//
}
//
});
//
aa.push(ad);
//
});
//
setProductList(aa);
//
}
//
})
//
.finally(() => {
//
setLoading(false);
//
});
//
}, []);
useEffect
(()
=>
{
setLoading
(
true
);
...
...
@@ -61,9 +61,9 @@ const ProductConfig = props => {
}
=
res
;
// setProductList(AllProducts);
setUserProductsList
(
UserProducts
);
// if (!productObj && data
.length > 0) {
// setProductObj(data
[0]);
//
}
if
(
!
productObj
&&
AllProducts
.
length
>
0
)
{
setProductObj
(
AllProducts
[
0
]);
}
// setProductList(data);
AllProducts
.
map
(
i
=>
{
list
.
add
(
i
.
ProductType
);
...
...
This diff is collapsed.
Click to expand it.
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