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
6b9f14d6
Commit
6b9f14d6
authored
Apr 22, 2021
by
shaoan123
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接方案配置模块接口
parent
89f2dd41
Pipeline
#26431
skipped with stages
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
392 additions
and
248 deletions
+392
-248
SchemeConfig.less
src/pages/platformCenter/schemeConfig/SchemeConfig.less
+16
-1
TileConfig.jsx
...ges/platformCenter/schemeConfig/TileConfig/TileConfig.jsx
+2
-2
AddModal.jsx
...s/platformCenter/schemeConfig/solutionConfig/AddModal.jsx
+18
-210
solutionConfig.jsx
...formCenter/schemeConfig/solutionConfig/solutionConfig.jsx
+350
-32
api.js
src/services/webConfig/api.js
+6
-3
No files found.
src/pages/platformCenter/schemeConfig/SchemeConfig.less
View file @
6b9f14d6
.container{
.container{
width: 100%;
width: 100%;
height:
100vh
;
height:
calc(100vh - 100px)
;
background-color: #ffffff;
background-color: #ffffff;
display: flex;
display: flex;
padding: 0.8rem;
padding: 0.8rem;
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
font-weight: 600;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
color: rgba(0, 0, 0, 0.85);
}
}
overflow-y: scroll;
}
}
.imgList{
.imgList{
display: flex;
display: flex;
...
@@ -77,3 +78,17 @@
...
@@ -77,3 +78,17 @@
color: rgba(0, 0, 0, 0.25);
color: rgba(0, 0, 0, 0.25);
z-index: 99;
z-index: 99;
}
}
.divider{
display: flex;
align-items: center;
line-height: 100%;
padding: 0.5rem;
.dividerIcon{
margin-left: 0.8rem;
color: #4699f4;
cursor: pointer;
}
}
.ant-table {
min-height: 15rem !important;
}
src/pages/platformCenter/schemeConfig/TileConfig/TileConfig.jsx
View file @
6b9f14d6
...
@@ -3,7 +3,7 @@ import React, { useState, useEffect, Modal } from 'react';
...
@@ -3,7 +3,7 @@ import React, { useState, useEffect, Modal } from 'react';
import
styles
from
'../SchemeConfig.less'
import
styles
from
'../SchemeConfig.less'
import
{
import
{
GetAllConfig
,
GetAllConfig
,
D
eleteConfig
d
eleteConfig
}
from
'@/services/webConfig/api'
;
}
from
'@/services/webConfig/api'
;
import
AddModal
from
'./AddModal'
import
AddModal
from
'./AddModal'
const
TileData
=
props
=>
{
const
TileData
=
props
=>
{
...
@@ -85,7 +85,7 @@ const TileData = props => {
...
@@ -85,7 +85,7 @@ const TileData = props => {
const
delConfirm
=
(
record
)
=>
{
const
delConfirm
=
(
record
)
=>
{
const
{
servicename
=
''
}
=
record
;
const
{
servicename
=
''
}
=
record
;
setTreeLoading
(
true
);
setTreeLoading
(
true
);
D
eleteConfig
({
d
eleteConfig
({
servicename
:
servicename
,
servicename
:
servicename
,
terminalType
:
'base'
,
terminalType
:
'base'
,
isBaseMap
:
true
isBaseMap
:
true
...
...
src/pages/platformCenter/schemeConfig/solutionConfig/AddModal.jsx
View file @
6b9f14d6
...
@@ -3,22 +3,14 @@ import { Form, Modal, Input, Select, AutoComplete, Button, notification } from '
...
@@ -3,22 +3,14 @@ import { Form, Modal, Input, Select, AutoComplete, Button, notification } from '
import
styles
from
'../SchemeConfig.less'
import
styles
from
'../SchemeConfig.less'
import
{
import
{
GetGISServerMapList
,
SetServiceConfig
,
GetAllConfig
publisService
}
from
'@/services/webConfig/api'
;
}
from
'@/services/webConfig/api'
;
const
{
Option
}
=
Select
;
const
{
Option
}
=
Select
;
const
AddModal
=
props
=>
{
const
AddModal
=
props
=>
{
const
{
callBackSubmit
=
()
=>
{
},
type
,
formObj
,
visible
,
solutionNames
}
=
props
;
const
{
callBackSubmit
=
()
=>
{
},
type
,
formObj
,
visible
,
listData
}
=
props
;
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
workSpace
,
setWorkSpace
]
=
useState
(
''
);
const
[
serviceName
,
setServicename
]
=
useState
([{
value
:
'geoserver'
,
item
:
'geoserver'
}]);
const
[
workList
,
setWorkList
]
=
useState
([]);
const
[
gsIp
,
setGsIp
]
=
useState
([]);
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
{
Item
}
=
Form
;
const
{
Item
}
=
Form
;
// 提交
// 提交
...
@@ -27,22 +19,15 @@ const AddModal = props => {
...
@@ -27,22 +19,15 @@ const AddModal = props => {
if
(
validate
)
{
if
(
validate
)
{
setLoading
(
true
);
setLoading
(
true
);
let
obj
=
form
.
getFieldsValue
();
let
obj
=
form
.
getFieldsValue
();
if
(
type
===
'add'
)
{
SetServiceConfig
({
let
query
=
{
schemename
:
obj
.
schemename
,
_version
:
9999
,
terminalType
:
type
===
'add'
?
'web'
:
'phone'
,
gsIP
:
obj
.
serviceadress
,
isBaseMap
:
'false'
,
gsPort
:
obj
.
port
,
jsonCfg
:
type
===
'add'
?
JSON
.
stringify
({
type
:
'dynamic'
})
:
JSON
.
stringify
({
isDefault
:
false
})
gsAppName
:
obj
.
servicename
,
})
gsUser
:
obj
.
user
,
gsWorkspaceName
:
obj
.
workname
,
gsPwd
:
obj
.
password
,
serviceName
:
obj
.
name
,
solution
:
solutionNames
,
}
publisService
(
query
,{
timeout
:
120000
})
.
then
(
res
=>
{
.
then
(
res
=>
{
setLoading
(
false
);
setLoading
(
false
);
if
(
res
.
s
uccess
)
{
if
(
res
.
IsS
uccess
)
{
form
.
resetFields
();
form
.
resetFields
();
callBackSubmit
();
callBackSubmit
();
notification
.
success
({
notification
.
success
({
...
@@ -50,8 +35,7 @@ const AddModal = props => {
...
@@ -50,8 +35,7 @@ const AddModal = props => {
duration
:
3
,
duration
:
3
,
description
:
'新增成功'
,
description
:
'新增成功'
,
});
});
setWorkList
([])
handlelocalStorage
(
'add'
,
obj
.
serviceadress
,
obj
.
servicename
)
}
else
{
}
else
{
notification
.
error
({
notification
.
error
({
message
:
'提示'
,
message
:
'提示'
,
...
@@ -68,94 +52,17 @@ const AddModal = props => {
...
@@ -68,94 +52,17 @@ const AddModal = props => {
});
});
setLoading
(
false
);
setLoading
(
false
);
});
});
}
else
if
(
type
===
'edit'
)
{
handleEdit
();
}
}
}
});
});
};
};
const
handleEdit
=
()
=>
{
// SetServiceConfig({
// servicename: serviceName,
// terminalType: 'base',
// isBaseMap: true,
// jsonCfg: JSON.stringify(query)
// })
// .then(res => {
// setLoading(false);
// if (res.success) {
// form.resetFields();
// callBackSubmit();
// notification.success({
// message: '提示',
// duration: 3,
// description: res.message || '编辑成功',
// });
// } else {
// notification.error({
// message: '提示',
// duration: 3,
// description: res.message || '编辑失败',
// });
// }
// })
// .catch(err => setLoading(false));
};
const
onFinish
=
value
=>
{
};
const
onFinish
=
value
=>
{
};
useEffect
(()
=>
{
useEffect
(()
=>
{
switch
(
type
)
{
form
.
setFieldsValue
({
schemename
:
listData
[
0
]
});
case
'add'
:
let
gsIp
=
[];
let
localStorageData
=
handlelocalStorage
(
'get'
);
if
(
localStorageData
)
{
gsIp
=
localStorageData
.
map
(
item
=>
({
value
:
item
.
gsIp
,
item
:
item
.
gsIp
}));
}
setGsIp
(
gsIp
)
let
localIps
=
[
'192.168.12.7'
,
'192.168.19.100'
]
let
port
=
localIps
.
includes
(
gsIp
)
?
8080
:
8088
form
.
setFieldsValue
({
servicename
:
serviceName
[
0
].
value
,
port
,
...
formObj
});
break
;
case
'edit'
:
form
.
setFieldsValue
({
...
formObj
});
break
;
default
:
break
;
}
},
[
visible
]);
},
[
visible
]);
//存储到localstorage
const
handlelocalStorage
=
(
type
,
gsIp
,
gisAppName
)
=>
{
if
(
!
localStorage
)
return
null
;
let
result
=
JSON
.
parse
(
localStorage
.
getItem
(
'metaData'
))
if
(
type
==
'get'
)
{
return
result
;
}
if
(
!
result
||
!
result
.
find
(
item
=>
item
.
gsIp
==
gsIp
))
{
if
(
!
result
)
result
=
[];
result
.
push
({
gsIp
,
gisAppName
:
[{
value
:
gisAppName
,
item
:
gisAppName
}]
})
localStorage
.
setItem
(
'metaData'
,
JSON
.
stringify
(
result
))
return
}
let
data
=
result
.
find
(
item
=>
item
.
gsIp
==
gsIp
)
let
isHasGisAppName
=
data
.
gisAppName
.
find
(
item
=>
item
.
value
==
gisAppName
);
if
(
isHasGisAppName
)
return
;
data
.
gisAppName
.
push
({
value
:
gisAppName
,
item
:
gisAppName
})
localStorage
.
setItem
(
'metaData'
,
JSON
.
stringify
(
result
))
};
const
layout
=
{
const
layout
=
{
layout
:
'horizontal'
,
layout
:
'horizontal'
,
...
@@ -167,56 +74,10 @@ const AddModal = props => {
...
@@ -167,56 +74,10 @@ const AddModal = props => {
},
},
};
};
const
handleChange
=
()
=>
{
}
const
handleChange
=
(
value
)
=>
{
form
.
setFieldsValue
({
schemename
:
value
});
//选择工作空间
const
selectWorkspace
=
()
=>
{
let
obj
=
form
.
getFieldsValue
();
form
.
validateFields
([
'serviceadress'
,
'port'
,
'servicename'
,
'user'
,
'password'
]).
then
(
validate
=>
{
if
(
validate
)
{
let
query
=
{
GISServerIP
:
obj
.
serviceadress
,
GISServerPort
:
obj
.
port
,
gsAppName
:
obj
.
servicename
,
gsUser
:
obj
.
user
,
gsPwd
:
obj
.
password
,
isGeoServer
:
true
,
_version
:
9999
,
}
GetGISServerMapList
(
query
).
then
(
res
=>
{
if
(
Array
.
isArray
(
res
))
{
const
defaultValue
=
res
[
0
].
name
||
''
form
.
setFieldsValue
({
name
:
defaultValue
,
workname
:
defaultValue
});
setWorkList
(
res
)
setWorkSpace
(
defaultValue
)
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
'获取工作空间失败'
,
});
}
})
}
})
};
//选择工作空间
const
handleWorkspace
=
(
value
)
=>
{
form
.
setFieldsValue
({
workname
:
value
,
name
:
value
})
setWorkSpace
(
value
)
}
}
const
selectIp
=
(
value
)
=>
{
let
localIps
=
[
'192.168.12.7'
,
'192.168.19.100'
]
let
port
=
localIps
.
includes
(
value
)
?
8080
:
8088
form
.
setFieldsValue
({
port
,
serviceadress
:
value
});
}
return
(
return
(
<
Modal
<
Modal
title=
{
`${type === 'add' ? '元数据发布' : '编辑'}`
}
title=
{
`${type === 'add' ? '元数据发布' : '编辑'}`
}
...
@@ -236,66 +97,13 @@ const AddModal = props => {
...
@@ -236,66 +97,13 @@ const AddModal = props => {
{
visible
&&
(
{
visible
&&
(
<
Form
form=
{
form
}
{
...
layout
}
onFinish=
{
onFinish
}
>
<
Form
form=
{
form
}
{
...
layout
}
onFinish=
{
onFinish
}
>
<
Item
<
Item
label=
"
GIS服务器地址
"
label=
"
方案名
"
name=
"s
erviceadress
"
name=
"s
chemename
"
rules=
{
[{
required
:
true
,
message
:
'请选择服务名'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请选择服务名'
}]
}
>
>
<
AutoComplete
<
Select
onChange=
{
handleChange
}
>
placeholder=
"请输入GIS服务器地址"
{
listData
.
map
((
item
,
index
)
=>
{
return
<
Option
value=
{
item
}
key=
{
index
}
>
{
item
}
</
Option
>
})
}
options=
{
gsIp
}
onSelect=
{
selectIp
}
/>
</
Item
>
<
Item
label=
"GIS服务器端口"
name=
"port"
rules=
{
[{
required
:
true
,
message
:
'请输入GIS服务器端口'
}]
}
>
<
Input
placeholder=
"请输入GIS服务器端口"
allowClear
/>
</
Item
>
<
Item
label=
"GIS服务器名"
name=
"servicename"
rules=
{
[{
required
:
true
,
message
:
'请输入GIS服务器名'
}]
}
>
<
AutoComplete
placeholder=
"Email"
options=
{
serviceName
}
/>
</
Item
>
<
Item
label=
"用户名称"
name=
"user"
rules=
{
[{
required
:
true
,
message
:
'请输入用户名称'
}]
}
>
<
Input
placeholder=
"请输入用户名称"
allowClear
/>
</
Item
>
<
Item
label=
"用户密码"
name=
"password"
rules=
{
[{
required
:
true
,
message
:
'请输入用户密码'
}]
}
>
<
Input
.
Password
placeholder=
"请输入用户密码"
allowClear
/>
</
Item
>
<
Item
label=
"工作空间名称"
name=
"workname"
rules=
{
[{
required
:
true
,
message
:
'请选择工作空间名称'
}]
}
>
<
div
className=
{
styles
.
imgList
}
>
<
Select
onChange=
{
handleWorkspace
}
value
={
workSpace
}
>
{
workList
.
length
?
workList
.
map
((
item
,
index
)
=>
{
return
<
Option
key=
{
index
}
value=
{
item
.
name
}
>
{
item
.
name
}
</
Option
>
})
:
''
}
</
Select
>
</
Select
>
<
Button
style=
{
{
marginLeft
:
'0.5rem'
}
}
onClick=
{
()
=>
{
selectWorkspace
()
}
}
>
选择工作空间
</
Button
>
</
div
>
</
Item
>
<
Item
label=
"服务名称"
name=
"name"
rules=
{
[{
required
:
true
,
message
:
'请输入服务名称'
}]
}
>
<
Input
placeholder=
"请输入服务名称"
allowClear
/>
</
Item
>
</
Item
>
</
Form
>
</
Form
>
)
}
)
}
...
...
src/pages/platformCenter/schemeConfig/solutionConfig/solutionConfig.jsx
View file @
6b9f14d6
import
{
Space
,
Table
,
Button
,
Popconfirm
,
notification
,
Divider
,
Radio
}
from
'antd'
;
import
{
Space
,
Table
,
Button
,
Popconfirm
,
notification
,
Divider
,
Checkbox
,
Spin
}
from
'antd'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
styles
from
'../SchemeConfig.less'
import
styles
from
'../SchemeConfig.less'
import
{
import
{
GetVectorService
,
deleteVectorService
,
GetAllConfig
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
deleteConfig
,
GetAllConfig
,
setServiceType
,
SetServiceConfig
}
from
'@/services/webConfig/api'
;
}
from
'@/services/webConfig/api'
;
import
{
import
{
UserAddOutlined
UserAddOutlined
}
from
'@ant-design/icons'
;
}
from
'@ant-design/icons'
;
import
AddModal
from
'./AddModal'
import
AddModal
from
'./AddModal'
import
{
set
}
from
'immutable'
;
const
VectorData
=
props
=>
{
const
VectorData
=
props
=>
{
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
// 弹窗显示
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
// 弹窗显示
const
[
schemename
,
setSchemename
]
=
useState
([]);
const
[
webData
,
setWebData
]
=
useState
([]);
// web数据
const
[
webData
,
setWebData
]
=
useState
([]);
// web数据
const
[
handData
,
setHandData
]
=
useState
([]);
//手持数据
const
[
handData
,
setHandData
]
=
useState
([]);
//手持数据
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 更新list
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 更新list
const
[
loading
,
setLoading
]
=
useState
([]);
// 更新状态
const
[
handStatus
,
setHandStatus
]
=
useState
([]);
// 更新状态
const
[
webStatus
,
setWebStatus
]
=
useState
([]);
// 更新状态
const
[
webIndex
,
setWebIndex
]
=
useState
(
0
);
// web默认选中状态
const
[
handIndex
,
setHandIndex
]
=
useState
(
0
);
// 手持默认选中状态
const
[
type
,
setType
]
=
useState
(
'add'
);
// 弹窗类型
const
[
type
,
setType
]
=
useState
(
'add'
);
// 弹窗类型
const
[
checkLoading
,
setCheckLoading
]
=
useState
(
false
)
const
[
solutionNames
,
setSolutionNames
]
=
useState
(
''
);
const
[
solutionNames
,
setSolutionNames
]
=
useState
(
''
);
const
[
formObj
,
setFormObj
]
=
useState
({
user
:
'admin'
,
password
:
'geoserver'
});
const
[
formObj
,
setFormObj
]
=
useState
({
user
:
'admin'
,
password
:
'geoserver'
});
const
columns
=
[
const
columns
=
[
...
@@ -25,7 +34,12 @@ const VectorData = props => {
...
@@ -25,7 +34,12 @@ const VectorData = props => {
key
:
'url'
,
key
:
'url'
,
render
:
(
text
,
record
,
index
)
=>
(
render
:
(
text
,
record
,
index
)
=>
(
<
Space
>
<
Space
>
<
Radio
value=
{
record
}
/>
<
Checkbox
checked=
{
webStatus
[
index
]
}
onChange=
{
e
=>
{
onChangeCheck
(
e
,
record
,
index
);
}
}
/>
</
Space
>
</
Space
>
),
),
},
},
...
@@ -38,10 +52,69 @@ const VectorData = props => {
...
@@ -38,10 +52,69 @@ const VectorData = props => {
{
{
title
:
'关联角色'
,
title
:
'关联角色'
,
align
:
'center'
,
align
:
'center'
,
key
:
'type'
,
key
:
'type'
,
render
:
(
text
,
record
,
index
)
=>
(
<
Space
>
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
style=
{
{
cursor
:
'pointer'
}
}
>
<
UserAddOutlined
/>
</
div
>
</
Space
>
),
},
{
title
:
'编辑'
,
align
:
'center'
,
key
:
'schemename'
,
render
:
(
text
,
record
,
index
)
=>
(
render
:
(
text
,
record
,
index
)
=>
(
<
Space
>
<
Space
>
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
>
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
>
<
Popconfirm
title=
"是否删除此条方案?"
okText=
"确认"
cancelText=
"取消"
onConfirm=
{
()
=>
{
delWebConfirm
(
record
);
}
}
>
<
Button
size=
"small"
danger
>
删除
</
Button
>
</
Popconfirm
>
</
div
>
</
Space
>
),
}
];
const
columns1
=
[
{
title
:
'查询方案'
,
align
:
'center'
,
key
:
'url'
,
render
:
(
text
,
record
,
index
)
=>
(
<
Space
>
<
Checkbox
checked=
{
handStatus
[
index
]
}
onChange=
{
e
=>
{
onChangeHand
(
e
,
record
,
index
);
}
}
/>
</
Space
>
),
},
{
title
:
'方案名'
,
dataIndex
:
'schemename'
,
key
:
'schemename'
,
align
:
'center'
},
{
title
:
'关联角色'
,
align
:
'center'
,
key
:
'type'
,
render
:
(
text
,
record
,
index
)
=>
(
<
Space
>
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
style=
{
{
cursor
:
'pointer'
}
}
>
<
UserAddOutlined
/>
<
UserAddOutlined
/>
</
div
>
</
div
>
</
Space
>
</
Space
>
...
@@ -55,11 +128,11 @@ const VectorData = props => {
...
@@ -55,11 +128,11 @@ const VectorData = props => {
<
Space
>
<
Space
>
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
>
<
div
onClick=
{
e
=>
e
.
stopPropagation
()
}
>
<
Popconfirm
<
Popconfirm
title=
"是否删除
该矢量数据
?"
title=
"是否删除
此条方案
?"
okText=
"确认"
okText=
"确认"
cancelText=
"取消"
cancelText=
"取消"
onConfirm=
{
()
=>
{
onConfirm=
{
()
=>
{
delConfirm
(
record
);
del
hand
Confirm
(
record
);
}
}
}
}
>
>
<
Button
size=
"small"
danger
>
<
Button
size=
"small"
danger
>
...
@@ -72,49 +145,238 @@ const VectorData = props => {
...
@@ -72,49 +145,238 @@ const VectorData = props => {
}
}
];
];
//设置web方案
const
onChangeCheck
=
(
e
,
record
,
index
)
=>
{
setCheckLoading
(
true
)
const
newLoadings
=
[...
webStatus
];
newLoadings
.
map
((
item
,
loadIndex
)
=>
{
return
loadIndex
==
index
?
newLoadings
[
loadIndex
]
=
!
newLoadings
[
loadIndex
]
:
newLoadings
[
loadIndex
]
=
false
})
setWebStatus
(
newLoadings
)
let
query
=
{
schemename
:
record
[
'schemename'
],
type
:
'dynamic'
}
if
(
!
newLoadings
[
index
])
{
setServiceType
(
query
).
then
(
res
=>
{
setCheckLoading
(
false
)
if
(
res
.
IsSuccess
)
{
const
changehandData
=
[...
webData
];
changehandData
[
index
].
type
=
'dynamic'
setWebData
(
changehandData
)
prompt
(
'success'
,
'设置成功'
)
}
else
{
prompt
(
'fail'
,
`
${
record
[
'schemename'
]}
默认设置时遇到错误:`
+
res
.
message
)
}
})
return
}
var
beforeDefault
=
webData
.
findIndex
((
item
)
=>
item
[
'type'
]
==
'pipenet'
);
setServiceType
({
schemename
:
record
[
'schemename'
],
type
:
'pipenet'
}).
then
(
res
=>
{
setCheckLoading
(
false
)
if
(
res
.
IsSuccess
)
{
const
changehandData
=
[...
webData
];
changehandData
[
index
].
type
=
'pipenet'
setWebData
(
changehandData
)
if
(
beforeDefault
!=
-
1
)
{
setServiceType
({
schemename
:
changehandData
[
beforeDefault
].
schemename
,
type
:
'dynamic'
}).
then
(
res
=>
{
setCheckLoading
(
false
)
if
(
res
.
IsSuccess
)
{
const
changehandData1
=
[...
webData
];
changehandData1
[
beforeDefault
].
type
=
'dynamic'
setWebData
(
changehandData1
)
prompt
(
'success'
,
'设置成功'
)
return
;
}
prompt
(
'fail'
,
`
${
record
[
'schemename'
]}
默认设置时遇到错误:`
+
res
.
message
)
})
}
}
})
}
const
onSubmit
=
prop
=>
{
//选择手持方案
setVisible
(
false
);
const
onChangeHand
=
(
e
,
record
,
index
)
=>
{
setFlag
(
flag
+
1
)
setCheckLoading
(
true
)
};
const
newLoadings
=
[...
handStatus
];
const
delConfirm
=
(
record
)
=>
{
newLoadings
.
map
((
item
,
loadIndex
)
=>
{
return
loadIndex
==
index
?
newLoadings
[
loadIndex
]
=
!
newLoadings
[
loadIndex
]
:
newLoadings
[
loadIndex
]
=
false
})
setHandStatus
(
newLoadings
)
let
query
=
{
let
query
=
{
serviceName
:
record
.
serviceName
,
schemename
:
record
[
'schemename'
],
_version
:
9999
,
terminalType
:
'phone'
,
solution
:
solutionNames
isBaseMap
:
false
,
jsonCfg
:
JSON
.
stringify
({
isDefault
:
newLoadings
[
index
],
})
}
}
deleteVectorService
(
query
).
then
(
res
=>
{
if
(
!
newLoadings
[
index
])
{
if
(
res
.
success
)
{
SetServiceConfig
(
query
).
then
(
res
=>
{
setFlag
(
flag
+
1
)
setCheckLoading
(
false
)
if
(
res
.
IsSuccess
)
{
const
changehandData
=
[...
handData
];
changehandData
[
index
].
isDefault
=
false
setHandData
(
changehandData
)
prompt
(
'success'
,
'设置成功'
)
}
else
{
prompt
(
'fail'
,
`
${
record
[
'schemename'
]}
默认设置时遇到错误:`
+
res
.
message
)
}
})
return
}
var
beforeDefault
=
handData
.
findIndex
((
item
)
=>
item
[
'isDefault'
]);
SetServiceConfig
({
schemename
:
record
[
'schemename'
],
terminalType
:
'phone'
,
isBaseMap
:
false
,
jsonCfg
:
JSON
.
stringify
({
isDefault
:
true
,
})
}).
then
(
res
=>
{
setCheckLoading
(
false
)
if
(
res
.
IsSuccess
)
{
const
changehandData
=
[...
handData
];
changehandData
[
index
].
isDefault
=
true
setHandData
(
changehandData
)
if
(
beforeDefault
!=
-
1
)
{
SetServiceConfig
({
schemename
:
changehandData
[
beforeDefault
].
schemename
,
terminalType
:
'phone'
,
isBaseMap
:
false
,
jsonCfg
:
JSON
.
stringify
({
isDefault
:
false
,
})
}).
then
(
res
=>
{
setCheckLoading
(
false
)
if
(
res
.
IsSuccess
)
{
const
changehandData1
=
[...
handData
];
changehandData1
[
beforeDefault
].
isDefault
=
false
setHandData
(
changehandData1
)
prompt
(
'success'
,
'设置成功'
)
return
;
}
prompt
(
'fail'
,
`
${
record
[
'schemename'
]}
默认设置时遇到错误:`
+
res
.
message
)
})
}
}
})
}
const
prompt
=
(
type
,
content
)
=>
{
if
(
type
==
'success'
)
{
notification
.
success
({
notification
.
success
({
message
:
'提示'
,
message
:
'提示'
,
duration
:
3
,
duration
:
3
,
description
:
'删除元数据成功'
,
description
:
content
,
});
});
}
else
{
}
else
{
notification
.
error
({
notification
.
error
({
message
:
'提示'
,
message
:
'提示'
,
duration
:
3
,
duration
:
3
,
description
:
'删除元数据失败'
,
description
:
content
,
});
});
}
}
const
onSubmit
=
prop
=>
{
setVisible
(
false
);
setFlag
(
flag
+
1
)
};
//删除web配置方案
const
delWebConfirm
=
(
record
)
=>
{
deleteConfig
({
schemename
:
record
[
'schemename'
],
terminalType
:
'web'
,
isBaseMap
:
false
}).
then
(
res
=>
{
if
(
res
.
IsSuccess
)
{
prompt
(
'success'
,
'删除成功'
)
setFlag
(
flag
+
1
)
}
else
{
prompt
(
'fail'
,
'删除失败'
)
};
};
})
})
}
}
const
handleAdd
=
()
=>
{
//删除手持配置方案
setType
(
'add'
);
const
delhandConfirm
=
(
record
)
=>
{
deleteConfig
({
schemename
:
record
[
'schemename'
],
terminalType
:
'phone'
,
isBaseMap
:
false
}).
then
(
res
=>
{
if
(
res
.
IsSuccess
)
{
prompt
(
'success'
,
'删除成功'
)
setFlag
(
flag
+
1
)
}
else
{
prompt
(
'fail'
,
'删除失败'
)
};
})
}
//添加方案
const
addType
=
(
type
)
=>
{
setType
(
type
);
let
listData
=
[]
type
==
'add'
?
listData
=
webData
:
listData
=
handData
let
webSchemenameArr
=
[],
schemeArr
=
[]
setTreeLoading
(
true
);
GetAllConfig
({
terminalType
:
'scheme'
,
isBaseMap
:
false
}).
then
(
res
=>
{
if
(
res
&&
res
.
Result
.
length
>
0
)
{
setTreeLoading
(
false
);
listData
.
map
(
item
=>
{
webSchemenameArr
.
push
(
item
.
schemename
)
})
res
.
Result
.
map
(
item
=>
{
if
(
!
webSchemenameArr
.
includes
(
item
.
schemename
))
schemeArr
.
push
(
item
.
schemename
)
})
setSchemename
(
schemeArr
)
if
(
schemeArr
.
length
)
{
setVisible
(
true
);
setVisible
(
true
);
}
}
else
{
notification
.
warning
({
message
:
'提示'
,
duration
:
3
,
description
:
'请先配置方案'
,
});
}
}
else
{
setTreeLoading
(
false
);
notification
.
warning
({
message
:
'提示'
,
duration
:
3
,
description
:
'请先配置方案'
,
});
}
}
)
}
useEffect
(()
=>
{
useEffect
(()
=>
{
renderTile
();
renderTile
();
},
[
flag
]);
},
[
flag
]);
// 获取瓦片数据配置数据
// 获取瓦片数据配置数据
const
renderTile
=
()
=>
{
const
renderTile
=
()
=>
{
setTreeLoading
(
true
);
setTreeLoading
(
true
);
//查询方案
//查询
手持
方案
var
schemeConfigQueryRequest
=
GetAllConfig
({
var
schemeConfigQueryRequest
=
GetAllConfig
({
terminalType
:
'
schem
e'
,
terminalType
:
'
phon
e'
,
isBaseMap
:
false
isBaseMap
:
false
})
})
//查询web方案
//查询web方案
...
@@ -122,13 +384,39 @@ const VectorData = props => {
...
@@ -122,13 +384,39 @@ const VectorData = props => {
terminalType
:
'web'
,
terminalType
:
'web'
,
isBaseMap
:
false
isBaseMap
:
false
})
})
Promise
.
all
([
schemeConfigQueryRequest
,
webSchemeQueryRequest
]).
then
(
res
=>
{
Promise
.
all
([
schemeConfigQueryRequest
,
webSchemeQueryRequest
]).
then
(
res
=>
{
console
.
log
(
'res'
,
res
);
console
.
log
(
'res'
,
res
)
if
(
res
[
0
].
IsSuccess
){
if
(
res
[
0
].
IsSuccess
)
{
let
arr
=
[]
res
[
0
].
Result
.
map
((
item
,
index
)
=>
{
if
(
item
.
isDefault
)
{
arr
.
push
(
true
)
setHandIndex
(
index
)
}
else
{
arr
.
push
(
false
)
}
item
.
isStatus
=
'hand'
return
item
})
setHandData
(
res
[
0
].
Result
)
setHandData
(
res
[
0
].
Result
)
setHandStatus
(
arr
)
}
if
(
res
[
1
].
IsSuccess
)
{
let
arr
=
[]
res
[
1
].
Result
.
map
((
item
,
index
)
=>
{
if
(
item
.
type
===
"pipenet"
)
{
arr
.
push
(
true
)
setWebIndex
(
index
)
}
else
{
arr
.
push
(
false
)
}
}
if
(
res
[
1
].
IsSuccess
){
item
.
isStatus
=
'web'
return
item
})
setWebData
(
res
[
1
].
Result
)
setWebData
(
res
[
1
].
Result
)
setWebStatus
(
arr
)
}
}
})
})
...
@@ -138,24 +426,54 @@ const VectorData = props => {
...
@@ -138,24 +426,54 @@ const VectorData = props => {
return
(
return
(
<>
<>
<
Divider
orientation=
"left"
>
Web
</
Divider
>
<
Spin
tip=
"loading..."
spinning=
{
checkLoading
}
>
<
div
>
<
div
>
<
Divider
orientation=
"left"
><
div
className=
{
styles
.
divider
}
>
Web
<
PlusOutlined
onClick=
{
()
=>
{
addType
(
'add'
)
}
}
className=
{
styles
.
dividerIcon
}
/></
div
></
Divider
>
<
Table
<
Table
columns=
{
columns
}
columns=
{
columns
}
dataSource=
{
webData
}
dataSource=
{
webData
}
bordered
bordered
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
defaultPageSize
:
3
,
}
}
rowKey=
"schemename"
rowKey=
"schemename"
scroll=
{
{
y
:
400
}
}
scroll=
{
{
y
:
400
}
}
>
>
</
Table
>
</
Table
>
<
Divider
orientation=
"left"
>
手持
</
Divider
>
</
div
>
<
Divider
orientation=
"left"
><
div
className=
{
styles
.
divider
}
>
手持
<
PlusOutlined
onClick=
{
()
=>
{
addType
(
'addHand'
)
}
}
className=
{
styles
.
dividerIcon
}
/></
div
>
</
Divider
>
<
Table
<
Table
columns=
{
columns
}
columns=
{
columns1
}
dataSource=
{
handData
}
dataSource=
{
handData
}
bordered
bordered
rowKey=
"schemename"
rowKey=
"schemename"
scroll=
{
{
y
:
400
}
}
scroll=
{
{
y
:
400
}
}
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
defaultPageSize
:
3
,
}
}
>
>
</
Table
>
</
Table
>
</
div
>
</
Spin
>
<
AddModal
visible=
{
visible
}
onCancel=
{
()
=>
setVisible
(
false
)
}
callBackSubmit=
{
onSubmit
}
type=
{
type
}
formObj=
{
formObj
}
listData=
{
schemename
}
/>
</>
</>
)
)
}
}
...
...
src/services/webConfig/api.js
View file @
6b9f14d6
...
@@ -169,9 +169,6 @@ export const SetServiceConfig = query =>
...
@@ -169,9 +169,6 @@ export const SetServiceConfig = query =>
export
const
GetVectorService
=
()
=>
export
const
GetVectorService
=
()
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/D_GetVectorService`
,
{
_version
:
9999
});
get
(
`
${
CITY_SERVICE
}
/OMS.svc/D_GetVectorService`
,
{
_version
:
9999
});
//删除底图配置
export
const
DeleteConfig
=
query
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/DeleteConfig`
,
query
);
//获取元数据的工作空间列表
//获取元数据的工作空间列表
export
const
GetGISServerMapList
=
query
=>
export
const
GetGISServerMapList
=
query
=>
...
@@ -207,4 +204,10 @@ get(`${CITY_SERVICE}/OMS.svc/BindSchemeBaseMap`, query );
...
@@ -207,4 +204,10 @@ get(`${CITY_SERVICE}/OMS.svc/BindSchemeBaseMap`, query );
export
const
unbindSchemeBaseMap
=
(
query
)
=>
export
const
unbindSchemeBaseMap
=
(
query
)
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/UnbindSchemeBaseMap`
,
query
);
get
(
`
${
CITY_SERVICE
}
/OMS.svc/UnbindSchemeBaseMap`
,
query
);
//设置web状态
export
const
setServiceType
=
(
query
)
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/SetServiceType`
,
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