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
7d9070cb
Commit
7d9070cb
authored
Nov 04, 2022
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加初始化tree
parent
0d105a36
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
164 additions
and
176 deletions
+164
-176
CTreeNode.jsx
src/components/CustomTree/CTreeNode.jsx
+1
-1
index.jsx
src/components/CustomTree/index.jsx
+145
-167
index.jsx
src/pages/distributionArea/addArea/index.jsx
+18
-8
No files found.
src/components/CustomTree/CTreeNode.jsx
View file @
7d9070cb
...
@@ -8,7 +8,7 @@ const CustomTree = forwardRef(props => {
...
@@ -8,7 +8,7 @@ const CustomTree = forwardRef(props => {
const
{
treeData
}
=
props
;
const
{
treeData
}
=
props
;
const
onChange
=
()
=>
{
const
onChange
=
()
=>
{
props
.
onChange
(
treeData
.
key
,
!
treeData
.
checked
);
props
.
onChange
(
treeData
.
key
,
!
treeData
.
checked
,
treeData
.
level
);
};
};
const
onVisible
=
debounce
(
e
=>
{
const
onVisible
=
debounce
(
e
=>
{
...
...
src/components/CustomTree/index.jsx
View file @
7d9070cb
This diff is collapsed.
Click to expand it.
src/pages/distributionArea/addArea/index.jsx
View file @
7d9070cb
...
@@ -48,15 +48,22 @@ const AddAreaModal = props => {
...
@@ -48,15 +48,22 @@ const AddAreaModal = props => {
const
handleOk
=
()
=>
{
const
handleOk
=
()
=>
{
validateFields
(
async
(
error
,
fieldsValue
)
=>
{
validateFields
(
async
(
error
,
fieldsValue
)
=>
{
const
newData
=
[];
const
newData
=
[];
console
.
log
(
'
fieldsValue :>>
'
,
fieldsValue
);
const
getValues
=
list
=>
{
fieldsValue
.
list
.
map
(
itemData
=>
list
.
forEach
(
itemData
=>
{
newData
.
push
({
if
(
itemData
.
checked
)
{
addressId
:
itemData
.
key
,
newData
.
push
({
addressLevel
:
itemData
.
level
,
addressId
:
itemData
.
key
,
addressName
:
itemData
.
label
,
addressLevel
:
itemData
.
level
,
}),
addressName
:
itemData
.
label
,
);
});
}
else
if
(
itemData
.
children
&&
itemData
.
children
.
length
)
{
getValues
(
itemData
.
children
);
}
});
};
if
(
!
error
)
{
if
(
!
error
)
{
console
.
log
(
'
fieldsValue :>>
'
,
fieldsValue
);
getValues
(
fieldsValue
.
list
);
if
(
props
.
templateData
.
status
)
{
if
(
props
.
templateData
.
status
)
{
const
data
=
await
forbiddenAddress
({
const
data
=
await
forbiddenAddress
({
templateId
:
props
.
templateData
.
id
,
templateId
:
props
.
templateData
.
id
,
...
@@ -91,6 +98,9 @@ const AddAreaModal = props => {
...
@@ -91,6 +98,9 @@ const AddAreaModal = props => {
let
arr
=
[];
let
arr
=
[];
const
dealData
=
list
=>
const
dealData
=
list
=>
list
.
map
(
item
=>
{
list
.
map
(
item
=>
{
item
.
key
=
+
item
.
addressId
;
item
.
label
=
item
.
addressName
;
item
.
indeterminate
=
!
item
.
isForbidden
;
item
.
checked
=
item
.
isForbidden
;
item
.
checked
=
item
.
isForbidden
;
item
.
children
&&
item
.
children
.
length
&&
dealData
(
item
.
children
);
item
.
children
&&
item
.
children
.
length
&&
dealData
(
item
.
children
);
return
item
;
return
item
;
...
...
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