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
73f784fb
Commit
73f784fb
authored
2 years ago
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '修复切换方案整图绘制管网不出来bug'
parent
9816e413
master
dev-database
dev-达梦
No related merge requests found
Pipeline
#62830
passed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
74 deletions
+64
-74
index.jsx
src/pages/platformCenter/gis/schemeConfig/ScopeMap/index.jsx
+38
-53
AddModal.jsx
...s/platformCenter/gis/schemeConfig/VectorData/AddModal.jsx
+26
-21
No files found.
src/pages/platformCenter/gis/schemeConfig/ScopeMap/index.jsx
View file @
73f784fb
...
...
@@ -405,6 +405,12 @@ const Map = props => {
// 获取地图实例
const
getMapInfo
=
viewObject
=>
{
const
pipenetLayers
=
viewObject
.
map
.
layers
.
filter
(
item
=>
{
item
.
layerType
&&
item
.
layerType
==
'PipenetLayertest'
;
});
viewObject
.
map
.
removeMany
(
pipenetLayers
);
console
.
log
(
viewObject
.
map
);
console
.
log
(
123
);
setMap
(
viewObject
);
// const { layer } = getPipenetLayer(viewObject?.map);
// if (layer) {
...
...
@@ -425,6 +431,7 @@ const Map = props => {
let
data
=
mapInfo
.
current
.
map
.
layers
.
find
(
item
=>
item
.
layerType
&&
item
.
layerType
==
'PipenetLayertest'
,
);
console
.
log
(
data
);
if
(
!
data
)
{
// 用户自定义创建的管网图
let
aa
=
''
;
...
...
@@ -433,7 +440,6 @@ const Map = props => {
aa
=
i
.
id
;
}
});
console
.
log
(
aa
);
const
pandagis1
=
new
MapImageLayer
({
id
:
aa
,
url
:
`/PandaGIS/MapServer/
${
aa
}
`
,
...
...
@@ -444,23 +450,6 @@ const Map = props => {
}
}
setRadio1
(
form
.
getFieldsValue
().
customFlag
);
// gate();
};
const
gate
=
()
=>
{
let
aa
=
form
.
getFieldsValue
().
schemename
;
GetWebSiteConfig
({
client
:
'sandbox'
}).
then
(
res
=>
{
let
data
=
res
.
data
.
find
(
i
=>
i
.
schemename
==
aa
);
console
.
log
(
data
);
if
(
data
.
areaName
==
null
)
{
console
.
log
(
121212212
);
mapRef
.
current
.
changeAreaName
(
'上海市'
);
mapRef
.
current
.
changeBoundWidthValue
(
'5'
);
mapRef
.
current
.
changeBoundColor
(
'#86C8F8'
);
mapRef
.
current
.
updateAreaColor
(
'#000000'
);
mapRef
.
current
.
changeBackgroundOpacity
(
'0.6'
);
}
});
};
// 选择颜色
...
...
@@ -482,12 +471,10 @@ const Map = props => {
switch
(
changedFields
[
0
].
name
[
0
])
{
case
'backgroundOpacity'
:
obj
[
index
].
backgroundOpacity
=
changedFields
[
0
].
value
/
100
;
console
.
log
(
obj
[
index
].
backgroundOpacity
);
mapRef
.
current
.
changeBackgroundOpacity
(
obj
[
index
].
backgroundOpacity
);
break
;
case
'boundWidth'
:
obj
[
index
].
boundWidth
=
changedFields
[
0
].
value
;
console
.
log
(
obj
[
index
].
boundWidth
);
mapRef
.
current
.
changeBoundWidthValue
(
obj
[
index
].
boundWidth
);
break
;
case
'areaName'
:
...
...
@@ -495,7 +482,6 @@ const Map = props => {
Drawtool
.
deactivate
(
false
);
setArea
(
''
);
obj
[
index
].
areaName
=
changedFields
[
0
].
value
[
changedFields
[
0
].
value
.
length
-
1
];
console
.
log
(
obj
[
index
].
areaName
);
mapRef
.
current
.
changeAreaName
(
obj
[
index
].
areaName
);
// form.setFieldsValue({ customPointExtent: '' });
setDraw
(
0
);
...
...
@@ -506,6 +492,7 @@ const Map = props => {
aa
.
layers
.
map
(
i
=>
{
if
(
i
.
layerType
==
'PipenetLayer'
)
{
i
.
layerType
=
'dynamic'
;
i
.
areaName
=
obj
[
index
].
areaName
;
}
if
(
i
.
schemename
==
form
.
getFieldsValue
().
schemename
)
{
i
.
backgroundColor
=
color
;
...
...
@@ -521,13 +508,12 @@ const Map = props => {
case
'schemename'
:
setKeepDataDraw
([]);
setRadio1
(
''
);
// const pipenetLayers = mapInfo.current.map.layers.filter(item => {
// item.layerType && item.layerType == 'PipenetLayertest';
// });
// mapInfo.current.map.removeMany(pipenetLayers);
// console.log(mapInfo.current.map);
mapInfo
.
current
.
map
.
layers
.
forEach
(
item
=>
{
console
.
log
(
item
.
layerType
);
if
(
item
.
layerType
&&
item
.
layerType
==
'PipenetLayertest'
)
{
mapInfo
.
current
.
map
.
remove
(
item
);
}
});
GetWebSiteConfig
({
client
:
'sandbox'
}).
then
(
res
=>
{
setSchemeList
(
res
.
data
);
setMapsettings
(
res
.
data
);
...
...
@@ -624,29 +610,30 @@ const Map = props => {
mapRef
.
current
.
mapchange
(
obj
);
if
(
form
.
getFieldsValue
().
exportScheme
==
'pandagis'
)
{
let
data
=
mapInfo
.
current
.
map
.
layers
.
find
(
item
=>
item
.
layerType
&&
item
.
layerType
==
'PipenetLayertest'
,
);
console
.
log
(
data
);
if
(
!
data
)
{
// 用户自定义创建的管网图
let
aa
=
''
;
mapsettings
.
map
(
i
=>
{
if
(
i
.
schemename
==
form
.
getFieldsValue
().
schemename
)
{
aa
=
i
.
id
;
}
});
console
.
log
(
aa
);
const
pandagis1
=
new
MapImageLayer
({
id
:
aa
,
url
:
`/PandaGIS/MapServer/
${
aa
}
`
,
layerType
:
'PipenetLayertest'
,
title
:
aa
,
});
mapInfo
.
current
.
map
.
add
(
pandagis1
);
}
}
// if (form.getFieldsValue().exportScheme === 'pandagis') {
// console.log(9999);
// let data = mapInfo.current.map.layers.find(
// item => item.layerType && item.layerType === 'PipenetLayertest',
// );
// console.log(data);
// if (!data) {
// // 用户自定义创建的管网图
// let aa = '';
// mapsettings.map(i => {
// if (i.schemename == form.getFieldsValue().schemename) {
// aa = i.id;
// }
// });
// console.log(aa);
// const pandagis1 = new MapImageLayer({
// id: aa,
// url: `/PandaGIS/MapServer/${aa}`,
// layerType: 'PipenetLayertest',
// title: aa,
// });
// mapInfo.current.map.add(pandagis1);
// }
// }
break
;
default
:
...
...
@@ -857,7 +844,7 @@ const Map = props => {
setSetttingsSave
(
mapObj
);
Drawtool
.
deactivate
(
false
);
setArea
(
''
);
//
setArea('');
setKeepSave
(
''
);
getData
();
}
else
{
...
...
@@ -885,9 +872,7 @@ const Map = props => {
if
(
e
.
target
.
value
==
'arcgis'
)
{
// 选择前端绘制时,如果界面有自定义的管网图就隐藏,打开组件自动生成前端管网图
mapInfo
.
current
.
map
.
layers
.
forEach
(
item
=>
{
console
.
log
(
item
.
layerType
);
if
(
item
.
layerType
&&
item
.
layerType
==
'PipenetLayertest'
)
{
console
.
log
(
3333
);
mapInfo
.
current
.
map
.
remove
(
item
);
}
});
...
...
This diff is collapsed.
Click to expand it.
src/pages/platformCenter/gis/schemeConfig/VectorData/AddModal.jsx
View file @
73f784fb
...
...
@@ -101,26 +101,31 @@ const AddModal = props => {
const
onFinish
=
value
=>
{};
useEffect
(()
=>
{
switch
(
type
)
{
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
;
if
(
visible
)
{
switch
(
type
)
{
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
;
}
}
else
{
form
.
resetFields
();
setWorkSpace
(
''
);
}
},
[
visible
]);
...
...
@@ -274,7 +279,7 @@ const AddModal = props => {
<
Select
onChange=
{
handleWorkspace
}
value=
{
workSpace
}
style=
{
{
width
:
'3
65
px'
}
}
style=
{
{
width
:
'3
78
px'
}
}
showSearch
>
{
workList
.
length
...
...
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