Commit cf4a4f32 authored by 皮倩雯's avatar 皮倩雯

fix: '地图配置删除联动'

parent 0df189e7
Pipeline #58347 passed with stages
......@@ -150,6 +150,7 @@ const Map = props => {
const [keep, setKeep] = useState('');
const [keepSave, setKeepSave] = useState('');
const [map, setMap] = useState(null);
const [color, setColor] = useState('');
useEffect(() => {
GetWebSiteConfig({ client: 'sandbox' }).then(res => {
......@@ -178,6 +179,7 @@ const Map = props => {
schemename: setttings.schemename,
exportScheme: setttings.exportScheme || 'pandagis',
});
setColor(setttings.backgroundColor);
setRadio(setttings.exportScheme || 'pandagis');
if (setttings.id) {
setKeep(setttings);
......@@ -231,6 +233,7 @@ const Map = props => {
// 选择颜色
const checkColor = color => {
form.setFieldsValue({ backgroundColor: color });
setColor(color);
mapRef.current.updateAreaColor(color);
};
// 表单修改后对地图进行配置
......@@ -286,6 +289,7 @@ const Map = props => {
extent: setttings.extent,
exportScheme: setttings.exportScheme || 'pandagis',
});
setColor(setttings.backgroundColor);
setRadio(setttings.exportScheme || 'pandagis');
mapRef.current.mapchange(obj);
// 清除原有接口返回后端绘制的管网图
......@@ -470,7 +474,7 @@ const Map = props => {
{colorArr.map(item => (
<div
className={classnames(styles.colorBox, {
[styles.currentColor]: item.color === form.getFieldValue('backgroundColor'),
[styles.currentColor]: item.color === color,
})}
key={item.color}
style={{ background: item.color }}
......
......@@ -136,6 +136,7 @@ const TileData = props => {
})
.then(res => {
setFlag(flag + 1);
setFlagAdd(flagAdd + 1);
setTreeLoading(false);
if (res.code == '0') {
// form.resetFields();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment