态势感知平台-开源生态与贡献价值全景接口字段修改
This commit is contained in:
@@ -43,10 +43,11 @@ const fetchDataFromApi = async () => {
|
||||
try {
|
||||
loading.value = true;
|
||||
const response = await talentMapDataPage2();
|
||||
|
||||
if (response.code === 0 && response.data) {
|
||||
const businessData = response.data; // Axios响应格式,业务数据在response.data中
|
||||
|
||||
if (businessData?.code === 200 && businessData.data) {
|
||||
// 转换API返回的数据格式为图表所需格式
|
||||
talentMapData.value = response.data.map((item: TalentMapItem) => {
|
||||
talentMapData.value = businessData.data.map((item: TalentMapItem) => {
|
||||
// 查找省份坐标,如果找不到则使用默认坐标
|
||||
let coordinates = [104.5, 37.5]; // 默认为中国中心坐标
|
||||
|
||||
@@ -97,7 +98,7 @@ const fetchDataFromApi = async () => {
|
||||
};
|
||||
});
|
||||
} else {
|
||||
console.error('获取人才地图数据失败:', response.msg || '未知错误');
|
||||
console.error('获取人才地图数据失败:', businessData?.msg || '未知错误');
|
||||
// 设置默认数据
|
||||
talentMapData.value = [
|
||||
{ name: '北京市', value: [116.4074, 39.9042, 141.15, 231.47] },
|
||||
|
||||
Reference in New Issue
Block a user