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
400040e8
Commit
400040e8
authored
Apr 23, 2021
by
shaoan123
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
方案配置引入角色列表组件
parent
6c76bf43
Pipeline
#26492
skipped with stages
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
112 additions
and
28 deletions
+112
-28
SchemeConfig.less
src/pages/platformCenter/schemeConfig/SchemeConfig.less
+4
-0
AddModal.jsx
...pages/platformCenter/schemeConfig/TileConfig/AddModal.jsx
+12
-10
TileConfig.jsx
...ges/platformCenter/schemeConfig/TileConfig/TileConfig.jsx
+6
-1
VectorData.jsx
...ges/platformCenter/schemeConfig/VectorData/VectorData.jsx
+11
-1
projectMessage.jsx
...formCenter/schemeConfig/projectMessage/projectMessage.jsx
+1
-1
AddModal.jsx
...s/platformCenter/schemeConfig/solutionConfig/AddModal.jsx
+4
-1
solutionConfig.jsx
...formCenter/schemeConfig/solutionConfig/solutionConfig.jsx
+70
-14
api.js
src/services/webConfig/api.js
+4
-0
No files found.
src/pages/platformCenter/schemeConfig/SchemeConfig.less
View file @
400040e8
...
...
@@ -9,6 +9,10 @@
color: rgba(0, 0, 0, 0.85);
}
overflow-y: scroll;
.ant-input-number-input{
background-color: #ffffff;
color: #000000;
}
}
.imgList{
display: flex;
...
...
src/pages/platformCenter/schemeConfig/TileConfig/AddModal.jsx
View file @
400040e8
...
...
@@ -45,13 +45,13 @@ const AddModal = props => {
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
message
||
type
==
'add'
?
'新增成功'
:
'编辑成功'
description
:
res
.
message
||
type
==
'add'
?
'新增成功'
:
'编辑成功'
});
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
message
||
type
==
'add'
?
'新增失败'
:
'编辑失败'
description
:
res
.
message
||
type
==
'add'
?
'新增失败'
:
'编辑失败'
});
}
})
...
...
@@ -59,19 +59,20 @@ const AddModal = props => {
}
});
};
const
onFinish
=
value
=>
{
};
useEffect
(()
=>
{
switch
(
type
)
{
case
'add'
:
setRadio
(
''
)
form
.
resetFields
();
form
.
setFieldsValue
({
servicename
:
baseMap
[
0
],
label
:
baseMap
[
0
],
type
:
servicenameToType
(
baseMap
[
0
])
})
setRadio
(
''
)
form
.
resetFields
();
form
.
setFieldsValue
({
servicename
:
baseMap
[
0
],
label
:
baseMap
[
0
],
type
:
servicenameToType
(
baseMap
[
0
])
})
break
;
case
'edit'
:
form
.
setFieldsValue
({
...
formObj
});
...
...
@@ -244,6 +245,7 @@ const AddModal = props => {
<
InputNumber
min=
{
0
}
max=
{
1
}
disabled
style=
{
{
margin
:
'0 16px'
}
}
defaultValue=
{
type
===
'add'
?
1
:
formObj
.
alpha
}
value=
{
alpha
}
...
...
src/pages/platformCenter/schemeConfig/TileConfig/TileConfig.jsx
View file @
400040e8
...
...
@@ -10,7 +10,7 @@ const TileData = props => {
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
// 弹窗显示
const
[
tileData
,
setTileData
]
=
useState
([]);
// table表格数据
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
const
[
type
,
setType
]
=
useState
(
'
add
'
);
// 弹窗类型
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
formObj
,
setFormObj
]
=
useState
({});
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 弹窗类型
const
[
baseMap
,
setBaseMap
]
=
useState
([]);
//底图数据
...
...
@@ -175,6 +175,11 @@ const TileData = props => {
bordered
rowKey=
"type"
scroll=
{
{
y
:
400
}
}
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
}
}
>
</
Table
>
<
AddModal
...
...
src/pages/platformCenter/schemeConfig/VectorData/VectorData.jsx
View file @
400040e8
...
...
@@ -13,7 +13,7 @@ const VectorData = props => {
const
[
previewVisible
,
setPreviewVisible
]
=
useState
(
false
);
// 预览弹窗
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 更新list
const
[
loading
,
setLoading
]
=
useState
([]);
// 更新状态
const
[
type
,
setType
]
=
useState
(
'
add
'
);
// 弹窗类型
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
solutionNames
,
setSolutionNames
]
=
useState
(
''
);
const
[
formObj
,
setFormObj
]
=
useState
({
user
:
'admin'
,
password
:
'geoserver'
});
const
[
currentMetaData
,
setCurrentMetaData
]
=
useState
(
null
)
...
...
@@ -111,6 +111,11 @@ const VectorData = props => {
const
newLoadings
=
[...
loading
];
newLoadings
[
index
]
=
false
setLoading
(
newLoadings
)
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
'服务无法访问'
,
});
})
}
...
...
@@ -202,6 +207,11 @@ const VectorData = props => {
bordered
rowKey=
"createTime"
scroll=
{
{
y
:
400
}
}
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
}
}
>
</
Table
>
<
AddModal
...
...
src/pages/platformCenter/schemeConfig/projectMessage/projectMessage.jsx
View file @
400040e8
...
...
@@ -14,7 +14,7 @@ const VectorData = props => {
const
[
tileData
,
setTileData
]
=
useState
([]);
// 页面初始化数据
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 状态更新
const
[
type
,
setType
]
=
useState
(
'
add
'
);
// 弹窗类型
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
formObj
,
setFormObj
]
=
useState
({});
...
...
src/pages/platformCenter/schemeConfig/solutionConfig/AddModal.jsx
View file @
400040e8
...
...
@@ -60,7 +60,10 @@ const AddModal = props => {
const
onFinish
=
value
=>
{
};
useEffect
(()
=>
{
form
.
setFieldsValue
({
schemename
:
listData
[
0
]
});
if
(
type
!=
''
){
form
.
setFieldsValue
({
schemename
:
listData
[
0
]
});
}
},
[
visible
]);
...
...
src/pages/platformCenter/schemeConfig/solutionConfig/solutionConfig.jsx
View file @
400040e8
import
{
Space
,
Table
,
Button
,
Popconfirm
,
notification
,
Divider
,
Checkbox
,
Spin
}
from
'antd'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
styles
from
'../SchemeConfig.less'
import
VisibleRoleModal
from
'@/pages/platformCenter/messageManage/projectManage/components/RolseSelect/VisibleRoleModal'
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
deleteConfig
,
GetAllConfig
,
setServiceType
,
SetServiceConfig
deleteConfig
,
GetAllConfig
,
setServiceType
,
SetServiceConfig
,
getUserRelationList
}
from
'@/services/webConfig/api'
;
import
{
UserAddOutlined
}
from
'@ant-design/icons'
;
import
AddModal
from
'./AddModal'
import
{
set
}
from
'immutable'
;
const
VectorData
=
props
=>
{
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
// 弹窗显示
const
[
schemename
,
setSchemename
]
=
useState
([]);
const
[
record
,
setRecord
]
=
useState
({});
//选中关联角色的方案名
const
[
webCurrent
,
setWebCurrent
]
=
useState
(
0
);
// web列表下标
const
[
handCurrent
,
setHandCurrent
]
=
useState
(
0
);
// hand列表下标
const
[
webData
,
setWebData
]
=
useState
([]);
// web数据
const
[
handData
,
setHandData
]
=
useState
([]);
//手持数据
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
...
...
@@ -23,7 +26,7 @@ const VectorData = props => {
const
[
webStatus
,
setWebStatus
]
=
useState
([]);
// 更新状态
const
[
webIndex
,
setWebIndex
]
=
useState
(
0
);
// web默认选中状态
const
[
handIndex
,
setHandIndex
]
=
useState
(
0
);
// 手持默认选中状态
const
[
type
,
setType
]
=
useState
(
'
add
'
);
// 弹窗类型
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
checkLoading
,
setCheckLoading
]
=
useState
(
false
)
const
[
solutionNames
,
setSolutionNames
]
=
useState
(
''
);
const
[
formObj
,
setFormObj
]
=
useState
({
user
:
'admin'
,
password
:
'geoserver'
});
...
...
@@ -35,9 +38,9 @@ const VectorData = props => {
render
:
(
text
,
record
,
index
)
=>
(
<
Space
>
<
Checkbox
checked=
{
webStatus
[
index
]
}
checked=
{
webStatus
[
index
+
webCurrent
*
3
]
}
onChange=
{
e
=>
{
onChangeCheck
(
e
,
record
,
index
);
onChangeCheck
(
e
,
record
,
index
+
webCurrent
*
3
);
}
}
/>
</
Space
>
...
...
@@ -55,9 +58,11 @@ const VectorData = props => {
key
:
'type'
,
render
:
(
text
,
record
,
index
)
=>
(
<
Space
>
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
style=
{
{
cursor
:
'pointer'
}
}
>
<
UserAddOutlined
/>
</
div
>
<
Space
>
<
div
onClick=
{
()
=>
pickRole
(
record
)
}
style=
{
{
cursor
:
'pointer'
}
}
>
<
VisibleRoleModal
onSubmit=
{
onPushSubmit
}
title=
{
"关联角色"
}
operate=
{
<
UserAddOutlined
/>
}
/>
</
div
>
</
Space
>
</
Space
>
),
},
...
...
@@ -94,9 +99,9 @@ const VectorData = props => {
render
:
(
text
,
record
,
index
)
=>
(
<
Space
>
<
Checkbox
checked=
{
handStatus
[
index
]
}
checked=
{
handStatus
[
index
+
handCurrent
*
3
]
}
onChange=
{
e
=>
{
onChangeHand
(
e
,
record
,
index
);
onChangeHand
(
e
,
record
,
index
+
handCurrent
*
3
);
}
}
/>
</
Space
>
...
...
@@ -114,8 +119,8 @@ const VectorData = props => {
key
:
'type'
,
render
:
(
text
,
record
,
index
)
=>
(
<
Space
>
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
style=
{
{
cursor
:
'pointer'
}
}
>
<
UserAddOutlined
/>
<
div
onClick=
{
()
=>
pickRole
(
record
)
}
style=
{
{
cursor
:
'pointer'
}
}
>
<
VisibleRoleModal
onSubmit=
{
onPushSubmit
}
title=
{
"关联角色"
}
operate=
{
<
UserAddOutlined
/>
}
/>
</
div
>
</
Space
>
),
...
...
@@ -145,6 +150,52 @@ const VectorData = props => {
}
];
//获取选中的角色
const
onPushSubmit
=
(
value
)
=>
{
let
id
=
[]
if
(
value
.
length
)
{
id
=
value
.
map
(
item
=>
{
return
item
.
id
})
let
query
=
{
schemename
:
record
.
schemename
,
terminalType
:
record
.
isStatus
,
isBaseMap
:
false
,
jsonCfg
:
JSON
.
stringify
({
roles
:
id
.
join
(
','
)
})
}
SetServiceConfig
(
query
).
then
(
res
=>
{
if
(
res
.
IsSuccess
)
{
prompt
(
'success'
,
'关联角色成功'
)
}
else
{
prompt
(
'fail'
,
'关联角色失败'
)
}
}).
catch
(
err
=>
{
prompt
(
'fail'
,
'网络请求失败'
)
})
}
else
{
notification
.
warning
({
message
:
'提示'
,
duration
:
3
,
description
:
'无选择任何角色'
,
});
}
}
//获取角色
const
pickRole
=
(
record
)
=>
{
setRecord
(
record
)
getUserRelationList
({
userID
:
record
[
'schemename'
],
_version
:
9999
}).
then
(
res
=>
{
console
.
log
(
'res'
,
res
);
})
}
//设置web方案
const
onChangeCheck
=
(
e
,
record
,
index
)
=>
{
setCheckLoading
(
true
)
...
...
@@ -385,7 +436,6 @@ const VectorData = props => {
isBaseMap
:
false
})
Promise
.
all
([
schemeConfigQueryRequest
,
webSchemeQueryRequest
]).
then
(
res
=>
{
console
.
log
(
'res'
,
res
)
if
(
res
[
0
].
IsSuccess
)
{
let
arr
=
[]
res
[
0
].
Result
.
map
((
item
,
index
)
=>
{
...
...
@@ -396,7 +446,7 @@ const VectorData = props => {
arr
.
push
(
false
)
}
item
.
isStatus
=
'
hand
'
item
.
isStatus
=
'
phone
'
return
item
})
setHandData
(
res
[
0
].
Result
)
...
...
@@ -440,6 +490,9 @@ const VectorData = props => {
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
defaultPageSize
:
3
,
onChange
:
(
value
)
=>
{
setWebCurrent
(
value
-
1
)
}
}
}
rowKey=
"schemename"
...
...
@@ -460,6 +513,9 @@ const VectorData = props => {
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
defaultPageSize
:
3
,
onChange
:
(
value
)
=>
{
setHandCurrent
(
value
-
1
)
}
}
}
>
...
...
src/services/webConfig/api.js
View file @
400040e8
...
...
@@ -208,6 +208,10 @@ get(`${CITY_SERVICE}/OMS.svc/UnbindSchemeBaseMap`, query );
export
const
setServiceType
=
(
query
)
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/SetServiceType`
,
query
);
//获取角色
export
const
getUserRelationList
=
(
query
)
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/WebGIS_GetUserRelationList`
,
query
);
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