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
9341edc9
Commit
9341edc9
authored
Feb 28, 2022
by
邓超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改产品配置应用开关切换失败
parent
6bb60036
Pipeline
#44749
skipped with stages
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
18 deletions
+10
-18
editForm.jsx
...pages/productCenter/productConfig/components/editForm.jsx
+1
-4
productConfig.jsx
src/pages/productCenter/productConfig/productConfig.jsx
+9
-14
No files found.
src/pages/productCenter/productConfig/components/editForm.jsx
View file @
9341edc9
...
...
@@ -28,11 +28,8 @@ const EditForm = props => {
},
];
useEffect
(()
=>
{
console
.
log
(
8888
);
console
.
log
(
productObj
,
'productObj'
);
console
.
log
(
userProductsList
);
form
.
setFieldsValue
({
...
productObj
});
console
.
log
(
productObj
.
IsUsed
,
'productObj.IsUsed'
);
form
.
setFieldsValue
({
...
productObj
});
if
(
!
productObj
.
IsUsed
)
{
setBut
(
true
);
}
else
{
...
...
src/pages/productCenter/productConfig/productConfig.jsx
View file @
9341edc9
...
...
@@ -9,7 +9,7 @@ const ProductConfig = props => {
const
[
addVisible
,
setAddVisible
]
=
useState
(
false
);
const
[
productList
,
setProductList
]
=
useState
([]);
const
[
userProductsList
,
setUserProductsList
]
=
useState
([]);
const
[
productObj
,
setProductOb
t
]
=
useState
(
''
);
const
[
productObj
,
setProductOb
j
]
=
useState
(
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
flag
,
setFlag
]
=
useState
(
1
);
const
[
list
,
setList
]
=
useState
(
new
Set
());
...
...
@@ -25,7 +25,7 @@ const ProductConfig = props => {
}
=
res
;
// setProductList(AllProducts);
setUserProductsList
(
UserProducts
);
setProductOb
t
(
AllProducts
[
0
]);
setProductOb
j
(
AllProducts
[
0
]);
AllProducts
.
map
(
i
=>
{
list
.
add
(
i
.
ProductType
);
});
...
...
@@ -43,8 +43,6 @@ const ProductConfig = props => {
});
aa
.
push
(
ad
);
});
console
.
log
(
aa
);
// console.log(...aa);
setProductList
(
aa
);
}
})
...
...
@@ -65,7 +63,7 @@ const ProductConfig = props => {
// setProductList(AllProducts);
setUserProductsList
(
UserProducts
);
// if (!productObj && data.length > 0) {
// setProductOb
t
(data[0]);
// setProductOb
j
(data[0]);
// }
// setProductList(data);
AllProducts
.
map
(
i
=>
{
...
...
@@ -85,7 +83,6 @@ const ProductConfig = props => {
});
aa
.
push
(
ad
);
});
console
.
log
(
aa
);
setProductList
(
aa
);
}
})
...
...
@@ -109,7 +106,7 @@ const ProductConfig = props => {
setLoading
(
false
);
if
(
res
.
code
===
0
)
{
item
.
IsUsed
=
false
;
setProductOb
t
(
item
);
setProductOb
j
(
item
);
notification
.
success
({
message
:
'提示'
,
description
:
'关闭成功'
,
...
...
@@ -174,7 +171,8 @@ const ProductConfig = props => {
});
item
.
IsUsed
=
true
;
console
.
log
(
item
,
'item'
);
setProductObt
(
item
);
console
.
log
(
productObj
,
'productObj33333'
);
setProductObj
({
...
item
});
setFlag
(
flag
+
1
);
}
else
{
notification
.
error
({
...
...
@@ -199,13 +197,13 @@ const ProductConfig = props => {
// console.log(value);
// let obj = productList.find(i => i.PackageName === value.PackageName);
setProductOb
t
(
value
);
setProductOb
j
({
...
value
}
);
// if (userProductsList.length > 0) {
// let obj = userProductsList.find(i => i.PackageName === value.PackageName);
// console.log(value);
// console.log(obj);
// if (obj) {
// setProductOb
t
(obj);
// setProductOb
j
(obj);
// } else {
// message.warning({
// content: '请先启用产品',
...
...
@@ -221,7 +219,7 @@ const ProductConfig = props => {
};
// const changeBut = value => {
// let obj = userProductsList.find(i => i.PackageName === value.PackageName);
// setProductOb
t
(obj);
// setProductOb
j
(obj);
// };
const
renderListItem
=
arr
=>
(
<
div
style=
{
{
marginBottom
:
'25px'
}
}
>
...
...
@@ -267,10 +265,7 @@ const ProductConfig = props => {
删除
</Button> */
}
</
div
>
{
console
.
log
(
productList
,
'productList'
)
}
{
productList
&&
productList
.
length
>
0
?
(
// <List>
{
renderListItem
(
productList
)}<
/
List
>
//
<
div
style=
{}
></
div
>
productList
.
map
(
item
=>
renderListItem
(
item
))
)
:
(
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description=
"暂无数据"
/>
...
...
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