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
fef51370
Commit
fef51370
authored
May 13, 2022
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '修改三维配置方案配置关联角色功能'
parent
1bee3c15
Pipeline
#50177
skipped with stages
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
63 deletions
+65
-63
solutionConfig.jsx
...er/gis/dimensionsConfig/solutionConfig/solutionConfig.jsx
+43
-23
RoleModal.jsx
...tformCenter/gis/schemeConfig/solutionConfig/RoleModal.jsx
+2
-0
solutionConfig.jsx
...Center/gis/schemeConfig/solutionConfig/solutionConfig.jsx
+1
-36
api.js
src/services/drawBoardManage/api.js
+16
-2
index.js
src/services/index.js
+3
-2
No files found.
src/pages/platformCenter/gis/dimensionsConfig/solutionConfig/solutionConfig.jsx
View file @
fef51370
import
{
Space
,
Table
,
Button
,
Popconfirm
,
notification
,
Divider
,
Checkbox
,
Spin
}
from
'antd'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
styles
from
'../dimensionsConfig.less'
;
import
React
,
{
useState
,
useEffect
,
useCallback
}
from
'react'
;
import
VisibleRoleModal
from
'@/pages/platformCenter/messageManage/projectManage/components/RolseSelect/VisibleRoleModal'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
PlusOutlined
,
UserAddOutlined
}
from
'@ant-design/icons'
;
import
styles
from
'../dimensionsConfig.less'
;
import
{
deleteConfig
,
SettingRoleWebSchema
,
...
...
@@ -12,7 +12,7 @@ import {
GetSchemaInfoList
,
IsActionWebSchema
,
}
from
'@/services/webConfig/api'
;
import
{
UserAddOutlined
}
from
'@ant-design/icons
'
;
import
RoleModal
from
'../../schemeConfig/solutionConfig/RoleModal
'
;
import
AddModal
from
'./AddModal'
;
const
VectorData
=
props
=>
{
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
// 弹窗显示
...
...
@@ -29,6 +29,9 @@ const VectorData = props => {
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
checkLoading
,
setCheckLoading
]
=
useState
(
false
);
const
[
formObj
,
setFormObj
]
=
useState
({
user
:
'admin'
,
password
:
'geoserver'
});
const
[
addVisible
,
setAddVisible
]
=
useState
(
false
);
const
[
checkValue
,
setCheckValue
]
=
useState
([]);
const
columns
=
[
{
title
:
'默认方案'
,
...
...
@@ -52,18 +55,12 @@ const VectorData = props => {
{
title
:
'关联角色'
,
align
:
'center'
,
render
:
(
text
,
record
,
index
)
=>
(
<
Space
>
<
Space
>
<
div
onClick=
{
()
=>
pickRole
(
record
)
}
style=
{
{
cursor
:
'pointer'
}
}
>
<
VisibleRoleModal
onSubmit=
{
onPushSubmit
}
title=
{
'关联角色'
}
initValues=
{
record
.
roles
!=
null
?
record
.
roles
.
split
(
','
)
:
[]
}
operate=
{
<
UserAddOutlined
/>
}
render
:
record
=>
(
<
Space
size=
"middle"
>
<
UserAddOutlined
onClick=
{
()
=>
pickRole
(
record
)
}
style=
{
{
fontSize
:
'18px'
,
color
:
'#1890FF'
}
}
/>
</
div
>
</
Space
>
</
Space
>
),
},
...
...
@@ -151,18 +148,15 @@ const VectorData = props => {
// ];
// 获取选中的角色
const
onPushSubmit
=
value
=>
{
let
id
=
[]
;
setAddVisible
(
false
)
;
if
(
value
.
length
)
{
id
=
value
.
map
(
item
=>
{
return
item
.
id
;
});
let
query
=
{
schemaname
:
record
.
scheme
.
schemename
,
roles
:
id
.
join
(
','
),
roles
:
value
.
join
(
','
),
};
SettingRoleWebSchema
(
query
)
.
then
(
res
=>
{
if
(
res
.
msg
===
''
)
{
if
(
res
.
code
===
0
)
{
prompt
(
'success'
,
'关联角色成功'
);
setFlag
(
flag
+
1
);
}
else
{
...
...
@@ -175,8 +169,12 @@ const VectorData = props => {
}
};
// 获取角色
const
pickRole
=
record
=>
{
setRecord
(
record
);
const
pickRole
=
e
=>
{
setRecord
(
e
);
setAddVisible
(
true
);
let
arr
=
e
.
roles
!=
null
?
e
.
roles
.
split
(
','
)
:
[];
console
.
log
(
arr
);
setCheckValue
(
arr
);
};
// 设置web方案
const
onChangeCheck
=
(
e
,
record
,
index
)
=>
{
...
...
@@ -395,6 +393,20 @@ const VectorData = props => {
});
};
const
rolCallBack
=
useCallback
(
list
=>
{
let
strList
=
[];
if
(
list
.
length
>
0
)
{
list
.
forEach
(
item
=>
{
console
.
log
(
item
,
'item'
);
Object
.
keys
(
item
.
last
).
forEach
(
i
=>
{
strList
.
push
(
i
);
});
});
console
.
log
(
strList
);
onPushSubmit
(
strList
);
}
});
return
(
<>
<
Spin
tip=
"loading..."
spinning=
{
checkLoading
}
>
...
...
@@ -458,6 +470,14 @@ const VectorData = props => {
formObj=
{
formObj
}
listData=
{
schemename
}
/>
<
RoleModal
selectValue=
{
checkValue
.
toString
()
}
visible=
{
addVisible
}
rolCallBack=
{
roleList
=>
rolCallBack
(
roleList
)
}
onCancel=
{
()
=>
{
setAddVisible
(
false
);
}
}
/>
</>
);
};
...
...
src/pages/platformCenter/gis/schemeConfig/solutionConfig/RoleModal.jsx
View file @
fef51370
...
...
@@ -72,6 +72,8 @@ const RoleModal = porps => {
}
});
console
.
log
(
selectValue
,
'selectValue'
);
}
else
{
setRoleList
([]);
}
},
[
visible
]);
// 多选change事件
...
...
src/pages/platformCenter/gis/schemeConfig/solutionConfig/solutionConfig.jsx
View file @
fef51370
...
...
@@ -34,41 +34,6 @@ const VectorData = props => {
const
[
addVisible
,
setAddVisible
]
=
useState
(
false
);
const
[
checkValue
,
setCheckValue
]
=
useState
([]);
// useEffect(() => {
// // RoleGroupList().then(async res => {
// // let dataArr = {};
// // let tree1 = [];
// // let leafs1 = [];
// // console.log(res.data.roleList);
// // // eslint-disable-next-line no-unused-expressions
// // res.data &&
// // res.data.roleList.map((item, index) => {
// // if (item.roleList.length > 0) {
// // tree1.push({
// // name: item.visibleTitle,
// // id: index,
// // children: item.roleList.map(roleItem => {
// // leafs1.push({
// // name: roleItem.roleName,
// // id: roleItem.roleID,
// // });
// // const leafNode = {
// // name: roleItem.roleName,
// // id: roleItem.roleID,
// // children: [],
// // };
// // return leafNode;
// // }),
// // });
// // }
// // });
// // setTree(tree1);
// // setLeafs(leafs1);
// // console.log(res.data.roleList);
// // console.log(tree1);
// // console.log(leafs1);
// // });
// }, []);
const
columns
=
[
{
title
:
'默认方案'
,
...
...
@@ -201,7 +166,7 @@ const VectorData = props => {
};
SetServiceConfig
(
query
)
.
then
(
res
=>
{
if
(
res
.
msg
===
'Ok'
)
{
if
(
res
.
code
===
0
)
{
prompt
(
'success'
,
'关联角色成功'
);
setFlag
(
flag
+
1
);
}
else
{
...
...
src/services/drawBoardManage/api.js
View file @
fef51370
...
...
@@ -2,14 +2,16 @@
* @Description:
* @Author: leizhe
* @Date: 2022-04-06 17:28:30
* @LastEditTime: 2022-0
4-15 15:08:11
* @LastEditTime: 2022-0
5-13 09:54:37
* @LastEditors: leizhe
*/
import
{
get
,
post
,
postForm
,
PUBLISH_SERVICE
,
WebSERVICE
}
from
'@/services/index'
;
import
{
get
,
post
,
postForm
,
PUBLISH_SERVICE
,
WebSERVICE
,
CoreSERVICE
}
from
'@/services/index'
;
export
const
typeList
=
param
=>
get
(
`
${
WebSERVICE
}
/ModelType/ModelType/TypeList`
,
param
);
// export const typeList = param => get(`${CoreSERVICE}/ModelType/List`, param);
export
const
modelManageList
=
param
=>
get
(
`
${
WebSERVICE
}
/Models/Models/ModelManageList`
,
param
);
// export const modelManageList = param => get(`${CoreSERVICE}/Model/ModelList`, param);
export
const
SaveUpload
=
query
=>
post
(
`
${
WebSERVICE
}
/Models/Models/SaveUpload`
,
query
,
{
...
...
@@ -17,6 +19,12 @@ export const SaveUpload = query =>
'Content-Type'
:
'multipart/form-data;charset=UTF-8'
,
},
});
// export const SaveUpload = query =>
// post(`${CoreSERVICE}/Model/Save`, query, {
// headers: {
// 'Content-Type': 'multipart/form-data;charset=UTF-8',
// },
// });
export
const
Save
=
param
=>
get
(
`
${
WebSERVICE
}
/ModelType/ModelType/Save`
,
param
);
...
...
@@ -32,6 +40,12 @@ export const Import = query =>
'Content-Type'
:
'multipart/form-data;charset=UTF-8'
,
},
});
// export const Import = query =>
// post(`${CoreSERVICE}/Model/Import`, query, {
// headers: {
// 'Content-Type': 'multipart/form-data;charset=UTF-8',
// },
// });
export
const
DownLoadModelType
=
query
=>
`
${
PUBLISH_SERVICE
}
/ModelType/DownLoadModelType?modelList=
${
query
.
modelList
}
`
;
...
...
src/services/index.js
View file @
fef51370
...
...
@@ -2,7 +2,7 @@
* @Description:
* @Author: leizhe
* @Date: 2021-12-23 17:51:09
* @LastEditTime: 2022-0
4-14 11:04:59
* @LastEditTime: 2022-0
5-12 18:51:42
* @LastEditors: leizhe
*/
import
{
request
}
from
'../utils/request'
;
...
...
@@ -12,6 +12,7 @@ const CITY_SERVICE = '/Cityinterface/rest/services';
const
PUBLISH_SERVICE
=
'/PandaOMS/OMS'
;
// export const PUBLISH_SERVICE = '/Publish/GateWay/OMS';
const
WebSERVICE
=
'/Publish/Web'
;
const
CoreSERVICE
=
'/PandaCore/GCK'
;
const
get
=
async
(
url
,
params
,
options
=
{})
=>
request
({
url
,
...
...
@@ -34,4 +35,4 @@ const postForm = async (url, params = {}, options = {}) => {
return
post
(
url
,
formData
,
options
);
};
export
{
get
,
post
,
postForm
,
CITY_SERVICE
,
PUBLISH_SERVICE
,
WebSERVICE
};
export
{
get
,
post
,
postForm
,
CITY_SERVICE
,
PUBLISH_SERVICE
,
WebSERVICE
,
CoreSERVICE
};
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