态势感知平台-武汉市开源生态建设-武汉知名开源社区接口对接
This commit is contained in:
@@ -311,7 +311,8 @@ import * as echarts from 'echarts';
|
||||
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 } from '@/api/jyh/situation';
|
||||
import { wuhanGithubProjectsPage3, cityProjectPage3, chinaExcellentProjectsPage3, excellentProjectsPage3,
|
||||
talentPage3, developerNamesPage3, communityRankChartPage3, wuhanCommunitiesPage3 } from '@/api/jyh/situation';
|
||||
|
||||
const { widthType } = usePageResize();
|
||||
|
||||
@@ -325,6 +326,8 @@ const chinaExcellentProjects = ref([]);
|
||||
|
||||
const developerNames = ref([]);
|
||||
|
||||
const wuhanCommunities = ref([]);
|
||||
|
||||
// 武汉优质开源项目备用数据
|
||||
const setgithubProjectsdata = () => {
|
||||
githubProjects.value = [
|
||||
@@ -616,7 +619,9 @@ const fetchDeveloperNamesData = async() => {
|
||||
}
|
||||
};
|
||||
|
||||
const wuhanCommunities = ref([
|
||||
// 武汉知名开源社区备用数据
|
||||
const setwuhanCommunitiesdata = () => {
|
||||
wuhanCommunities.value = [
|
||||
{ name: '黄鹤开源社区', type: '核心生态', slogan: '国家级、城市级开源社区平台,武汉开源生态的核心枢纽' },
|
||||
{ name: '深度社区 (Deepin)', type: '操作系统', slogan: '全球最大桌面操作系统社区之一,全球用户超过 750 万' },
|
||||
{
|
||||
@@ -633,7 +638,25 @@ const wuhanCommunities = ref([
|
||||
{ name: '华中师范大学', type: '兴趣小组', slogan: '开源技术兴趣小组' },
|
||||
{ name: '中南民族大学', type: '兴趣小组', slogan: '开源技术兴趣小组' },
|
||||
{ name: '湖北大学', type: '兴趣小组', slogan: '开源技术兴趣小组' }
|
||||
]);
|
||||
];
|
||||
};
|
||||
|
||||
const fetchwuhanCommunities = async() => {
|
||||
try {
|
||||
const response = await wuhanCommunitiesPage3();
|
||||
const communitydata = response.data;
|
||||
if (communitydata?.code === 200 && communitydata?.data) {
|
||||
wuhanCommunities.value = communitydata.data;
|
||||
} else {
|
||||
console.error('获取武汉知名开源社区数据失败:', communitydata?.msg || '未知错误');
|
||||
setwuhanCommunitiesdata();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('请求武汉知名开源社区数据时发生错误:', error);
|
||||
setwuhanCommunitiesdata();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 图表数据
|
||||
const chartData = ref({
|
||||
@@ -958,6 +981,7 @@ onMounted(async() => {
|
||||
await fetchchinaExcellentProjects(); // 获取2024中国优秀开源项目数据
|
||||
await fetchexcellentProjects(); // 获取2025武汉优秀开源项目数据
|
||||
await fetchCommunityRankData(); // 获取城市社区数量排行数据
|
||||
await fetchwuhanCommunities(); // 获取武汉知名开源社区数据
|
||||
init(); // 再初始化图表
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user