态势感知平台-武汉市开源生态建设-重点城市高校开源社团数量接口对接

This commit is contained in:
d266377
2026-02-04 14:16:10 +08:00
parent c5fc4a301b
commit efd9493cb0

View File

@@ -312,7 +312,7 @@ import { usePageResize } from '@/utils/hooks/usePageResize';
import StatsBar from './components/StatsBar.vue';
import HarmonyEcoCharts from './components/HarmonyEcoCharts.vue';
import { wuhanGithubProjectsPage3, cityProjectPage3, chinaExcellentProjectsPage3, excellentProjectsPage3,
talentPage3, developerNamesPage3, communityRankChartPage3, wuhanCommunitiesPage3 } from '@/api/jyh/situation';
talentPage3, developerNamesPage3, communityRankChartPage3, wuhanCommunitiesPage3, ClubPage3 } from '@/api/jyh/situation';
const { widthType } = usePageResize();
@@ -657,6 +657,29 @@ const fetchwuhanCommunities = async() => {
}
};
const setClubdata = () => {
chartData.value.club.xAxis = ['成都', '北京', '上海', '武汉', '重庆', '深圳', '苏州', '杭州', '合肥', '青岛'];
chartData.value.club.data = [10, 7, 5, 4, 3, 2, 2, 2, 2, 2];
isEmpty.value.club = false;
};
const fetchclubData = async() => {
try {
const response = await ClubPage3();
const clubdata = response.data;
if (clubdata?.code === 200 && clubdata?.data) {
chartData.value.club.xAxis = clubdata.data.map(item => item.name);
chartData.value.club.data = clubdata.data.map(item => item.number);
isEmpty.value.club = false;
} else {
console.error('获取重点城市高校开源社团数量数据失败:', clubdata?.msg || '未知错误');
setClubdata();
}
} catch (error) {
console.error('请求重点城市高校开源社团数量数据时发生错误:', error);
setClubdata();
}
};
// 图表数据
const chartData = ref({
@@ -872,8 +895,8 @@ const initClubChart = () => {
myChart.setOption({
tooltip: { trigger: 'axis', valueFormatter: (value: any) => value + ' 个' },
grid: commonGrid,
xAxis: { type: 'category', data: chartData.value.club.xAxis, axisLabel: { color: '#666' } },
yAxis: { type: 'value', name: '单位:个', splitLine: { lineStyle: { type: 'dashed', color: '#eee' } } },
xAxis: { type: 'category', data: chartData.value.club.xAxis, axisLabel: { color: '#666' }},
yAxis: { type: 'value', name: '单位:个', splitLine: { lineStyle: { type: 'dashed', color: '#eee' }}},
series: [{
type: 'line', data: chartData.value.club.data, smooth: true, symbolSize: 8,
lineStyle: { width: 3, color: '#F59E0B' },
@@ -982,6 +1005,7 @@ onMounted(async() => {
await fetchexcellentProjects(); // 获取2025武汉优秀开源项目数据
await fetchCommunityRankData(); // 获取城市社区数量排行数据
await fetchwuhanCommunities(); // 获取武汉知名开源社区数据
await fetchclubData(); // 获取重点城市高校开源社团数量数据
init(); // 再初始化图表
});