Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
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-platform
Commits
859d17be
Commit
859d17be
authored
May 10, 2022
by
前端-李俊鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 调整规则配置品类接口
parent
32535c1b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
index.tsx
...ruleEng/ruleEngConfig/components/CategoryDrawer/index.tsx
+5
-5
index.tsx
...g/ruleEng/ruleEngConfig/components/ConfigDrawer/index.tsx
+3
-2
No files found.
src/pages/systemSetting/ruleEng/ruleEngConfig/components/CategoryDrawer/index.tsx
View file @
859d17be
import
React
,
{
useRef
,
useState
,
useCallback
,
forwardRef
,
memo
,
useEffect
,
useImperativeHandle
}
from
'react'
import
{
Modal
,
Tree
}
from
'antd'
import
CommonDrawer
from
'../CommonDrawer'
import
{
getProduct
PlatformGet
CategoryTree
}
from
'@/services/ProductV2Api'
import
{
getProduct
CustomerGetCustomer
CategoryTree
}
from
'@/services/ProductV2Api'
interface
PropsType
{
onOk
?:
(
values
:
any
)
=>
void
...
...
@@ -24,7 +24,7 @@ const CategoryDrawer = (props: PropsType, ref) => {
},
[
checkedKeys
])
const
getCategoryTree
=
async
()
=>
{
const
{
code
,
data
}
=
await
getProduct
PlatformGet
CategoryTree
()
const
{
code
,
data
}
=
await
getProduct
CustomerGetCustomer
CategoryTree
()
if
(
code
===
1000
)
{
setCategoryTree
(
data
)
}
...
...
@@ -38,11 +38,11 @@ const CategoryDrawer = (props: PropsType, ref) => {
const
checkAbleCategoryTree
=
()
=>
{
const
newTree
=
JSON
.
parse
(
JSON
.
stringify
(
categoryTree
))
function
delTree
(
tree
,
delItem
)
{
function
delTree
(
delItem
)
{
if
(
delItem
)
{
if
(
delItem
.
children
.
length
)
{
delItem
.
children
.
forEach
(
item
=>
{
delTree
(
tree
,
item
)
delTree
(
item
)
})
}
else
{
if
(
selectCache
.
includes
(
delItem
.
id
))
{
...
...
@@ -52,7 +52,7 @@ const CategoryDrawer = (props: PropsType, ref) => {
}
}
newTree
.
forEach
(
item
=>
{
delTree
(
newTree
,
item
)
delTree
(
item
)
})
return
newTree
}
...
...
src/pages/systemSetting/ruleEng/ruleEngConfig/components/ConfigDrawer/index.tsx
View file @
859d17be
...
...
@@ -69,9 +69,10 @@ const ConfigDrawer = (props: PropsType, ref) => {
fnClose
()
}
})
return
}
else
{
onChange
?.()
fnClose
()
}
fnClose
()
},
[])
const
handleShow
=
useCallback
(
async
({
process
,
formData
}:
any
,
flag
:
boolean
)
=>
{
...
...
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