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

fix: 'gis地图配置方案配置新增可选择基础底图或者分级底图

parent bfe5494d
Pipeline #52667 waiting for manual action with stages
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
padding: 0 0 2rem; padding: 0 0 2rem;
} }
.schemeName { .schemeName {
width: 68px;
margin-right: 0.8rem; margin-right: 0.8rem;
font-weight: bold; font-weight: bold;
} }
...@@ -93,7 +94,7 @@ ...@@ -93,7 +94,7 @@
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
width: 3rem; width: 41px;
justify-content: center; justify-content: center;
} }
.mapText { .mapText {
......
...@@ -486,7 +486,7 @@ const AddModal = props => { ...@@ -486,7 +486,7 @@ const AddModal = props => {
}; };
return ( return (
<Modal <Modal
title="添加底图" title="添加基础底图"
bodyStyle={{ width: '100%', maxHeight: '600px', overflow: 'scroll', minHeight: '360px' }} bodyStyle={{ width: '100%', maxHeight: '600px', overflow: 'scroll', minHeight: '360px' }}
style={{ top: '150px' }} style={{ top: '150px' }}
width="700px" width="700px"
......
...@@ -66,9 +66,9 @@ const AddProjectModal = props => { ...@@ -66,9 +66,9 @@ const AddProjectModal = props => {
if (res.code === 0) { if (res.code === 0) {
form.resetFields(); form.resetFields();
callBackSubmit(); callBackSubmit();
prompt('success', '瓦片新增成功'); prompt('success', '基础底图新增成功');
} else { } else {
prompt('fail', '瓦片新增失败'); prompt('fail', '基础底图新增失败');
} }
}) })
.catch(err => { .catch(err => {
...@@ -117,9 +117,9 @@ const AddProjectModal = props => { ...@@ -117,9 +117,9 @@ const AddProjectModal = props => {
if (res.code === 0) { if (res.code === 0) {
form.resetFields(); form.resetFields();
callBackSubmit(); callBackSubmit();
prompt('success', '方案新增成功'); prompt('success', '分级底图新增成功');
} else { } else {
prompt('fail', '方案新增失败'); prompt('fail', '分级底图新增失败');
} }
}) })
.catch(err => { .catch(err => {
...@@ -220,7 +220,7 @@ const AddProjectModal = props => { ...@@ -220,7 +220,7 @@ const AddProjectModal = props => {
const handleBaseMap = () => {}; const handleBaseMap = () => {};
return ( return (
<Modal <Modal
title={`${type === 'add' ? '添加底图' : '添加底图方案'}`} title={`${type === 'add' ? '添加基础底图' : '添加分级底图'}`}
bodyStyle={{ width: '100%', minHeight: '100px' }} bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: '150px' }} style={{ top: '150px' }}
width="700px" width="700px"
...@@ -238,27 +238,10 @@ const AddProjectModal = props => { ...@@ -238,27 +238,10 @@ const AddProjectModal = props => {
<Form form={form} {...layout} onFinish={onFinish}> <Form form={form} {...layout} onFinish={onFinish}>
{type === 'add' ? ( {type === 'add' ? (
<> <>
<Item
label="服务名"
name="serverName"
rules={[{ required: true, message: '请输入服务名' }]}
>
<Select onChange={handleChange}>
{serviceList.length
? serviceList.map((item, index) => {
return (
<Option key={index} value={item}>
{item}
</Option>
);
})
: ''}
</Select>
</Item>
<Item <Item
label={ label={
<div> <div>
<Tooltip title="同一底图方案中的不同底图缩放级别不能相同"> <Tooltip title="同一分级底图中的不同基础底图级别不能相同">
<InfoCircleOutlined <InfoCircleOutlined
style={{ style={{
color: 'rgb(24, 144, 255)', color: 'rgb(24, 144, 255)',
...@@ -267,19 +250,19 @@ const AddProjectModal = props => { ...@@ -267,19 +250,19 @@ const AddProjectModal = props => {
}} }}
/> />
</Tooltip> </Tooltip>
<span>缩放级别</span> <span>级别</span>
</div> </div>
} }
name="zoom" name="zoom"
rules={[ rules={[
{ required: true, message: '请输入缩放级别' }, { required: true, message: '请输入级别' },
{ {
validator: (rule, value) => { validator: (rule, value) => {
const obj = form.getFieldsValue().zoom; const obj = form.getFieldsValue().zoom;
console.log(obj); console.log(obj);
if (arr.indexOf(obj) != -1) { if (arr.indexOf(obj) != -1) {
console.log(111); console.log(111);
return Promise.reject('已存在该缩放级别的底图'); return Promise.reject('已存在该级别的基础底图');
} }
return Promise.resolve(); return Promise.resolve();
}, },
...@@ -288,20 +271,37 @@ const AddProjectModal = props => { ...@@ -288,20 +271,37 @@ const AddProjectModal = props => {
> >
<InputNumber min={0} /> <InputNumber min={0} />
</Item> </Item>
<Item
label="基础底图"
name="serverName"
rules={[{ required: true, message: '请输入基础底图' }]}
>
<Select onChange={handleChange}>
{serviceList.length
? serviceList.map((item, index) => {
return (
<Option key={index} value={item}>
{item}
</Option>
);
})
: ''}
</Select>
</Item>
</> </>
) : ( ) : (
<> <>
<Item <Item
label="方案名" label="名称"
name="schemename" name="schemename"
rules={[{ required: true, message: '请输入方案名' }]} rules={[{ required: true, message: '请输入名称' }]}
> >
<Input placeholder="请输入方案名" allowClear /> <Input placeholder="请输入名称" allowClear />
</Item> </Item>
<Item <Item
label="默认底图" label="默认基础底图"
name="baseMap" name="baseMap"
rules={[{ required: true, message: '请选择底图' }]} rules={[{ required: true, message: '请选择基础底图' }]}
> >
<Select onChange={handleBaseMap}> <Select onChange={handleBaseMap}>
{baseMap.length {baseMap.length
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Description: * @Description:
* @Author: leizhe * @Author: leizhe
* @Date: 2022-05-25 15:07:30 * @Date: 2022-05-25 15:07:30
* @LastEditTime: 2022-06-02 17:20:19 * @LastEditTime: 2022-06-10 15:36:33
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
...@@ -113,7 +113,7 @@ const BaseMap = props => { ...@@ -113,7 +113,7 @@ const BaseMap = props => {
<> <>
<span>编辑</span> <span>编辑</span>
<span style={{ color: 'rgb(24, 144, 255)' }}>{keepProject}</span> <span style={{ color: 'rgb(24, 144, 255)' }}>{keepProject}</span>
<span>缩放级别</span> <span>的级别</span>
</> </>
); );
return ( return (
...@@ -135,7 +135,7 @@ const BaseMap = props => { ...@@ -135,7 +135,7 @@ const BaseMap = props => {
<Item <Item
label={ label={
<div> <div>
<Tooltip title="同一底图方案中的不同底图缩放级别不能相同"> <Tooltip title="同一分级底图中的不同基础底图级别不能相同">
<InfoCircleOutlined <InfoCircleOutlined
style={{ style={{
color: 'rgb(24, 144, 255)', color: 'rgb(24, 144, 255)',
...@@ -144,20 +144,20 @@ const BaseMap = props => { ...@@ -144,20 +144,20 @@ const BaseMap = props => {
}} }}
/> />
</Tooltip> </Tooltip>
<span>缩放级别</span> <span>级别</span>
</div> </div>
} }
style={{ marginTop: '20px' }} style={{ marginTop: '20px' }}
name="zoom" name="zoom"
rules={[ rules={[
{ required: true, message: '请输入缩放级别' }, { required: true, message: '请输入级别' },
{ {
validator: (rule, value) => { validator: (rule, value) => {
const obj = form.getFieldsValue().zoom; const obj = form.getFieldsValue().zoom;
console.log(obj); console.log(obj);
if (arr.indexOf(obj) != -1) { if (arr.indexOf(obj) != -1) {
console.log(111); console.log(111);
return Promise.reject('已存在该缩放级别的底图'); return Promise.reject('已存在该级别的基础底图');
} }
return Promise.resolve(); return Promise.resolve();
}, },
......
...@@ -200,7 +200,7 @@ const EditModal = props => { ...@@ -200,7 +200,7 @@ const EditModal = props => {
return ( return (
<Modal <Modal
title={`${type === 'add' ? '添加' : '编辑'}底图`} title={`${type === 'add' ? '添加' : '编辑'}基础底图`}
bodyStyle={{ width: '100%', minHeight: '100px' }} bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: '150px' }} style={{ top: '150px' }}
width="700px" width="700px"
......
...@@ -458,7 +458,7 @@ const NewEditModal = props => { ...@@ -458,7 +458,7 @@ const NewEditModal = props => {
}; };
return ( return (
<Modal <Modal
title="编辑底图" title="编辑基础底图"
bodyStyle={{ width: '100%', maxHeight: '600px', overflow: 'scroll' }} bodyStyle={{ width: '100%', maxHeight: '600px', overflow: 'scroll' }}
style={{ top: '150px' }} style={{ top: '150px' }}
width="700px" width="700px"
......
...@@ -226,8 +226,8 @@ const TileData = props => { ...@@ -226,8 +226,8 @@ const TileData = props => {
<Divider orientation="left"> <Divider orientation="left">
<div className={styles.divider}> <div className={styles.divider}>
{' '} {' '}
底图{' '} 基础底图{' '}
<Tooltip title="新增底图"> <Tooltip title="新增基础底图">
<PlusOutlined <PlusOutlined
onClick={() => { onClick={() => {
handleAdd(); handleAdd();
...@@ -250,8 +250,8 @@ const TileData = props => { ...@@ -250,8 +250,8 @@ const TileData = props => {
/> />
<Divider orientation="left" style={{ marginTop: '50px' }}> <Divider orientation="left" style={{ marginTop: '50px' }}>
<div className={styles.divider}> <div className={styles.divider}>
底图分级显示方案{' '} 分级底图{' '}
<Tooltip title="新增底图方案"> <Tooltip title="新增分级底图">
<PlusOutlined <PlusOutlined
onClick={() => { onClick={() => {
addType(); addType();
......
...@@ -38,14 +38,14 @@ const CardData = props => { ...@@ -38,14 +38,14 @@ const CardData = props => {
notification.success({ notification.success({
message: '提示', message: '提示',
duration: 3, duration: 3,
description: '底图删除成功', description: '基础底图删除成功',
}); });
deletebaseMaps(); deletebaseMaps();
} else { } else {
notification.error({ notification.error({
message: '提示', message: '提示',
duration: 3, duration: 3,
description: '底图删除失败', description: '基础底图删除失败',
}); });
} }
}); });
...@@ -61,14 +61,14 @@ const CardData = props => { ...@@ -61,14 +61,14 @@ const CardData = props => {
notification.success({ notification.success({
message: '提示', message: '提示',
duration: 3, duration: 3,
description: '方案删除成功', description: '分级底图删除成功',
}); });
deletebaseMaps(); deletebaseMaps();
} else { } else {
notification.error({ notification.error({
message: '提示', message: '提示',
duration: 3, duration: 3,
description: '方案删除失败', description: '分级底图删除失败',
}); });
} }
}); });
...@@ -103,7 +103,7 @@ const CardData = props => { ...@@ -103,7 +103,7 @@ const CardData = props => {
notification.warning({ notification.warning({
message: '提示', message: '提示',
duration: 3, duration: 3,
description: '请先在基础配置-配置底图', description: '请先在基础配置-配置基础底图',
}); });
} }
}); });
...@@ -163,14 +163,14 @@ const CardData = props => { ...@@ -163,14 +163,14 @@ const CardData = props => {
<Card <Card
title={ title={
<div> <div>
<span className={styles.schemeName}>方案名</span> <span className={styles.schemeName}>名称</span>
{props.item.schemename} {props.item.schemename}
</div> </div>
} }
extra={ extra={
<a href="#"> <a href="#">
<Popconfirm <Popconfirm
title="是否删除该方案?" title="是否删除该分级底图?"
okText="确认" okText="确认"
cancelText="取消" cancelText="取消"
onConfirm={() => { onConfirm={() => {
...@@ -196,11 +196,11 @@ const CardData = props => { ...@@ -196,11 +196,11 @@ const CardData = props => {
</Button> </Button>
</div> */} </div> */}
<div className={styles.schemeItem}> <div className={styles.schemeItem}>
<span className={styles.schemeName}>底图</span> <span className={styles.schemeName}>基础底图</span>
<Button className={styles.schemeBtn1} onClick={() => addTile(props.item)}> <Button className={styles.schemeBtn1} onClick={() => addTile(props.item)}>
{' '} {' '}
<PlusOutlined /> <PlusOutlined />
添加底图 添加基础底图
</Button> </Button>
</div> </div>
<div style={{ overflowY: 'scroll', height: '11.4rem' }}> <div style={{ overflowY: 'scroll', height: '11.4rem' }}>
...@@ -232,7 +232,7 @@ const CardData = props => { ...@@ -232,7 +232,7 @@ const CardData = props => {
</div> </div>
<div className={styles.mapIcon1}> <div className={styles.mapIcon1}>
<Popconfirm <Popconfirm
title="是否删除该底图?" title="是否删除该基础底图?"
okText="确认" okText="确认"
cancelText="取消" cancelText="取消"
onConfirm={() => { onConfirm={() => {
......
/* eslint-disable indent */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Form, Modal, Input, Select, notification } from 'antd'; import { Form, Modal, Input, Select, notification, Radio } from 'antd';
import { import {
GettMaplayer, GettMaplayer,
GetVectorService, GetVectorService,
...@@ -10,11 +11,12 @@ import { ...@@ -10,11 +11,12 @@ import {
const { Item } = Form; const { Item } = Form;
const { Option } = Select; const { Option } = Select;
const AddModal = props => { const AddModal = props => {
const { callBackSubmit = () => {}, type, formObj, visible, serviceList } = props; const { callBackSubmit = () => {}, type, formObj, visible, serviceList, keepData } = props;
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [baseMap, setBaseMap] = useState([]); const [baseMap, setBaseMap] = useState([]);
const [pipeArr, setPipeArr] = useState([]); const [pipeArr, setPipeArr] = useState([]);
const [list, setList] = useState([]); const [list, setList] = useState([]);
const [radio, setRadio] = useState('');
const [form] = Form.useForm(); const [form] = Form.useForm();
// 提交 // 提交
...@@ -32,9 +34,9 @@ const AddModal = props => { ...@@ -32,9 +34,9 @@ const AddModal = props => {
if (res.code === 0) { if (res.code === 0) {
form.resetFields(); form.resetFields();
callBackSubmit(); callBackSubmit();
prompt('success', '底图方案新增成功'); prompt('success', '分级底图新增成功');
} else { } else {
prompt('fail', '底图方案新增失败'); prompt('fail', '分级底图新增失败');
} }
}); });
} else { } else {
...@@ -90,15 +92,26 @@ const AddModal = props => { ...@@ -90,15 +92,26 @@ const AddModal = props => {
const onFinish = value => {}; const onFinish = value => {};
useEffect(() => { useEffect(() => {
switch (type) { if (visible) {
case 'add': console.log(keepData);
addTile(); switch (type) {
break; case 'add':
case 'schemeAdd': addTile();
pipeNetwork(); break;
break; case 'schemeAdd':
default: pipeNetwork();
break; setRadio('基础底图');
form.setFieldsValue({ choose: '基础底图' });
form.setFieldsValue({
baseMap: keepData[0],
});
break;
default:
break;
}
} else {
setRadio('');
form.resetFields();
} }
}, [visible]); }, [visible]);
...@@ -129,9 +142,9 @@ const AddModal = props => { ...@@ -129,9 +142,9 @@ const AddModal = props => {
} }
setPipeArr(pipeArr); setPipeArr(pipeArr);
setBaseMap(baseMap); setBaseMap(baseMap);
form.setFieldsValue({ // form.setFieldsValue({
baseMap: baseMap[0], // baseMap: baseMap[0],
}); // });
}); });
}; };
const layout = { const layout = {
...@@ -155,11 +168,25 @@ const AddModal = props => { ...@@ -155,11 +168,25 @@ const AddModal = props => {
}); });
}; };
const onChange = e => {
console.log(keepData);
setRadio(e.target.value);
if (e.target.value === '基础底图') {
form.setFieldsValue({
baseMap: keepData[0],
});
} else {
form.setFieldsValue({
baseMap: baseMap[0],
});
}
};
// 选择底图 // 选择底图
const handleBaseMap = () => {}; const handleBaseMap = () => {};
return ( return (
<Modal <Modal
title={`${type === 'add' ? '添加底图方案' : '添加方案'}`} title={`${type === 'add' ? '添加分级底图' : '添加方案'}`}
bodyStyle={{ width: '100%', minHeight: '100px' }} bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: '150px' }} style={{ top: '150px' }}
width="700px" width="700px"
...@@ -176,7 +203,7 @@ const AddModal = props => { ...@@ -176,7 +203,7 @@ const AddModal = props => {
{visible && ( {visible && (
<Form form={form} {...layout} onFinish={onFinish}> <Form form={form} {...layout} onFinish={onFinish}>
{type === 'add' ? ( {type === 'add' ? (
<Item label="服务名" name="serverName"> <Item label="分级底图" name="serverName">
<Select onChange={handleChange}> <Select onChange={handleChange}>
{serviceList.length {serviceList.length
? serviceList.map((item, index) => { ? serviceList.map((item, index) => {
...@@ -217,7 +244,50 @@ const AddModal = props => { ...@@ -217,7 +244,50 @@ const AddModal = props => {
<Item label="url" name="url"> <Item label="url" name="url">
<Input placeholder="请输入url" allowClear /> <Input placeholder="请输入url" allowClear />
</Item> </Item>
<Item <Item name="choose" style={{ marginLeft: '110px' }}>
<Radio.Group onChange={onChange} value={radio}>
<Radio value="基础底图">基础底图</Radio>
<Radio value="分级底图">分级底图</Radio>
</Radio.Group>
</Item>
{form.getFieldsValue().choose === '分级底图' ? (
<Item
label="默认分级底图"
name="baseMap"
rules={[{ required: true, message: '请选择分级底图' }]}
>
<Select onChange={handleBaseMap}>
{baseMap.length
? baseMap.map((item, index) => {
return (
<Option key={index} value={item}>
{item}
</Option>
);
})
: ''}
</Select>
</Item>
) : (
<Item
label="默认基础底图"
name="baseMap"
rules={[{ required: true, message: '请选择基础底图' }]}
>
<Select onChange={handleBaseMap}>
{keepData.length
? keepData.map((item, index) => {
return (
<Option key={index} value={item}>
{item}
</Option>
);
})
: ''}
</Select>
</Item>
)}
{/* <Item
label="默认底图方案" label="默认底图方案"
name="baseMap" name="baseMap"
rules={[{ required: true, message: '请选择底图方案' }]} rules={[{ required: true, message: '请选择底图方案' }]}
...@@ -233,7 +303,7 @@ const AddModal = props => { ...@@ -233,7 +303,7 @@ const AddModal = props => {
}) })
: ''} : ''}
</Select> </Select>
</Item> </Item> */}
</> </>
)} )}
</Form> </Form>
......
...@@ -31,9 +31,9 @@ const AddModal = props => { ...@@ -31,9 +31,9 @@ const AddModal = props => {
if (res.code === 0) { if (res.code === 0) {
form.resetFields(); form.resetFields();
callBackSubmit(); callBackSubmit();
prompt('success', '瓦片新增成功'); prompt('success', '基础底图新增成功');
} else { } else {
prompt('fail', '瓦片新增失败'); prompt('fail', '基础底图新增失败');
} }
}); });
} else { } else {
...@@ -157,7 +157,7 @@ const AddModal = props => { ...@@ -157,7 +157,7 @@ const AddModal = props => {
const handleBaseMap = () => {}; const handleBaseMap = () => {};
return ( return (
<Modal <Modal
title={`${type === 'add' ? '添加底图' : '添加方案'}`} title={`${type === 'add' ? '添加基础底图' : '添加方案'}`}
bodyStyle={{ width: '100%', minHeight: '100px' }} bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: '150px' }} style={{ top: '150px' }}
width="700px" width="700px"
...@@ -174,7 +174,7 @@ const AddModal = props => { ...@@ -174,7 +174,7 @@ const AddModal = props => {
{visible && ( {visible && (
<Form form={form} {...layout} onFinish={onFinish}> <Form form={form} {...layout} onFinish={onFinish}>
{type === 'add' ? ( {type === 'add' ? (
<Item label="服务名" name="serverName"> <Item label="基础底图" name="serverName">
<Select onChange={handleChange}> <Select onChange={handleChange}>
{serviceList.length {serviceList.length
? serviceList.map((item, index) => { ? serviceList.map((item, index) => {
...@@ -216,9 +216,9 @@ const AddModal = props => { ...@@ -216,9 +216,9 @@ const AddModal = props => {
<Input placeholder="请输入url" allowClear /> <Input placeholder="请输入url" allowClear />
</Item> </Item>
<Item <Item
label="默认底图" label="默认基础底图"
name="baseMap" name="baseMap"
rules={[{ required: true, message: '请选择底图' }]} rules={[{ required: true, message: '请选择基础底图' }]}
> >
<Select onChange={handleBaseMap}> <Select onChange={handleBaseMap}>
{baseMap.length {baseMap.length
......
...@@ -243,15 +243,15 @@ const CardData = props => { ...@@ -243,15 +243,15 @@ const CardData = props => {
</div> */} </div> */}
<div className={styles.schemeItem}> <div className={styles.schemeItem}>
{/* <span className={styles.schemeName}>底图方案</span> */} {/* <span className={styles.schemeName}>底图方案</span> */}
<Button className={styles.schemeBtn} onClick={() => addTile(props.item)}>
{' '}
<BlockOutlined />
添加底图方案
</Button>
<Button className={styles.schemeBtn} onClick={() => addTileBase(props.item)}> <Button className={styles.schemeBtn} onClick={() => addTileBase(props.item)}>
{' '} {' '}
<GlobalOutlined /> <GlobalOutlined />
添加底图 添加基础底图
</Button>
<Button className={styles.schemeBtn} onClick={() => addTile(props.item)}>
{' '}
<BlockOutlined />
添加分级底图
</Button> </Button>
</div> </div>
<div style={{ overflowY: 'scroll', height: '11.4rem' }}> <div style={{ overflowY: 'scroll', height: '11.4rem' }}>
...@@ -280,7 +280,7 @@ const CardData = props => { ...@@ -280,7 +280,7 @@ const CardData = props => {
<Popconfirm <Popconfirm
title={ title={
cardData.indexOf(baseMapItem) == -1 ? ( cardData.indexOf(baseMapItem) == -1 ? (
<span>是否删除该底图方案</span> <span>是否删除该分级底图</span>
) : ( ) : (
<span>是否删除该底图?</span> <span>是否删除该底图?</span>
) )
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
* @Description: * @Description:
* @Author: leizhe * @Author: leizhe
* @Date: 2022-01-13 10:47:32 * @Date: 2022-01-13 10:47:32
* @LastEditTime: 2022-06-02 18:06:20 * @LastEditTime: 2022-06-10 15:13:28
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
/* eslint-disable indent */ /* eslint-disable indent */
import { Button, Spin } from 'antd'; import { Button, Spin, Empty } from 'antd';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import styles from '../SchemeConfig.less'; import styles from '../SchemeConfig.less';
import { GetMaplayerByTerminalType, GettMaplayer } from '@/services/webConfig/api'; import { GetMaplayerByTerminalType, GettMaplayer } from '@/services/webConfig/api';
...@@ -35,6 +35,7 @@ const VectorData = props => { ...@@ -35,6 +35,7 @@ const VectorData = props => {
setVisible(true); setVisible(true);
}; };
useEffect(() => { useEffect(() => {
console.log(1212);
renderTile(); renderTile();
}, [flag]); }, [flag]);
...@@ -52,8 +53,10 @@ const VectorData = props => { ...@@ -52,8 +53,10 @@ const VectorData = props => {
resdata.data.scheme.optionalLayer.layers.map((j, index) => { resdata.data.scheme.optionalLayer.layers.map((j, index) => {
let arr = []; let arr = [];
res.data.general.baseMap.layers.map(i => { res.data.general.baseMap.layers.map(i => {
console.log(i);
arr.push(i.servicename); arr.push(i.servicename);
}); });
console.log(arr);
setKeepData(arr); setKeepData(arr);
let data = []; let data = [];
let aa = []; let aa = [];
...@@ -97,26 +100,28 @@ const VectorData = props => { ...@@ -97,26 +100,28 @@ const VectorData = props => {
<div style={{ height: 'calc(100vh - 216px)', width: '100%' }}> <div style={{ height: 'calc(100vh - 216px)', width: '100%' }}>
<div className={styles.cardsList}> <div className={styles.cardsList}>
{/* {console.log(tileData)} */} {/* {console.log(tileData)} */}
{tileData && tileData.length {tileData && tileData.length ? (
? tileData.map((item, index) => { tileData.map((item, index) => {
return ( return (
<div <div
className={styles.cardItem} className={styles.cardItem}
key={index} key={index}
span={5} span={5}
offset={2} offset={2}
style={{ marginBottom: '1rem' }} style={{ marginBottom: '1rem' }}
> >
<Cards <Cards
item={item} item={item}
cardFlag={cardFlag} cardFlag={cardFlag}
deletebaseMaps={onDeletebaseMap} deletebaseMaps={onDeletebaseMap}
keepData={keepData} keepData={keepData}
/> />
</div> </div>
); );
}) })
: ''} ) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} style={{ margin: 'auto' }} />
)}
</div> </div>
<AddModal <AddModal
visible={visible} visible={visible}
...@@ -124,6 +129,7 @@ const VectorData = props => { ...@@ -124,6 +129,7 @@ const VectorData = props => {
callBackSubmit={onSubmit} callBackSubmit={onSubmit}
type={type} type={type}
formObj={formObj} formObj={formObj}
keepData={keepData}
/> />
</div> </div>
</Spin> </Spin>
......
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