Merge pull request #92 from Learnware-LAMDA/feat(frontend)/summary_new_data

feat(frontend): (un)verified user/learnware count
This commit is contained in:
AnnyTerfect 2023-11-06 16:33:04 +08:00 committed by GitHub
commit 38f11c216e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 7 deletions

View File

@ -19,9 +19,11 @@ const { t } = useI18n();
ChartJS.register(ArcElement, Tooltip, Legend);
const countUser = ref(0);
const countVerifiedUser = ref(0);
const countUnverifiedUser = ref(0);
const countVerifiedLearnware = ref(0);
const countUnverifiedLearnware = ref(0);
const countLearnwareAwaitingStorage = ref(0);
const countDownload = ref(0);
const countDetail = ref<CountDetail>();
@ -37,9 +39,15 @@ const errorTimer = ref<number>();
const numberItems = computed(() => {
return [
{
title: t("Summary.UserCount"),
title: t("Summary.VerifiedUserCount"),
icon: "mdi-account",
value: countUser.value,
value: countVerifiedUser.value,
to: "/alluser",
},
{
title: t("Summary.UnverifiedUserCount"),
icon: "mdi-account",
value: countUnverifiedUser.value,
to: "/alluser",
},
{
@ -54,6 +62,11 @@ const numberItems = computed(() => {
value: countUnverifiedLearnware.value,
to: "/alllearnware?is_verified=false",
},
{
title: t("Summary.AwaitingStorageLearnwareCount"),
icon: "mdi-clock",
value: countLearnwareAwaitingStorage.value,
},
{
title: t("Summary.DownloadCount"),
icon: "mdi-download",
@ -76,17 +89,21 @@ function fetchSummary(): void {
code: number;
msg: string;
data: {
count_user: number;
count_verified_user: number;
count_unverified_user: number;
count_download: number;
count_verified_learnware: number;
count_unverified_learnware: number;
count_learnware_awaiting_storage: number;
count_detail: CountDetail;
};
}) => {
if (res.code === 0) {
countUser.value = res.data.count_user;
countVerifiedUser.value = res.data.count_verified_user;
countUnverifiedUser.value = res.data.count_unverified_user;
countVerifiedLearnware.value = res.data.count_verified_learnware;
countUnverifiedLearnware.value = res.data.count_unverified_learnware;
countLearnwareAwaitingStorage.value = res.data.count_learnware_awaiting_storage;
countDownload.value = res.data.count_download;
countDetail.value = res.data.count_detail;
} else if (res.code === 11) {

View File

@ -1,7 +1,9 @@
export default {
UserCount: "User Count",
VerifiedUserCount: "Verified User Count",
UnverifiedUserCount: "Unverified User Count",
VerifiedLearnwareCount: "Verified Learnware Count",
UnverifiedLearnwareCount: "Unverified Learnware Count",
AwaitingStorageLearnwareCount: "Awaiting Storage Learnware Count",
DownloadCount: "Download Count",
Chart: "Chart",
};

View File

@ -1,7 +1,9 @@
export default {
UserCount: "用户数量",
VerifiedUserCount: "已验证用户数量",
UnverifiedUserCount: "未验证用户数量",
VerifiedLearnwareCount: "已验证学件数量",
UnverifiedLearnwareCount: "未验证学件数量",
AwaitingStorageLearnwareCount: "待存储学件数量",
DownloadCount: "下载量",
Chart: "图表",
};