Commit db8295c6 authored by shaoan123's avatar shaoan123

优化GIS平台下方案管理页面

parent 1b1c261d
Pipeline #26556 skipped with stages
......@@ -10,13 +10,13 @@ import { number } from 'prop-types';
const { Item } = Form;
const { Option } = Select;
const AddModal = props => {
const { callBackSubmit = () => { }, type, formObj, visible } = props;
const { callBackSubmit = () => { }, type, formObj, visible,serviceList } = props;
const [loading, setLoading] = useState(false);
const [mapType, setMapType] = useState(0);
const [ImgIndex, setImgIndex] = useState('');
const [baseMap, setBaseMap] = useState([]);
const [pipeArr, setPipeArr] = useState([]);
const [serviceList, setServiceList] = useState([]);
const [form] = Form.useForm();
// 提交
......@@ -28,16 +28,16 @@ const AddModal = props => {
if (type === 'add') {
bindSchemeBaseMap({
schemename: formObj.schemename,
basemapName:obj.serverName
}).then(res=>{
setLoading(false);
if(res.IsSuccess){
basemapName: obj.serverName
}).then(res => {
setLoading(false);
if (res.IsSuccess) {
form.resetFields();
callBackSubmit();
prompt('success','瓦片新增成功')
prompt('success', '瓦片新增成功')
}
else{
prompt('fail','瓦片新增失败')
else {
prompt('fail', '瓦片新增失败')
}
})
} else {
......@@ -46,15 +46,15 @@ const AddModal = props => {
}
});
};
const prompt =(type,content)=>{
if(type=='success'){
const prompt = (type, content) => {
if (type == 'success') {
notification.success({
message: '提示',
duration: 3,
description: content,
});
}
else{
else {
notification.error({
message: '提示',
duration: 3,
......@@ -82,9 +82,9 @@ const AddModal = props => {
if (res.IsSuccess) {
form.resetFields();
callBackSubmit();
prompt('success','方案新增成功')
prompt('success', '方案新增成功')
} else {
prompt('fail','方案新增失败')
prompt('fail', '方案新增失败')
}
})
.catch(err => {
......@@ -92,7 +92,9 @@ const AddModal = props => {
});
};
const onFinish = value => { };
const onFinish = value => {
};
useEffect(() => {
switch (type) {
case 'add':
......@@ -108,23 +110,9 @@ const AddModal = props => {
//添加瓦片
const addTile = () => {
let serverList = []
if (JSON.stringify(formObj) != "{}") {
GetAllConfig({ terminalType: 'base', isBaseMap: true }).then(res => {
console.log('res', res)
if (res.Result && res.Result.length) {
res.Result.map(item => {
if (formObj.baseMap.indexOf(item.servicename) == -1) {
serverList.push(item.servicename)
}
})
setServiceList(serverList)
form.setFieldsValue({
serverName: serverList[0]
})
}
})
}
form.setFieldsValue({
serverName: serviceList[0]
})
}
//获取管网及默认底图
const pipeNetwork = () => {
......@@ -169,6 +157,7 @@ const AddModal = props => {
url: `http://{IP}/CityInterface/rest/services/MapServer.svc/${value}`
})
}
//选择底图
const handleBaseMap = () => { }
return (
......
......@@ -3,7 +3,7 @@ import classnames from 'classnames'
import styles from '../../SchemeConfig.less'
import { Popconfirm, notification, Card, Button } from 'antd';
import {
unbindSchemeBaseMap
unbindSchemeBaseMap,GetAllConfig
} from '@/services/webConfig/api';
import {
CloseOutlined, PlusOutlined
......@@ -15,6 +15,7 @@ const CardData = props => {
const [flag, setFlag] = useState(0); // 状态更新
const [type, setType] = useState(''); // 弹窗类型
const [formObj, setFormObj] = useState({});
const [serviceList, setServiceList] = useState([]);
//删除瓦片
const deletebaseMap = (item, baseMapItem) => {
unbindSchemeBaseMap({ schemename: item.schemename, basemapName: baseMapItem }).then(res => {
......@@ -65,11 +66,34 @@ const CardData = props => {
deletebaseMaps()
};
//增加瓦片
const addTile = (item) => {
setFormObj(item);
setType('add');
setVisible(true);
const addTile = (value) => {
let serverList = []
setFormObj(value);
if (JSON.stringify(value) != "{}") {
GetAllConfig({ terminalType: 'base', isBaseMap: true }).then(res => {
if (res.Result && res.Result.length) {
res.Result.map(item => {
if (value.baseMap.indexOf(item.servicename) == -1) {
serverList.push(item.servicename)
}
})
}
if(serverList.length){
setServiceList(serverList)
setType('add');
setVisible(true);
}
else{
notification.warning({
message: '提示',
duration: 3,
description: '请先在基础配置-配置底图',
});
}
})
}
}
return (
<>
......@@ -116,6 +140,7 @@ const CardData = props => {
onCancel={() => setVisible(false)}
callBackSubmit={onSubmit}
type={type}
serviceList={serviceList}
formObj={formObj}
/>
</>
......
......@@ -46,8 +46,6 @@ const VectorData = props => {
}
)
};
return (
<>
<div style={{ width: 'calc(100vw - 265px)' }}>
......
......@@ -176,8 +176,8 @@ export const GetGISServerMapList = query =>
//发布原数据
export const publisService = (query) =>
get(`${CITY_SERVICE}/OMS.svc/D_Publish_GS_Service`, query,{timeout:120000});
export const publisService = (query,timeout) =>
get(`${CITY_SERVICE}/OMS.svc/D_Publish_GS_Service`, query,timeout);
//解决方案名称
export const getSolutionList = (query) =>
......
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