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
ebe22401
Commit
ebe22401
authored
Jan 13, 2021
by
Maofei94
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: web拖拽问题
parent
ecbf51d8
Pipeline
#22347
passed with stages
in 19 minutes 21 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
14 deletions
+50
-14
index.js
src/pages/mobileConfig/index.js
+2
-1
index.js
src/pages/webConfig/index.js
+2
-0
webMenu.jsx
src/pages/webConfig/menuconfig/webMenu.jsx
+46
-12
index.js
src/utils/request/index.js
+0
-1
No files found.
src/pages/mobileConfig/index.js
View file @
ebe22401
...
...
@@ -44,7 +44,8 @@ const MobileConfigPage = props => {
setLoading
(
false
);
if
(
res
.
code
===
0
)
{
const
{
data
}
=
res
;
let
array
=
data
[
0
].
children
.
length
>
0
&&
[...
data
[
0
].
children
];
let
array
=
(
data
[
0
].
children
.
length
>
0
&&
[...
data
[
0
].
children
])
||
[];
let
arr
=
[];
array
.
map
(
item
=>
{
arr
.
push
({
...
...
src/pages/webConfig/index.js
View file @
ebe22401
...
...
@@ -254,6 +254,8 @@ const WebConfigPage = props => {
onUpdate
=
{
handleUpdateOnMenuChange
}
configFiles
=
{
configFiles
}
updateMenuTree
=
{
updateMenuTree
}
userMode
=
{
userMode
}
webid
=
{
tabPaneItem
?.
id
}
subSystemValue
=
{
tabPaneItem
?.
subSystemValue
}
/
>
<
/ProCard
>
...
...
src/pages/webConfig/menuconfig/webMenu.jsx
View file @
ebe22401
...
...
@@ -20,10 +20,18 @@ import {
getWebMenuInfo
,
// 查
dragMenu
,
// 菜单拖拽
getProductList
,
getWebModuleTree
,
}
from
'@/services/webConfig/api'
;
const
MiniMenu
=
props
=>
{
const
{
menu
,
configFiles
,
subSystemValue
,
updateMenuTree
}
=
props
;
const
{
menu
,
configFiles
,
subSystemValue
,
updateMenuTree
,
userMode
,
webid
,
}
=
props
;
const
[
flag
,
setFlag
]
=
useState
(
1
);
// 刷新标志
const
[
loading
,
setLoading
]
=
useState
(
false
);
// 加载
const
[
menuID
,
setMenuID
]
=
useState
(
''
);
// 选中的树ID
...
...
@@ -40,6 +48,7 @@ const MiniMenu = props => {
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
[
newTreeList
,
setNewTreeList
]
=
useState
([]);
const
[
productList
,
setProductList
]
=
useState
([]);
const
[
menuList
,
setMenuList
]
=
useState
([]);
// 菜单树
/* ***************************************************** */
const
[
curMenuType
,
setCurMenuType
]
=
useState
(
''
);
...
...
@@ -47,7 +56,7 @@ const MiniMenu = props => {
// 获取菜单信息
useEffect
(()
=>
{
getInfo
();
},
[
menuID
]);
},
[
menuID
,
webid
]);
useEffect
(()
=>
{
getProductList
().
then
(
res
=>
{
const
{
code
,
data
}
=
res
;
...
...
@@ -56,11 +65,36 @@ const MiniMenu = props => {
}
});
},
[]);
useEffect
(()
=>
{
setLoading
(
true
);
getWebModuleTree
(
userMode
||
'super'
)
.
then
(
res
=>
{
setLoading
(
false
);
console
.
log
(
res
);
const
{
code
,
data
}
=
res
;
if
(
code
===
0
)
{
let
arr
=
data
.
filter
(
item
=>
item
.
id
===
'Web4SingleStation'
)
.
map
(
r
=>
r
.
children
.
filter
(
i
=>
i
.
id
===
webid
))
.
flat
(
2
);
let
arr2
=
arr
[
0
].
children
.
find
(
item
=>
item
.
text
===
'菜单管理'
).
children
||
[];
setMenuList
(
arr2
||
[]);
console
.
log
(
arr
,
webid
,
arr2
);
}
})
.
catch
(
err
=>
{
setLoading
(
false
);
});
return
()
=>
{
setLoading
(
false
);
};
},
[
flag
,
webid
]);
useEffect
(()
=>
{
console
.
log
(
menu
,
'menu'
);
setNewTreeList
(
menu
.
children
||
[]);
},
[
menu
]);
setNewTreeList
(
menu
List
||
[]);
},
[
menu
List
]);
// 处理数据
const
mapTree
=
val
=>
{
...
...
@@ -164,7 +198,7 @@ const MiniMenu = props => {
setFlag
(
flag
+
1
);
setNodeType
(
''
);
setNodeObj
(
''
);
updateMenuTree
(
'delete'
,
nodeObj
);
//
updateMenuTree('delete', nodeObj);
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
...
...
@@ -228,7 +262,7 @@ const MiniMenu = props => {
setAddVisible
(
false
);
setAddTwoVisible
(
false
);
setFlag
(
flag
+
1
);
updateMenuTree
(
'add'
,
item
);
//
updateMenuTree('add', item);
notification
.
success
({
message
:
'提示'
,
description
:
'新增成功'
,
...
...
@@ -265,7 +299,7 @@ const MiniMenu = props => {
if
(
res
.
success
)
{
setFlag
(
flag
+
1
);
updateMenuTree
(
'edit'
);
//
updateMenuTree('edit');
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
...
...
@@ -354,8 +388,8 @@ const MiniMenu = props => {
}).
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
success
)
{
updateMenuTree
();
//
setFlag(flag + 1);
//
updateMenuTree();
setFlag
(
flag
+
1
);
}
else
{
notification
.
error
({
message
:
'提示'
,
...
...
@@ -413,11 +447,11 @@ const MiniMenu = props => {
</
Tooltip
>
</
div
>
</
div
>
{
menu
.
children
.
length
>
0
&&
(
{
menu
List
.
length
>
0
&&
(
<
Tree
showIcon
onSelect=
{
handleSelect
}
treeData=
{
menu
.
children
.
map
(
item
=>
mapTree
(
item
))
}
treeData=
{
menu
List
.
map
(
item
=>
mapTree
(
item
))
}
blockNode
draggable
autoExpandParent
...
...
src/utils/request/index.js
View file @
ebe22401
...
...
@@ -38,7 +38,6 @@ axios.interceptors.request.use( function (request){
if
(
request
.
url
!=
'/Publish/OMS/OMSLogin'
&&
request
.
url
!=
'/Publish/OMS/FileCenter/SaveMobileApk'
&&
request
.
url
!=
'/Publish/OMS/GateWayConfig'
)
request
.
url
=
getWay
+
request
.
url
}
console
.
log
(
request
,
pandaPublish
)
return
request
},
function
(
error
)
{
// Any status codes that falls outside the range of 2xx cause this function to trigger
...
...
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