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

fix: 'gis全部接口替换成pandagis,接入新地图组件,接入管网组件'

parent 27b4a9af
Pipeline #58305 passed with stages
......@@ -91,9 +91,9 @@
"@babel/runtime": "^7.10.5",
"@esri/calcite-colors": "6.0.3",
"@wisdom-cesium/cesium": "^1.0.78",
"@wisdom-map/amap": "1.1.0-beta.36",
"@wisdom-map/arcgismap": "1.4.0-23",
"@wisdom-map/basemap": "1.1.0-8",
"@wisdom-map/amap": "1.1.0-beta.37",
"@wisdom-map/arcgismap": "1.4.0-29",
"@wisdom-map/basemap": "1.1.0-9",
"ace-builds": "^1.4.12",
"antd-img-crop": "^3.13.2",
"bizcharts": "^4.0.15",
......
......@@ -211,7 +211,7 @@ const VectorData = props => {
if (!newLoadings[index]) {
SetServiceConfig(query).then(res => {
setCheckLoading(false);
if (res.msg === 'Ok') {
if (res.code == '0') {
const changehandData = [...handData];
changehandData[index].isDefault = false;
setHandData(changehandData);
......@@ -232,7 +232,7 @@ const VectorData = props => {
}),
}).then(res => {
setCheckLoading(false);
if (res.msg === 'Ok') {
if (res.code == '0') {
const changehandData = [...handData];
changehandData[index].isDefault = true;
setHandData(changehandData);
......@@ -296,7 +296,7 @@ const VectorData = props => {
terminalType: 'phone',
isBaseMap: false,
}).then(res => {
if (res.msg === 'Ok') {
if (res.code == '0') {
prompt('success', '删除成功');
setFlag(flag + 1);
} else {
......
......@@ -7,6 +7,9 @@
display: flex;
width: 100%;
height: calc(100vh - 160px);
.ant-radio-wrapper {
min-width: 100px;
}
.mapTool {
width: 400px;
.title {
......
......@@ -125,7 +125,7 @@ const AddModal = props => {
SetServiceConfig(arr)
.then(res => {
if (res.msg === 'Ok') {
if (res.code == '0') {
onCancel();
setLoading(false);
form.resetFields();
......
......@@ -63,7 +63,7 @@ const AddProjectModal = props => {
SetBaseMapschemeName(data)
.then(res => {
setLoading(false);
if (res.code === 0) {
if (res.code == '0') {
form.resetFields();
callBackSubmit();
prompt('success', '基础底图新增成功');
......@@ -114,7 +114,7 @@ const AddProjectModal = props => {
SetBaseMapschemeName(data)
.then(res => {
setLoading(false);
if (res.code === 0) {
if (res.code == '0') {
form.resetFields();
callBackSubmit();
prompt('success', '分级底图新增成功');
......@@ -178,7 +178,7 @@ const AddProjectModal = props => {
let pipeArr = [],
baseMap = [];
Promise.all([req1, req2]).then(res => {
if (res[0].msg === 'Ok') {
if (res[0].code == '0') {
(res[0].data.general.baseMap.layers || []).map(item => {
baseMap.push(item.servicename);
});
......
......@@ -3,7 +3,7 @@
* @Description:
* @Author: leizhe
* @Date: 2022-05-25 15:07:30
* @LastEditTime: 2022-06-10 15:36:33
* @LastEditTime: 2022-08-16 17:27:15
* @LastEditors: leizhe
*/
import React, { useState, useEffect } from 'react';
......@@ -73,7 +73,7 @@ const BaseMap = props => {
zoom: obj.zoom,
};
SetBaseMapschemeName(data).then(res => {
if (res.code === 0) {
if (res.code == '0') {
form.resetFields();
callBackSubmit();
prompt('success', '编辑成功');
......
......@@ -57,7 +57,7 @@ const EditModal = props => {
SetServiceConfig(arr)
.then(res => {
setLoading(false);
if (res.msg === 'Ok') {
if (res.code == '0') {
form.resetFields();
callBackSubmit();
notification.success({
......
......@@ -135,7 +135,7 @@ const NewEditModal = props => {
SetServiceConfig(arr)
.then(res => {
if (res.msg === 'Ok') {
if (res.code == '0') {
form.resetFields();
onCancel();
setLoading(false);
......
......@@ -101,9 +101,10 @@ const TileData = props => {
isBaseMap: false,
}).then(res => {
console.log('res', res);
if (res.msg === 'Ok') {
if (res.code == '0') {
setTreeLoading(false);
setCardData(res.data.baseMapscheme.optionalLayer.layers);
console.log(res.data.optionalLayer.layers);
setCardData(res.data.optionalLayer.layers);
} else {
setTreeLoading(false);
}
......@@ -136,7 +137,7 @@ const TileData = props => {
.then(res => {
setFlag(flag + 1);
setTreeLoading(false);
if (res.msg === 'Ok') {
if (res.code == '0') {
// form.resetFields();
// callBackSubmit();
notification.success({
......@@ -188,7 +189,7 @@ const TileData = props => {
terminalType: 'base',
isBaseMap: true,
}).then(res => {
if (res.msg === 'Ok') {
if (res.code == '0') {
setTreeLoading(false);
setTileData(res.data.general.baseMap.layers);
let data = [];
......
......@@ -34,7 +34,7 @@ const CardData = props => {
}, []);
const deletebaseMap = (item, baseMapItem) => {
DeletMapServicename({ schemename: item.schemename, servicename: baseMapItem }).then(res => {
if (res.code === 0) {
if (res.code == '0') {
notification.success({
message: '提示',
duration: 3,
......@@ -57,7 +57,7 @@ const CardData = props => {
terminalType: 'baseMapscheme',
isBaseMap: false,
}).then(res => {
if (res.msg === 'Ok') {
if (res.code == '0') {
notification.success({
message: '提示',
duration: 3,
......@@ -84,7 +84,7 @@ const CardData = props => {
setFormObj(value);
if (JSON.stringify(value) != '{}') {
GettMaplayer({ terminalType: 'base', isBaseMap: true }).then(res => {
if (res.msg === 'Ok') {
if (res.code == '0') {
res.data.general.baseMap.layers.map(item => {
console.log(value);
console.log(value.baseMap);
......@@ -131,7 +131,7 @@ const CardData = props => {
isBaseMap: false,
jsonCfg: JSON.stringify(jsConfig),
}).then(res => {
if (res.msg === 'Ok') {
if (res.code == '0') {
setMapScopeVisible(false);
message.info('范围设置成功');
}
......@@ -146,7 +146,7 @@ const CardData = props => {
defaultBaseMap: index,
}),
}).then(res => {
if (res.msg === 'Ok') {
if (res.code == '0') {
deletebaseMaps();
message.info('设置成功');
} else {
......
......@@ -11,7 +11,15 @@ import {
const { Item } = Form;
const { Option } = Select;
const AddModal = props => {
const { callBackSubmit = () => {}, type, formObj, visible, serviceList, keepData } = props;
const {
callBackSubmit = () => {},
type,
formObj,
visible,
serviceList,
keepData,
nameData,
} = props;
const [loading, setLoading] = useState(false);
const [baseMap, setBaseMap] = useState([]);
const [pipeArr, setPipeArr] = useState([]);
......@@ -31,7 +39,7 @@ const AddModal = props => {
basemapName: obj.serverName,
}).then(res => {
setLoading(false);
if (res.code === 0) {
if (res.code == '0') {
form.resetFields();
callBackSubmit();
prompt('success', '分级底图新增成功');
......@@ -77,7 +85,7 @@ const AddModal = props => {
SetServiceConfig(query)
.then(res => {
setLoading(false);
if (res.msg === 'Ok') {
if (res.code == '0') {
form.resetFields();
callBackSubmit();
prompt('success', '方案新增成功');
......@@ -130,7 +138,7 @@ const AddModal = props => {
let pipeArr = [],
baseMap = [];
Promise.all([req1, req2]).then(res => {
if (res[0].code === 0) {
if (res[0].code == '0') {
(res[0].data || []).map(item => {
baseMap.push(item);
});
......@@ -140,6 +148,7 @@ const AddModal = props => {
pipeArr.push(item.ServiceName.split('.')[0]);
});
}
console.log(baseMap);
setPipeArr(pipeArr);
setBaseMap(baseMap);
// form.setFieldsValue({
......@@ -164,7 +173,7 @@ const AddModal = props => {
form.setFieldsValue({
label: value,
// url: `http://{IP}/PandaGIS/MapServer/Export?mapServerName=${value}`,
url: `http://{IP}/CityInterface/rest/services/MapServer.svc/${value}`,
url: `http://{IP}/PandaGIS/MapServer/${value}`,
});
};
......@@ -221,11 +230,22 @@ const AddModal = props => {
<Item
label="方案名"
name="schemename"
rules={[{ required: true, message: '请输入方案名' }]}
rules={[
{ required: true, message: '请输入方案名' },
{
validator: (rule, value) => {
let aa = form.getFieldValue().schemename;
if (nameData.indexOf(aa) != -1) {
return Promise.reject('方案名已存在');
}
return Promise.resolve();
},
},
]}
>
<Input placeholder="请输入方案名" allowClear />
</Item>
<Item label="管网" name="servicename">
<Item label="管网" name="servicename" placeholder="请选择管网">
<Select onChange={handleService}>
{pipeArr.length
? pipeArr.map((item, index) => {
......
......@@ -10,7 +10,7 @@ import {
const { Item } = Form;
const { Option } = Select;
const AddModal = props => {
const { callBackSubmit = () => {}, type, formObj, visible, serviceList } = props;
const { callBackSubmit = () => {}, type, formObj, visible, serviceList, nameData } = props;
const [loading, setLoading] = useState(false);
const [baseMap, setBaseMap] = useState([]);
const [pipeArr, setPipeArr] = useState([]);
......@@ -28,7 +28,7 @@ const AddModal = props => {
basemapName: obj.serverName,
}).then(res => {
setLoading(false);
if (res.code === 0) {
if (res.code == '0') {
form.resetFields();
callBackSubmit();
prompt('success', '基础底图新增成功');
......@@ -74,7 +74,7 @@ const AddModal = props => {
SetServiceConfig(query)
.then(res => {
setLoading(false);
if (res.msg === 'Ok') {
if (res.code == '0') {
form.resetFields();
callBackSubmit();
prompt('success', '方案新增成功');
......@@ -115,7 +115,7 @@ const AddModal = props => {
let pipeArr = [],
baseMap = [];
Promise.all([req1, req2]).then(res => {
if (res[0].msg === 'Ok') {
if (res[0].code == '0') {
(res[0].data.general.baseMap.layers || []).map(item => {
baseMap.push(item.servicename);
});
......@@ -149,7 +149,7 @@ const AddModal = props => {
form.setFieldsValue({
label: value,
// url: `http://{IP}/PandaGIS/MapServer/Export?mapServerName=${value}`,
url: `http://{IP}/CityInterface/rest/services/MapServer.svc/${value}`,
url: `http://{IP}/PandaGIS/MapServer/${value}`,
});
};
......@@ -192,7 +192,18 @@ const AddModal = props => {
<Item
label="方案名"
name="schemename"
rules={[{ required: true, message: '请输入方案名' }]}
rules={[
{ required: true, message: '请输入方案名' },
{
validator: (rule, value) => {
let aa = form.getFieldValue().schemename;
if (nameData.indexOf(aa) != -1) {
return Promise.reject('方案名已存在');
}
return Promise.resolve();
},
},
]}
>
<Input placeholder="请输入方案名" allowClear />
</Item>
......
/* eslint-disable indent */
import React, { useState, useEffect } from 'react';
import { Form, Modal, Input, Select, notification } from 'antd';
import {
GetVectorService,
bindSchemeBaseMap,
UpdateSchemPipeNetwork,
} from '@/services/webConfig/api';
const { Item } = Form;
const { Option } = Select;
const EditModal = props => {
const { callBackSubmit = () => {}, formObj, visible } = props;
const [loading, setLoading] = useState(false);
const [pipeArr, setPipeArr] = useState([]);
const [form] = Form.useForm();
// 提交
const onSubmit = () => {
form.validateFields().then(validate => {
if (validate) {
setLoading(true);
let obj = form.getFieldsValue();
UpdateSchemPipeNetwork({
schemename: formObj.schemename,
...obj,
}).then(res => {
setLoading(false);
if (res.code == '0') {
form.resetFields();
callBackSubmit();
notification.success({
message: '提示',
duration: 3,
description: '修改成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
}
});
};
useEffect(() => {
if (visible) {
pipeNetwork();
form.setFieldsValue({
servicename: formObj.servicename,
label: formObj.label,
url: formObj.url,
});
} else {
form.resetFields();
}
}, [visible]);
// 获取管网及默认底图
const pipeNetwork = () => {
form.resetFields();
let pipeArr1 = [];
GetVectorService().then(res => {
if (res.code === 0) {
if (res.data.VectorList.length > 0) {
res.data.VectorList.map(item => {
pipeArr1.push(item.ServiceName.split('.')[0]);
});
}
setPipeArr(pipeArr1);
}
});
};
const layout = {
layout: 'horizontal',
labelCol: {
span: 4,
},
wrapperCol: {
span: 18,
},
};
// 选择管网
const handleService = value => {
form.setFieldsValue({
label: value,
// url: `http://{IP}/PandaGIS/MapServer/Export?mapServerName=${value}`,
url: `http://{IP}/PandaGIS/MapServer/${value}`,
});
};
return (
<Modal
title="修改管网"
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: '150px' }}
width="700px"
destroyOnClose
maskClosable={false}
cancelText="取消"
okText="确认"
{...props}
onOk={() => onSubmit()}
confirmLoading={loading}
forceRender={true}
getContainer={false}
>
{visible && (
<Form form={form} {...layout}>
<Item label="管网" name="servicename">
<Select onChange={handleService} placeholder="请选择管网">
{pipeArr.length
? pipeArr.map((item, index) => {
return (
<Option key={index} value={item}>
{item}
</Option>
);
})
: ''}
</Select>
</Item>
<Item label="标签" name="label">
<Input placeholder="请输入标签" allowClear />
</Item>
<Item label="url" name="url">
<Input placeholder="请输入url" allowClear />
</Item>
</Form>
)}
</Modal>
);
};
export default EditModal;
......@@ -10,14 +10,21 @@ import {
deleteConfig,
GetbaseMapschemeName,
} from '@/services/webConfig/api';
import { CloseOutlined, PlusOutlined, GlobalOutlined, BlockOutlined } from '@ant-design/icons';
import {
CloseOutlined,
PlusOutlined,
GlobalOutlined,
BlockOutlined,
FormOutlined,
} from '@ant-design/icons';
import AddModal from '../AddModal';
import EditModal from '../EditModal';
import MapScope from '@/components/MapScope';
import { createGuid } from '@/utils/transformUtil';
import AddModalBase from '../AddModalBase';
import styles from '../../SchemeConfig.less';
const CardData = props => {
const { deletebaseMaps = () => {}, item, cardFlag, keepData } = props;
const { deletebaseMaps = () => {}, item, cardFlag, keepData, nameData } = props;
const [visible, setVisible] = useState(false); // 弹窗
const [basevisible, setBaseVisible] = useState(false); // 弹窗
const [flag, setFlag] = useState(0); // 状态更新
......@@ -26,6 +33,7 @@ const CardData = props => {
const [serviceList, setServiceList] = useState([]);
const [mapScopeVisible, setMapScopeVisible] = useState(false);
const [cardData, setCardData] = useState([]);
const [editVisible, setEditVisible] = useState(false);
// 删除瓦片
useEffect(() => {
......@@ -42,7 +50,7 @@ const CardData = props => {
}, [cardFlag]);
const deletebaseMap = (item, baseMapItem) => {
unbindSchemeBaseMap({ schemename: item.schemename, basemapName: baseMapItem }).then(res => {
if (res.code === 0) {
if (res.code == '0') {
notification.success({
message: '提示',
duration: 3,
......@@ -65,7 +73,7 @@ const CardData = props => {
terminalType: 'scheme',
isBaseMap: false,
}).then(res => {
if (res.msg === 'Ok') {
if (res.code == '0') {
notification.success({
message: '提示',
duration: 3,
......@@ -86,13 +94,14 @@ const CardData = props => {
deletebaseMaps();
setBaseVisible(false);
};
// 增加瓦片
const addTile = value => {
let serverList = [];
setFormObj(value);
if (JSON.stringify(value) != '{}') {
GettMaplayer({ terminalType: 'base', isBaseMap: true }).then(res => {
if (res.msg === 'Ok') {
if (res.code == '0') {
res.data.general.baseMap.layers.map(item => {
if (value.baseMap.indexOf(item.servicename) == -1) {
serverList.push(item.servicename);
......@@ -135,7 +144,7 @@ const CardData = props => {
setFormObj(value);
if (JSON.stringify(value) != '{}') {
GettMaplayer({ terminalType: 'base', isBaseMap: true }).then(res => {
if (res.msg === 'Ok') {
if (res.code == '0') {
res.data.general.baseMap.layers.map(item => {
if (value.baseMap.indexOf(item.servicename) == -1) {
serverList.push(item.servicename);
......@@ -156,6 +165,12 @@ const CardData = props => {
});
}
};
const editTile = value => {
setFormObj(value);
setEditVisible(true);
};
const submitExtent = (extent, areaName, flag) => {
if (flag === 0) {
notification.warn({
......@@ -178,7 +193,7 @@ const CardData = props => {
isBaseMap: false,
jsonCfg: JSON.stringify(jsConfig),
}).then(res => {
if (res.msg === 'Ok') {
if (res.code == '0') {
setMapScopeVisible(false);
message.info('范围设置成功');
}
......@@ -196,7 +211,7 @@ const CardData = props => {
defaultBaseMap: i,
}),
}).then(res => {
if (res.msg === 'Ok') {
if (res.code == '0') {
deletebaseMaps();
message.info('设置成功');
} else {
......@@ -204,6 +219,12 @@ const CardData = props => {
}
});
};
const onEditSubmit = () => {
setEditVisible(false);
deletebaseMaps();
};
return (
<>
<Card
......@@ -229,9 +250,18 @@ const CardData = props => {
}
style={{ width: 360 }}
>
<p>
<span className={styles.schemeName}>管网</span> {props.item.servicename}
</p>
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '13px' }}>
<div>
<span className={styles.schemeName}>管网</span> {props.item.servicename}
</div>
<div>
<FormOutlined
style={{ marginRight: '10px', color: '#1890ff' }}
onClick={() => editTile(props.item)}
/>
</div>
</div>
{/* <div>
<span className={styles.schemeName}>范围</span>
<Button
......@@ -307,6 +337,13 @@ const CardData = props => {
type={type}
serviceList={serviceList}
formObj={formObj}
nameData={nameData}
/>
<EditModal
visible={editVisible}
onCancel={() => setEditVisible(false)}
callBackSubmit={onEditSubmit}
formObj={formObj}
/>
<AddModalBase
visible={basevisible}
......@@ -315,6 +352,7 @@ const CardData = props => {
type={type}
serviceList={serviceList}
formObj={formObj}
nameData={nameData}
/>
<MapScope
mapId={createGuid()}
......
......@@ -2,7 +2,7 @@
* @Description:
* @Author: leizhe
* @Date: 2022-01-13 10:47:32
* @LastEditTime: 2022-06-22 11:56:59
* @LastEditTime: 2022-08-17 11:04:24
* @LastEditors: leizhe
*/
/* eslint-disable indent */
......@@ -15,6 +15,7 @@ import Cards from './components/card';
const VectorData = props => {
const [treeLoading, setTreeLoading] = useState(false); // 弹窗显示
const [tileData, setTileData] = useState([]); // 页面初始化数据
const [nameData, setNameData] = useState([]);
const [visible, setVisible] = useState(false); // 弹窗
const [flag, setFlag] = useState(0); // 状态更新
const [cardFlag, setCardFlag] = useState(false); // 状态更新
......@@ -46,13 +47,10 @@ const VectorData = props => {
terminalType: 'scheme',
isBaseMap: false,
}).then(resdata => {
console.log(123);
if (resdata.code == 0) {
console.log(333);
if (resdata.code == '0') {
setTreeLoading(false);
GettMaplayer({ terminalType: 'base', isBaseMap: true }).then(res => {
if (res.code == 0) {
console.log(666);
if (res.code == '0') {
let arr = [];
res.data.general.baseMap.layers.map(i => {
console.log(i);
......@@ -60,7 +58,8 @@ const VectorData = props => {
});
console.log(arr);
setKeepData(arr);
resdata.data.scheme.optionalLayer.layers.map((j, index) => {
let list = [];
resdata.data.map((j, index) => {
let data = [];
let aa = [];
j.baseMap.map(k => {
......@@ -70,13 +69,16 @@ const VectorData = props => {
aa.push(k);
}
});
list.push(j.schemename);
let bb = aa.concat(data);
let i = bb.indexOf(j.baseMap[j.defaultBaseMap]);
resdata.data.scheme.optionalLayer.layers[index].defaultOldBaseMap = j.baseMap;
resdata.data.scheme.optionalLayer.layers[index].baseMap = bb;
resdata.data.scheme.optionalLayer.layers[index].defaultBaseMap = i;
resdata.data[index].defaultOldBaseMap = j.baseMap;
resdata.data[index].baseMap = bb;
resdata.data[index].defaultBaseMap = i;
});
setTileData(resdata.data.scheme.optionalLayer.layers);
console.log(list);
setNameData(list);
setTileData(resdata.data);
}
});
} else {
......@@ -119,6 +121,7 @@ const VectorData = props => {
cardFlag={cardFlag}
deletebaseMaps={onDeletebaseMap}
keepData={keepData}
nameData={nameData}
/>
</div>
);
......@@ -134,6 +137,7 @@ const VectorData = props => {
type={type}
formObj={formObj}
keepData={keepData}
nameData={nameData}
/>
</div>
</Spin>
......
......@@ -25,7 +25,7 @@ const AddModal = props => {
})
.then(res => {
setLoading(false);
if (res.msg === 'Ok') {
if (res.code == '0') {
form.resetFields();
callBackSubmit();
notification.success({
......
......@@ -167,7 +167,7 @@ const VectorData = props => {
};
SetServiceConfig(query)
.then(res => {
if (res.code == 0) {
if (res.code == '0') {
prompt('success', '关联角色成功');
setFlag(flag + 1);
} else {
......@@ -227,7 +227,7 @@ const VectorData = props => {
if (!newLoadings[index]) {
SetDefaultsSchemeName(query).then(res => {
setCheckLoading(false);
if (res.code == 0) {
if (res.code == '0') {
const changehandData = [...webData];
changehandData[index].type = 'dynamic';
console.log(changehandData);
......@@ -248,7 +248,7 @@ const VectorData = props => {
uncheck: false,
}).then(res => {
setCheckLoading(false);
if (res.code == 0) {
if (res.code == '0') {
const changehandData = [...webData];
changehandData[index].type = 'pipenet';
console.log(changehandData);
......@@ -294,7 +294,7 @@ const VectorData = props => {
if (!newLoadings[index]) {
SetDefaultsSchemeName(query).then(res => {
setCheckLoading(false);
if (res.code == 0) {
if (res.code == '0') {
const changehandData = [...webData];
changehandData[index].type = 'dynamic';
// setWebData(changehandData);
......@@ -312,7 +312,7 @@ const VectorData = props => {
uncheck: false,
}).then(res => {
setCheckLoading(false);
if (res.code == 0) {
if (res.code == '0') {
const changehandData = [...webData];
changehandData[index].type = 'pipenet';
// setWebData(changehandData);
......@@ -359,7 +359,7 @@ const VectorData = props => {
if (!newLoadings[index]) {
SetDefaultsSchemeName(query).then(res => {
setCheckLoading(false);
if (res.code === 0) {
if (res.code == '0') {
const changehandData = [...handData];
changehandData[index].isDefault = false;
setHandData(changehandData);
......@@ -377,7 +377,7 @@ const VectorData = props => {
uncheck: false,
}).then(res => {
setCheckLoading(false);
if (res.code === 0) {
if (res.code == '0') {
const changehandData = [...handData];
changehandData[index].isDefault = true;
setHandData(changehandData);
......@@ -418,7 +418,7 @@ const VectorData = props => {
if (!newLoadings[index]) {
SetDefaultsSchemeName(query).then(res => {
setCheckLoading(false);
if (res.code === 0) {
if (res.code == '0') {
const changehandData = [...handData];
changehandData[index].isDefault = false;
// setHandData(changehandData);
......@@ -436,7 +436,7 @@ const VectorData = props => {
uncheck: false,
}).then(res => {
setCheckLoading(false);
if (res.code === 0) {
if (res.code == '0') {
const changehandData = [...handData];
changehandData[index].isDefault = true;
// setHandData(changehandData);
......@@ -495,7 +495,7 @@ const VectorData = props => {
terminalType: 'web',
isBaseMap: false,
}).then(res => {
if (res.msg === 'Ok') {
if (res.code == '0') {
prompt('success', '删除成功');
setFlag(flag + 1);
} else {
......@@ -512,7 +512,7 @@ const VectorData = props => {
isBaseMap: false,
}).then(res => {
setCheckLoading(false);
if (res.msg === 'Ok') {
if (res.code == '0') {
prompt('success', '删除成功');
setFlag(flag + 1);
} else {
......@@ -532,18 +532,19 @@ const VectorData = props => {
terminalType: 'scheme',
isBaseMap: false,
}).then(res => {
if (res.data.scheme && res.data.scheme.optionalLayer.layers.length) {
if (res.data && res.data.length > 0) {
setTreeLoading(false);
listData.map(item => {
webSchemenameArr.push(item.schemename);
});
res.data.scheme.optionalLayer.layers.map(item => {
res.data.map(item => {
if (!webSchemenameArr.includes(item.schemename)) schemeArr.push(item.schemename);
});
setSchemename(schemeArr);
if (schemeArr.length) {
setVisible(true);
} else {
console.log(12);
notification.warning({
message: '提示',
duration: 3,
......@@ -551,6 +552,7 @@ const VectorData = props => {
});
}
} else {
console.log(34);
setTreeLoading(false);
notification.warning({
message: '提示',
......@@ -575,10 +577,9 @@ const VectorData = props => {
});
Promise.all([schemeConfigQueryRequest])
.then(res => {
console.log('res', res);
if (res[0].msg === 'Ok' && res[0].data.phone) {
if (res[0].code == '0') {
let arr = [];
res[0].data.phone.optionalLayer.layers.map((item, index) => {
res[0].data.optionalLayer.layers.map((item, index) => {
if (item.isDefault) {
arr.push(true);
} else {
......@@ -587,13 +588,13 @@ const VectorData = props => {
item.isStatus = 'phone';
return item;
});
setHandData(res[0].data.phone.optionalLayer.layers);
setHandData(res[0].data.optionalLayer.layers);
if (arr.indexOf(true) == -1) {
arr[arr.length - 1] = true;
setHandStatus(arr);
onChangeHand1(
'',
res[0].data.phone.optionalLayer.layers[arr.length - 1],
res[0].data.optionalLayer.layers[arr.length - 1],
arr.length - 1,
arr,
);
......@@ -618,10 +619,9 @@ const VectorData = props => {
});
Promise.all([webSchemeQueryRequest])
.then(res => {
console.log('res', res);
if (res[0].msg === 'Ok' && res[0].data.web) {
if (res[0].code == '0') {
let arr = [];
res[0].data.web.optionalLayer.layers.map((item, index) => {
res[0].data.optionalLayer.layers.map((item, index) => {
if (item.type === 'pipenet') {
arr.push(true);
} else {
......@@ -630,14 +630,13 @@ const VectorData = props => {
item.isStatus = 'web';
return item;
});
console.log(res[0].data.web.optionalLayer.layers);
setWebData(res[0].data.web.optionalLayer.layers);
setWebData(res[0].data.optionalLayer.layers);
if (arr.indexOf(true) == -1) {
arr[arr.length - 1] = true;
setWebStatus(arr);
onChangeCheck1(
'',
res[0].data.web.optionalLayer.layers[arr.length - 1],
res[0].data.optionalLayer.layers[arr.length - 1],
arr.length - 1,
arr,
);
......
......@@ -7,4 +7,4 @@ export const GetMetaData = param => get(`${PANDA_GIS}/${param.mapServerName}`);
// 3.获取元数据新
export const GetMetaDataNew = param => get(`${CITY_SERVICE}/MapServer.svc/${param}`);
// 获取mapsetting配置
export const GetWebSiteConfig = param => get(`${PUBLISH_SERVICE}/WebSite/GetWebSiteConfig`, param);
export const GetWebSiteConfig = param => get(`${PANDA_GIS}/MapLayer/LayerSetting`, param);
......@@ -144,18 +144,17 @@ export const omsDeleteWebsite = client =>
// 获取全部
export const GetMaplayerByTerminalType = query =>
get(`${PUBLISH_SERVICE}/Maplayer/GetMaplayerByTerminalType`, query);
get(`${PANDA_GIS}/Maplayer/GetMaplayerByTerminalType`, query);
// 获取全部
export const GettMaplayer = query => get(`${PUBLISH_SERVICE}/Maplayer/GetMaplayer`, query);
export const GettMaplayer = query => get(`${PANDA_GIS}/Maplayer/GetMaplayer`, query);
// 添加底图方案
export const SetBaseMapschemeName = param =>
post(`${PUBLISH_SERVICE}/Maplayer/SetBaseMapschemeName`, param);
post(`${PANDA_GIS}/Maplayer/SetBaseMapschemeName`, param);
// 设置底图数据
export const SetServiceConfig = query =>
post(`${PUBLISH_SERVICE}/Maplayer/SetServiceConfig`, query);
export const SetServiceConfig = query => post(`${PANDA_GIS}/Maplayer/SetServiceConfig`, query);
// 获取方矢量数据列表
export const GetVectorService = () =>
......@@ -182,28 +181,26 @@ export const updatePublishedMetaData = query =>
get(`${PANDA_GIS}/MetaData/D_UpdatePublishedMetaData`, query);
// 删除配置
export const deleteConfig = query => get(`${PUBLISH_SERVICE}/Maplayer/DeletMaplayer`, query);
export const deleteConfig = query => get(`${PANDA_GIS}/MapLayer/DeleteMapLayer`, query);
// 增加瓦片
export const bindSchemeBaseMap = query =>
get(`${PUBLISH_SERVICE}/Maplayer/BindSchemeBaseMap`, query);
export const bindSchemeBaseMap = query => get(`${PANDA_GIS}/Maplayer/BindSchemeBaseMap`, query);
// 删除瓦片
export const unbindSchemeBaseMap = query =>
get(`${PUBLISH_SERVICE}/Maplayer/UnBindSchemeBaseMap`, query);
export const unbindSchemeBaseMap = query => get(`${PANDA_GIS}/Maplayer/UnBindSchemeBaseMap`, query);
// 删除底图分级显示方案
export const DeletMapServicename = query =>
get(`${PUBLISH_SERVICE}/Maplayer/DeletMapServicename`, query);
get(`${PANDA_GIS}/MapLayer/DeleteMapServiceName`, query);
// 获取底图分级显示方案名
export const GetbaseMapschemeName = query =>
get(`${PUBLISH_SERVICE}/Maplayer/GetbaseMapschemeName`, query);
get(`${PANDA_GIS}/Maplayer/GetbaseMapschemeName`, query);
// 设置web状态
export const setServiceType = query => get(`${PANDA_GIS}/MetaData/SetServiceType`, query);
// 设置web的默认方案
export const SetDefaultsSchemeName = param =>
post(`${PUBLISH_SERVICE}/Maplayer/SetDefaultsSchemeName`, param);
post(`${PANDA_GIS}/Maplayer/SetDefaultsSchemeName`, param);
// 获取角色
export const getUserRelationList = query =>
get(`${CITY_SERVICE}/OMS.svc/WebGIS_GetUserRelationList`, query);
......@@ -308,3 +305,6 @@ export const GetCustomBaseMapByName = param =>
export const DragSingleWebsite = param =>
get(`${CITY_SERVICE}/OMS.svc/Web4_DragSingleWebsite?_version=9999&_dc=1653360044919`, param);
export const UpdateSchemPipeNetwork = param =>
get(`${PANDA_GIS}/MapLayer/UpdateSchemPipeNetwork`, param);
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