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
bb9b912c
Commit
bb9b912c
authored
Sep 14, 2022
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
范围设置改变边界颜色交互优化
parent
45dc2769
Pipeline
#59975
waiting for manual action with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
30 deletions
+99
-30
index.jsx
src/pages/platformCenter/gis/schemeConfig/ScopeMap/index.jsx
+40
-9
card.jsx
...enter/gis/schemeConfig/projectMessage/components/card.jsx
+37
-2
projectMessage.jsx
...Center/gis/schemeConfig/projectMessage/projectMessage.jsx
+22
-19
No files found.
src/pages/platformCenter/gis/schemeConfig/ScopeMap/index.jsx
View file @
bb9b912c
...
...
@@ -25,6 +25,7 @@ import {
Tooltip
,
Radio
,
message
,
Popconfirm
,
}
from
'antd'
;
import
{
EnvironmentOutlined
}
from
'@ant-design/icons'
;
import
classnames
from
'classnames'
;
...
...
@@ -152,7 +153,9 @@ const Map = props => {
const
[
keepSave
,
setKeepSave
]
=
useState
(
''
);
const
[
map
,
setMap
]
=
useState
(
null
);
const
[
color
,
setColor
]
=
useState
(
''
);
const
[
borderColor
,
setBorderColor
]
=
useState
(
''
);
const
[
colorList
,
setColorList
]
=
useState
(
''
);
const
[
keepColor
,
setKeepColor
]
=
useState
(
''
);
useEffect
(()
=>
{
// GetSpriteSheet().then(res => {
...
...
@@ -185,6 +188,7 @@ const Map = props => {
exportScheme
:
setttings
.
exportScheme
||
'pandagis'
,
});
setColorList
(
setttings
.
boundColor
||
'#86C8F8'
);
setKeepColor
(
setttings
.
boundColor
||
'#86C8F8'
);
setColor
(
setttings
.
backgroundColor
||
'#000000'
);
setRadio
(
setttings
.
exportScheme
||
'pandagis'
);
if
(
setttings
.
id
)
{
...
...
@@ -295,10 +299,10 @@ const Map = props => {
obj
[
index
].
boundWidth
=
changedFields
[
0
].
value
;
mapRef
.
current
.
changeBoundWidthValue
(
obj
[
index
].
boundWidth
);
break
;
case
'boundColor'
:
obj
[
index
].
boundColor
=
changedFields
[
0
].
value
.
hex
;
mapRef
.
current
.
changeBoundColor
(
obj
[
index
].
boundColor
);
break
;
//
case 'boundColor':
//
obj[index].boundColor = changedFields[0].value.hex;
//
mapRef.current.changeBoundColor(obj[index].boundColor);
//
break;
case
'areaName'
:
Drawtool
.
deactivate
(
false
);
obj
[
index
].
areaName
=
changedFields
[
0
].
value
[
changedFields
[
0
].
value
.
length
-
1
];
...
...
@@ -337,6 +341,7 @@ const Map = props => {
exportScheme
:
setttings
.
exportScheme
||
'pandagis'
,
});
setColorList
(
setttings
.
boundColor
||
'#86C8F8'
);
setKeepColor
(
setttings
.
boundColor
||
'#86C8F8'
);
setColor
(
setttings
.
backgroundColor
||
'#000000'
);
setRadio
(
setttings
.
exportScheme
||
'pandagis'
);
mapRef
.
current
.
mapchange
(
obj
);
...
...
@@ -472,18 +477,14 @@ const Map = props => {
});
const
onChange
=
e
=>
{
console
.
log
(
e
.
target
.
value
);
const
{
layer
}
=
getPipenetLayer
(
mapInfo
.
current
?.
map
);
console
.
log
(
layer
);
if
(
layer
)
{
console
.
log
(
923423
);
layer
.
visible
=
false
;
}
if
(
e
.
target
.
value
==
'arcgis'
)
{
// 选择前端绘制时,如果界面有自定义的管网图就隐藏,打开组件自动生成前端管网图
mapInfo
.
current
.
map
.
layers
.
forEach
(
item
=>
{
if
(
item
.
layerType
&&
item
.
layerType
==
'PipenetLayertest'
)
{
console
.
log
(
123
);
mapInfo
.
current
.
map
.
remove
(
item
);
}
});
...
...
@@ -500,6 +501,8 @@ const Map = props => {
// 颜色选择
const
colorChange
=
value
=>
{
form
.
setFieldsValue
({
boundColor
:
value
.
hex
});
mapRef
.
current
.
changeBoundColor
(
value
.
hex
);
setColorList
(
value
.
hex
);
};
...
...
@@ -556,7 +559,35 @@ const Map = props => {
<
Slider
min=
{
0
}
max=
{
100
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"边界颜色"
name=
"boundColor"
style=
{
{
marginBottom
:
'19px'
}
}
>
<
SketchPicker
width=
"217px"
color=
{
colorList
}
onChange=
{
e
=>
colorChange
(
e
)
}
/>
<
div
style=
{
{
background
:
colorList
,
display
:
'inline-block'
,
width
:
'15px'
,
height
:
'15px'
,
border
:
'1px solid #ccc'
,
marginTop
:
'10px'
,
}
}
/>
<
Popconfirm
placement=
"topLeft"
icon=
{
false
}
title=
{
<
SketchPicker
width=
"217px"
color=
{
colorList
}
onChange=
{
e
=>
colorChange
(
e
)
}
/>
}
okText=
"确认"
cancelText=
"取消"
onConfirm=
{
()
=>
{
setKeepColor
(
colorList
);
}
}
onCancel=
{
()
=>
{
form
.
setFieldsValue
({
boundColor
:
keepColor
});
mapRef
.
current
.
changeBoundColor
(
keepColor
);
setColorList
(
keepColor
);
}
}
>
<
Button
style=
{
{
marginLeft
:
'15px'
}
}
>
更改边界颜色
</
Button
>
</
Popconfirm
>
</
Form
.
Item
>
<
Form
.
Item
label=
"边界宽度"
name=
"boundWidth"
style=
{
{
marginBottom
:
'19px'
}
}
>
<
InputNumber
min=
{
1
}
max=
{
10
}
/>
...
...
src/pages/platformCenter/gis/schemeConfig/projectMessage/components/card.jsx
View file @
bb9b912c
...
...
@@ -51,16 +51,49 @@ const CardData = props => {
const
deletebaseMap
=
(
item
,
baseMapItem
)
=>
{
console
.
log
(
item
);
console
.
log
(
props
.
item
.
defaultOldBaseMap
);
console
.
log
(
baseMapItem
);
let
j
=
props
.
item
.
defaultOldBaseMap
.
indexOf
(
baseMapItem
);
let
i
=
props
.
item
.
defaultBaseMap
;
console
.
log
(
j
);
console
.
log
(
i
);
if
(
item
.
baseMap
.
length
>
1
)
{
unbindSchemeBaseMap
({
schemename
:
item
.
schemename
,
basemapName
:
baseMapItem
}).
then
(
res
=>
{
if
(
res
.
code
==
'0'
)
{
if
(
j
==
i
)
{
SetServiceConfig
({
schemename
:
props
.
item
.
schemename
,
terminalType
:
'scheme'
,
isBaseMap
:
false
,
jsonCfg
:
JSON
.
stringify
({
defaultBaseMap
:
0
,
}),
}).
then
(
resdata
=>
{
if
(
resdata
.
code
==
'0'
)
{
deletebaseMaps
();
}
});
}
else
if
(
j
<
i
)
{
SetServiceConfig
({
schemename
:
props
.
item
.
schemename
,
terminalType
:
'scheme'
,
isBaseMap
:
false
,
jsonCfg
:
JSON
.
stringify
({
defaultBaseMap
:
i
-
1
,
}),
}).
then
(
resdata
=>
{
if
(
resdata
.
code
==
'0'
)
{
deletebaseMaps
();
}
});
}
else
{
deletebaseMaps
();
}
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
description
:
'底图方案删除成功'
,
});
deletebaseMaps
();
}
else
{
notification
.
error
({
message
:
'提示'
,
...
...
@@ -206,7 +239,9 @@ const CardData = props => {
}
});
};
const
pick
=
(
schemename
,
baseMapItem
)
=>
{
console
.
log
(
schemename
);
console
.
log
(
props
.
item
.
defaultOldBaseMap
);
let
i
=
props
.
item
.
defaultOldBaseMap
.
indexOf
(
baseMapItem
);
console
.
log
(
i
);
...
...
@@ -220,7 +255,7 @@ const CardData = props => {
}).
then
(
res
=>
{
if
(
res
.
code
==
'0'
)
{
deletebaseMaps
();
message
.
info
(
'设置成功'
);
message
.
success
(
'设置成功'
);
}
else
{
message
.
warning
(
res
.
msg
);
}
...
...
src/pages/platformCenter/gis/schemeConfig/projectMessage/projectMessage.jsx
View file @
bb9b912c
...
...
@@ -59,6 +59,7 @@ const VectorData = props => {
console
.
log
(
arr
);
setKeepData
(
arr
);
let
list
=
[];
console
.
log
(
resdata
.
data
);
resdata
.
data
.
map
((
j
,
index
)
=>
{
let
data
=
[];
let
aa
=
[];
...
...
@@ -70,7 +71,10 @@ const VectorData = props => {
}
});
list
.
push
(
j
.
schemename
);
console
.
log
(
aa
);
console
.
log
(
data
);
let
bb
=
aa
.
concat
(
data
);
console
.
log
(
bb
);
let
i
=
bb
.
indexOf
(
j
.
baseMap
[
j
.
defaultBaseMap
]);
resdata
.
data
[
index
].
defaultOldBaseMap
=
j
.
baseMap
;
resdata
.
data
[
index
].
baseMap
=
bb
;
...
...
@@ -78,6 +82,7 @@ const VectorData = props => {
});
console
.
log
(
list
);
setNameData
(
list
);
console
.
log
(
resdata
.
data
);
setTileData
(
resdata
.
data
);
}
});
...
...
@@ -107,25 +112,23 @@ const VectorData = props => {
<
div
className=
{
styles
.
cardsList
}
>
{
/* {console.log(tileData)} */
}
{
tileData
&&
tileData
.
length
?
(
tileData
.
map
((
item
,
index
)
=>
{
return
(
<
div
className=
{
styles
.
cardItem
}
key=
{
index
}
span=
{
5
}
offset=
{
2
}
style=
{
{
marginBottom
:
'1rem'
}
}
>
<
Cards
item=
{
item
}
cardFlag=
{
cardFlag
}
deletebaseMaps=
{
onDeletebaseMap
}
keepData=
{
keepData
}
nameData=
{
nameData
}
/>
</
div
>
);
})
tileData
.
map
((
item
,
index
)
=>
(
<
div
className=
{
styles
.
cardItem
}
key=
{
index
}
span=
{
5
}
offset=
{
2
}
style=
{
{
marginBottom
:
'1rem'
}
}
>
<
Cards
item=
{
item
}
cardFlag=
{
cardFlag
}
deletebaseMaps=
{
onDeletebaseMap
}
keepData=
{
keepData
}
nameData=
{
nameData
}
/>
</
div
>
))
)
:
(
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
style=
{
{
margin
:
'auto'
}
}
/>
)
}
...
...
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