diff --git a/backend/package-lock.json b/backend/package-lock.json index 3c95414..6af953c 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -1,12 +1,12 @@ { "name": "rating-system-backend", - "version": "0.3.0", + "version": "0.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rating-system-backend", - "version": "0.3.0", + "version": "0.4.0", "license": "MIT", "devDependencies": { "prettier": "^3.3.3", diff --git a/backend/package.json b/backend/package.json index 47479c5..ff63592 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "rating-system-backend", - "version": "0.3.0", + "version": "0.4.0", "scripts": { "format": "npx prettier --write app/ && python -m black app/", "lint": "pylint app/" diff --git a/frontend/package-lock.json b/frontend/package-lock.json index ba33297..80827c3 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "rating-system-frontend", - "version": "0.3.0", + "version": "0.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rating-system-frontend", - "version": "0.3.0", + "version": "0.4.0", "license": "MIT", "dependencies": { "axios": "^1.7.7", diff --git a/frontend/package.json b/frontend/package.json index 26cc713..32fa99f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "rating-system-frontend", - "version": "0.3.0", + "version": "0.4.0", "private": true, "type": "module", "scripts": { diff --git a/frontend/src/views/AdminView.vue b/frontend/src/views/AdminView.vue index a692a4b..f2f14ad 100644 --- a/frontend/src/views/AdminView.vue +++ b/frontend/src/views/AdminView.vue @@ -137,7 +137,7 @@ function addUpdateLinks(row, id) { placeholder="额外信息" type="text" name="info" - value='{"links": "https://codeforces.com/contest/2024/problem/A", "pid": "2024A", "type": "未分类"}' + value='{"links": "https://codeforces.com/contest/2024/problem/A", "pid": "2024A", "type": ["未分类"]}' /> @@ -176,7 +176,7 @@ function addUpdateLinks(row, id) { placeholder="额外信息" type="text" name="info" - value='{"links": "https://codeforces.com/contest/2024/problem/A", "pid": "2024A", "type": "未分类"}' + value='{"links": "https://codeforces.com/contest/2024/problem/A", "pid": "2024A", "type": ["未分类"]}' /> diff --git a/frontend/src/views/ProblemsView.vue b/frontend/src/views/ProblemsView.vue index a0dab9d..2aabe30 100644 --- a/frontend/src/views/ProblemsView.vue +++ b/frontend/src/views/ProblemsView.vue @@ -12,7 +12,7 @@ const voteModal = ref(false) const pid = ref(1) const showVotesModal = ref(false) const selected = ref() -const options = ref([{ text: '未分类', value: '未分类' }]) +const options = ref([]) const detailsModal = ref(false) const loggedIn = window.loggedIn @@ -160,12 +160,14 @@ function showTable() { let table = $('#problems-table tbody') table.empty() for (let i = 0; i < problemsData.length; i++) { - var type = '未分类' + var type = ['未分类'] if ('type' in problemsData[i]['info']) type = problemsData[i]['info']['type'] - if (!Object.values(options.value).some((el) => el.value == type)) { - options.value.push({ text: type, value: type }) - } - if (selected.value != undefined && selected.value.value != type) continue + type.forEach(function (t) { + if (!options.value.some((el) => el.value == t)) { + options.value.push({ text: t, value: t }) + } + }) + if (selected.value != undefined && !type.includes(selected.value.value)) continue let row = $('