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