态势感知平台-武汉市开源生态建设接口字段修改

This commit is contained in:
d266377
2026-01-30 11:07:58 +08:00
parent 4ddc7aa90f
commit 15b04e6788
3 changed files with 20 additions and 15 deletions

View File

@@ -58,9 +58,10 @@ const fetchStats = async () => {
try { try {
loading.value = true; loading.value = true;
const response = await hmStatsBarPage3(); const response = await hmStatsBarPage3();
const businessData = response.data;
if (response.code === 200 && response.data) { if (businessData.code === 200 && businessData) {
const { developer, certificationDeveloper, wuhanCertificationDeveloper, project, company } = response.data; const { developer, certificationDeveloper, wuhanCertificationDeveloper, project, company } = businessData.data;
// 格式化数据显示 // 格式化数据显示
hmDevelopers.value = `${formatNumber(developer)}+`; hmDevelopers.value = `${formatNumber(developer)}+`;
@@ -69,7 +70,7 @@ const fetchStats = async () => {
hmProjects.value = `${formatNumber(project)}`; hmProjects.value = `${formatNumber(project)}`;
hmCompanies.value = `${formatNumber(company)}+`; hmCompanies.value = `${formatNumber(company)}+`;
} else { } else {
console.error('获取鸿蒙统计数据失败:', response.msg || '未知错误'); console.error('获取鸿蒙统计数据失败:', businessData.msg || '未知错误');
// 设置默认值 // 设置默认值
hmDevelopers.value = '1000万+'; hmDevelopers.value = '1000万+';
hmCertificationDevelopers.value = '60万+'; hmCertificationDevelopers.value = '60万+';

View File

@@ -455,10 +455,11 @@ const hmProjects = ref([
const fetchHmProjects = async () => { const fetchHmProjects = async () => {
try { try {
const response = await hmProjectsPage3(); const response = await hmProjectsPage3();
if (response.code === 200 && response.data) { const businessData = response.data;
hmProjects.value = response.data; if (businessData.code === 200 && businessData.data) {
hmProjects.value = businessData.data;
} else { } else {
console.error('获取鸿蒙开源项目数据失败:', response.msg || '未知错误'); console.error('获取鸿蒙开源项目数据失败:', businessData.msg || '未知错误');
// 使用默认数据 // 使用默认数据
hmProjects.value = [ hmProjects.value = [
{ {
@@ -607,10 +608,11 @@ const whProjects = ref([
const fetchWhProjects = async() => { const fetchWhProjects = async() => {
try { try {
const response = await whProjectsPage3(); const response = await whProjectsPage3();
if (response.code === 200 && response.data) { const businessData = response.data;
whProjects.value = response.data; if (businessData.code === 200 && businessData.data) {
whProjects.value = businessData.data;
} else { } else {
console.error('获取武汉鸿蒙开源项目数据失败:', response.msg || '未知错误'); console.error('获取武汉鸿蒙开源项目数据失败:', businessData.msg || '未知错误');
// 使用默认数据 // 使用默认数据
whProjects.value = [ whProjects.value = [
{ name: 'docs', desc: 'OpenHarmony官方文档与指南', stars: '498', company: '中科创达' }, // 总热度: 4152 (498 Star + 3654 Fork) { name: 'docs', desc: 'OpenHarmony官方文档与指南', stars: '498', company: '中科创达' }, // 总热度: 4152 (498 Star + 3654 Fork)
@@ -974,12 +976,13 @@ const initHmCityChart = () => {
const fetchHmCityData = async () => { const fetchHmCityData = async () => {
try { try {
const response = await hmCityDataPage3(); const response = await hmCityDataPage3();
if (response.code === 200 && response.data) { const businessData = response.data;
hmCityData.value = response.data; if (businessData.code === 200 && businessData.data) {
hmCityData.value = businessData.data;
// 重新初始化图表以显示新数据 // 重新初始化图表以显示新数据
initHmCityChart(); initHmCityChart();
} else { } else {
console.error('获取鸿蒙项目城市分布数据失败:', response.msg || '未知错误'); console.error('获取鸿蒙项目城市分布数据失败:', businessData.msg || '未知错误');
// 使用默认数据 // 使用默认数据
hmCityData.value = [ hmCityData.value = [
{ name: '广东', value: 185 }, { name: '广东', value: 185 },

View File

@@ -52,9 +52,10 @@ const fetchStats = async() => {
try { try {
loading.value = true; loading.value = true;
const response = await statsBarPage3(); const response = await statsBarPage3();
const businessData = response.data;
if (response.code === 200 && response.data) { if (businessData.code === 200 && businessData) {
const { developer, community, company, project } = response.data; const { developer, community, company, project } = businessData.data;
// 格式化数据显示 // 格式化数据显示
whDeveloper.value = `${formatNumber(developer)}+`; whDeveloper.value = `${formatNumber(developer)}+`;
@@ -62,7 +63,7 @@ const fetchStats = async() => {
whCompany.value = `${formatNumber(company)}+`; whCompany.value = `${formatNumber(company)}+`;
whProject.value = `${formatNumber(project)}+`; whProject.value = `${formatNumber(project)}+`;
} else { } else {
console.error('获取统计数据失败:', response.msg || '未知错误'); console.error('获取统计数据失败:', businessData.msg || '未知错误');
// 设置默认值 // 设置默认值
whDeveloper.value = '70万+'; whDeveloper.value = '70万+';
whCommunity.value = '12'; whCommunity.value = '12';