Commit 59975fa1 authored by 皮倩雯's avatar 皮倩雯

fix: 'gis接口设置超时时间10s'

parent ffeee370
Pipeline #80066 waiting for manual action with stages
...@@ -111,13 +111,25 @@ const TileData = props => { ...@@ -111,13 +111,25 @@ const TileData = props => {
console.log('res', res); console.log('res', res);
if (res.code == '0') { if (res.code == '0') {
setTreeLoading(false); setTreeLoading(false);
console.log(res.data.optionalLayer.layers);
setCardData(res.data.optionalLayer.layers); setCardData(res.data.optionalLayer.layers);
} else { } else {
setTreeLoading(false); setTreeLoading(false);
} }
}) })
.catch(() => { .catch(err => {
if (err.message.indexOf('timeout') !== -1) {
notification.error({
message: '提示',
duration: 3,
description: '请求超时',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: err.message,
});
}
setTreeLoading(false); setTreeLoading(false);
}); });
}, [flagAdd]); }, [flagAdd]);
...@@ -188,10 +200,27 @@ const TileData = props => { ...@@ -188,10 +200,27 @@ const TileData = props => {
}, [flag]); }, [flag]);
useEffect(() => { useEffect(() => {
QueryBaseMapItems().then(res => { QueryBaseMapItems()
.then(res => {
if (res.code === '0') { if (res.code === '0') {
setJson(res.data); setJson(res.data);
} }
})
.catch(err => {
if (err.message.indexOf('timeout') !== -1) {
notification.error({
message: '提示',
duration: 3,
description: '请求超时',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: err.message,
});
}
setTreeLoading(false);
}); });
}, []); }, []);
// 获取瓦片数据配置数据 // 获取瓦片数据配置数据
...@@ -231,7 +260,20 @@ const TileData = props => { ...@@ -231,7 +260,20 @@ const TileData = props => {
}); });
} }
}) })
.catch(() => { .catch(err => {
if (err.message.indexOf('timeout') !== -1) {
notification.error({
message: '提示',
duration: 3,
description: '请求超时',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: err.message,
});
}
setTreeLoading(false); setTreeLoading(false);
}); });
}; };
......
...@@ -192,7 +192,8 @@ const VectorData = props => { ...@@ -192,7 +192,8 @@ const VectorData = props => {
const renderTile = (params = { info: '' }) => { const renderTile = (params = { info: '' }) => {
setTreeLoading(true); setTreeLoading(true);
solutionName(); solutionName();
GetVectorService(params).then(res => { GetVectorService(params)
.then(res => {
if (res.msg === 'Ok') { if (res.msg === 'Ok') {
let arr = []; let arr = [];
res.data.VectorList.map(item => { res.data.VectorList.map(item => {
...@@ -208,6 +209,22 @@ const VectorData = props => { ...@@ -208,6 +209,22 @@ const VectorData = props => {
description: res.message, description: res.message,
}); });
} }
})
.catch(err => {
if (err.message.indexOf('timeout') !== -1) {
notification.error({
message: '提示',
duration: 3,
description: '请求超时',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: err.message,
});
}
setTreeLoading(false);
}); });
}; };
// 搜索 // 搜索
...@@ -224,7 +241,7 @@ const VectorData = props => { ...@@ -224,7 +241,7 @@ const VectorData = props => {
version: 9999, version: 9999,
solution: solutionNames, solution: solutionNames,
}; };
for (const [index,item] of tileData.entries()) { for (const [index, item] of tileData.entries()) {
setAllLoading(true); setAllLoading(true);
query.serviceName = item.ServiceName; query.serviceName = item.ServiceName;
let res = null; let res = null;
...@@ -245,8 +262,8 @@ const VectorData = props => { ...@@ -245,8 +262,8 @@ const VectorData = props => {
description: '更新元数据失败', description: '更新元数据失败',
}); });
} }
if(index === tileData.length-1) { if (index === tileData.length - 1) {
setFlag(flag + 1) setFlag(flag + 1);
} }
} }
}; };
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* @LastEditors: dengchao 754083046@qq.com * @LastEditors: dengchao 754083046@qq.com
*/ */
/* eslint-disable indent */ /* eslint-disable indent */
import { Button, Spin, Empty, Input } from 'antd'; import { Button, Spin, Empty, Input, notification } from 'antd';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { OrderedListOutlined } from '@ant-design/icons'; import { OrderedListOutlined } from '@ant-design/icons';
import styles from '../SchemeConfig.less'; import styles from '../SchemeConfig.less';
...@@ -52,9 +52,9 @@ const VectorData = props => { ...@@ -52,9 +52,9 @@ const VectorData = props => {
terminalType: 'scheme', terminalType: 'scheme',
isBaseMap: false, isBaseMap: false,
...params, ...params,
}).then(resdata => { })
.then(resdata => {
if (resdata.code == '0') { if (resdata.code == '0') {
setTreeLoading(false);
GettMaplayer({ terminalType: 'base', isBaseMap: true }).then(res => { GettMaplayer({ terminalType: 'base', isBaseMap: true }).then(res => {
if (res.code == '0') { if (res.code == '0') {
let arr = []; let arr = [];
...@@ -82,11 +82,28 @@ const VectorData = props => { ...@@ -82,11 +82,28 @@ const VectorData = props => {
}); });
setNameData(list); setNameData(list);
setTileData(resdata.data); setTileData(resdata.data);
setTreeLoading(false);
} }
}); });
} else { } else {
setTreeLoading(false); setTreeLoading(false);
} }
})
.catch(err => {
if (err.message.indexOf('timeout') !== -1) {
notification.error({
message: '提示',
duration: 3,
description: '请求超时',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: err.message,
});
}
setTreeLoading(false);
}); });
}; };
useEffect(() => { useEffect(() => {
...@@ -148,7 +165,7 @@ const VectorData = props => { ...@@ -148,7 +165,7 @@ const VectorData = props => {
<div style={{ height: 'calc(100%)', width: '100%' }}> <div style={{ height: 'calc(100%)', width: '100%' }}>
<div className={styles.cardsList}> <div className={styles.cardsList}>
{/* {console.log(tileData)} */} {/* {console.log(tileData)} */}
{tileData && tileData.length ? ( {tileData.length > 0 ? (
tileData.map((item, index) => ( tileData.map((item, index) => (
<div <div
className={styles.cardItem} className={styles.cardItem}
......
...@@ -535,7 +535,8 @@ const VectorData = props => { ...@@ -535,7 +535,8 @@ const VectorData = props => {
GetMaplayerByTerminalType({ GetMaplayerByTerminalType({
terminalType: 'scheme', terminalType: 'scheme',
isBaseMap: false, isBaseMap: false,
}).then(res => { })
.then(res => {
if (res.data && res.data.length > 0) { if (res.data && res.data.length > 0) {
setTreeLoading(false); setTreeLoading(false);
listData.map(item => { listData.map(item => {
...@@ -564,6 +565,22 @@ const VectorData = props => { ...@@ -564,6 +565,22 @@ const VectorData = props => {
description: '请先配置方案', description: '请先配置方案',
}); });
} }
})
.catch(err => {
if (err.message.indexOf('timeout') !== -1) {
notification.error({
message: '提示',
duration: 3,
description: '请求超时',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: err.message,
});
}
setTreeLoading(false);
}); });
}; };
useEffect(() => { useEffect(() => {
...@@ -608,8 +625,21 @@ const VectorData = props => { ...@@ -608,8 +625,21 @@ const VectorData = props => {
} }
setCheckLoading(false); setCheckLoading(false);
}) })
.catch(e => { .catch(err => {
setCheckLoading(false); if (err.message.indexOf('timeout') !== -1) {
notification.error({
message: '提示',
duration: 3,
description: '请求超时',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: err.message,
});
}
setTreeLoading(false);
}); });
}; };
...@@ -650,8 +680,21 @@ const VectorData = props => { ...@@ -650,8 +680,21 @@ const VectorData = props => {
} }
setCheckLoading(false); setCheckLoading(false);
}) })
.catch(e => { .catch(err => {
setCheckLoading(false); if (err.message.indexOf('timeout') !== -1) {
notification.error({
message: '提示',
duration: 3,
description: '请求超时',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: err.message,
});
}
setTreeLoading(false);
}); });
}; };
......
...@@ -7,7 +7,8 @@ export const GetMetaData = param => get(`${PANDA_GIS}/${param.mapServerName}`); ...@@ -7,7 +7,8 @@ export const GetMetaData = param => get(`${PANDA_GIS}/${param.mapServerName}`);
// 3.获取元数据新 // 3.获取元数据新
export const GetMetaDataNew = param => get(`${CITY_SERVICE}/MapServer.svc/${param}`); export const GetMetaDataNew = param => get(`${CITY_SERVICE}/MapServer.svc/${param}`);
// 获取mapsetting配置 // 获取mapsetting配置
export const GetWebSiteConfig = param => get(`${PANDA_GIS}/MapLayer/LayerSetting`, param); export const GetWebSiteConfig = param =>
get(`${PANDA_GIS}/MapLayer/LayerSetting`, param, { timeout: 10000 });
// 获取图层列表 // 获取图层列表
export const GetLayerList = param => get(`${PANDA_GIS}/MetaData/D_GetLayerList`, param); export const GetLayerList = param => get(`${PANDA_GIS}/MetaData/D_GetLayerList`, param);
......
...@@ -155,10 +155,11 @@ export const omsDeleteWebsite = client => ...@@ -155,10 +155,11 @@ export const omsDeleteWebsite = client =>
// 获取全部 // 获取全部
export const GetMaplayerByTerminalType = query => export const GetMaplayerByTerminalType = query =>
get(`${PANDA_GIS}/Maplayer/GetMaplayerByTerminalType`, query); get(`${PANDA_GIS}/Maplayer/GetMaplayerByTerminalType`, query, { timeout: 10000 });
// 获取全部 // 获取全部
export const GettMaplayer = query => get(`${PANDA_GIS}/Maplayer/GetMaplayer`, query); export const GettMaplayer = query =>
get(`${PANDA_GIS}/Maplayer/GetMaplayer`, query, { timeout: 10000 });
// 添加底图方案 // 添加底图方案
export const SetBaseMapschemeName = param => export const SetBaseMapschemeName = param =>
...@@ -169,7 +170,11 @@ export const SetServiceConfig = query => post(`${PANDA_GIS}/Maplayer/SetServiceC ...@@ -169,7 +170,11 @@ export const SetServiceConfig = query => post(`${PANDA_GIS}/Maplayer/SetServiceC
// 获取方矢量数据列表 // 获取方矢量数据列表
export const GetVectorService = query => export const GetVectorService = query =>
get(`${PUBLISH_SERVICE}/Maplayer/GetVectorService`, { ...query, _version: 9999 }); get(
`${PUBLISH_SERVICE}/Maplayer/GetVectorService`,
{ ...query, _version: 9999 },
{ timeout: 10000 },
);
// 获取元数据的工作空间列表 // 获取元数据的工作空间列表
export const GetGISServerMapList = query => export const GetGISServerMapList = query =>
...@@ -329,7 +334,8 @@ export const SyncMapComponent = query => get(`${PUBLISH_SERVICE}/WebSite/SyncMap ...@@ -329,7 +334,8 @@ export const SyncMapComponent = query => get(`${PUBLISH_SERVICE}/WebSite/SyncMap
export const BatchDragSingleWebsite = data => export const BatchDragSingleWebsite = data =>
post(`${PUBLISH_SERVICE}/WebSite/BatchDragSingleWebsite`, data); post(`${PUBLISH_SERVICE}/WebSite/BatchDragSingleWebsite`, data);
export const QueryBaseMapItems = param => get(`${PANDA_GIS}/MapLayer/QueryBaseMapItems`, param); export const QueryBaseMapItems = param =>
get(`${PANDA_GIS}/MapLayer/QueryBaseMapItems`, param, { timeout: 10000 });
// 通过client获取角色 // 通过client获取角色
export const GetRoleGroups = param => get(`${PUBLISH_SERVICE}/UserCenter/GetRoleGroups`, param); export const GetRoleGroups = param => get(`${PUBLISH_SERVICE}/UserCenter/GetRoleGroups`, 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