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 => {
console.log('res', res);
if (res.code == '0') {
setTreeLoading(false);
console.log(res.data.optionalLayer.layers);
setCardData(res.data.optionalLayer.layers);
} else {
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);
});
}, [flagAdd]);
......@@ -188,10 +200,27 @@ const TileData = props => {
}, [flag]);
useEffect(() => {
QueryBaseMapItems().then(res => {
QueryBaseMapItems()
.then(res => {
if (res.code === '0') {
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 => {
});
}
})
.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);
});
};
......
......@@ -192,7 +192,8 @@ const VectorData = props => {
const renderTile = (params = { info: '' }) => {
setTreeLoading(true);
solutionName();
GetVectorService(params).then(res => {
GetVectorService(params)
.then(res => {
if (res.msg === 'Ok') {
let arr = [];
res.data.VectorList.map(item => {
......@@ -208,6 +209,22 @@ const VectorData = props => {
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 => {
version: 9999,
solution: solutionNames,
};
for (const [index,item] of tileData.entries()) {
for (const [index, item] of tileData.entries()) {
setAllLoading(true);
query.serviceName = item.ServiceName;
let res = null;
......@@ -245,8 +262,8 @@ const VectorData = props => {
description: '更新元数据失败',
});
}
if(index === tileData.length-1) {
setFlag(flag + 1)
if (index === tileData.length - 1) {
setFlag(flag + 1);
}
}
};
......
......@@ -6,7 +6,7 @@
* @LastEditors: dengchao 754083046@qq.com
*/
/* 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 { OrderedListOutlined } from '@ant-design/icons';
import styles from '../SchemeConfig.less';
......@@ -52,9 +52,9 @@ const VectorData = props => {
terminalType: 'scheme',
isBaseMap: false,
...params,
}).then(resdata => {
})
.then(resdata => {
if (resdata.code == '0') {
setTreeLoading(false);
GettMaplayer({ terminalType: 'base', isBaseMap: true }).then(res => {
if (res.code == '0') {
let arr = [];
......@@ -82,11 +82,28 @@ const VectorData = props => {
});
setNameData(list);
setTileData(resdata.data);
setTreeLoading(false);
}
});
} else {
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(() => {
......@@ -148,7 +165,7 @@ const VectorData = props => {
<div style={{ height: 'calc(100%)', width: '100%' }}>
<div className={styles.cardsList}>
{/* {console.log(tileData)} */}
{tileData && tileData.length ? (
{tileData.length > 0 ? (
tileData.map((item, index) => (
<div
className={styles.cardItem}
......
......@@ -535,7 +535,8 @@ const VectorData = props => {
GetMaplayerByTerminalType({
terminalType: 'scheme',
isBaseMap: false,
}).then(res => {
})
.then(res => {
if (res.data && res.data.length > 0) {
setTreeLoading(false);
listData.map(item => {
......@@ -564,6 +565,22 @@ const VectorData = props => {
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(() => {
......@@ -608,8 +625,21 @@ const VectorData = props => {
}
setCheckLoading(false);
})
.catch(e => {
setCheckLoading(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);
});
};
......@@ -650,8 +680,21 @@ const VectorData = props => {
}
setCheckLoading(false);
})
.catch(e => {
setCheckLoading(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);
});
};
......
......@@ -7,7 +7,8 @@ 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(`${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);
......
......@@ -155,10 +155,11 @@ export const omsDeleteWebsite = client =>
// 获取全部
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 =>
......@@ -169,7 +170,11 @@ export const SetServiceConfig = query => post(`${PANDA_GIS}/Maplayer/SetServiceC
// 获取方矢量数据列表
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 =>
......@@ -329,7 +334,8 @@ export const SyncMapComponent = query => get(`${PUBLISH_SERVICE}/WebSite/SyncMap
export const 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获取角色
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