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
97f01955
Commit
97f01955
authored
Mar 08, 2022
by
邓超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://g.civnet.cn:8443/ReactWeb5/maintenance
# Conflicts: # src/pages/userCenter/userManage/AddUserModal.jsx
parents
26e56baa
a355b655
Pipeline
#45358
passed with stages
in 7 minutes 36 seconds
Changes
16
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
261 additions
and
230 deletions
+261
-230
index.jsx
src/components/MapScope/index.jsx
+8
-21
maintenance.less
src/pages/bsmanager/maintenance/maintenance.less
+1
-1
index.jsx
src/pages/productCenter/mobileConfig/index.jsx
+5
-1
AddForm.jsx
src/pages/productCenter/mobileConfig/menuconfig/AddForm.jsx
+3
-2
miniMenu.jsx
src/pages/productCenter/mobileConfig/menuconfig/miniMenu.jsx
+0
-0
editForm.jsx
...pages/productCenter/productConfig/components/editForm.jsx
+41
-29
productConfig.jsx
src/pages/productCenter/productConfig/productConfig.jsx
+42
-120
index.jsx
src/pages/productCenter/webConfig/index.jsx
+4
-1
webMenu.jsx
src/pages/productCenter/webConfig/menuconfig/webMenu.jsx
+49
-13
RoleManage.jsx
src/pages/userCenter/roleManage/RoleManage.jsx
+46
-10
AddSubOrgModal.jsx
src/pages/userCenter/userManage/AddSubOrgModal.jsx
+13
-13
AddUserModal.jsx
src/pages/userCenter/userManage/AddUserModal.jsx
+7
-1
EditOrgModal.jsx
src/pages/userCenter/userManage/EditOrgModal.jsx
+14
-6
RelateRoleModal.jsx
src/pages/userCenter/userManage/RelateRoleModal.jsx
+5
-6
UserManage.jsx
src/pages/userCenter/userManage/UserManage.jsx
+17
-6
UserManage.less
src/pages/userCenter/userManage/UserManage.less
+6
-0
No files found.
src/components/MapScope/index.jsx
View file @
97f01955
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
SiteModal
from
'@/components/Modal/SiteModa'
;
import
{
Input
,
Cascader
,
Button
}
from
'antd'
;
import
{
gcj_decrypt
,
exetent2AmapPoint
,
lngLat2WebMercator
,
}
from
'@/utils/transformUtil'
;
import
{
gcj_decrypt
,
exetent2AmapPoint
,
lngLat2WebMercator
}
from
'@/utils/transformUtil'
;
import
{
GetAllConfig
,
GetMetaData
}
from
'@/services/gis/gis'
;
const
{
Search
}
=
Input
;
import
styles
from
'./index.less'
;
...
...
@@ -54,10 +50,7 @@ const MapScope = props => {
const
layers
=
res2
.
layers
||
[];
const
workspace
=
res2
.
mapName
.
split
(
'_'
)[
0
];
const
subLayers
=
layers
.
filter
(
layer
=>
layer
.
subLayerIds
&&
layer
.
subLayerIds
.
length
===
0
,
)
.
filter
(
layer
=>
layer
.
subLayerIds
&&
layer
.
subLayerIds
.
length
===
0
)
.
map
(
layer
=>
layer
.
name
);
const
paramLayers
=
`
${
workspace
}
:
${
subLayers
.
join
(
','
)}
`
;
const
params
=
{
...
...
@@ -68,9 +61,7 @@ const MapScope = props => {
console
.
log
(
'params'
,
params
);
const
wmsOption
=
{
tileSize
:
512
,
url
:
`
${
location
.
origin
}
/Cityinterface/rest/services/MapServer.svc/
${
url
:
`
${
location
.
origin
}
/Cityinterface/rest/services/MapServer.svc/
${
pipenetCofig
.
servicename
}
/GeoServerProxy/wms`
,
blend
:
false
,
...
...
@@ -200,17 +191,16 @@ const MapScope = props => {
});
};
const
filter
=
(
inputValue
,
path
)
=>
{
return
path
.
some
(
option
=>
option
.
name
.
toLowerCase
().
indexOf
(
inputValue
.
toLowerCase
())
>
-
1
,
);
return
path
.
some
(
option
=>
option
.
name
.
toLowerCase
().
indexOf
(
inputValue
.
toLowerCase
())
>
-
1
);
};
return
(
<
SiteModal
{
...
props
}
title=
{
<
span
>
<
span
style=
{
{
marginRight
:
'20px'
}
}
>
{
title
}
的范围选择
</
span
>
<
span
style=
{
{
marginRight
:
'20px'
}
}
>
<
span
style=
{
{
fontWeight
:
'blod'
,
color
:
'red'
}
}
>
{
title
}
</
span
>
的范围选择
</
span
>
<
span
style=
{
{
color
:
'red'
}
}
>
提示:必须框选范围
</
span
>
</
span
>
}
...
...
@@ -224,10 +214,7 @@ const MapScope = props => {
okText=
"确认"
onOk=
{
()
=>
onSubmit
()
}
>
<
div
style=
{
{
width
:
'750px'
,
height
:
'500px'
}
}
className=
{
styles
.
indexContainer
}
>
<
div
style=
{
{
width
:
'750px'
,
height
:
'500px'
}
}
className=
{
styles
.
indexContainer
}
>
<
div
style=
{
{
width
:
'750px'
,
height
:
'500px'
,
position
:
'absolute'
}
}
>
<
div
id=
{
mapId
}
style=
{
{
width
:
'750px'
,
height
:
'500px'
}
}
/>
...
...
src/pages/bsmanager/maintenance/maintenance.less
View file @
97f01955
...
...
@@ -79,7 +79,7 @@
padding: 10px 24px 0px 24px;
}
.ant-modal-footer {
padding: 0px 48px 10px 40px;
padding:
1
0px 48px 10px 40px;
}
.ant-table-pagination.ant-pagination {
margin: 5px 0;
...
...
src/pages/productCenter/mobileConfig/index.jsx
View file @
97f01955
...
...
@@ -117,6 +117,8 @@ const MobileConfigPage = props => {
};
// 删除
const
delMini
=
(
val
,
closeModal
)
=>
{
console
.
log
(
clientName
);
console
.
log
(
val
);
setLoading
(
true
);
closeModal
();
console
.
log
(
val
);
...
...
@@ -128,7 +130,9 @@ const MobileConfigPage = props => {
.
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
code
===
0
)
{
setMiniTitle
(
''
);
if
(
clientName
===
val
)
{
setMiniTitle
(
singleList
[
0
].
text
);
}
setTimeout
(()
=>
{
setFlag
(
flag
+
1
);
},
500
);
...
...
src/pages/productCenter/mobileConfig/menuconfig/AddForm.jsx
View file @
97f01955
...
...
@@ -11,6 +11,7 @@ const AddForm = props => {
submitCallback
,
nodeType
,
nodeObj
,
keepType
,
addType
,
submitLoading
,
valueCallback
,
...
...
@@ -27,11 +28,11 @@ const AddForm = props => {
const
submit
=
()
=>
{
if
(
addType
===
1
||
addType
===
2
)
{
let
obj
=
form
.
getFieldsValue
();
submitCallback
(
obj
,
nodeObj
);
submitCallback
(
obj
,
nodeObj
,
keepType
);
}
if
(
addType
===
3
||
addType
===
4
)
{
let
obj
=
otherForm
.
getFieldsValue
();
submitCallback
(
obj
,
nodeObj
);
submitCallback
(
obj
,
nodeObj
,
keepType
);
}
};
const
finish
=
()
=>
{
...
...
src/pages/productCenter/mobileConfig/menuconfig/miniMenu.jsx
View file @
97f01955
This diff is collapsed.
Click to expand it.
src/pages/productCenter/productConfig/components/editForm.jsx
View file @
97f01955
...
...
@@ -28,12 +28,17 @@ const EditForm = props => {
},
];
useEffect
(()
=>
{
console
.
log
(
productObj
.
ProductName
);
console
.
log
(
productObj
.
IsUsed
,
'productObj.IsUsed'
);
form
.
setFieldsValue
({
...
productObj
});
let
aa
=
userProductsList
.
find
(
i
=>
i
.
ProductName
==
productObj
.
ProductName
);
console
.
log
(
aa
);
if
(
!
productObj
.
IsUsed
)
{
setBut
(
true
);
form
.
setFieldsValue
({
...
productObj
});
}
else
{
setBut
(
false
);
form
.
setFieldsValue
({
...
aa
});
}
},
[
productObj
]);
// 提交选择
...
...
@@ -109,35 +114,42 @@ const EditForm = props => {
))
}
</
Select
>
</
Item
>
<
Item
label=
"访问路由"
name=
"RouteUrl"
rules=
{
[
{
required
:
true
,
message
:
'请输入访问路由,ip加端口号,示例//localhost:3001'
,
},
]
}
>
{
/* <Input addonBefore="//" placeholder="请输入访问路由" allowClear /> */
}
<
Input
placeholder=
"请输入访问路由,ip加端口号,示例//localhost:3001"
allowClear
/>
</
Item
>
{
but
?
(
<></>
)
:
(
<>
<
Item
label=
"访问路由"
name=
"RouteUrl"
rules=
{
[
{
required
:
true
,
message
:
'请输入访问路由,ip加端口号,示例//localhost:3001'
,
},
]
}
>
{
/* <Input addonBefore="//" placeholder="请输入访问路由" allowClear /> */
}
<
Input
placeholder=
"请输入访问路由,ip加端口号,示例//localhost:3001"
allowClear
/>
</
Item
>
<
Item
label=
"默认配置"
name=
"DefaultSetting"
rules=
{
[
{
required
:
false
,
message
:
'请输入默认配置'
,
},
]
}
>
<
TextArea
placeholder=
'请输入json对象,示例
{
"name"
:
"张三"
,
"age"
:
"18"
}
'
autoSize=
{
{
minRows
:
3
,
maxRows
:
5
}
}
/>
</
Item
>
</>
)
}
<
Item
label=
"默认配置"
name=
"DefaultSetting"
rules=
{
[
{
required
:
false
,
message
:
'请输入默认配置'
,
},
]
}
>
<
TextArea
placeholder=
'请输入json对象,示例{"name":"张三","age":"18"}'
autoSize=
{
{
minRows
:
3
,
maxRows
:
5
}
}
/>
</
Item
>
<
div
style=
{
{
display
:
'flex'
,
marginLeft
:
'35%'
}
}
>
<
Item
wrapperCol=
{
{
span
:
8
,
offset
:
8
}
}
style=
{
{
marginRight
:
'30px'
}
}
>
<
Button
type=
"primary"
htmlType=
"submit"
disabled=
{
but
}
>
...
...
src/pages/productCenter/productConfig/productConfig.jsx
View file @
97f01955
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Card
,
List
,
Drawer
,
Button
,
Empty
,
Spin
,
notification
,
Switch
,
message
}
from
'antd'
;
import
{
Card
,
List
,
Empty
,
Spin
,
notification
,
Switch
}
from
'antd'
;
import
{
modifyProduct
,
getProductList
,
delProductList
}
from
'@/services/webConfig/api'
;
import
classnames
from
'classnames'
;
import
EditForm
from
'./components/editForm'
;
import
styles
from
'./productConfig.less'
;
const
ProductConfig
=
props
=>
{
const
[
addVisible
,
setAddVisible
]
=
useState
(
false
);
const
[
productList
,
setProductList
]
=
useState
([]);
const
[
userProductsList
,
setUserProductsList
]
=
useState
([]);
const
[
productObj
,
setProductObj
]
=
useState
(
''
);
...
...
@@ -14,42 +13,42 @@ const ProductConfig = props => {
const
[
flag
,
setFlag
]
=
useState
(
1
);
const
[
list
,
setList
]
=
useState
(
new
Set
());
// 默认展示第一项
useEffect
(()
=>
{
setLoading
(
true
);
getProductList
()
.
then
(
res
=>
{
const
{
code
}
=
res
;
if
(
code
===
0
)
{
const
{
data
:
{
AllProducts
,
UserProducts
},
}
=
res
;
// setProductList(AllProducts);
setUserProductsList
(
UserProducts
);
setProductObj
(
AllProducts
[
0
]);
AllProducts
.
map
(
i
=>
{
list
.
add
(
i
.
ProductType
);
});
let
a
=
[];
list
.
map
(
i
=>
{
a
.
push
(
i
);
});
let
aa
=
[];
a
.
map
((
i
,
j
)
=>
{
let
ad
=
[];
AllProducts
.
map
(
k
=>
{
if
(
k
.
ProductType
==
i
)
{
ad
.
push
(
k
);
}
});
aa
.
push
(
ad
);
});
setProductList
(
aa
);
}
})
.
finally
(()
=>
{
setLoading
(
false
);
});
},
[]);
//
useEffect(() => {
//
setLoading(true);
//
getProductList()
//
.then(res => {
//
const { code } = res;
//
if (code === 0) {
//
const {
//
data: { AllProducts, UserProducts },
//
} = res;
//
// setProductList(AllProducts);
//
setUserProductsList(UserProducts);
//
setProductObj(AllProducts[0]);
//
AllProducts.map(i => {
//
list.add(i.ProductType);
//
});
//
let a = [];
//
list.map(i => {
//
a.push(i);
//
});
//
let aa = [];
//
a.map((i, j) => {
//
let ad = [];
//
AllProducts.map(k => {
//
if (k.ProductType == i) {
//
ad.push(k);
//
}
//
});
//
aa.push(ad);
//
});
//
setProductList(aa);
//
}
//
})
//
.finally(() => {
//
setLoading(false);
//
});
//
}, []);
useEffect
(()
=>
{
setLoading
(
true
);
...
...
@@ -62,9 +61,9 @@ const ProductConfig = props => {
}
=
res
;
// setProductList(AllProducts);
setUserProductsList
(
UserProducts
);
// if (!productObj && data
.length > 0) {
// setProductObj(data
[0]);
//
}
if
(
!
productObj
&&
AllProducts
.
length
>
0
)
{
setProductObj
(
AllProducts
[
0
]);
}
// setProductList(data);
AllProducts
.
map
(
i
=>
{
list
.
add
(
i
.
ProductType
);
...
...
@@ -91,10 +90,6 @@ const ProductConfig = props => {
});
},
[
flag
]);
// 展示新增抽屉
const
handleAdd
=
()
=>
{
setAddVisible
(
true
);
};
// 删除
const
handleDel
=
item
=>
{
setLoading
(
true
);
...
...
@@ -123,11 +118,7 @@ const ProductConfig = props => {
console
.
error
(
err
);
});
};
// 新增提交回调
const
addCallback
=
val
=>
{
setAddVisible
(
false
);
setFlag
(
flag
+
1
);
};
// 编辑的回调
const
editCallback
=
val
=>
{
setLoading
(
true
);
...
...
@@ -167,8 +158,6 @@ const ProductConfig = props => {
duration
:
3
,
});
item
.
IsUsed
=
true
;
console
.
log
(
item
,
'item'
);
console
.
log
(
productObj
,
'productObj33333'
);
setProductObj
({
...
item
});
setFlag
(
flag
+
1
);
}
else
{
...
...
@@ -190,34 +179,8 @@ const ProductConfig = props => {
}
};
const
handleClickItem
=
value
=>
{
// console.log(productList);
// console.log(value);
// let obj = productList.find(i => i.PackageName === value.PackageName);
setProductObj
({
...
value
});
// if (userProductsList.length > 0) {
// let obj = userProductsList.find(i => i.PackageName === value.PackageName);
// console.log(value);
// console.log(obj);
// if (obj) {
// setProductObj(obj);
// } else {
// message.warning({
// content: '请先启用产品',
// duration: 3,
// });
// }
// } else {
// message.warning({
// content: '请先启用产品',
// duration: 3,
// });
// }
};
// const changeBut = value => {
// let obj = userProductsList.find(i => i.PackageName === value.PackageName);
// setProductObj(obj);
// };
const
renderListItem
=
arr
=>
(
<
div
style=
{
{
marginBottom
:
'25px'
,
borderBottom
:
'1px solid #ccc'
,
paddingBottom
:
'25px'
}
}
>
{
arr
.
map
(
item
=>
(
...
...
@@ -231,20 +194,14 @@ const ProductConfig = props => {
>
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
>
<
Switch
// size="small"
// defaultChecked=
{
item
.
IsUsed
}
checked=
{
item
.
IsUsed
}
checkedChildren=
"启用"
unCheckedChildren=
"关闭"
onClick=
{
e
=>
{
handleSwitchClick
(
e
,
item
,
userProductsList
);
}
}
// onChange=
{
changeBut
(
item
)}
/>
</
div
>
{
/* <span className={classnames({ [styles.itemspan]: true })}>{`${item.ProductName}【${
item.ProductType
}】`}</span> */
}
<
span
className=
{
classnames
({
[
styles
.
itemspan
]:
true
})
}
>
{
item
.
ProductType
?
`${item.ProductName}【${item.ProductType}】`
:
item
.
ProductName
}
</
span
>
...
...
@@ -256,15 +213,7 @@ const ProductConfig = props => {
<
Spin
spinning=
{
loading
}
tip=
"loading..."
>
<
div
className=
{
styles
.
box
}
>
<
Card
className=
{
classnames
(
`${styles.leftList}`
)
}
>
<
div
className=
{
styles
.
listTop
}
>
产品选择:
{
/* <Button type="primary" onClick={handleAdd}>
新增
</Button> */
}
{
/* <Button type="primary" danger onClick={handleDel}>
删除
</Button> */
}
</
div
>
<
div
className=
{
styles
.
listTop
}
>
产品选择:
</
div
>
{
productList
&&
productList
.
length
>
0
?
(
productList
.
map
(
item
=>
renderListItem
(
item
))
)
:
(
...
...
@@ -278,33 +227,6 @@ const ProductConfig = props => {
handleDel=
{
handleDel
}
userProductsList=
{
userProductsList
}
/>
{
/* {productList && productList.length > 0 && productObj ? (
<EditForm
productObj={productObj}
editCallback={editCallback}
handleDel={handleDel}
userProductsList={userProductsList}
/>
) : (
<Empty
style={{ marginTop: '60px' }}
image={Empty.PRESENTED_IMAGE_SIMPLE}
description="当前未选中产品类型"
/>
)} */
}
{
/* <Drawer
title="新增产品"
destroyOnClose
maskClosable={false}
width={600}
onClose={() => {
setAddVisible(false);
}}
visible={addVisible}
>
<AddForm addCallback={addCallback} />
</Drawer> */
}
</
Card
>
</
div
>
</
Spin
>
...
...
src/pages/productCenter/webConfig/index.jsx
View file @
97f01955
...
...
@@ -82,6 +82,7 @@ const WebConfigPage = props => {
const
updateModuleTree
=
(
userModePrama
,
canceled
=
{
cancel
:
false
})
=>
{
setLoading
(
true
);
console
.
log
(
userModePrama
);
return
getWebModuleTree
(
userModePrama
)
.
then
(
res
=>
{
const
websArr
=
[
...
...
@@ -151,7 +152,9 @@ const WebConfigPage = props => {
duration
:
3
,
});
// updateModuleTree(userMode || 'super');
if
(
webToOperate
.
id
===
curWeb
.
id
)
{
setCurWeb
(
webs
[
0
].
id
);
}
setTimeout
(()
=>
{
updateModuleTree
(
userMode
||
'super'
);
},
500
);
...
...
src/pages/productCenter/webConfig/menuconfig/webMenu.jsx
View file @
97f01955
/* eslint-disable array-callback-return */
/* eslint-disable no-plusplus */
/* eslint-disable consistent-return */
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
;
import
{
notification
,
Tooltip
,
Modal
,
Spin
,
Empty
}
from
'antd'
;
import
Tree
from
'@/components/ExpendableTree'
;
import
{
...
...
@@ -52,9 +52,11 @@ const MiniMenu = props => {
const
[
expendKey
,
setExpendKey
]
=
useState
(
''
);
// 保存默认展开项
const
[
menuList
,
setMenuList
]
=
useState
([]);
// 菜单树
const
[
keepId
,
setKeepId
]
=
useState
(
''
);
const
[
mapDataList
,
setMapDataList
]
=
useState
(
new
Set
());
/* ***************************************************** */
const
[
curMenuType
,
setCurMenuType
]
=
useState
(
''
);
const
parentRef
=
useRef
();
// 获取菜单信息
useEffect
(()
=>
{
...
...
@@ -62,6 +64,7 @@ const MiniMenu = props => {
if
(
flag
===
1
)
{
setExpendKey
(
menuID
);
}
console
.
log
(
expendKey
);
getInfo
();
},
[
menuID
,
webid
]);
useEffect
(()
=>
{
...
...
@@ -114,14 +117,23 @@ const MiniMenu = props => {
children
:
hasChild
?
obj
.
children
.
map
(
i
=>
mapTree
(
i
))
:
[],
};
};
const
mapData
=
(
val
,
e
)
=>
{
const
obj
=
{
...
val
};
const
hasChild
=
obj
.
children
.
length
>
0
;
if
(
hasChild
)
{
obj
.
children
.
map
(
i
=>
mapData
(
i
));
}
mapDataList
.
add
(
obj
);
};
// 树的点击事件
const
handleSelect
=
(
prop
,
treeNode
)
=>
{
console
.
log
(
prop
);
console
.
log
(
treeNode
);
if
(
treeNode
)
{
const
{
node
:
{
menuType
},
}
=
treeNode
;
console
.
log
(
menuType
);
setCurMenuType
(
menuType
);
switch
(
menuType
)
{
case
'Web4MenuGroup'
:
setNodeType
(
2
);
...
...
@@ -174,7 +186,7 @@ const MiniMenu = props => {
notification
.
error
({
message
:
'提示'
,
duration
:
10
,
description
:
res
.
m
essage
||
'获取失败'
,
description
:
res
.
m
sg
||
'获取失败'
,
});
}
})
...
...
@@ -220,7 +232,7 @@ const MiniMenu = props => {
notification
.
error
({
message
:
'提示'
,
duration
:
10
,
description
:
res
.
m
essage
||
'删除失败'
,
description
:
res
.
m
sg
||
'删除失败'
,
});
}
})
...
...
@@ -291,10 +303,12 @@ const MiniMenu = props => {
.
then
(
res
=>
{
setSubmitLoading
(
false
);
if
(
res
.
code
===
0
)
{
console
.
log
(
res
.
data
);
setAddVisible
(
false
);
setAddTwoVisible
(
false
);
// setFlag(flag + 1);
getTree
();
console
.
log
(
prop
);
getTree
(
res
.
data
);
// updateMenuTree('add', item);
notification
.
success
({
message
:
'提示'
,
...
...
@@ -304,7 +318,7 @@ const MiniMenu = props => {
}
else
{
notification
.
error
({
message
:
'提示'
,
description
:
res
.
m
essage
||
'新增失败'
,
description
:
res
.
m
sg
||
'新增失败'
,
duration
:
10
,
});
}
...
...
@@ -314,6 +328,11 @@ const MiniMenu = props => {
console
.
error
(
err
);
});
};
const
treeCallback
=
value
=>
{
if
(
value
)
{
console
.
log
(
value
);
}
};
// 编辑的回调
const
editSubmitCallback
=
prop
=>
{
setLoading
(
true
);
...
...
@@ -343,7 +362,7 @@ const MiniMenu = props => {
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
mes
sage
||
'编辑失败'
,
description
:
res
.
mes
||
'编辑失败'
,
});
}
})
...
...
@@ -411,7 +430,7 @@ const MiniMenu = props => {
}
}
};
const
getTree
=
()
=>
{
const
getTree
=
e
=>
{
getWebModuleTree
(
userMode
||
'super'
)
.
then
(
res
=>
{
setLoading
(
false
);
...
...
@@ -422,14 +441,32 @@ const MiniMenu = props => {
.
map
(
r
=>
r
.
children
.
filter
(
i
=>
i
.
id
===
webid
))
.
flat
(
2
);
let
arr2
=
arr
[
0
].
children
.
find
(
item
=>
item
.
text
===
'菜单管理'
).
children
||
[];
console
.
log
(
arr2
[
0
]);
setKeepId
(
arr2
[
0
]);
setMenuList
(
arr2
||
[]);
if
(
e
)
{
arr2
.
map
(
item
=>
mapData
(
item
,
e
));
console
.
log
([...
mapDataList
]);
let
aa
=
[...
mapDataList
].
find
(
i
=>
i
.
menuID
==
e
);
console
.
log
(
aa
);
setMenuID
(
aa
.
menuID
);
setExpendKey
(
aa
.
menuID
);
console
.
log
(
expendKey
);
switch
(
aa
.
menuType
)
{
case
'Web4MenuGroup'
:
setNodeType
(
2
);
setAddType
(
2
);
break
;
default
:
setNodeType
(
1
);
setAddType
(
1
);
break
;
}
}
setKeepId
(
arr2
[
0
]);
// 进页面后默认展示第一条数据
if
(
arr2
.
length
>
0
)
{
if
(
flag
===
1
)
{
setMenuID
(
arr2
[
0
].
menuID
);
setCurMenuType
(
arr2
[
0
].
menuType
);
switch
(
arr2
[
0
].
menuType
)
{
case
'Web4MenuGroup'
:
setNodeType
(
2
);
...
...
@@ -524,14 +561,13 @@ const MiniMenu = props => {
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
// updateMenuTree();
console
.
log
(
11111111
);
getTree
();
// setFlag(flag + 1);
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
m
essage
||
'操作失败'
,
description
:
res
.
m
sg
||
'操作失败'
,
});
}
});
...
...
src/pages/userCenter/roleManage/RoleManage.jsx
View file @
97f01955
...
...
@@ -60,6 +60,7 @@ const SiteManage = () => {
const
[
saveTreeId
,
setSaveTreeId
]
=
useState
(
''
);
// 保存点击回调的roleid
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
// 新增弹窗
const
[
flag
,
setFlag
]
=
useState
(
1
);
const
[
flagSearch
,
setFlagSearch
]
=
useState
(
0
);
const
[
itemObj
,
setItemObj
]
=
useState
(
''
);
// 选择的角色item
const
[
delVisible
,
setDelVisible
]
=
useState
(
false
);
// 删除弹窗
const
[
editVisible
,
setEditVisible
]
=
useState
(
false
);
// 修改弹窗
...
...
@@ -77,21 +78,35 @@ const SiteManage = () => {
const
[
mulu
,
setMulu
]
=
useState
(
true
);
// 展示目录
const
[
siteList
,
setSiteList
]
=
useState
([]);
const
[
disFlag
,
setDisFlag
]
=
useState
(
false
);
const
[
chileID
,
setChildID
]
=
useState
([]);
const
[
descrip
,
setDescrip
]
=
useState
(
'当前未选中角色'
);
// const [childData, setChildData] = useState({visibleValue:''})
// 点击树的回调
const
handleTreeSelect
=
(
e
,
treenode
)
=>
{
console
.
log
(
e
);
console
.
log
(
treenode
);
if
(
treenode
)
{
const
{
node
}
=
treenode
;
const
{
roleID
:
id
}
=
node
;
setItemObj
(
node
);
let
aa
=
chileID
.
find
(
i
=>
i
.
roleID
===
id
);
if
(
id
)
{
setSaveTreeId
(
id
);
setRoleID
(
id
);
setValueList
([...
valueList
]);
if
(
aa
)
{
setRoleID
(
''
);
setDescrip
(
'系统分组下的角色不可配置菜单权限也不能被关联'
);
setFlagSearch
(
0
);
}
else
{
setRoleID
(
id
);
setFlagSearch
(
1
);
}
}
else
{
// setRoleID(saveTreeId);
setRoleID
(
''
);
setDescrip
(
'当前未选中角色'
);
setFlagSearch
(
0
);
}
}
...
...
@@ -147,10 +162,27 @@ const SiteManage = () => {
}
}
});
console
.
log
(
res
.
data
.
roleList
);
const
{
roleList
}
=
res
.
data
;
let
arr
=
transTree
(
roleList
);
setTreeData
(
arr
);
console
.
log
(
arr
);
let
dataA
=
[];
arr
.
map
(
i
=>
{
console
.
log
(
i
.
child
);
dataA
.
push
(
i
.
child
.
find
(
j
=>
j
.
visibleTitle
===
'系统分组'
));
// if (i.child.find(j => j.visibleTitle === '系统分组')) {
// data.push(j);
// }
});
console
.
log
(
dataA
);
let
Arr
=
[];
dataA
.
map
(
i
=>
{
i
.
children
.
map
(
j
=>
{
Arr
.
push
(
j
);
});
});
console
.
log
(
Arr
);
setChildID
(
Arr
);
}
});
};
...
...
@@ -795,13 +827,17 @@ const SiteManage = () => {
>
<
Row
align=
"middle"
>
<
Col
span=
{
8
}
>
<
Search
allowClear
placeholder=
{
placeholder
}
// onSearch={handleSearch}
onChange=
{
handleChange
}
enterButton
/>
{
flagSearch
==
1
?
(
<
Search
allowClear
placeholder=
{
placeholder
}
// onSearch=
{
handleSearch
}
onChange=
{
handleChange
}
enterButton
/>
)
:
(
<
span
/>
)
}
</
Col
>
<
Col
span=
{
3
}
/>
</
Row
>
...
...
@@ -823,7 +859,7 @@ const SiteManage = () => {
hasData=
{
hasData
}
/>
)
:
(
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description=
"当前未选中角色"
/>
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
description=
{
descrip
}
/>
)
}
</
Card
>
</
div
>
...
...
src/pages/userCenter/userManage/AddSubOrgModal.jsx
View file @
97f01955
...
...
@@ -3,17 +3,17 @@ import { Modal, Form, Input, notification, message } from 'antd';
import
{
addOrg
}
from
'@/services/userManage/api'
;
const
AddUserModal
=
props
=>
{
const
{
title
,
visible
,
orgID
,
onCancel
,
updateTrees
,
onSelect
}
=
props
;
const
{
visible
,
orgID
,
onCancel
,
updateTrees
,
onSelect
,
orgTitle1
}
=
props
;
const
[
addOrgForm
]
=
Form
.
useForm
();
// 添加用户
useEffect
(()
=>
{
console
.
log
(
orgID
)
console
.
log
(
orgID
)
;
addOrgForm
.
resetFields
();
},
[
orgID
]);
// 提交-添加下级机构
const
submitAddOrg
=
()
=>
{
if
(
orgID
==
-
1
)
{
if
(
orgID
==
-
1
)
{
addOrg
(
orgID
,
addOrgForm
.
getFieldValue
(
'OUName'
),
...
...
@@ -21,7 +21,7 @@ const AddUserModal = props => {
''
,
)
.
then
(
res
=>
{
if
(
res
.
msg
===
"Ok"
)
{
if
(
res
.
msg
===
'Ok'
)
{
onCancel
();
notification
.
success
({
message
:
'提交成功'
,
...
...
@@ -40,8 +40,7 @@ const AddUserModal = props => {
.
catch
(
err
=>
{
message
.
error
(
err
);
});
}
else
{
}
else
{
addOrg
(
orgID
.
id
,
addOrgForm
.
getFieldValue
(
'OUName'
),
...
...
@@ -49,7 +48,7 @@ const AddUserModal = props => {
''
,
)
.
then
(
res
=>
{
if
(
res
.
msg
===
"Ok"
)
{
if
(
res
.
msg
===
'Ok'
)
{
onCancel
();
notification
.
success
({
message
:
'提交成功'
,
...
...
@@ -70,9 +69,14 @@ const AddUserModal = props => {
});
}
};
const
title
=
(
<
span
>
在
<
span
style=
{
{
fontWeight
:
'bold'
,
color
:
'red'
}
}
>
{
orgTitle1
}
</
span
>
下添加机构
</
span
>
);
return
(
<
Modal
title=
{
title
}
title=
{
orgID
===
'-1'
?
'添加顶级机构'
:
title
}
visible=
{
visible
}
onCancel=
{
onCancel
}
onOk=
{
submitAddOrg
}
...
...
@@ -80,11 +84,7 @@ const AddUserModal = props => {
cancelText=
"取消"
>
<
Form
form=
{
addOrgForm
}
labelCol=
{
{
span
:
4
}
}
>
<
Form
.
Item
name=
"OUName"
label=
"机构名称"
rules=
{
[{
required
:
true
,
message
:
'不能为空'
}]
}
>
<
Form
.
Item
name=
"OUName"
label=
"机构名称"
rules=
{
[{
required
:
true
,
message
:
'不能为空'
}]
}
>
<
Input
placeholder=
"请输入机构名称"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"description"
label=
"描述"
>
...
...
src/pages/userCenter/userManage/AddUserModal.jsx
View file @
97f01955
...
...
@@ -4,7 +4,7 @@ import { addUser } from '@/services/userManage/api';
import
{
ok
}
from
'../../../assets/images/icons/ok.svg'
;
const
AddUserModal
=
props
=>
{
const
{
title
,
visible
,
orgID
,
onCancel
,
onSelect
}
=
props
;
const
{
visible
,
orgID
,
onCancel
,
onSelect
,
orgTitle1
}
=
props
;
const
[
addUserForm
]
=
Form
.
useForm
();
// 添加用户
/** ***正则验证**** */
const
noChinese
=
new
RegExp
(
/^
[^\u
4e00-
\u
9fa5
]
+$/
);
// 不能包含中文
...
...
@@ -93,6 +93,12 @@ const AddUserModal = props => {
});
}
};
const
title
=
(
<
span
>
在
<
span
style=
{
{
fontWeight
:
'bold'
,
color
:
'red'
}
}
>
{
orgTitle1
}
</
span
>
下添加用户
</
span
>
);
return
(
<
Modal
title=
{
title
}
...
...
src/pages/userCenter/userManage/EditOrgModal.jsx
View file @
97f01955
/*
* @Description:
* @Author: leizhe
* @Date: 2022-01-13 17:26:14
* @LastEditTime: 2022-03-07 18:50:03
* @LastEditors: leizhe
*/
import
React
,
{
useEffect
}
from
'react'
;
import
{
Modal
,
Form
,
Input
,
notification
,
message
}
from
'antd'
;
import
{
editOrgInfo
}
from
'@/services/userManage/api'
;
const
EditOrgModal
=
props
=>
{
const
{
title
,
visible
,
orgID
,
orgTitle
,
...
...
@@ -12,6 +18,7 @@ const EditOrgModal = props => {
onCancel
,
updateTrees
,
onSelect
,
orgTitle1
,
}
=
props
;
const
[
editOrgForm
]
=
Form
.
useForm
();
// 添加用户
...
...
@@ -51,6 +58,11 @@ const EditOrgModal = props => {
.
catch
(
err
=>
{
message
.
error
(
err
);
});
const
title
=
(
<
span
>
编辑
<
span
style=
{
{
fontWeight
:
'bold'
,
color
:
'red'
}
}
>
{
orgTitle1
}
</
span
>
</
span
>
);
return
(
<
Modal
title=
{
title
}
...
...
@@ -61,11 +73,7 @@ const EditOrgModal = props => {
cancelText=
"取消"
>
<
Form
form=
{
editOrgForm
}
labelCol=
{
{
span
:
4
}
}
>
<
Form
.
Item
name=
"OUName"
label=
"机构名称"
rules=
{
[{
required
:
true
,
message
:
'不能为空'
}]
}
>
<
Form
.
Item
name=
"OUName"
label=
"机构名称"
rules=
{
[{
required
:
true
,
message
:
'不能为空'
}]
}
>
<
Input
placeholder=
"请输入机构名称"
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"description"
label=
"描述"
>
...
...
src/pages/userCenter/userManage/RelateRoleModal.jsx
View file @
97f01955
import
React
,
{
useState
,
useCallback
,
useEffect
}
from
'react'
;
import
{
Modal
,
Spin
,
Tabs
,
notification
,
message
,
Checkbox
,
Divider
}
from
'antd'
;
import
{
SetUserRelationList
,
setUserRelation
,
setUserRelations
,
}
from
'@/services/userManage/api'
;
import
{
SetUserRelationList
,
setUserRelation
,
setUserRelations
}
from
'@/services/userManage/api'
;
import
ListCardItem
from
'./components/listCardItem'
;
const
CheckboxGroup
=
Checkbox
.
Group
;
...
...
@@ -45,6 +41,7 @@ const RelateRoleModal = props => {
},
[]);
useEffect
(()
=>
{
console
.
log
(
currentUser
);
console
.
log
(
multiRoleList
);
console
.
log
(
multistationList
);
},
[
visible
]);
...
...
@@ -129,7 +126,9 @@ const RelateRoleModal = props => {
);
const
title1
=
(
<
span
>
<
span
>
关联角色
{
currentUser
.
loginName
}
</
span
>
<
span
>
关联角色
<
span
style=
{
{
fontWeight
:
'bold'
,
color
:
'red'
}
}
>
{
currentUser
.
userName
}
</
span
>
</
span
>
</
span
>
);
if
(
mult
==
'Yes'
)
{
...
...
src/pages/userCenter/userManage/UserManage.jsx
View file @
97f01955
...
...
@@ -151,6 +151,7 @@ const UserManage = () => {
const
[
keep1
,
setKeep1
]
=
useState
([
4
]);
// 存储树选择
const
[
id
,
setId
]
=
useState
(
''
);
const
{
Search
}
=
Input
;
const
[
hoverItemIndex
,
setHoverItemIndex
]
=
useState
(
0
);
// hover流程索引
const
setRowClassName
=
record
=>
record
.
userID
===
selectColor
.
userID
?
styles
.
clickRowStyle
:
''
;
// 用户表列名
...
...
@@ -389,7 +390,18 @@ const UserManage = () => {
title
:
(
<
div
className=
{
styles
.
title1
}
>
<
span
className=
{
styles
.
titleText
}
>
{
org
.
text
}
</
span
>
<
span
className=
{
styles
.
tip1
}
>
<
span
className=
{
classnames
({
[
styles
.
tip1
]:
true
,
[
styles
.
listHover
]:
org
===
hoverItemIndex
,
})
}
onMouseEnter=
{
()
=>
{
setHoverItemIndex
(
org
);
}
}
onMouseLeave=
{
()
=>
{
setHoverItemIndex
(
''
);
}
}
>
<
Tooltip
title=
""
className=
{
styles
.
fs1
}
>
<
Dropdown
overlay=
{
orgButtonMenu
}
>
<
PlusOutlined
...
...
@@ -403,7 +415,6 @@ const UserManage = () => {
/>
</
Dropdown
>
</
Tooltip
>
<
Dropdown
overlay=
{
orgButtonMenu1
}
>
<
EllipsisOutlined
style=
{
{
marginLeft
:
10
,
fontSize
:
'20px'
}
}
...
...
@@ -1316,6 +1327,7 @@ const UserManage = () => {
const
addChange
=
e
=>
{
e
.
domEvent
.
stopPropagation
();
};
/** ***操作按钮**** */
// 机构操作
const
orgButtonMenu
=
(
...
...
@@ -1487,16 +1499,16 @@ const UserManage = () => {
{
/* Modal弹框 */
}
{
/* 添加用户 */
}
<
AddUserModal
title=
{
`在${orgTitle1}下添加用户`
}
visible=
{
userVisible
}
orgID=
{
orgID
}
orgTitle1=
{
orgTitle1
}
onCancel=
{
kee
}
onSelect=
{
()
=>
onSelect
([
orgID
])
}
/>
{
/* 添加下级机构 */
}
<
AddSubOrgModal
title=
{
orgID
===
'-1'
?
'添加顶级机构'
:
`在${orgTitle1}下添加机构`
}
visible=
{
addOrgVisible
}
orgTitle1=
{
orgTitle1
}
orgID=
{
orgID
}
onCancel=
{
()
=>
setAddOrgVisible
(
false
)
}
// onSelect={onSelect}
...
...
@@ -1504,10 +1516,9 @@ const UserManage = () => {
/>
{
/* 编辑机构 */
}
<
EditOrgModal
title=
{
`编辑${orgTitle1}`
}
visible=
{
editOrgVisible
}
orgID=
{
orgID
}
orgTitle=
{
orgTitle1
}
orgTitle
1
=
{
orgTitle1
}
description=
{
description
}
onCancel=
{
()
=>
setEditOrgVisible
(
false
)
}
// onSelect={onSelect}
...
...
src/pages/userCenter/userManage/UserManage.less
View file @
97f01955
...
...
@@ -196,6 +196,12 @@
font-size: 18px;
margin-left: 10px;
}
.listHover {
display: flex;
align-items: center;
justify-content: flex-end;
width: 100%;
}
.title1:hover {
.tip1 {
display: flex;
...
...
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