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
e2719255
Commit
e2719255
authored
Nov 13, 2020
by
张烨
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://g.civnet.cn:8443/test/maintenance
parents
f8dd3d06
ded44389
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
377 additions
and
184 deletions
+377
-184
AppMenu.js
src/pages/appConfig/AppMenu.js
+143
-2
SevenParams.js
src/pages/appConfig/SevenParams.js
+1
-1
LeftPart.jsx
src/pages/mobileConfig/menuconfig/LeftPart.jsx
+178
-149
LeftPart.less
src/pages/mobileConfig/menuconfig/LeftPart.less
+20
-19
MenuConfig.jsx
src/pages/mobileConfig/menuconfig/MenuConfig.jsx
+2
-6
UserManage.js
src/pages/userCenter/UserManage.js
+15
-3
RoleManage.jsx
src/pages/userCenter/roleManage/RoleManage.jsx
+8
-2
RoleManage.less
src/pages/userCenter/roleManage/RoleManage.less
+8
-0
SiteManage.jsx
src/pages/userCenter/siteManage/SiteManage.jsx
+2
-2
No files found.
src/pages/appConfig/AppMenu.js
View file @
e2719255
...
@@ -31,7 +31,7 @@ import ListCardItem from '../orgnazation/listCardItem';
...
@@ -31,7 +31,7 @@ import ListCardItem from '../orgnazation/listCardItem';
import
styles
from
'./AppMenu.less'
;
import
styles
from
'./AppMenu.less'
;
import
PicturesWall
from
'@/components/Upload/index'
;
import
PicturesWall
from
'@/components/Upload/index'
;
const
SevenParams
=
()
=>
{
const
AppMenu
=
()
=>
{
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
true
);
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
true
);
const
[
treeData
,
setTreeData
]
=
useState
([]);
// 菜单树
const
[
treeData
,
setTreeData
]
=
useState
([]);
// 菜单树
...
@@ -47,6 +47,7 @@ const SevenParams = () => {
...
@@ -47,6 +47,7 @@ const SevenParams = () => {
const
[
addMenuVisible
,
setAddMenuVisible
]
=
useState
(
false
);
const
[
addMenuVisible
,
setAddMenuVisible
]
=
useState
(
false
);
const
[
addMenuGroupVisible
,
setAddMenuGroupVisible
]
=
useState
(
false
);
const
[
addMenuGroupVisible
,
setAddMenuGroupVisible
]
=
useState
(
false
);
const
[
tipVisible
,
setTipVisible
]
=
useState
(
false
);
const
[
tipVisible
,
setTipVisible
]
=
useState
(
false
);
const
[
deleteMenuVisible
,
setDeleteMenuVisible
]
=
useState
(
false
);
const
[
deleteMenuVisible
,
setDeleteMenuVisible
]
=
useState
(
false
);
const
[
addMenuForm
]
=
Form
.
useForm
();
const
[
addMenuForm
]
=
Form
.
useForm
();
...
@@ -534,8 +535,148 @@ const SevenParams = () => {
...
@@ -534,8 +535,148 @@ const SevenParams = () => {
<
/div
>
<
/div
>
<
div
className
=
{
styles
.
previewContainer
}
>
界面预览
<
/div
>
<
div
className
=
{
styles
.
previewContainer
}
>
界面预览
<
/div
>
{
/* 必填项提示 */
}
{
/* 必填项提示 */
}
<
Modal
title
=
"提示"
visible
=
{
tipVisible
}
onCancel
=
{()
=>
setTipVisible
(
false
)}
width
=
"300px"
styles
=
{{
zIndex
:
999999
}}
centered
footer
=
{[
<
Button
key
=
"back"
type
=
"primary"
onClick
=
{()
=>
setTipVisible
(
false
)}
>
关闭
<
/Button>
,
]}
>
<
p
>
标记
<
span
className
=
{
styles
.
redText
}
>*<
/span>的为必填
项
<
/p
>
<
/Modal
>
{
/* 添加菜单 */
}
<
Modal
title
=
{
menuTitle
}
visible
=
{
addMenuVisible
}
onOk
=
{
submitAddMenu
}
onCancel
=
{()
=>
setAddMenuVisible
(
false
)}
okText
=
"确认"
cancelText
=
"取消"
centered
>
<
Form
form
=
{
addMenuForm
}
labelCol
=
{{
span
:
4
}}
>
<
Form
.
Item
name
=
"menuName"
label
=
"菜单名称"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入菜单名称"
/>
<
/Form.Item
>
<
Form
.
Item
name
=
"shortName"
label
=
"菜单别名"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入菜单别名"
/>
<
/Form.Item
>
<
Form
.
Item
name
=
"imageUrl"
label
=
"菜单图标"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入菜单图标"
/>
<
/Form.Item
>
<
Form
.
Item
name
=
"pageUrl"
label
=
"功能路径"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入菜单图标"
/>
<
/Form.Item
>
<
Form
.
Item
label
=
"图标预览"
>
<
PicturesWall
maxLen
=
{
3
}
/
>
<
/Form.Item
>
<
Form
.
Item
name
=
"funParam"
label
=
"功能参数"
>
<
Input
placeholder
=
"请输入功能参数"
/>
<
/Form.Item
>
<
/Form
>
<
ListCardItem
itemid
=
"1"
key
=
"1"
userList
=
{
rolelist
}
OUName
=
"关联角色"
getValueCallback
=
{
getRoleValueCallback
}
/
>
<
/Modal
>
{
/* 添加菜单组 */
}
<
Modal
title
=
{
menuTitle
}
visible
=
{
addMenuGroupVisible
}
onOk
=
{
submitAddMenuGroup
}
onCancel
=
{()
=>
setAddMenuGroupVisible
(
false
)}
okText
=
"确认"
cancelText
=
"取消"
centered
>
<
Form
form
=
{
addMenuGroupForm
}
labelCol
=
{{
span
:
4
}}
>
<
Form
.
Item
name
=
"menuName"
label
=
"分组名称"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入分组名称"
/>
<
/Form.Item
>
<
Form
.
Item
name
=
"shortName"
label
=
"分组别名"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入分组别名"
/>
<
/Form.Item
>
<
Form
.
Item
name
=
"imageUrl"
label
=
{
menuLabel
}
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入菜单图标"
/>
<
/Form.Item
>
<
Form
.
Item
label
=
"图标预览"
>
<
PicturesWall
maxLen
=
{
3
}
/
>
<
/Form.Item
>
{
/* 添加菜单组,label名称为在线图标才有离线图标 */
}
{
menuLabel
===
'在线图标'
&&
(
<
Form
.
Item
name
=
"offlineImgUrl"
label
=
"离线图标"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入离线图标"
/>
<
/Form.Item
>
)}
<
Form
.
Item
label
=
"图标预览"
>
<
PicturesWall
maxLen
=
{
3
}
/
>
<
/Form.Item
>
<
Form
.
Item
name
=
"funParam"
label
=
"功能参数"
>
<
Input
placeholder
=
"请输入功能参数"
/>
<
/Form.Item
>
<
/Form
>
<
/Modal
>
{
/* 删除菜单 */
}
<
Modal
title
=
{
menuTitle
}
visible
=
{
deleteMenuVisible
}
onOk
=
{
submitDeleteMenu
}
onCancel
=
{()
=>
setDeleteMenuVisible
(
false
)}
okText
=
"确认"
cancelText
=
"取消"
centered
>
<
span
>
确定删除?
<
/span
>
<
/Modal
>
<
/div
>
<
/div
>
);
);
};
};
export
default
SevenParams
;
export
default
AppMenu
;
src/pages/appConfig/SevenParams.js
View file @
e2719255
...
@@ -208,7 +208,7 @@ const SevenParams = () => {
...
@@ -208,7 +208,7 @@ const SevenParams = () => {
form
=
{
sevenForm
}
form
=
{
sevenForm
}
labelCol
=
{{
span
:
2
,
offset
:
2
}}
labelCol
=
{{
span
:
2
,
offset
:
2
}}
wrapperCol
=
{{
span
:
16
,
offset
:
1
}}
wrapperCol
=
{{
span
:
16
,
offset
:
1
}}
style
=
{{
height
:
'calc(100vh - 300px)'
}}
style
=
{{
height
:
'calc(100vh - 300px)'
,
overflow
:
'auto'
}}
onFinish
=
{
submitSevenParams
}
onFinish
=
{
submitSevenParams
}
initialValues
=
{{
ellipseType
:
'1'
,
transType
:
'1'
}}
initialValues
=
{{
ellipseType
:
'1'
,
transType
:
'1'
}}
>
>
...
...
src/pages/mobileConfig/menuconfig/LeftPart.jsx
View file @
e2719255
...
@@ -22,6 +22,7 @@ import {
...
@@ -22,6 +22,7 @@ import {
getTree
,
getTree
,
addMenuApi
,
addMenuApi
,
addMenuGroupApi
,
addMenuGroupApi
,
submitMenuInfo
,
getRoleList
,
getRoleList
,
getMenuInfo
,
getMenuInfo
,
deleteMenuApi
,
deleteMenuApi
,
...
@@ -34,6 +35,8 @@ const LeftPart = () => {
...
@@ -34,6 +35,8 @@ const LeftPart = () => {
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
true
);
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
true
);
const
[
treeData
,
setTreeData
]
=
useState
([]);
// 菜单树
const
[
treeData
,
setTreeData
]
=
useState
([]);
// 菜单树
const
[
treeState
,
setTreeState
]
=
useState
(
true
);
const
[
nodeType
,
setNodeType
]
=
useState
(
1
);
// 根据节点类型渲染不同的编辑表单item,0-0一级菜单,0-0-0二级,0-0-0-0三级
const
[
rolelist
,
setRolelist
]
=
useState
([]);
const
[
rolelist
,
setRolelist
]
=
useState
([]);
const
[
roleValueList
,
setRoleValueList
]
=
useState
({});
const
[
roleValueList
,
setRoleValueList
]
=
useState
({});
...
@@ -44,9 +47,10 @@ const LeftPart = () => {
...
@@ -44,9 +47,10 @@ const LeftPart = () => {
const
[
addMenuVisible
,
setAddMenuVisible
]
=
useState
(
false
);
const
[
addMenuVisible
,
setAddMenuVisible
]
=
useState
(
false
);
const
[
addMenuGroupVisible
,
setAddMenuGroupVisible
]
=
useState
(
false
);
const
[
addMenuGroupVisible
,
setAddMenuGroupVisible
]
=
useState
(
false
);
const
[
tipVisible
,
setTipVisible
]
=
useState
(
false
);
const
[
tipVisible
,
setTipVisible
]
=
useState
(
false
);
// const [editMenuVisible, setEditMenuVisible] = useState(false);
const
[
deleteMenuVisible
,
setDeleteMenuVisible
]
=
useState
(
false
);
const
[
deleteMenuVisible
,
setDeleteMenuVisible
]
=
useState
(
false
);
const
[
addMenuForm
]
=
Form
.
useForm
();
const
[
addMenuForm
]
=
Form
.
useForm
();
const
[
editMenuForm
]
=
Form
.
useForm
();
const
[
addMenuGroupForm
]
=
Form
.
useForm
();
const
[
addMenuGroupForm
]
=
Form
.
useForm
();
const
getRoleValueCallback
=
useCallback
((
value
,
index
)
=>
{
const
getRoleValueCallback
=
useCallback
((
value
,
index
)
=>
{
...
@@ -65,8 +69,14 @@ const LeftPart = () => {
...
@@ -65,8 +69,14 @@ const LeftPart = () => {
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
length
>
0
)
{
if
(
res
.
length
>
0
)
{
setTreeLoading
(
false
);
setTreeLoading
(
false
);
setTreeData
(
res
[
0
].
children
[
0
].
children
[
2
].
children
);
const
result
=
res
[
0
].
children
[
0
].
children
[
2
].
children
;
console
.
log
(
res
[
0
].
children
[
0
].
children
[
2
].
children
);
setTreeData
(
result
);
console
.
log
(
result
);
// 第一次加载,默认选择第一个组织
if
(
treeState
)
{
onSelect
([
result
[
0
].
menuID
],
false
);
setTreeState
(
false
);
}
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
...
@@ -109,11 +119,11 @@ const LeftPart = () => {
...
@@ -109,11 +119,11 @@ const LeftPart = () => {
onClick=
{
()
=>
addMenuGroup
(
menu
,
'分组图标'
)
}
onClick=
{
()
=>
addMenuGroup
(
menu
,
'分组图标'
)
}
/>
/>
</
Tooltip
>
</
Tooltip
>
<
Tooltip
title=
"添加菜单组"
>
{
/*
<Tooltip title="添加菜单组">
<EditTwoTone
<EditTwoTone
onClick={() => editMenuGroup(menu, '在线图标')}
onClick={() => editMenuGroup(menu, '在线图标')}
/>
/>
</
Tooltip
>
</Tooltip>
*/
}
</>
</>
)
}
)
}
{
menu
.
menuType
===
'MiniAppMenuGroupTwo'
&&
(
{
menu
.
menuType
===
'MiniAppMenuGroupTwo'
&&
(
...
@@ -121,20 +131,20 @@ const LeftPart = () => {
...
@@ -121,20 +131,20 @@ const LeftPart = () => {
<
Tooltip
title=
"添加菜单"
>
<
Tooltip
title=
"添加菜单"
>
<
FileAddTwoTone
onClick=
{
()
=>
addMenu
(
menu
)
}
/>
<
FileAddTwoTone
onClick=
{
()
=>
addMenu
(
menu
)
}
/>
</
Tooltip
>
</
Tooltip
>
<
Tooltip
title=
"编辑菜单组"
>
{
/*
<Tooltip title="编辑菜单组">
<EditTwoTone
<EditTwoTone
onClick={() => editMenuGroup(menu, '分组图标')}
onClick={() => editMenuGroup(menu, '分组图标')}
/>
/>
</
Tooltip
>
</Tooltip>
*/
}
</>
</>
)
}
)
}
{
menu
.
menuType
===
'MiniAppMenuThree'
&&
(
{
/* {
menu.menuType === 'MiniAppMenuThree' && (
<>
<>
<Tooltip title="编辑菜单">
<Tooltip title="编辑菜单">
<EditTwoTone onClick={() => editMenu(menu)} />
<EditTwoTone onClick={() => editMenu(menu)} />
</Tooltip>
</Tooltip>
</>
</>
)
}
)}
*/
}
<
Tooltip
title=
"删除菜单"
>
<
Tooltip
title=
"删除菜单"
>
<
DeleteTwoTone
onClick=
{
()
=>
deleteMenu
(
menu
)
}
/>
<
DeleteTwoTone
onClick=
{
()
=>
deleteMenu
(
menu
)
}
/>
</
Tooltip
>
</
Tooltip
>
...
@@ -148,6 +158,38 @@ const LeftPart = () => {
...
@@ -148,6 +158,38 @@ const LeftPart = () => {
};
};
};
};
// 获取当前菜单详细
const
onSelect
=
(
props
,
e
)
=>
{
// e.node.pos节点类型,根据这个渲染不同的编辑表单item,0-x一级菜单,0-0-x二级,0-0-0-x三级
if
(
e
)
{
if
(
e
.
node
.
pos
.
lastIndexOf
(
'-'
)
===
1
)
{
setNodeType
(
1
);
}
else
if
(
e
.
node
.
pos
.
lastIndexOf
(
'-'
)
===
3
)
{
setNodeType
(
2
);
}
else
{
setNodeType
(
3
);
}
}
setMenuID
(
props
[
0
]);
getMenuInfo
(
props
[
0
])
.
then
(
res
=>
{
if
(
res
.
success
)
{
editMenuForm
.
setFieldsValue
({
menuName
:
res
.
menuName
,
shortName
:
res
.
menuShortName
,
imageUrl
:
res
.
imageUrl
,
pageUrl
:
res
.
pageUrl
,
offlineImgUrl
:
res
.
offlineImgUrl
,
funParam
:
res
.
funParam
,
relatedRoleList
:
res
.
relatedRoleList
||
''
,
});
}
})
.
catch
(
err
=>
{
message
.
error
(
err
);
});
};
// 左侧目录树相关操作
// 左侧目录树相关操作
const
addMenu
=
menu
=>
{
const
addMenu
=
menu
=>
{
setAddMenuVisible
(
true
);
setAddMenuVisible
(
true
);
...
@@ -199,34 +241,35 @@ const LeftPart = () => {
...
@@ -199,34 +241,35 @@ const LeftPart = () => {
message
.
error
(
err
);
message
.
error
(
err
);
});
});
};
};
const
editMenuGroup
=
(
menu
,
label
)
=>
{
setAddMenuGroupVisible
(
true
);
// const editMenuGroup = (menu, label) => {
setMenuTitle
(
`编辑
${
menu
.
text
}
`
);
// setAddMenuGroupVisible(true);
setMenuID
(
menu
.
menuID
);
// setMenuTitle(`编辑${menu.text}`);
setMenuLabel
(
label
);
// setMenuID(menu.menuID);
getMenuInfo
(
menu
.
menuID
)
// setMenuLabel(label);
.
then
(
res
=>
{
// getMenuInfo(menu.menuID)
if
(
res
.
success
)
{
// .then(res => {
addMenuGroupForm
.
setFieldsValue
({
// if (res.success) {
menuName
:
res
.
menuName
,
// addMenuGroupForm.setFieldsValue({
shortName
:
res
.
menuShortName
,
// menuName: res.menuName,
imageUrl
:
res
.
imageUrl
,
// shortName: res.menuShortName,
pageUrl
:
res
.
pageUrl
,
// imageUrl: res.imageUrl,
offlineImgUrl
:
res
.
offlineImgUrl
,
// pageUrl: res.pageUrl,
funParam
:
res
.
funParam
,
// offlineImgUrl: res.offlineImgUrl,
relatedRoleList
:
res
.
relatedRoleList
||
[],
// funParam: res.funParam,
});
// relatedRoleList: res.relatedRoleList || [],
}
else
{
// });
notification
.
error
({
// } else {
message
:
'获取失败'
,
// notification.error({
description
:
res
.
message
,
// message: '获取失败',
});
// description: res.message,
}
// });
})
// }
.
catch
(
err
=>
{
// })
message
.
error
(
err
);
// .catch(err => {
});
// message.error(err);
};
// });
// };
const
deleteMenu
=
menu
=>
{
const
deleteMenu
=
menu
=>
{
setDeleteMenuVisible
(
true
);
setDeleteMenuVisible
(
true
);
setMenuTitle
(
`删除菜单
${
menu
.
text
}
`
);
setMenuTitle
(
`删除菜单
${
menu
.
text
}
`
);
...
@@ -300,6 +343,65 @@ const LeftPart = () => {
...
@@ -300,6 +343,65 @@ const LeftPart = () => {
setTipVisible
(
true
);
setTipVisible
(
true
);
}
}
};
};
// 提交-编辑菜单
const
submitEditMenu
=
()
=>
{
let
menuName
=
editMenuForm
.
getFieldValue
(
'menuName'
);
let
shortName
=
editMenuForm
.
getFieldValue
(
'shortName'
);
let
imageUrl
=
editMenuForm
.
getFieldValue
(
'imageUrl'
);
let
offlineImgUrl
=
editMenuForm
.
getFieldValue
(
'offlineImgUrl'
)
||
''
;
let
pageUrl
=
editMenuForm
.
getFieldValue
(
'pageUrl'
)
||
''
;
let
funParam
=
editMenuForm
.
getFieldValue
(
'funParam'
)
||
''
;
let
relatedRoleList
=
editMenuForm
.
getFieldValue
(
'funParam'
)
||
''
;
const
params
=
{
menuID
,
menuName
,
shortName
,
imageUrl
,
offlineImgUrl
,
pageUrl
,
funParam
,
relatedRoleList
,
};
// 根据节点类型,加一层判断,必填项全部不为空时才能提交
if
(
nodeType
===
1
)
{
if
(
menuName
&&
shortName
&&
imageUrl
&&
offlineImgUrl
)
{
submitMenu
(
params
);
}
else
{
setTipVisible
(
true
);
}
}
else
if
(
nodeType
===
2
)
{
if
(
menuName
&&
shortName
&&
imageUrl
)
{
submitMenu
(
params
);
}
else
{
setTipVisible
(
true
);
}
}
else
if
(
nodeType
===
3
)
{
if
(
menuName
&&
shortName
&&
imageUrl
&&
pageUrl
)
{
submitMenu
(
params
);
}
else
{
setTipVisible
(
true
);
}
}
};
const
submitMenu
=
params
=>
{
submitMenuInfo
(
params
)
.
then
(
res
=>
{
if
(
res
.
success
)
{
notification
.
success
({
message
:
'提交成功'
,
});
}
else
{
notification
.
error
({
message
:
'获取失败'
,
description
:
res
.
message
,
});
}
})
.
catch
(
err
=>
{
message
.
error
(
err
);
});
};
// 提交删除菜单
// 提交删除菜单
const
submitDeleteMenu
=
()
=>
{
const
submitDeleteMenu
=
()
=>
{
deleteMenuApi
(
menuID
)
deleteMenuApi
(
menuID
)
...
@@ -359,44 +461,18 @@ const LeftPart = () => {
...
@@ -359,44 +461,18 @@ const LeftPart = () => {
showLine=
{
{
showLeafIcon
:
false
}
}
showLine=
{
{
showLeafIcon
:
false
}
}
defaultExpandAll=
"true"
defaultExpandAll=
"true"
// selectedKeys=
{[
currentSelectMenu
]}
// selectedKeys=
{[
currentSelectMenu
]}
//
onSelect=
{
onSelect
}
onSelect=
{
onSelect
}
treeData=
{
treeData
.
map
(
t
=>
mapTree
(
t
))
}
treeData=
{
treeData
.
map
(
t
=>
mapTree
(
t
))
}
/>
/>
</
Spin
>
</
Spin
>
)
}
)
}
</
div
>
</
div
>
{
/* 必填项提示 */
}
<
div
className=
{
styles
.
editContainer
}
>
<
Modal
<
Form
title=
"提示"
form=
{
editMenuForm
}
visible=
{
tipVisible
}
labelCol=
{
{
span
:
4
}
}
onCancel=
{
()
=>
setTipVisible
(
false
)
}
wrapperCol=
{
{
span
:
19
}
}
width=
"300px"
>
centered
footer=
{
[
<
Button
key=
"back"
type=
"primary"
onClick=
{
()
=>
setTipVisible
(
false
)
}
>
关闭
</
Button
>,
]
}
>
<
p
>
标记
<
span
className=
{
styles
.
redText
}
>
*
</
span
>
的为必填项
</
p
>
</
Modal
>
{
/* 添加菜单 */
}
<
Modal
title=
{
menuTitle
}
visible=
{
addMenuVisible
}
onOk=
{
submitAddMenu
}
onCancel=
{
()
=>
setAddMenuVisible
(
false
)
}
okText=
"确认"
cancelText=
"取消"
centered
>
<
Form
form=
{
addMenuForm
}
labelCol=
{
{
span
:
4
}
}
>
<
Form
.
Item
<
Form
.
Item
name=
"menuName"
name=
"menuName"
label=
"菜单名称"
label=
"菜单名称"
...
@@ -418,93 +494,46 @@ const LeftPart = () => {
...
@@ -418,93 +494,46 @@ const LeftPart = () => {
>
>
<
Input
placeholder=
"请输入菜单图标"
/>
<
Input
placeholder=
"请输入菜单图标"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
name=
"imageUrl"
label=
"菜单图标"
rules=
{
[{
required
:
true
,
message
:
'不能为空'
}]
}
>
<
Input
placeholder=
"请输入菜单图标"
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"图标预览"
>
<
PicturesWall
maxLen=
{
3
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"funParam"
label=
"功能参数"
>
<
Input
placeholder=
"请输入功能参数"
/>
</
Form
.
Item
>
</
Form
>
<
ListCardItem
itemid=
"1"
key=
"1"
userList=
{
rolelist
}
OUName=
"关联角色"
getValueCallback=
{
getRoleValueCallback
}
/>
</
Modal
>
{
/* 添加菜单组 */
}
<
Modal
title=
{
menuTitle
}
visible=
{
addMenuGroupVisible
}
onOk=
{
submitAddMenuGroup
}
onCancel=
{
()
=>
setAddMenuGroupVisible
(
false
)
}
okText=
"确认"
cancelText=
"取消"
centered
>
<
Form
form=
{
addMenuGroupForm
}
labelCol=
{
{
span
:
4
}
}
>
<
Form
.
Item
name=
"menuName"
label=
"分组名称"
rules=
{
[{
required
:
true
,
message
:
'不能为空'
}]
}
>
<
Input
placeholder=
"请输入分组名称"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"shortName"
label=
"分组别名"
rules=
{
[{
required
:
true
,
message
:
'不能为空'
}]
}
>
<
Input
placeholder=
"请输入分组别名"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"imageUrl"
label=
{
menuLabel
}
rules=
{
[{
required
:
true
,
message
:
'不能为空'
}]
}
>
<
Input
placeholder=
"请输入菜单图标"
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"图标预览"
>
<
Form
.
Item
label=
"图标预览"
>
<
PicturesWall
maxLen=
{
3
}
/>
<
PicturesWall
maxLen=
{
3
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
{
/* 添加菜单组,label名称为在线图标才有离线图标 */
}
{
nodeType
===
1
&&
(
{
menuLabel
===
'在线图标'
&&
(
<>
<
Form
.
Item
<
Form
.
Item
name=
"offlineImgUrl"
name=
"offlineImgUrl"
label=
"离线图标"
label=
"离线图标"
rules=
{
[{
required
:
true
,
message
:
'不能为空'
}]
}
rules=
{
[{
required
:
true
,
message
:
'不能为空'
}]
}
>
>
<
Input
placeholder=
"请输入离线图标"
/>
<
Input
placeholder=
"请输入离线图标"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"图标预览"
>
<
PicturesWall
maxLen=
{
3
}
/>
</
Form
.
Item
>
</>
)
}
{
nodeType
===
3
&&
(
<>
<
Form
.
Item
name=
"pageUrl"
label=
"功能路径"
rules=
{
[{
required
:
true
,
message
:
'不能为空'
}]
}
>
<
Input
placeholder=
"请输入功能路径"
/>
</
Form
.
Item
>
</>
)
}
)
}
<
Form
.
Item
label=
"图标预览"
>
<
PicturesWall
maxLen=
{
3
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"funParam"
label=
"功能参数"
>
<
Form
.
Item
name=
"funParam"
label=
"功能参数"
>
<
Input
placeholder=
"请输入功能参数"
/>
<
Input
placeholder=
"请输入功能参数"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
wrapperCol=
{
{
offset
:
12
}
}
>
<
Button
key=
"back"
type=
"primary"
onClick=
{
()
=>
submitEditMenu
()
}
>
提交
</
Button
>
</
Form
.
Item
>
</
Form
>
</
Form
>
</
Modal
>
</
div
>
{
/* 删除菜单 */
}
<
div
className=
{
styles
.
previewContainer
}
>
关联角色
</
div
>
<
Modal
{
/* 必填项提示 */
}
title=
{
menuTitle
}
visible=
{
deleteMenuVisible
}
onOk=
{
submitDeleteMenu
}
onCancel=
{
()
=>
setDeleteMenuVisible
(
false
)
}
okText=
"确认"
cancelText=
"取消"
centered
>
<
span
>
确定删除?
</
span
>
</
Modal
>
</
div
>
</
div
>
);
);
};
};
...
...
src/pages/mobileConfig/menuconfig/LeftPart.less
View file @
e2719255
.contentContainer{
.contentContainer{
// min-height: calc(100vh - 194px);
max-height: calc(100vh - 300px);
overflow-x: auto;
display: flex;
display: flex;
.menuContainer{
.menuContainer{
min-width: 300px;
min-width: 300px;
border:1px solid #abaeb1;
border:1px solid #abaeb1;
min-height:calc(100vh - 300px);
//
min-height:calc(100vh - 300px);
overflow-y:auto;
overflow-y:auto;
.ant-tree-list{
.ant-tree-list{
padding: 10px;
padding: 10px;
height:calc(100vh - 3
0
0px);
height:calc(100vh - 3
3
0px);
.ant-tree-switcher{
.ant-tree-switcher{
line-height: 1;
line-height: 1;
color:#1890FF;
color:#1890FF;
...
@@ -19,11 +20,23 @@
...
@@ -19,11 +20,23 @@
}
}
}
}
}
}
.
preview
Container{
.
edit
Container{
margin-left: 12px;
margin-left: 12px;
flex: 1;
flex: 1;
padding: 16px;
float: left;
float: left;
// background: white;
min-width: 500px;
border:1px solid #abaeb1;
.ant-table-pagination-right{
padding-right: 12px;
}
}
.previewContainer{
margin-left: 12px;
// flex: 1;
float: left;
min-width: 400px;
border:1px solid #abaeb1;
.ant-table-pagination-right{
.ant-table-pagination-right{
padding-right: 12px;
padding-right: 12px;
}
}
...
@@ -53,16 +66,4 @@
...
@@ -53,16 +66,4 @@
.redText{
.redText{
color: red;
color: red;
cursor: pointer;
cursor: pointer;
}
}
// .ant-modal-root{
\ No newline at end of file
// .ant-tree-switcher{
// line-height: 1;
// color:#1890FF;
// }
// }
// .menuContainer{
// width: 300px;
// padding: 10px;
// background: #1890FF;
// }
\ No newline at end of file
src/pages/mobileConfig/menuconfig/MenuConfig.jsx
View file @
e2719255
...
@@ -7,12 +7,8 @@ const MenuConfig = props => {
...
@@ -7,12 +7,8 @@ const MenuConfig = props => {
const
[
flag
,
setFlag
]
=
useState
(
1
);
const
[
flag
,
setFlag
]
=
useState
(
1
);
return
(
return
(
<
ProCard
split=
"vertical"
>
<
ProCard
split=
"vertical"
>
<
ProCard
colSpan=
"400px"
>
<
LeftPart
/>
<
LeftPart
/>
{
/* <ProCard><AddForm /></ProCard> */
}
</
ProCard
>
<
ProCard
>
<
AddForm
/>
</
ProCard
>
</
ProCard
>
</
ProCard
>
);
);
};
};
...
...
src/pages/userCenter/UserManage.js
View file @
e2719255
...
@@ -78,7 +78,7 @@ const UserManage = () => {
...
@@ -78,7 +78,7 @@ const UserManage = () => {
const
[
deleteUserVisible
,
setDeleteUserVisible
]
=
useState
(
false
);
const
[
deleteUserVisible
,
setDeleteUserVisible
]
=
useState
(
false
);
const
[
orgTitle
,
setOrgTitle
]
=
useState
(
'机构'
);
const
[
orgTitle
,
setOrgTitle
]
=
useState
(
'机构'
);
const
[
tableTitle
,
setTableTitle
]
=
useState
(
'
机构
'
);
const
[
tableTitle
,
setTableTitle
]
=
useState
(
'
0
'
);
const
[
orgID
,
setOrgID
]
=
useState
();
const
[
orgID
,
setOrgID
]
=
useState
();
const
[
newOrgID
,
setNewOrgID
]
=
useState
();
const
[
newOrgID
,
setNewOrgID
]
=
useState
();
const
[
currentUser
,
setCurrentUser
]
=
useState
({});
const
[
currentUser
,
setCurrentUser
]
=
useState
({});
...
@@ -303,6 +303,12 @@ const UserManage = () => {
...
@@ -303,6 +303,12 @@ const UserManage = () => {
onSelect
([
res
[
0
].
id
]);
onSelect
([
res
[
0
].
id
]);
setTreeState
(
false
);
setTreeState
(
false
);
}
}
}
else
{
setTreeLoading
(
false
);
notification
.
error
({
message
:
'获取失败'
,
description
:
res
.
message
,
});
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
...
@@ -328,9 +334,9 @@ const UserManage = () => {
...
@@ -328,9 +334,9 @@ const UserManage = () => {
setOrgID
(
props
[
0
]
||
currentSelectOrg
);
setOrgID
(
props
[
0
]
||
currentSelectOrg
);
getOneOUUserListNew
(
props
[
0
]
||
currentSelectOrg
)
getOneOUUserListNew
(
props
[
0
]
||
currentSelectOrg
)
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
IsSuccess
)
{
if
(
res
.
code
===
0
)
{
setTableLoading
(
false
);
setTableLoading
(
false
);
const
temp
=
flatten
(
getUsers
(
res
.
D
ata
));
const
temp
=
flatten
(
getUsers
(
res
.
d
ata
));
console
.
log
(
temp
);
console
.
log
(
temp
);
setTableTitle
(
temp
.
length
);
setTableTitle
(
temp
.
length
);
const
table
=
temp
.
map
((
item
,
index
)
=>
{
const
table
=
temp
.
map
((
item
,
index
)
=>
{
...
@@ -341,6 +347,12 @@ const UserManage = () => {
...
@@ -341,6 +347,12 @@ const UserManage = () => {
return
item
;
return
item
;
});
});
setTableData
(
table
);
setTableData
(
table
);
}
else
{
setTreeLoading
(
false
);
notification
.
error
({
message
:
'获取失败'
,
description
:
res
.
message
,
});
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
...
...
src/pages/userCenter/roleManage/RoleManage.jsx
View file @
e2719255
...
@@ -67,11 +67,13 @@ const SiteManage = () => {
...
@@ -67,11 +67,13 @@ const SiteManage = () => {
// });
// });
// }, [flag]);
// }, [flag]);
useEffect
(()
=>
{
useEffect
(()
=>
{
setSpinLoading
(
true
);
getUserRelationList
({
getUserRelationList
({
userID
:
82
,
userID
:
82
,
_version
:
9999
,
_version
:
9999
,
_dc
:
Date
.
now
(),
_dc
:
Date
.
now
(),
}).
then
(
res
=>
{
}).
then
(
res
=>
{
setSpinLoading
(
false
);
let
arr
=
res
.
roleList
;
let
arr
=
res
.
roleList
;
let
arr2
=
transTree2
(
arr
);
let
arr2
=
transTree2
(
arr
);
console
.
log
(
arr2
,
'arr2'
);
console
.
log
(
arr2
,
'arr2'
);
...
@@ -229,6 +231,8 @@ const SiteManage = () => {
...
@@ -229,6 +231,8 @@ const SiteManage = () => {
onSelect=
{
e
=>
handleTreeSelect
(
e
)
}
onSelect=
{
e
=>
handleTreeSelect
(
e
)
}
treeData=
{
treeData
}
treeData=
{
treeData
}
blockNode
blockNode
autoExpandParent
defaultExpandAll
/>
/>
</
Spin
>
</
Spin
>
<
AddModal
<
AddModal
...
@@ -250,8 +254,8 @@ const SiteManage = () => {
...
@@ -250,8 +254,8 @@ const SiteManage = () => {
/>
/>
</
Card
>
</
Card
>
</
Col
>
</
Col
>
<
Col
lg=
{
18
}
md=
{
24
}
>
<
Col
lg=
{
18
}
>
<
Card
className=
{
styles
.
cardBox
}
>
<
Card
style=
{
{
marginBottom
:
'10px'
}
}
>
<
Row
align=
"middle"
>
<
Row
align=
"middle"
>
<
Col
span=
{
1
}
>
搜索
</
Col
>
<
Col
span=
{
1
}
>
搜索
</
Col
>
<
Col
span=
{
8
}
>
<
Col
span=
{
8
}
>
...
@@ -264,6 +268,8 @@ const SiteManage = () => {
...
@@ -264,6 +268,8 @@ const SiteManage = () => {
/>
/>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
</
Card
>
<
Card
className=
{
styles
.
cardBoxR
}
>
{
ouid
&&
(
{
ouid
&&
(
<
ListCard
<
ListCard
ouid=
{
ouid
}
ouid=
{
ouid
}
...
...
src/pages/userCenter/roleManage/RoleManage.less
View file @
e2719255
.cardBox{
.cardBox{
min-height: calc(100vh - 200px);
min-height: calc(100vh - 200px);
max-height: calc(100vh - 200px);
overflow-y: scroll;
}
}
.ant-tree-node-content-wrapper-open{
.ant-tree-node-content-wrapper-open{
display: flex;
display: flex;
...
@@ -22,4 +24,9 @@
...
@@ -22,4 +24,9 @@
// flex-wrap: wrap;
// flex-wrap: wrap;
justify-content: space-around;
justify-content: space-around;
align-items: center;
align-items: center;
}
.cardBoxR{
min-height: calc(100vh - 292px);
max-height: calc(100vh - 292px);
overflow-y: scroll;
}
}
\ No newline at end of file
src/pages/userCenter/siteManage/SiteManage.jsx
View file @
e2719255
...
@@ -207,7 +207,7 @@ const SiteManage = () => {
...
@@ -207,7 +207,7 @@ const SiteManage = () => {
<
PageContainer
>
<
PageContainer
>
<
GridContent
>
<
GridContent
>
<
Row
gutter=
{
12
}
>
<
Row
gutter=
{
12
}
>
<
Col
lg=
{
6
}
sm=
{
6
}
>
<
Col
lg=
{
6
}
>
<
Card
className=
{
styles
.
cardBox
}
>
<
Card
className=
{
styles
.
cardBox
}
>
<
Spin
<
Spin
tip=
"loading...."
tip=
"loading...."
...
@@ -235,7 +235,7 @@ const SiteManage = () => {
...
@@ -235,7 +235,7 @@ const SiteManage = () => {
/>
/>
</
Card
>
</
Card
>
</
Col
>
</
Col
>
<
Col
lg=
{
18
}
sm=
{
18
}
>
<
Col
lg=
{
18
}
>
<
Card
style=
{
{
marginBottom
:
'10px'
}
}
>
<
Card
style=
{
{
marginBottom
:
'10px'
}
}
>
<
Row
align=
"middle"
>
<
Row
align=
"middle"
>
<
Col
span=
{
1
}
>
搜索
</
Col
>
<
Col
span=
{
1
}
>
搜索
</
Col
>
...
...
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