Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
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
shenshaokai
jinfa-admin
Commits
ee267e47
Commit
ee267e47
authored
Apr 14, 2022
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 处理品类多次请求的问题
parent
1a4f6fe5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
index.tsx
src/pages/productManage/classAndProperty/class/index.tsx
+7
-3
No files found.
src/pages/productManage/classAndProperty/class/index.tsx
View file @
ee267e47
import
React
from
'react'
import
React
,
{
useState
}
from
'react'
import
{
Row
,
Col
,
Popconfirm
,
Button
,
Card
}
from
'antd'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
TabTree
,
{
createTreeActions
}
from
'@/components/TabTree'
;
...
...
@@ -49,22 +49,26 @@ const ClassProperty: React.FC<{}> = () => {
fetchItemDetailData
:
getProductPlatformGetCategory
})
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
)
const
formInitValue
=
(
nodeRecord
&&
treeStatus
===
FormState
.
EDIT
)
?
getTreeMaps
(
nodeRecord
.
key
)
:
{}
const
onFinish
=
(
values
)
=>
{
setLoading
(
true
)
const
editOrAdd
=
nodeRecord
&&
treeStatus
===
FormState
.
EDIT
const
params
=
editOrAdd
?
{
...
values
,
parentId
:
nodeRecord
.
parentId
}
:
{
...
values
,
parentId
:
nodeRecord
?
nodeRecord
.
parentId
:
0
,
id
:
null
,
}
postProductPlatformSaveOrUpdateCategory
(
params
).
then
(
res
=>
{
postProductPlatformSaveOrUpdateCategory
(
params
).
then
(
()
=>
{
resetMenu
()
setTreeStatus
(
FormState
.
FREE
)
setNodeRecord
(
undefined
)
// 保存后要将是否填写过表单设为false
setIsEditForm
(
false
)
flag
=
false
setLoading
(
false
)
})
}
...
...
@@ -122,7 +126,7 @@ const ClassProperty: React.FC<{}> = () => {
schema=
{
classSchema
}
>
<
FormButtonGroup
>
<
Button
htmlType=
'submit'
type=
"primary"
style=
{
{
marginTop
:
32
,
marginBottom
:
16
,
marginRight
:
24
}
}
>
<
Button
htmlType=
'submit'
type=
"primary"
loading=
{
loading
}
style=
{
{
marginTop
:
32
,
marginBottom
:
16
,
marginRight
:
24
}
}
>
保存
</
Button
>
<
Popconfirm
title=
"确定要删除吗?"
okText=
"是"
cancelText=
"否"
onConfirm=
{
handleDeleteMenu
}
>
...
...
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