diff --git a/components.d.ts b/components.d.ts
index 4cc9083..d5d0f6b 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -12,6 +12,9 @@ declare module '@vue/runtime-core' {
ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElContainer: typeof import('element-plus/es')['ElContainer']
+ ElDescription: typeof import('element-plus/es')['ElDescription']
+ ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
+ ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
diff --git a/src/oj/api.ts b/src/oj/api.ts
index 636f483..81cc39c 100644
--- a/src/oj/api.ts
+++ b/src/oj/api.ts
@@ -1,17 +1,12 @@
import { getACRate } from "./../utils/functions"
+import { DIFFICULTY } from "./../utils/constants"
import http from "./../utils/http"
-const difficultDict = {
- Low: "简单",
- Mid: "中等",
- High: "困难",
-}
-
function filterResult(result: any) {
const newResult: any = {
displayID: result._id,
title: result.title,
- difficulty: difficultDict[<"Low" | "Mid" | "High">result.difficulty],
+ difficulty: DIFFICULTY[<"Low" | "Mid" | "High">result.difficulty],
tags: result.tags,
submission: result.submission_number,
rate: getACRate(result.accepted_number, result.submission_number),
diff --git a/src/oj/components/editor.vue b/src/oj/components/editor.vue
deleted file mode 100644
index 8c5c0cc..0000000
--- a/src/oj/components/editor.vue
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
- C
- Python
-
-
-
-
-
diff --git a/src/oj/problem/detail.vue b/src/oj/problem/detail.vue
index 363b582..2e1a1ce 100644
--- a/src/oj/problem/detail.vue
+++ b/src/oj/problem/detail.vue
@@ -1,15 +1,28 @@
+
+
+
+
+
+ C
+ Python
+ C++
+ Java
+
+
+
+ 重置
+
+
+
+
+ 1
+ 2
+
+
+
+ 运行
+ 提交
+
+
+
+
+
diff --git a/src/oj/problem/list.vue b/src/oj/problem/list.vue
index af46db1..d795cf0 100644
--- a/src/oj/problem/list.vue
+++ b/src/oj/problem/list.vue
@@ -1,8 +1,9 @@
+
+
+
+
diff --git a/src/oj/problem/problem-info.vue b/src/oj/problem/problem-info.vue
new file mode 100644
index 0000000..75229cb
--- /dev/null
+++ b/src/oj/problem/problem-info.vue
@@ -0,0 +1,40 @@
+
+
+
+
+
+ {{ problem._id }}
+
+
+ {{ problem.created_by.username }}
+
+
+
+ {{ DIFFICULTY[<"Low" | "Mid" | "High">problem.difficulty] }}
+
+
+
+ {{ problem.time_limit }}毫秒
+
+
+ {{ problem.memory_limit }}MB
+
+
+ {{ problem.rule_type }}
+
+
+
+
+ {{ tag }}
+
+
+
+
+
+
+
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index 4989711..720db22 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -119,11 +119,26 @@ export const STORAGE_KEY = {
USER: "user",
}
+export const DIFFICULTY = {
+ Low: "简单",
+ Mid: "中等",
+ High: "困难",
+}
+
+export function getTagColor(tag: string) {
+ return {
+ Low: "success",
+ Mid: "",
+ High: "danger",
+ 简单: "success",
+ 中等: "",
+ 困难: "danger",
+ }[tag]
+}
+
export function buildProblemCodeKey(problemID: number, contestID = null) {
if (contestID) {
return `${STORAGE_KEY.PROBLEM_CODE}_${contestID}_${problemID}`
}
return `${STORAGE_KEY.PROBLEM_CODE}_NaN_${problemID}`
}
-
-export const GOOGLE_ANALYTICS_ID = "UA-111499601-1"