diff --git a/public/A.png b/public/A.png new file mode 100644 index 0000000..01c828e Binary files /dev/null and b/public/A.png differ diff --git a/public/B.png b/public/B.png new file mode 100644 index 0000000..57d6638 Binary files /dev/null and b/public/B.png differ diff --git a/public/C.png b/public/C.png new file mode 100644 index 0000000..7be3add Binary files /dev/null and b/public/C.png differ diff --git a/public/S.png b/public/S.png new file mode 100644 index 0000000..1e2daa0 Binary files /dev/null and b/public/S.png differ diff --git a/src/admin/user/generate.vue b/src/admin/user/generate.vue index fbe89e8..88b7740 100644 --- a/src/admin/user/generate.vue +++ b/src/admin/user/generate.vue @@ -2,9 +2,8 @@ import { importUsers } from "../api" const message = useMessage() -const prefix = ref("") +const prefix = ref(0) const rawInput = ref("") -const [needKs] = useToggle(true) const [loading, toggleLoading] = useToggle() const users = shallowRef([]) @@ -13,25 +12,17 @@ function generateUsers() { message.info("请填写相关内容") return false } - // 自动加上 ks 的开头 - let myClass = "" - if (prefix.value) { - if (needKs.value && !prefix.value.startsWith("ks")) { - myClass = "ks" + prefix.value - } else { - myClass = prefix.value - } - } + let className = !!prefix.value ? `ks${prefix.value}` : "" rawInput.value = rawInput.value.trim() const inputs = rawInput.value.split("\n") users.value = inputs.map((u, i) => { - const username = myClass + u + const username = className + u let password = "" for (let j = 0; j < 6; j++) { password += "123456789".charAt(Math.floor(Math.random() * 9)) } const realName = u - const email = `${myClass}.${i + 1}@example.com` + const email = `${className}.${i + 1}@example.com` return [username, password, email, realName] }) return true @@ -68,14 +59,16 @@ async function submit() { - - 前面带上 ks +
ks
+
- + + + + + + + + 查询 + + + + + + {{ durationLabel }}, + {{ !!username ? username : "你" }}一共解决 + {{ solvedProblems.length }} + 道题, + + 并且参加 + {{ contest_count }} 次比赛, + + 综合评价给到 + + {{ greeting }} + + + + + + + + + + + + + + + + + + + + diff --git a/src/oj/ai/components/DifficultyChart.vue b/src/oj/ai/components/DifficultyChart.vue new file mode 100644 index 0000000..e059824 --- /dev/null +++ b/src/oj/ai/components/DifficultyChart.vue @@ -0,0 +1,58 @@ + + + diff --git a/src/oj/ai/components/Grade.vue b/src/oj/ai/components/Grade.vue new file mode 100644 index 0000000..3c9773d --- /dev/null +++ b/src/oj/ai/components/Grade.vue @@ -0,0 +1,31 @@ + + + diff --git a/src/oj/ai/components/TagTitle.vue b/src/oj/ai/components/TagTitle.vue new file mode 100644 index 0000000..48d91e3 --- /dev/null +++ b/src/oj/ai/components/TagTitle.vue @@ -0,0 +1,21 @@ + + diff --git a/src/oj/ai/components/TagsChart.vue b/src/oj/ai/components/TagsChart.vue new file mode 100644 index 0000000..f05c25b --- /dev/null +++ b/src/oj/ai/components/TagsChart.vue @@ -0,0 +1,57 @@ + + + diff --git a/src/oj/ai/components/WeeklyChart.vue b/src/oj/ai/components/WeeklyChart.vue new file mode 100644 index 0000000..0e0eb28 --- /dev/null +++ b/src/oj/ai/components/WeeklyChart.vue @@ -0,0 +1,126 @@ + + + diff --git a/src/oj/api.ts b/src/oj/api.ts index fca4b7e..f18d29e 100644 --- a/src/oj/api.ts +++ b/src/oj/api.ts @@ -90,7 +90,7 @@ export function getSubmissions(params: SubmissionListPayload) { } export function getRankOfProblem(problem_id: string) { - return http.get("user_problem_rank", { params: {problem_id: problem_id} }) + return http.get("user_problem_rank", { params: { problem_id: problem_id } }) } export function getTodaySubmissionCount() { @@ -244,3 +244,19 @@ export function getTutorial(id: number) { export function getTutorials() { return http.get("tutorials") } + +export function getAIDetailData(start: string, end: string, username?: string) { + return http.get("ai/detail", { params: { start, end, username } }) +} + +export function getAIWeeklyData( + end: string, + duration: string, + username?: string, +) { + return http.get("ai/weekly", { params: { end, duration, username } }) +} + +export function getAIAnalysis() { + return http.get("ai/analysis") +} diff --git a/src/oj/problem/components/ProblemSubmission.vue b/src/oj/problem/components/ProblemSubmission.vue index eaebbdb..0b5f9f3 100644 --- a/src/oj/problem/components/ProblemSubmission.vue +++ b/src/oj/problem/components/ProblemSubmission.vue @@ -66,6 +66,7 @@ const class_name = ref("") const rank = ref(-1) const class_ac_count = ref(0) const all_ac_count = ref(0) +const loading = ref(false) const submissions = ref([]) const total = ref(0) @@ -82,7 +83,8 @@ const showList = computed(() => { const errorMsg = computed(() => { if (!userStore.isAuthed) return "请先登录" - else if (!configStore.config.submission_list_show_all) return "不让看了" + else if (!configStore.config.submission_list_show_all) + return "提交列表已被管理员关闭" else return "" }) @@ -100,7 +102,10 @@ async function listSubmissions() { } async function getRankOfThisProblem() { + loading.value = true const res = await getRankOfProblem(route.params.problemID ?? "") + loading.value = false + class_name.value = res.data.class_name rank.value = res.data.rank class_ac_count.value = res.data.class_ac_count @@ -114,8 +119,9 @@ onMounted(() => { watch(query, listSubmissions)