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
6039d9c8
Commit
6039d9c8
authored
Dec 09, 2020
by
Maofei94
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix
parent
80c27a1f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
37 deletions
+35
-37
miniMenu.jsx
src/pages/mobileConfig/menuconfig/miniMenu.jsx
+33
-35
index.js
src/services/index.js
+2
-2
No files found.
src/pages/mobileConfig/menuconfig/miniMenu.jsx
View file @
6039d9c8
...
...
@@ -155,9 +155,9 @@ const MiniMenu = props => {
obj
.
menuType
!==
'MiniAppMenuThree'
&&
obj
.
menuType
!==
'MiniAppMenu'
?
(
<
FolderFilled
/>
)
:
(
<
FileOutlined
/>
),
)
:
(
<
FileOutlined
/>
),
menuType
:
obj
.
menuType
,
children
:
hasChild
?
obj
.
children
.
map
(
i
=>
mapTree
(
i
))
:
[],
};
...
...
@@ -395,14 +395,21 @@ const MiniMenu = props => {
const
dragPos
=
infos
.
dragNode
.
props
.
pos
.
split
(
'-'
);
// 拖动的节点
const
dropKey
=
infos
.
node
.
props
.
eventKey
;
const
dropPos
=
infos
.
node
.
props
.
pos
.
split
(
'-'
);
// 拖动结束的节点
const
endIndex
=
Number
(
dropPos
[
dropPos
.
length
-
1
]);
const
dropPosition
=
infos
.
dropPosition
-
Number
(
dropPos
[
dropPos
.
length
-
1
]);
console
.
log
(
findNum
(
newTreeList
,
dragKey
,
getArrList
),
'aa'
);
let
obj
=
findNum
(
newTreeList
,
dragKey
,
getArrList
);
// let obj = findNum(newTreeList, dragKey, getArrList);
let
obj
;
findNum
(
newTreeList
,
dragKey
,
(
arr
,
id
,
parentId
,
index
)
=>
{
obj
=
{
arr
,
id
,
parentId
,
index
};
return
{
arr
,
id
,
parentId
,
index
};
});
console
.
log
(
obj
,
'obj'
);
let
arrList
=
[];
if
(
dragPos
.
length
!==
dropPos
.
length
)
{
if
(
dragPos
.
length
!==
dropPos
.
length
||
dragPos
[
dragPos
.
length
-
2
]
!==
dropPos
[
dropPos
.
length
-
2
]
)
{
notification
.
warning
({
message
:
'提示'
,
duration
:
3
,
...
...
@@ -410,30 +417,28 @@ const MiniMenu = props => {
});
return
null
;
}
obj
.
arr
.
map
(
item
=>
{
let
idIndex
;
obj
.
arr
.
map
((
item
,
index
)
=>
{
if
(
item
.
menuID
===
obj
.
id
)
{
idIndex
=
index
;
return
;
}
arrList
.
push
(
item
.
menuID
);
});
console
.
log
(
infos
,
'info'
,
pos
,
dragKey
,
dropKey
,
dropPos
,
infos
.
dropPosition
,
dragPos
,
dropPosition
,
arrList
,
);
if
(
dropPosition
===
-
1
)
{
arrList
.
splice
(
Number
(
dropPos
[
dropPos
.
length
-
1
]),
0
,
obj
.
id
);
}
else
if
(
dropPosition
===
1
)
{
arrList
.
splice
(
Number
(
dropPos
[
dropPos
.
length
-
1
])
+
1
,
0
,
obj
.
id
);
if
(
idIndex
>
endIndex
)
{
if
(
dropPosition
===
-
1
)
{
arrList
.
splice
(
endIndex
,
0
,
obj
.
id
);
}
else
if
(
dropPosition
===
1
)
{
arrList
.
splice
(
endIndex
+
1
,
0
,
obj
.
id
);
}
}
else
if
(
idIndex
<
endIndex
)
{
if
(
dropPosition
===
-
1
)
{
arrList
.
splice
(
endIndex
-
1
,
0
,
obj
.
id
);
}
else
if
(
dropPosition
===
1
)
{
arrList
.
splice
(
endIndex
,
0
,
obj
.
id
);
}
}
console
.
log
(
arrList
,
'console.log(arrList);'
,
obj
.
menuID
);
dragMenu
({
menuID
:
obj
.
id
,
newParentID
:
obj
.
parentId
||
-
1
,
...
...
@@ -455,30 +460,23 @@ const MiniMenu = props => {
};
const
findNum
=
(
array
,
id
,
callback
,
parentId
=
''
)
=>
{
let
ptId
=
parentId
;
let
arr
=
[];
let
arrFlag
=
true
;
array
.
map
((
item
,
index
)
=>
{
if
(
item
.
menuID
===
id
)
{
arr
=
callback
(
array
,
id
,
parentId
,
index
);
callback
(
array
,
id
,
parentId
,
index
);
arrFlag
=
false
;
return
arr
;
return
;
}
console
.
log
(
arr
,
'arr'
);
if
(
arrFlag
&&
item
.
children
&&
item
.
children
.
length
>
0
)
{
ptId
=
item
.
menuID
;
arr
=
findNum
(
item
.
children
,
id
,
callback
,
ptId
);
return
arr
;
findNum
(
item
.
children
,
id
,
callback
,
ptId
);
}
});
return
arr
;
};
const
getArrList
=
(
arr
,
id
,
parentId
,
index
)
=>
{
console
.
log
(
arr
,
'arr'
,
id
,
'id'
,
parentId
,
'parentId'
,
index
,
'index'
);
return
{
arr
,
id
,
parentId
,
index
};
};
const
handleDragEnter
=
infos
=>
{
console
.
log
(
infos
,
'info'
);
};
return
(
<
Spin
spinning=
{
loading
}
tip=
"loading..."
>
<
div
...
...
src/services/index.js
View file @
6039d9c8
import
{
request
}
from
'../utils/request'
;
export
const
CITY_SERVICE
=
'/Cityinterface/rest/services'
;
//
export const CITY_SERVICE = '/Cityinterface/rest/services';
export
const
PUBLISH_SERVICE
=
'/Publish/OMS'
;
//
export const CITY_SERVICE = '/Publish/GateWay/CityServer';
export
const
CITY_SERVICE
=
'/Publish/GateWay/CityServer'
;
const
get
=
async
(
url
,
params
,
options
=
{})
=>
request
({
...
...
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