Commit 83c0f277 authored by 皮倩雯's avatar 皮倩雯

gis底图配置新增离线地图配置,限制方案删除最后一个底图

parent a3fbb117
Pipeline #59534 waiting for manual action with stages
...@@ -51,6 +51,7 @@ const AddModal = props => { ...@@ -51,6 +51,7 @@ const AddModal = props => {
const [o, setO] = useState(''); const [o, setO] = useState('');
const [r, setR] = useState(''); const [r, setR] = useState('');
const [current, setCurrent] = useState(false); const [current, setCurrent] = useState(false);
const [type1, setType] = useState(0);
const [form] = Form.useForm(); const [form] = Form.useForm();
const arr = [ const arr = [
'assets/images/thumbnail/thumbnail_1.jpg', 'assets/images/thumbnail/thumbnail_1.jpg',
...@@ -66,7 +67,7 @@ const AddModal = props => { ...@@ -66,7 +67,7 @@ const AddModal = props => {
setLoading(true); setLoading(true);
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
let arr = {}; let arr = {};
console.log(obj.servicename); console.log(obj.url);
// 连点 // 连点
if (obj.servicename) { if (obj.servicename) {
if (mapType == 1) { if (mapType == 1) {
...@@ -75,9 +76,10 @@ const AddModal = props => { ...@@ -75,9 +76,10 @@ const AddModal = props => {
terminalType: 'base', terminalType: 'base',
isBaseMap: true, isBaseMap: true,
jsonCfg: JSON.stringify({ jsonCfg: JSON.stringify({
alpha: alpha, alpha,
label: obj.label, label: obj.label,
url: obj.url, url: obj.url,
taggingUrl: obj.taggingUrl,
icon: obj.icon, icon: obj.icon,
type: obj.type, type: obj.type,
extent: obj.range, extent: obj.range,
...@@ -114,9 +116,10 @@ const AddModal = props => { ...@@ -114,9 +116,10 @@ const AddModal = props => {
terminalType: 'base', terminalType: 'base',
isBaseMap: true, isBaseMap: true,
jsonCfg: JSON.stringify({ jsonCfg: JSON.stringify({
alpha: alpha, alpha,
label: obj.label, label: obj.label,
url: url, url: obj.url || url,
taggingUrl: obj.taggingUrl,
icon: obj.icon, icon: obj.icon,
type: obj.type, type: obj.type,
}), }),
...@@ -156,6 +159,7 @@ const AddModal = props => { ...@@ -156,6 +159,7 @@ const AddModal = props => {
useEffect(() => { useEffect(() => {
setLoading(false); setLoading(false);
setMapType(0); setMapType(0);
setType(0);
setAdvanced(0); setAdvanced(0);
setCurrent(false); setCurrent(false);
setPickItem(''); setPickItem('');
...@@ -215,9 +219,7 @@ const AddModal = props => { ...@@ -215,9 +219,7 @@ const AddModal = props => {
let silderData = value == 100 ? 1 : value / 100; let silderData = value == 100 ? 1 : value / 100;
setAlpha(silderData); setAlpha(silderData);
}; };
const tipFormatter = value => { const tipFormatter = value => `${value}%`;
return `${value}%`;
};
const imgURL = [ const imgURL = [
{ {
...@@ -250,6 +252,11 @@ const AddModal = props => { ...@@ -250,6 +252,11 @@ const AddModal = props => {
} else { } else {
setMapType(0); setMapType(0);
} }
if (value == 'offline-map') {
setType(1);
} else {
setType(0);
}
}; };
// 添加地图类型 // 添加地图类型
const servicenameToType = type => { const servicenameToType = type => {
...@@ -347,12 +354,13 @@ const AddModal = props => { ...@@ -347,12 +354,13 @@ const AddModal = props => {
return 'arcgis影像'; return 'arcgis影像';
case 'arcgis-i-ia': case 'arcgis-i-ia':
return 'arcgis影像注记'; return 'arcgis影像注记';
case 'offline-map':
return '离线地图';
// case 'google-user': // case 'google-user':
// return; // return;
// case 'pipenet-tile': // case 'pipenet-tile':
// return; // return;
default: default:
return;
} }
}; };
// 选择坐标系 // 选择坐标系
...@@ -512,7 +520,7 @@ const AddModal = props => { ...@@ -512,7 +520,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: '300px' }}
style={{ top: '150px' }} style={{ top: '150px' }}
width="700px" width="700px"
destroyOnClose destroyOnClose
...@@ -541,6 +549,7 @@ const AddModal = props => { ...@@ -541,6 +549,7 @@ const AddModal = props => {
<Option value="mapbox-i-ia">mapbox影像(mapbox-i-ia)</Option> <Option value="mapbox-i-ia">mapbox影像(mapbox-i-ia)</Option>
<Option value="tianditu-arcgis-i">arcgis影像(tianditu-arcgis-i)</Option> <Option value="tianditu-arcgis-i">arcgis影像(tianditu-arcgis-i)</Option>
<Option value="arcgis-i-ia">arcgis影像注记(arcgis-i-ia)</Option> <Option value="arcgis-i-ia">arcgis影像注记(arcgis-i-ia)</Option>
<Option value="offline-map">离线地图(offline-map)</Option>
</Select> </Select>
</Item> </Item>
<Item <Item
...@@ -568,7 +577,7 @@ const AddModal = props => { ...@@ -568,7 +577,7 @@ const AddModal = props => {
{/* <Item label="URL" name="url"> {/* <Item label="URL" name="url">
<Input placeholder="请输入URL" allowClear /> <Input placeholder="请输入URL" allowClear />
</Item> */} </Item> */}
<Item label="透明度" name="alpha"> {/* <Item label="透明度" name="alpha">
<Slider <Slider
marks={marks} marks={marks}
min={0} min={0}
...@@ -579,15 +588,14 @@ const AddModal = props => { ...@@ -579,15 +588,14 @@ const AddModal = props => {
// tooltipVisible // tooltipVisible
defaultValue={100} defaultValue={100}
/> />
</Item> </Item> */}
<Item <Item
label="选择缩略图" label="选择缩略图"
name="icon" name="icon"
rules={[{ required: true, message: '请选择缩略图' }]} rules={[{ required: true, message: '请选择缩略图' }]}
> >
<div style={{ display: 'flex', justifyContent: 'space-around' }}> <div style={{ display: 'flex', justifyContent: 'space-around' }}>
{imgURL.map((item, index) => { {imgURL.map((item, index) => (
return (
<div <div
className={classnames({ className={classnames({
[styles.imgHidden]: index !== pickItem, [styles.imgHidden]: index !== pickItem,
...@@ -608,10 +616,23 @@ const AddModal = props => { ...@@ -608,10 +616,23 @@ const AddModal = props => {
<Radio value={arr[index]} /> <Radio value={arr[index]} />
</Radio.Group> */} </Radio.Group> */}
</div> </div>
); ))}
})}
</div> </div>
</Item> </Item>
{type1 === 1 && (
<>
<Item label="URL" name="url" rules={[{ required: true, message: '请输入url' }]}>
<Input placeholder="请输入url" allowClear />
</Item>
<Item
label="注记URL"
name="taggingUrl"
rules={[{ required: true, message: '请输入url' }]}
>
<Input placeholder="请输入url" allowClear />
</Item>
</>
)}
{/* <Item label="缩略图" name="icon" rules={[{ required: true, message: '请选择缩略图' }]}> {/* <Item label="缩略图" name="icon" rules={[{ required: true, message: '请选择缩略图' }]}>
<Input placeholder="请输入URL" disabled /> <Input placeholder="请输入URL" disabled />
</Item> */} </Item> */}
...@@ -646,13 +667,11 @@ const AddModal = props => { ...@@ -646,13 +667,11 @@ const AddModal = props => {
> >
<Select onChange={handleWorkSpance}> <Select onChange={handleWorkSpance}>
{keyData {keyData
? keyData.map((item, index) => { ? keyData.map((item, index) => (
return (
<Option value={item} key={index}> <Option value={item} key={index}>
{item} {item}
</Option> </Option>
); ))
})
: ''} : ''}
</Select> </Select>
</Item> </Item>
...@@ -663,13 +682,11 @@ const AddModal = props => { ...@@ -663,13 +682,11 @@ const AddModal = props => {
> >
<Select onChange={handleLayer}> <Select onChange={handleLayer}>
{data {data
? data.map((item, index) => { ? data.map((item, index) => (
return (
<Option value={item} key={index}> <Option value={item} key={index}>
{item} {item}
</Option> </Option>
); ))
})
: ''} : ''}
</Select> </Select>
</Item> </Item>
...@@ -680,13 +697,11 @@ const AddModal = props => { ...@@ -680,13 +697,11 @@ const AddModal = props => {
> >
<Select onChange={handleCoordinate}> <Select onChange={handleCoordinate}>
{areaData {areaData
? areaData.map((item, index) => { ? areaData.map((item, index) => (
return (
<Option value={item} key={index}> <Option value={item} key={index}>
{item} {item}
</Option> </Option>
); ))
})
: ''} : ''}
</Select> </Select>
</Item> </Item>
......
...@@ -49,6 +49,7 @@ const NewEditModal = props => { ...@@ -49,6 +49,7 @@ const NewEditModal = props => {
const [areaData, setAreaData] = useState([]); const [areaData, setAreaData] = useState([]);
const [pickItem, setPickItem] = useState(''); const [pickItem, setPickItem] = useState('');
const [current, setCurrent] = useState(false); const [current, setCurrent] = useState(false);
const [type1, setType] = useState(0);
const [form] = Form.useForm(); const [form] = Form.useForm();
const arr = [ const arr = [
'assets/images/thumbnail/thumbnail_1.jpg', 'assets/images/thumbnail/thumbnail_1.jpg',
...@@ -71,9 +72,10 @@ const NewEditModal = props => { ...@@ -71,9 +72,10 @@ const NewEditModal = props => {
terminalType: 'base', terminalType: 'base',
isBaseMap: true, isBaseMap: true,
jsonCfg: JSON.stringify({ jsonCfg: JSON.stringify({
alpha: alpha, alpha,
label: obj.label, label: obj.label,
url: obj.url, url: obj.url,
taggingUrl: obj.taggingUrl,
icon: obj.icon, icon: obj.icon,
type: obj.type, type: obj.type,
extent: obj.range, extent: obj.range,
...@@ -110,9 +112,10 @@ const NewEditModal = props => { ...@@ -110,9 +112,10 @@ const NewEditModal = props => {
terminalType: 'base', terminalType: 'base',
isBaseMap: true, isBaseMap: true,
jsonCfg: JSON.stringify({ jsonCfg: JSON.stringify({
alpha: alpha, alpha,
label: obj.label, label: obj.label,
url: url, url: obj.url || url,
taggingUrl: obj.taggingUrl,
icon: obj.icon, icon: obj.icon,
type: obj.type, type: obj.type,
extent: null, extent: null,
...@@ -182,6 +185,11 @@ const NewEditModal = props => { ...@@ -182,6 +185,11 @@ const NewEditModal = props => {
} else { } else {
setMapType(0); setMapType(0);
} }
if (formObj.type == 'offline-map') {
setType(1);
} else {
setType(0);
}
if (formObj.m_User) { if (formObj.m_User) {
setAdvanced(1); setAdvanced(1);
setCurrent(true); setCurrent(true);
...@@ -246,9 +254,7 @@ const NewEditModal = props => { ...@@ -246,9 +254,7 @@ const NewEditModal = props => {
let silderData = value == 100 ? 1 : value / 100; let silderData = value == 100 ? 1 : value / 100;
setAlpha(silderData); setAlpha(silderData);
}; };
const tipFormatter = value => { const tipFormatter = value => `${value}%`;
return `${value}%`;
};
const imgURL = [ const imgURL = [
{ {
...@@ -293,6 +299,11 @@ const NewEditModal = props => { ...@@ -293,6 +299,11 @@ const NewEditModal = props => {
} else { } else {
setMapType(0); setMapType(0);
} }
if (value == 'offline-map') {
setType(1);
} else {
setType(0);
}
}; };
// 添加地图类型 // 添加地图类型
const servicenameToType = type => { const servicenameToType = type => {
...@@ -316,7 +327,6 @@ const NewEditModal = props => { ...@@ -316,7 +327,6 @@ const NewEditModal = props => {
// case 'pipenet-tile': // case 'pipenet-tile':
// return; // return;
default: default:
return;
} }
}; };
// 选择坐标系 // 选择坐标系
...@@ -502,6 +512,7 @@ const NewEditModal = props => { ...@@ -502,6 +512,7 @@ const NewEditModal = props => {
<Option value="mapbox-i-ia">mapbox影像(mapbox-i-ia)</Option> <Option value="mapbox-i-ia">mapbox影像(mapbox-i-ia)</Option>
<Option value="tianditu-arcgis-i">arcgis影像(tianditu-arcgis-i)</Option> <Option value="tianditu-arcgis-i">arcgis影像(tianditu-arcgis-i)</Option>
<Option value="arcgis-i-ia">arcgis影像注记(arcgis-i-ia)</Option> <Option value="arcgis-i-ia">arcgis影像注记(arcgis-i-ia)</Option>
<Option value="offline-map">离线地图(offline-map)</Option>
</Select> </Select>
</Item> </Item>
<Item <Item
...@@ -521,7 +532,7 @@ const NewEditModal = props => { ...@@ -521,7 +532,7 @@ const NewEditModal = props => {
{/* <Item label="URL" name="url"> {/* <Item label="URL" name="url">
<Input placeholder="请输入URL" allowClear /> <Input placeholder="请输入URL" allowClear />
</Item> */} </Item> */}
<Item label="透明度" name="alpha"> {/* <Item label="透明度" name="alpha">
{console.log(formObj.alpha)} {console.log(formObj.alpha)}
<Slider <Slider
marks={marks} marks={marks}
...@@ -532,15 +543,14 @@ const NewEditModal = props => { ...@@ -532,15 +543,14 @@ const NewEditModal = props => {
// // tooltipVisible={true} // // tooltipVisible={true}
defaultValue={formObj.alpha * 100} defaultValue={formObj.alpha * 100}
/> />
</Item> </Item> */}
<Item <Item
label="选择缩略图" label="选择缩略图"
name="icon" name="icon"
rules={[{ required: true, message: '请选择缩略图' }]} rules={[{ required: true, message: '请选择缩略图' }]}
> >
<div style={{ display: 'flex', justifyContent: 'space-around' }}> <div style={{ display: 'flex', justifyContent: 'space-around' }}>
{imgURL.map((item, index) => { {imgURL.map((item, index) => (
return (
<div <div
className={classnames({ className={classnames({
[styles.imgHidden]: index !== pickItem, [styles.imgHidden]: index !== pickItem,
...@@ -561,10 +571,23 @@ const NewEditModal = props => { ...@@ -561,10 +571,23 @@ const NewEditModal = props => {
<Radio value={arr[index]} /> <Radio value={arr[index]} />
</Radio.Group> */} </Radio.Group> */}
</div> </div>
); ))}
})}
</div> </div>
</Item> </Item>
{type1 === 1 && (
<>
<Item label="URL" name="url" rules={[{ required: true, message: '请输入url' }]}>
<Input placeholder="请输入url" allowClear />
</Item>
<Item
label="注记URL"
name="taggingUrl"
rules={[{ required: true, message: '请输入url' }]}
>
<Input placeholder="请输入url" allowClear />
</Item>
</>
)}
{/* <Item label="缩略图" name="icon" rules={[{ required: true, message: '请选择缩略图' }]}> {/* <Item label="缩略图" name="icon" rules={[{ required: true, message: '请选择缩略图' }]}>
<Input placeholder="请输入URL" disabled /> <Input placeholder="请输入URL" disabled />
</Item> */} </Item> */}
...@@ -599,13 +622,11 @@ const NewEditModal = props => { ...@@ -599,13 +622,11 @@ const NewEditModal = props => {
> >
<Select onChange={handleWorkSpance}> <Select onChange={handleWorkSpance}>
{keyData {keyData
? keyData.map((item, index) => { ? keyData.map((item, index) => (
return (
<Option value={item} key={index}> <Option value={item} key={index}>
{item} {item}
</Option> </Option>
); ))
})
: ''} : ''}
</Select> </Select>
</Item> </Item>
...@@ -616,13 +637,11 @@ const NewEditModal = props => { ...@@ -616,13 +637,11 @@ const NewEditModal = props => {
> >
<Select onChange={handleLayer}> <Select onChange={handleLayer}>
{data {data
? data.map((item, index) => { ? data.map((item, index) => (
return (
<Option value={item} key={index}> <Option value={item} key={index}>
{item} {item}
</Option> </Option>
); ))
})
: ''} : ''}
</Select> </Select>
</Item> </Item>
...@@ -633,13 +652,11 @@ const NewEditModal = props => { ...@@ -633,13 +652,11 @@ const NewEditModal = props => {
> >
<Select onChange={handleCoordinate}> <Select onChange={handleCoordinate}>
{areaData {areaData
? areaData.map((item, index) => { ? areaData.map((item, index) => (
return (
<Option value={item} key={index}> <Option value={item} key={index}>
{item} {item}
</Option> </Option>
); ))
})
: ''} : ''}
</Select> </Select>
</Item> </Item>
......
...@@ -48,7 +48,11 @@ const CardData = props => { ...@@ -48,7 +48,11 @@ const CardData = props => {
setCardData(keepData); setCardData(keepData);
console.log(props.item); console.log(props.item);
}, [cardFlag]); }, [cardFlag]);
const deletebaseMap = (item, baseMapItem) => { const deletebaseMap = (item, baseMapItem) => {
console.log(item);
console.log(baseMapItem);
if (item.baseMap.length > 1) {
unbindSchemeBaseMap({ schemename: item.schemename, basemapName: baseMapItem }).then(res => { unbindSchemeBaseMap({ schemename: item.schemename, basemapName: baseMapItem }).then(res => {
if (res.code == '0') { if (res.code == '0') {
notification.success({ notification.success({
...@@ -65,6 +69,9 @@ const CardData = props => { ...@@ -65,6 +69,9 @@ const CardData = props => {
}); });
} }
}); });
} else {
message.error('方案至少需要一张底图');
}
}; };
// 删除方案 // 删除方案
const deleteTile = item => { const deleteTile = item => {
...@@ -286,8 +293,7 @@ const CardData = props => { ...@@ -286,8 +293,7 @@ const CardData = props => {
</div> </div>
<div style={{ overflowY: 'scroll', height: '11.4rem' }}> <div style={{ overflowY: 'scroll', height: '11.4rem' }}>
{props.item.baseMap && props.item.baseMap.length {props.item.baseMap && props.item.baseMap.length
? props.item.baseMap.map((baseMapItem, baseindex) => { ? props.item.baseMap.map((baseMapItem, baseindex) => (
return (
<div className={styles.mapItem} key={baseindex}> <div className={styles.mapItem} key={baseindex}>
<div <div
onClick={() => pick(props.item.schemename, baseMapItem)} onClick={() => pick(props.item.schemename, baseMapItem)}
...@@ -325,8 +331,7 @@ const CardData = props => { ...@@ -325,8 +331,7 @@ const CardData = props => {
</Popconfirm>{' '} </Popconfirm>{' '}
</div> </div>
</div> </div>
); ))
})
: ''} : ''}
</div> </div>
</Card> </Card>
......
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