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

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

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