diff --git a/src/views/Jyh/Community/components/HarmonyEcoCharts.vue b/src/views/Jyh/Community/components/HarmonyEcoCharts.vue index d5126b5..0aca6d6 100644 --- a/src/views/Jyh/Community/components/HarmonyEcoCharts.vue +++ b/src/views/Jyh/Community/components/HarmonyEcoCharts.vue @@ -337,7 +337,7 @@ import { ref, onMounted, nextTick, onUnmounted } from 'vue'; import * as echarts from 'echarts'; import HMStatsBar from './HMStatsBar.vue'; -import { hmCityDataPage3, hmProjectsPage3, whProjectsPage3, hmDevCityDataPage3, hmDevelopersPage3, whHmDevelopersPage3, hmEnterpriseCityDataPage3, hmEnterprisesPage3, whEnterprisesPage3, uniCityDataPage3 } from '@/api/jyh/situation'; +import { hmCityDataPage3, hmProjectsPage3, whProjectsPage3, hmDevCityDataPage3, hmDevelopersPage3, whHmDevelopersPage3, hmEnterpriseCityDataPage3, hmEnterprisesPage3, whEnterprisesPage3, uniCityDataPage3, uniContributorsPage3 } from '@/api/jyh/situation'; // ================= 数据定义 ================= const hmCityData = ref([ @@ -616,8 +616,187 @@ const fetchuniCityData = async() => { } }; +const setuniContributorsdata = () => { + uniContributors.value = [ + { + authorName: "d00887893", + project: "arkcompiler_ets_frontend", + branch: "master", + repo: "communication_nfc", + authorEmail: "re****g@whut.edu.cn", + detailMessage: "Add SDK test cases Issue: I9CRGH Signed-off-by: d00887893 ", + additions: 664, + deletions: 97, + changeNum: 761, + rollbackCount: 0, + university: "武汉理工大学", + contributionScore: 845.3 // 计算结果 + }, + { + authorName: "Jiefeng Li", + project: "openharmony", + branch: "master", + repo: "docs", + authorEmail: "ji****i@hust.edu.cn", + detailMessage: "fix typo", + additions: 116, + deletions: 116, + changeNum: 232, + rollbackCount: 0, + university: "华中科技大学", + contributionScore: 197.2 + }, + { + authorName: "”景涛“", + project: "openharmony", + branch: "master", + repo: "kernel_liteos_a", + authorEmail: "ji****3@hust.edu.cn", + detailMessage: "fix some typo errors", + additions: 17, + deletions: 17, + changeNum: 34, + rollbackCount: 0, + university: "华中科技大学", + contributionScore: 28.9 + }, + { + authorName: "Zian", + project: "openharmony", + branch: "master", + repo: "drivers_peripheral", + authorEmail: "u2****5@hust.edu.cn", + detailMessage: "fix NULL pointer problem caused by function HdfRemoteServiceWriteInterfaceToken()", + additions: 10, + deletions: 9, + changeNum: 19, + rollbackCount: 0, + university: "华中科技大学", + contributionScore: 16.5 + }, + { + authorName: "fly1ngpengu1ns", + project: "openharmony", + branch: "master", + repo: "drivers_hdf_core", + authorEmail: "pe****n@hust.edu.cn", + detailMessage: "fix: fix the fault handler when ctrl_hdlr is NULL", + additions: 6, + deletions: 5, + changeNum: 11, + rollbackCount: 0, + university: "华中科技大学", + contributionScore: 9.7 + }, + { + authorName: "phd", + project: "openharmony", + branch: "master", + repo: "drivers_hdf_core", + authorEmail: "m2****8@hust.edu.cn", + detailMessage: "fix:An exception when queue is NULL", + additions: 5, + deletions: 5, + changeNum: 10, + rollbackCount: 0, + university: "华中科技大学", + contributionScore: 8.5 + }, + { + authorName: "辛哲麒", + project: "openharmony", + branch: "master", + repo: "communication_nfc", + authorEmail: "xi****i@hust.edu.cn", + detailMessage: "fix:context maybe nullptr", + additions: 3, + deletions: 3, + changeNum: 6, + rollbackCount: 0, + university: "华中科技大学", + contributionScore: 5.1 + }, + { + authorName: "Ruibo Lu", + project: "openharmony", + branch: "master", + repo: "update_packaging_tools", + authorEmail: "re****u@hust.edu.cn", + detailMessage: "[fix]: fix indent in blocks_manager.py", + additions: 1, + deletions: 1, + changeNum: 2, + rollbackCount: 0, + university: "华中科技大学", + contributionScore: 1.7 + }, + { + authorName: "Zian", + project: "openharmony", + branch: "master", + repo: "drivers_peripheral", + authorEmail: "u2****5@hust.edu.cn", + detailMessage: "fix:NULL pointer reference caused by variable hwAdapter", + additions: 1, + deletions: 1, + changeNum: 2, + rollbackCount: 0, + university: "华中科技大学", + contributionScore: 1.7 + }, + { + authorName: "xy420", + project: "openharmony", + branch: "master", + repo: "communication_dsoftbus", + authorEmail: "ch*****g@hust.edu.cn", + detailMessage: "update tests/sdk/transmission/fuzztest/rawstreamdata_fuzzer/rawstreamdata_fuzzer.cpp", + additions: 1, + deletions: 1, + changeNum: 2, + rollbackCount: 0, + university: "华中科技大学", + contributionScore: 1.7 + }, + { + authorName: "辛哲麒", + project: "openharmony", + branch: "master", + repo: "distributeddatamgr_datamgr_service", + authorEmail: "xi****i@hust.edu.cn", + detailMessage: "update services/distributeddataservice/service/directory/src/directory_manager.cpp", + additions: 1, + deletions: 1, + changeNum: 2, + rollbackCount: 0, + university: "华中科技大学", + contributionScore: 1.7 + } + ] +} + +// 获取湖北高校鸿蒙贡献者数据 +const fetchuniContributors = async() => { + try { + const response = await uniContributorsPage3(); + const businessData = response.data; + if (businessData.code === 200 && businessData.data) { + uniContributors.value = businessData.data; + } else { + console.error('获取湖北高校鸿蒙贡献者数据失败:', businessData.msg || '未知错误'); + // 使用默认数据 + setuniContributorsdata(); + } + } catch (error) { + console.error('获取湖北高校鸿蒙贡献者数据异常:', error); + // 使用默认数据 + setuniContributorsdata(); + } +}; + + // 获取鸿蒙开源项目数据 -const fetchHmProjects = async () => { +const fetchHmProjects = async() => { try { const response = await hmProjectsPage3(); const businessData = response.data; @@ -825,162 +1004,7 @@ const whEnterprises = ref([]); const uniCityData = ref([]); // 高校贡献者榜单 -const uniContributors = [ - { - authorName: "d00887893", - project: "arkcompiler_ets_frontend", - branch: "master", - repo: "communication_nfc", - authorEmail: "re****g@whut.edu.cn", - detailMessage: "Add SDK test cases Issue: I9CRGH Signed-off-by: d00887893 ", - additions: 664, - deletions: 97, - changeNum: 761, - rollbackCount: 0, - university: "武汉理工大学", - contributionScore: 845.3 // 计算结果 - }, - { - authorName: "Jiefeng Li", - project: "openharmony", - branch: "master", - repo: "docs", - authorEmail: "ji****i@hust.edu.cn", - detailMessage: "fix typo", - additions: 116, - deletions: 116, - changeNum: 232, - rollbackCount: 0, - university: "华中科技大学", - contributionScore: 197.2 - }, - { - authorName: "”景涛“", - project: "openharmony", - branch: "master", - repo: "kernel_liteos_a", - authorEmail: "ji****3@hust.edu.cn", - detailMessage: "fix some typo errors", - additions: 17, - deletions: 17, - changeNum: 34, - rollbackCount: 0, - university: "华中科技大学", - contributionScore: 28.9 - }, - { - authorName: "Zian", - project: "openharmony", - branch: "master", - repo: "drivers_peripheral", - authorEmail: "u2****5@hust.edu.cn", - detailMessage: "fix NULL pointer problem caused by function HdfRemoteServiceWriteInterfaceToken()", - additions: 10, - deletions: 9, - changeNum: 19, - rollbackCount: 0, - university: "华中科技大学", - contributionScore: 16.5 - }, - { - authorName: "fly1ngpengu1ns", - project: "openharmony", - branch: "master", - repo: "drivers_hdf_core", - authorEmail: "pe****n@hust.edu.cn", - detailMessage: "fix: fix the fault handler when ctrl_hdlr is NULL", - additions: 6, - deletions: 5, - changeNum: 11, - rollbackCount: 0, - university: "华中科技大学", - contributionScore: 9.7 - }, - { - authorName: "phd", - project: "openharmony", - branch: "master", - repo: "drivers_hdf_core", - authorEmail: "m2****8@hust.edu.cn", - detailMessage: "fix:An exception when queue is NULL", - additions: 5, - deletions: 5, - changeNum: 10, - rollbackCount: 0, - university: "华中科技大学", - contributionScore: 8.5 - }, - { - authorName: "辛哲麒", - project: "openharmony", - branch: "master", - repo: "communication_nfc", - authorEmail: "xi****i@hust.edu.cn", - detailMessage: "fix:context maybe nullptr", - additions: 3, - deletions: 3, - changeNum: 6, - rollbackCount: 0, - university: "华中科技大学", - contributionScore: 5.1 - }, - { - authorName: "Ruibo Lu", - project: "openharmony", - branch: "master", - repo: "update_packaging_tools", - authorEmail: "re****u@hust.edu.cn", - detailMessage: "[fix]: fix indent in blocks_manager.py", - additions: 1, - deletions: 1, - changeNum: 2, - rollbackCount: 0, - university: "华中科技大学", - contributionScore: 1.7 - }, - { - authorName: "Zian", - project: "openharmony", - branch: "master", - repo: "drivers_peripheral", - authorEmail: "u2****5@hust.edu.cn", - detailMessage: "fix:NULL pointer reference caused by variable hwAdapter", - additions: 1, - deletions: 1, - changeNum: 2, - rollbackCount: 0, - university: "华中科技大学", - contributionScore: 1.7 - }, - { - authorName: "xy420", - project: "openharmony", - branch: "master", - repo: "communication_dsoftbus", - authorEmail: "ch*****g@hust.edu.cn", - detailMessage: "update tests/sdk/transmission/fuzztest/rawstreamdata_fuzzer/rawstreamdata_fuzzer.cpp", - additions: 1, - deletions: 1, - changeNum: 2, - rollbackCount: 0, - university: "华中科技大学", - contributionScore: 1.7 - }, - { - authorName: "辛哲麒", - project: "openharmony", - branch: "master", - repo: "distributeddatamgr_datamgr_service", - authorEmail: "xi****i@hust.edu.cn", - detailMessage: "update services/distributeddataservice/service/directory/src/directory_manager.cpp", - additions: 1, - deletions: 1, - changeNum: 2, - rollbackCount: 0, - university: "华中科技大学", - contributionScore: 1.7 - } -]; +const uniContributors = ref([]); // ================= 逻辑处理 ================= const activeTab = ref(0); @@ -1485,7 +1509,7 @@ const handleResize = () => { onMounted(async() => { nextTick(async() => { // 先获取鸿蒙项目城市分布数据、鸿蒙开源项目数据、开发者分布数据、开发者贡献榜数据和武汉开发者贡献榜数据 - await Promise.all([fetchHmCityData(), fetchHmProjects(), fetchWhProjects(), fetchHmDevCityData(), fetchHmDevelopers(), fetchWhHmDevelopers(), fetchHmEnterpriseCityData(), fetchHmEnterprises(), fetchwhEnterprises(), fetchuniCityData()]); + await Promise.all([fetchHmCityData(), fetchHmProjects(), fetchWhProjects(), fetchHmDevCityData(), fetchHmDevelopers(), fetchWhHmDevelopers(), fetchHmEnterpriseCityData(), fetchHmEnterprises(), fetchwhEnterprises(), fetchuniCityData(), fetchuniContributors()]); initHmCityChart(); initHmEnterpriseChart();