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
d4617766
Commit
d4617766
authored
Nov 30, 2023
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '地图方案权限配置关联站点优化'
parent
01c660bd
Pipeline
#82569
passed with stages
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
214 additions
and
4 deletions
+214
-4
index.jsx
src/components/RolePmSite/index.jsx
+200
-2
solutionConfig.jsx
...Center/gis/schemeConfig/solutionConfig/solutionConfig.jsx
+11
-2
api.js
src/services/webConfig/api.js
+3
-0
No files found.
src/components/RolePmSite/index.jsx
View file @
d4617766
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Modal
,
Checkbox
,
Tabs
,
Input
,
Button
,
Pagination
,
Empty
,
Tag
,
Divider
,
Radio
}
from
'antd'
;
import
{
Modal
,
Checkbox
,
Tabs
,
Input
,
Button
,
Pagination
,
Empty
,
Tag
,
Divider
,
Radio
}
from
'antd'
;
import
{
CM_Event_LoadDepartmentAndRoles
}
from
'@/services/standingBook/api'
;
import
{
CM_Event_LoadDepartmentAndRoles
}
from
'@/services/standingBook/api'
;
import
{
GetMapLayerStationList
}
from
'@/services/webConfig/api'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
const
CheckboxGroup
=
Checkbox
.
Group
;
const
CheckboxGroup
=
Checkbox
.
Group
;
...
@@ -32,6 +33,8 @@ const RMSComponents = props => {
...
@@ -32,6 +33,8 @@ const RMSComponents = props => {
chooseGroupName
,
chooseGroupName
,
dataType
,
dataType
,
isRadio
,
isRadio
,
mapSite
,
gisType
,
}
=
props
;
}
=
props
;
const
[
checkedList
,
setCheckedList
]
=
useState
([]);
// 选中复选框内容
const
[
checkedList
,
setCheckedList
]
=
useState
([]);
// 选中复选框内容
const
[
searchWord
,
setSearchWord
]
=
useState
(
''
);
// 关键字
const
[
searchWord
,
setSearchWord
]
=
useState
(
''
);
// 关键字
...
@@ -102,7 +105,7 @@ const RMSComponents = props => {
...
@@ -102,7 +105,7 @@ const RMSComponents = props => {
setKeyValue
(
'2'
);
setKeyValue
(
'2'
);
setKeepTabKey
(
2
);
setKeepTabKey
(
2
);
}
}
getRoles
(
groupName
,
''
,
pageSize
,
1
,
0
);
let
checkArr
=
[];
let
checkArr
=
[];
// 角色
// 角色
let
listdata
=
[];
let
listdata
=
[];
...
@@ -178,6 +181,7 @@ const RMSComponents = props => {
...
@@ -178,6 +181,7 @@ const RMSComponents = props => {
}
}
setSaveCheckValue
(
checkArr
);
setSaveCheckValue
(
checkArr
);
setCheckedList
(
checkArr
);
setCheckedList
(
checkArr
);
getRoles
(
groupName
,
''
,
pageSize
,
1
,
0
,
checkArr
);
}
}
});
});
}
else
{
}
else
{
...
@@ -232,6 +236,7 @@ const RMSComponents = props => {
...
@@ -232,6 +236,7 @@ const RMSComponents = props => {
// 搜索时获取数据
// 搜索时获取数据
const
sreachRoles
=
(
type
,
keywords
,
pageSizes
,
pageIndex
)
=>
{
const
sreachRoles
=
(
type
,
keywords
,
pageSizes
,
pageIndex
)
=>
{
if
(
!
mapSite
)
{
CM_Event_LoadDepartmentAndRoles
({
CM_Event_LoadDepartmentAndRoles
({
type
,
type
,
keywords
,
keywords
,
...
@@ -299,9 +304,92 @@ const RMSComponents = props => {
...
@@ -299,9 +304,92 @@ const RMSComponents = props => {
}
}
}
}
});
});
}
else
{
GetMapLayerStationList
({
keywords
:
keywords
,
}).
then
(
res
=>
{
if
(
res
.
code
===
'0'
)
{
let
obj
=
{};
let
arr
=
[];
res
.
data
.
list
.
forEach
(
i
=>
{
let
str
=
checkedList
[
2
].
indexOf
(
i
.
id
.
toString
())
!==
-
1
;
if
(
gisType
===
'phone'
)
{
arr
.
push
({
label
:
i
.
name
,
value
:
i
.
id
.
toString
(),
disabled
:
str
?
false
:
i
.
isPhone
,
});
}
else
{
arr
.
push
({
label
:
i
.
name
,
value
:
i
.
id
.
toString
(),
disabled
:
str
?
false
:
i
.
isWeb
,
});
}
});
obj
.
站点
=
arr
;
setOptionValue
(
obj
);
let
list
=
[];
let
data
=
''
;
if
(
type
==
'角色'
)
{
data
=
0
;
}
else
if
(
type
==
'部门'
)
{
data
=
1
;
}
else
if
(
type
==
'站点'
)
{
data
=
2
;
}
obj
[
type
]
&&
obj
[
type
].
map
(
i
=>
{
if
(
checkedList
[
data
].
indexOf
(
i
.
value
)
!=
-
1
)
{
list
.
push
(
i
.
value
);
}
});
if
(
list
.
length
===
obj
[
type
].
length
)
{
if
(
type
==
'角色'
)
{
setCheckAll
(
true
);
setIndeterminate
(
false
);
}
else
if
(
type
==
'部门'
)
{
setCheckAll1
(
true
);
setIndeterminate1
(
false
);
}
else
if
(
type
==
'站点'
)
{
setCheckAll2
(
true
);
setIndeterminate2
(
false
);
}
}
else
if
(
list
.
length
<
obj
[
type
].
length
&&
list
.
length
!==
0
)
{
if
(
type
==
'角色'
)
{
setCheckAll
(
false
);
setIndeterminate
(
true
);
}
else
if
(
type
==
'部门'
)
{
setCheckAll1
(
false
);
setIndeterminate1
(
true
);
}
else
if
(
type
==
'站点'
)
{
setCheckAll2
(
false
);
setIndeterminate2
(
true
);
}
}
else
if
(
list
.
length
===
0
)
{
if
(
type
==
'角色'
)
{
setCheckAll
(
false
);
setIndeterminate
(
false
);
}
else
if
(
type
==
'部门'
)
{
setCheckAll1
(
false
);
setIndeterminate1
(
false
);
}
else
if
(
type
==
'站点'
)
{
setCheckAll2
(
false
);
setIndeterminate2
(
false
);
}
}
if
(
res
.
data
.
count
==
0
)
{
setEmptyValue
(
1
);
}
else
{
setEmptyValue
(
0
);
}
}
});
}
};
};
const
getRoles
=
(
type
,
keywords
,
pageSizes
,
pageIndex
,
flag
)
=>
{
const
getRoles
=
(
type
,
keywords
,
pageSizes
,
pageIndex
,
flag
,
check
)
=>
{
if
(
!
mapSite
)
{
CM_Event_LoadDepartmentAndRoles
({
CM_Event_LoadDepartmentAndRoles
({
type
,
type
,
keywords
,
keywords
,
...
@@ -388,6 +476,109 @@ const RMSComponents = props => {
...
@@ -388,6 +476,109 @@ const RMSComponents = props => {
}
}
}
}
});
});
}
else
{
GetMapLayerStationList
({
keywords
:
''
,
}).
then
(
res
=>
{
if
(
res
.
code
===
'0'
)
{
let
obj
=
{};
let
arr
=
[];
res
.
data
.
list
.
forEach
(
i
=>
{
let
newCheck
=
check
?
check
:
checkedList
;
let
str
=
newCheck
[
2
].
indexOf
(
i
.
id
.
toString
())
!==
-
1
;
if
(
gisType
===
'phone'
)
{
arr
.
push
({
label
:
i
.
name
,
value
:
i
.
id
.
toString
(),
disabled
:
str
?
false
:
i
.
isPhone
,
});
}
else
{
arr
.
push
({
label
:
i
.
name
,
value
:
i
.
id
.
toString
(),
disabled
:
str
?
false
:
i
.
isWeb
,
});
}
});
obj
.
站点
=
arr
;
setOptionValue
(
obj
);
let
list
=
[];
let
data
=
''
;
if
(
type
==
'角色'
)
{
data
=
0
;
}
else
if
(
type
==
'部门'
)
{
data
=
1
;
}
else
if
(
type
==
'站点'
)
{
data
=
2
;
}
// 首次进入调用
if
(
flag
!=
undefined
)
{
let
listId
=
[];
newCheckedList
.
map
(
checkItem
=>
{
keepFiled
.
current
[
groupName
].
map
(
i
=>
{
let
canSave
=
dataType
===
'name'
?
i
.
label
==
checkItem
:
i
.
value
==
checkItem
;
if
(
canSave
)
{
listId
.
push
(
i
.
value
.
toString
());
}
});
});
obj
[
type
]
&&
obj
[
type
].
map
(
i
=>
{
if
(
listId
.
indexOf
(
i
.
value
)
!=
-
1
)
{
list
.
push
(
i
.
value
);
}
});
}
else
{
obj
[
type
]
&&
obj
[
type
].
map
(
i
=>
{
if
(
checkedList
[
data
].
indexOf
(
i
.
value
)
!=
-
1
)
{
list
.
push
(
i
.
value
);
}
});
}
if
(
list
.
length
===
obj
[
type
].
length
)
{
if
(
type
==
'角色'
)
{
setCheckAll
(
true
);
setIndeterminate
(
false
);
}
else
if
(
type
==
'部门'
)
{
setCheckAll1
(
true
);
setIndeterminate1
(
false
);
}
else
if
(
type
==
'站点'
)
{
setCheckAll2
(
true
);
setIndeterminate2
(
false
);
}
}
else
if
(
list
.
length
<
obj
[
type
].
length
&&
list
.
length
!==
0
)
{
if
(
type
==
'角色'
)
{
setCheckAll
(
false
);
setIndeterminate
(
true
);
}
else
if
(
type
==
'部门'
)
{
setCheckAll1
(
false
);
setIndeterminate1
(
true
);
}
else
if
(
type
==
'站点'
)
{
setCheckAll2
(
false
);
setIndeterminate2
(
true
);
}
}
else
if
(
list
.
length
===
0
)
{
if
(
type
==
'角色'
)
{
setCheckAll
(
false
);
setIndeterminate
(
false
);
}
else
if
(
type
==
'部门'
)
{
setCheckAll1
(
false
);
setIndeterminate1
(
false
);
}
else
if
(
type
==
'站点'
)
{
setCheckAll2
(
false
);
setIndeterminate2
(
false
);
}
}
if
(
res
.
data
.
count
==
0
)
{
setEmptyValue
(
1
);
}
else
{
setEmptyValue
(
0
);
}
}
});
}
};
};
const
groupArr
=
(
initialArr
,
name
)
=>
{
const
groupArr
=
(
initialArr
,
name
)
=>
{
...
@@ -927,6 +1118,8 @@ const RMSComponents = props => {
...
@@ -927,6 +1118,8 @@ const RMSComponents = props => {
})
}
})
}
</
Radio
.
Group
>
</
Radio
.
Group
>
)
:
(
)
:
(
<>
{
!
mapSite
&&
(
<>
<>
<
Checkbox
<
Checkbox
indeterminate=
{
indeterminate2
}
indeterminate=
{
indeterminate2
}
...
@@ -936,6 +1129,9 @@ const RMSComponents = props => {
...
@@ -936,6 +1129,9 @@ const RMSComponents = props => {
全选
全选
</
Checkbox
>
</
Checkbox
>
<
Divider
/>
<
Divider
/>
</>
)
}
<
CheckboxGroup
<
CheckboxGroup
options=
{
optionValue
[
'站点'
]
}
options=
{
optionValue
[
'站点'
]
}
value=
{
checkedList
[
2
]
}
value=
{
checkedList
[
2
]
}
...
@@ -957,6 +1153,7 @@ const RMSComponents = props => {
...
@@ -957,6 +1153,7 @@ const RMSComponents = props => {
</
div
>
</
div
>
{
/* 分页 */
}
{
/* 分页 */
}
<
div
className=
{
styles
.
footer
}
>
<
div
className=
{
styles
.
footer
}
>
{
!
mapSite
&&
(
<
Pagination
<
Pagination
size=
"small"
size=
"small"
total=
{
total
}
total=
{
total
}
...
@@ -968,6 +1165,7 @@ const RMSComponents = props => {
...
@@ -968,6 +1165,7 @@ const RMSComponents = props => {
onChange=
{
paginationChange
}
onChange=
{
paginationChange
}
style=
{
{
marginBottom
:
'10px'
}
}
style=
{
{
marginBottom
:
'10px'
}
}
/>
/>
)
}
</
div
>
</
div
>
</
div
>
</
div
>
{
/* 已选列表 */
}
{
/* 已选列表 */
}
...
...
src/pages/platformCenter/gis/schemeConfig/solutionConfig/solutionConfig.jsx
View file @
d4617766
...
@@ -35,6 +35,7 @@ const VectorData = props => {
...
@@ -35,6 +35,7 @@ const VectorData = props => {
const
[
leafs
,
setLeafs
]
=
useState
([]);
const
[
leafs
,
setLeafs
]
=
useState
([]);
const
[
addVisible
,
setAddVisible
]
=
useState
(
false
);
const
[
addVisible
,
setAddVisible
]
=
useState
(
false
);
const
[
checkValue
,
setCheckValue
]
=
useState
([]);
const
[
checkValue
,
setCheckValue
]
=
useState
([]);
const
[
gisType
,
setGisType
]
=
useState
(
''
);
const
columns
=
[
const
columns
=
[
{
{
...
@@ -65,7 +66,10 @@ const VectorData = props => {
...
@@ -65,7 +66,10 @@ const VectorData = props => {
render
:
record
=>
(
render
:
record
=>
(
<
Space
size=
"middle"
>
<
Space
size=
"middle"
>
<
UserAddOutlined
<
UserAddOutlined
onClick=
{
()
=>
pickRole
(
record
)
}
onClick=
{
()
=>
{
pickRole
(
record
);
setGisType
(
'web'
);
}
}
style=
{
{
fontSize
:
'18px'
,
color
:
'#1890FF'
}
}
style=
{
{
fontSize
:
'18px'
,
color
:
'#1890FF'
}
}
/>
/>
</
Space
>
</
Space
>
...
@@ -124,7 +128,10 @@ const VectorData = props => {
...
@@ -124,7 +128,10 @@ const VectorData = props => {
render
:
record
=>
(
render
:
record
=>
(
<
Space
size=
"middle"
>
<
Space
size=
"middle"
>
<
UserAddOutlined
<
UserAddOutlined
onClick=
{
()
=>
pickRole
(
record
)
}
onClick=
{
()
=>
{
pickRole
(
record
);
setGisType
(
'phone'
);
}
}
style=
{
{
fontSize
:
'18px'
,
color
:
'#1890FF'
}
}
style=
{
{
fontSize
:
'18px'
,
color
:
'#1890FF'
}
}
/>
/>
</
Space
>
</
Space
>
...
@@ -779,6 +786,8 @@ const VectorData = props => {
...
@@ -779,6 +786,8 @@ const VectorData = props => {
groupName=
"站点"
// 打开组件展示的分组名,用来首次获取数据
groupName=
"站点"
// 打开组件展示的分组名,用来首次获取数据
chooseGroupName=
{
[
'站点'
]
}
// 可选分组名
chooseGroupName=
{
[
'站点'
]
}
// 可选分组名
dataType=
"id"
dataType=
"id"
mapSite=
{
true
}
gisType=
{
gisType
}
// isRadio={true} // 站点单选
// isRadio={true} // 站点单选
/>
/>
{
/* <RoleModal
{
/* <RoleModal
...
...
src/services/webConfig/api.js
View file @
d4617766
...
@@ -349,3 +349,6 @@ export const SortSchemePost = param => post(`${PANDA_GIS}/MapLayer/SortSchemePos
...
@@ -349,3 +349,6 @@ export const SortSchemePost = param => post(`${PANDA_GIS}/MapLayer/SortSchemePos
export
const
GetUserName
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/GetUserName`
,
param
);
export
const
GetUserName
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/GetUserName`
,
param
);
export
const
ProductRepair
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/DBManager/ProductRepair`
,
param
);
export
const
ProductRepair
=
param
=>
get
(
`
${
PUBLISH_SERVICE
}
/DBManager/ProductRepair`
,
param
);
export
const
GetMapLayerStationList
=
param
=>
get
(
`
${
PANDA_GIS
}
/MapLayer/GetMapLayerStationList`
,
param
);
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