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
fc976a9b
Commit
fc976a9b
authored
Aug 19, 2024
by
涂伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: '运维地图配置范围内网数据获取逻辑优化'
parent
806ade78
Pipeline
#91895
passed with stages
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
56 deletions
+87
-56
index.jsx
src/pages/platformCenter/gis/schemeConfig/ScopeMap/index.jsx
+87
-56
mapData.json
...ges/platformCenter/gis/schemeConfig/ScopeMap/mapData.json
+0
-0
utils.js
src/utils/utils.js
+0
-0
No files found.
src/pages/platformCenter/gis/schemeConfig/ScopeMap/index.jsx
View file @
fc976a9b
...
...
@@ -19,7 +19,9 @@ import {
Graphic
,
EditAndDrawPanel
,
}
from
'@wisdom-map/arcgismap'
;
import
{
checkInternalNetwork
}
from
'@/utils/utils'
;
import
{
getPipenetLayer
}
from
'@wisdom-map/basemap'
;
import
mapDataJson
from
'./mapData.json'
;
import
{
Form
,
Input
,
...
...
@@ -308,24 +310,53 @@ const Map = props => {
}
});
// 获取城市选择器列表
window
.
AMap
.
plugin
(
'AMap.DistrictSearch'
,
()
=>
{
let
districtSearch
=
new
AMap
.
DistrictSearch
({
// 关键字对应的行政区级别,country表示国家
level
:
'country'
,
// 显示下级行政区级数,1表示返回下一级行政区
subdistrict
:
3
,
});
//
window.AMap.plugin('AMap.DistrictSearch', () => {
//
let districtSearch = new AMap.DistrictSearch({
//
// 关键字对应的行政区级别,country表示国家
//
level: 'country',
//
// 显示下级行政区级数,1表示返回下一级行政区
//
subdistrict: 3,
//
});
// 搜索所有省/直辖市信息
districtSearch
.
search
(
'中国'
,
(
status
,
result
)
=>
{
// 查询成功时,result即为对应的行政区信息
console
.
log
(
result
,
'行政区划信息'
);
result
.
districtList
[
0
].
districtList
.
push
({
adcode
:
'100000'
,
name
:
'中华人民共和国'
});
setOptions
(
result
.
districtList
[
0
].
districtList
);
});
});
// // 搜索所有省/直辖市信息
// districtSearch.search('中国', (status, result) => {
// // 查询成功时,result即为对应的行政区信息
// console.log(result, '行政区划信息');
// result.districtList[0].districtList.push({ adcode: '100000', name: '中华人民共和国' });
// setOptions(result.districtList[0].districtList);
// });
// });
getAreaJsonData
()
},
[]);
// 获取城市选择器列表
const
getAreaJsonData
=
()
=>
{
checkInternalNetwork
().
then
(
res
=>
{
console
.
log
(
res
,
'res'
);
if
(
!
res
)
{
console
.
log
(
mapDataJson
,
'mapDataJson本地数据'
);
setOptions
(
mapDataJson
)
}
else
{
window
.
AMap
.
plugin
(
'AMap.DistrictSearch'
,
()
=>
{
let
districtSearch
=
new
AMap
.
DistrictSearch
({
// 关键字对应的行政区级别,country表示国家
level
:
'country'
,
// 显示下级行政区级数,1表示返回下一级行政区
subdistrict
:
3
,
});
// 搜索所有省/直辖市信息
districtSearch
.
search
(
'中国'
,
(
status
,
result
)
=>
{
// 查询成功时,result即为对应的行政区信息
console
.
log
(
result
,
'行政区划信息'
);
result
.
districtList
[
0
].
districtList
.
push
({
adcode
:
'100000'
,
name
:
'中华人民共和国'
});
setOptions
(
result
.
districtList
[
0
].
districtList
);
});
})
}
})
}
const
getData
=
()
=>
{
GetWebSiteConfig
({
client
:
'sandbox'
})
.
then
(
res
=>
{
...
...
@@ -430,22 +461,23 @@ const Map = props => {
}
});
// 获取城市选择器列表
window
.
AMap
.
plugin
(
'AMap.DistrictSearch'
,
()
=>
{
let
districtSearch
=
new
AMap
.
DistrictSearch
({
// 关键字对应的行政区级别,country表示国家
level
:
'country'
,
// 显示下级行政区级数,1表示返回下一级行政区
subdistrict
:
3
,
});
//
window.AMap.plugin('AMap.DistrictSearch', () => {
//
let districtSearch = new AMap.DistrictSearch({
//
// 关键字对应的行政区级别,country表示国家
//
level: 'country',
//
// 显示下级行政区级数,1表示返回下一级行政区
//
subdistrict: 3,
//
});
// 搜索所有省/直辖市信息
districtSearch
.
search
(
'中国'
,
(
status
,
result
)
=>
{
// 查询成功时,result即为对应的行政区信息
console
.
log
(
result
,
'行政区划信息'
);
result
.
districtList
[
0
].
districtList
.
push
({
adcode
:
'100000'
,
name
:
'中华人民共和国'
});
setOptions
(
result
.
districtList
[
0
].
districtList
);
});
});
// // 搜索所有省/直辖市信息
// districtSearch.search('中国', (status, result) => {
// // 查询成功时,result即为对应的行政区信息
// console.log(result, '行政区划信息');
// result.districtList[0].districtList.push({ adcode: '100000', name: '中华人民共和国' });
// setOptions(result.districtList[0].districtList);
// });
// });
getAreaJsonData
()
};
// 获取地图实例
...
...
@@ -717,9 +749,8 @@ const Map = props => {
ymax
:
data
.
rings
[
0
][
0
][
1
],
});
form
.
setFieldsValue
({
extent
:
`
${
data
.
rings
[
0
][
0
][
0
]}
,
${
data
.
rings
[
0
][
1
][
1
]}
,
${
data
.
rings
[
0
][
2
][
0
]}
,
${
data
.
rings
[
0
][
0
][
1
]
}
`
,
extent
:
`
${
data
.
rings
[
0
][
0
][
0
]}
,
${
data
.
rings
[
0
][
1
][
1
]}
,
${
data
.
rings
[
0
][
2
][
0
]}
,
${
data
.
rings
[
0
][
0
][
1
]
}
`
,
});
mapRef
.
current
.
gotoGeometry
(
geom1
);
},
...
...
@@ -1038,30 +1069,30 @@ const Map = props => {
<
Radio
value=
{
1
}
>
手绘区域
</
Radio
>
</
Radio
.
Group
>
</
Form
.
Item
>
{
radio1
===
0
&&
(
{
radio1
===
0
&&
(
<>
<
Form
.
Item
label=
"手绘区域"
name=
"customPointExtent"
>
<
Tag
style=
{
{
width
:
'100px'
,
height
:
'27px'
,
paddingLeft
:
'25px'
,
paddingTop
:
'0px'
,
marginTop
:
'4px'
,
display
:
'flex'
,
alignItems
:
'center'
,
}
}
color=
"processing"
onClick=
{
()
=>
{
form
.
setFieldsValue
({
customFlag
:
1
});
setRadio1
(
1
)
setButState
(
true
);
setResultData
(
null
);
}
}
>
开始绘制
</
Tag
>
</
Form
.
Item
>
<
Tag
style=
{
{
width
:
'100px'
,
height
:
'27px'
,
paddingLeft
:
'25px'
,
paddingTop
:
'0px'
,
marginTop
:
'4px'
,
display
:
'flex'
,
alignItems
:
'center'
,
}
}
color=
"processing"
onClick=
{
()
=>
{
form
.
setFieldsValue
({
customFlag
:
1
});
setRadio1
(
1
)
setButState
(
true
);
setResultData
(
null
);
}
}
>
开始绘制
</
Tag
>
</
Form
.
Item
>
</>
)
}
{
radio1
===
1
&&
(
...
...
@@ -1326,7 +1357,7 @@ const Map = props => {
view=
{
mapInfo
.
current
}
editType=
{
[
'POLYGON'
,
'EXTENT'
,
'CIRCLE'
]
}
defaultGraphic=
{
resultData
||
'edgelayer-arcgismap'
}
areaName
=
{
areaName
=
{
form
.
getFieldsValue
().
areaName
&&
form
.
getFieldsValue
().
areaName
[
form
.
getFieldsValue
().
areaName
.
length
-
1
]
}
...
...
src/pages/platformCenter/gis/schemeConfig/ScopeMap/mapData.json
0 → 100644
View file @
fc976a9b
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/utils/utils.js
View file @
fc976a9b
This diff is collapsed.
Click to expand it.
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