update
This commit is contained in:
8
.github/workflows/deploy.yml
vendored
8
.github/workflows/deploy.yml
vendored
@@ -11,9 +11,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 22
|
||||||
cache: npm
|
cache: npm
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: CI=false npm run build
|
- run: CI=false npm run build
|
||||||
@@ -32,9 +32,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 22
|
||||||
cache: npm
|
cache: npm
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: CI=false NODE_ENV=development npm run build
|
- run: CI=false NODE_ENV=development npm run build
|
||||||
|
|||||||
605
package-lock.json
generated
605
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
19
package.json
19
package.json
@@ -11,7 +11,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/lang-cpp": "^6.0.2",
|
"@codemirror/lang-cpp": "^6.0.2",
|
||||||
"@codemirror/lang-python": "^6.1.6",
|
"@codemirror/lang-python": "^6.1.6",
|
||||||
"@vueuse/core": "^10.10.0",
|
"@vueuse/core": "^10.11.0",
|
||||||
"@wangeditor/editor": "^5.1.23",
|
"@wangeditor/editor": "^5.1.23",
|
||||||
"@wangeditor/editor-for-vue": "5.1.12",
|
"@wangeditor/editor-for-vue": "5.1.12",
|
||||||
"axios": "^1.7.2",
|
"axios": "^1.7.2",
|
||||||
@@ -24,24 +24,25 @@
|
|||||||
"naive-ui": "^2.38.2",
|
"naive-ui": "^2.38.2",
|
||||||
"normalize.css": "^8.0.1",
|
"normalize.css": "^8.0.1",
|
||||||
"pinia": "^2.1.7",
|
"pinia": "^2.1.7",
|
||||||
"vue": "^3.4.27",
|
"vue": "^3.4.31",
|
||||||
"vue-chartjs": "^5.3.1",
|
"vue-chartjs": "^5.3.1",
|
||||||
"vue-codemirror": "^6.1.1",
|
"vue-codemirror": "^6.1.1",
|
||||||
"vue-router": "^4.3.3"
|
"vue-router": "^4.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@iconify/vue": "^4.1.2",
|
"@iconify/vue": "^4.1.2",
|
||||||
"@types/node": "^20.14.2",
|
"@types/canvas-confetti": "^1.6.4",
|
||||||
|
"@types/node": "^20.14.9",
|
||||||
"@vitejs/plugin-legacy": "^5.4.1",
|
"@vitejs/plugin-legacy": "^5.4.1",
|
||||||
"@vitejs/plugin-vue": "^5.0.5",
|
"@vitejs/plugin-vue": "^5.0.5",
|
||||||
"prettier": "^3.3.2",
|
"prettier": "^3.3.2",
|
||||||
"prettier-plugin-organize-imports": "^3.2.4",
|
"prettier-plugin-organize-imports": "^4.0.0",
|
||||||
"terser": "^5.31.1",
|
"terser": "^5.31.1",
|
||||||
"typescript": "^5.4.5",
|
"typescript": "^5.5.3",
|
||||||
"unplugin-auto-import": "^0.17.6",
|
"unplugin-auto-import": "^0.17.6",
|
||||||
"unplugin-vue-components": "^0.27.0",
|
"unplugin-vue-components": "^0.27.2",
|
||||||
"unplugin-vue-markdown": "^0.26.2",
|
"unplugin-vue-markdown": "^0.26.2",
|
||||||
"vite": "^5.2.13",
|
"vite": "^5.3.3",
|
||||||
"vue-tsc": "^2.0.21"
|
"vue-tsc": "^2.0.24"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import "normalize.css"
|
|
||||||
import { zhCN, dateZhCN, darkTheme } from "naive-ui"
|
|
||||||
import hljs from "highlight.js/lib/core"
|
import hljs from "highlight.js/lib/core"
|
||||||
import c from "highlight.js/lib/languages/c"
|
import c from "highlight.js/lib/languages/c"
|
||||||
import python from "highlight.js/lib/languages/python"
|
import python from "highlight.js/lib/languages/python"
|
||||||
|
import { darkTheme, dateZhCN, zhCN } from "naive-ui"
|
||||||
|
import "normalize.css"
|
||||||
import "./index.css"
|
import "./index.css"
|
||||||
|
|
||||||
hljs.registerLanguage("c", c)
|
hljs.registerLanguage("c", c)
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ async function handleDelete() {
|
|||||||
message.success("删除成功")
|
message.success("删除成功")
|
||||||
emit("deleted")
|
emit("deleted")
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<n-flex>
|
<n-flex>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import TextEditor from "~/shared/components/TextEditor.vue"
|
import TextEditor from "~/shared/components/TextEditor.vue"
|
||||||
import { createAnnouncement, editAnnouncement, getAnnouncement } from "../api"
|
|
||||||
import { AnnouncementEdit } from "~/utils/types"
|
import { AnnouncementEdit } from "~/utils/types"
|
||||||
|
import { createAnnouncement, editAnnouncement, getAnnouncement } from "../api"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
announcementID?: string
|
announcementID?: string
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { NSwitch } from "naive-ui"
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
import Pagination from "~/shared/components/Pagination.vue"
|
||||||
import Actions from "./components/Actions.vue"
|
import { parseTime } from "~/utils/functions"
|
||||||
import { Announcement } from "~/utils/types"
|
import { Announcement } from "~/utils/types"
|
||||||
import { editAnnouncement, getAnnouncementList } from "../api"
|
import { editAnnouncement, getAnnouncementList } from "../api"
|
||||||
import { parseTime } from "~/utils/functions"
|
import Actions from "./components/Actions.vue"
|
||||||
import { NSwitch } from "naive-ui"
|
|
||||||
|
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const query = reactive({
|
const query = reactive({
|
||||||
|
|||||||
@@ -1,107 +1,107 @@
|
|||||||
<template>
|
<template>
|
||||||
<n-flex justify="space-between" class="titleWrapper">
|
<n-flex justify="space-between" class="titleWrapper">
|
||||||
<h2 class="title">评论列表(只列出有内容的)</h2>
|
<h2 class="title">评论列表(只列出有内容的)</h2>
|
||||||
<div>
|
<div>
|
||||||
<n-input
|
<n-input
|
||||||
v-model:value="query.problem"
|
v-model:value="query.problem"
|
||||||
clearable
|
clearable
|
||||||
placeholder="输入题目序号"
|
placeholder="输入题目序号"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
<n-data-table striped :columns="columns" :data="comments" />
|
<n-data-table striped :columns="columns" :data="comments" />
|
||||||
<Pagination
|
<Pagination
|
||||||
:total="total"
|
:total="total"
|
||||||
v-model:limit="query.limit"
|
v-model:limit="query.limit"
|
||||||
v-model:page="query.page"
|
v-model:page="query.page"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { NButton } from "naive-ui"
|
import { NButton } from "naive-ui"
|
||||||
import { getCommentList } from "../api"
|
import Pagination from "~/shared/components/Pagination.vue"
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
import { parseTime } from "~/utils/functions"
|
||||||
import { Comment } from "~/utils/types"
|
import { Comment } from "~/utils/types"
|
||||||
import { parseTime } from "~/utils/functions"
|
import { getCommentList } from "../api"
|
||||||
import CommentActions from "./components/CommentActions.vue"
|
import CommentActions from "./components/CommentActions.vue"
|
||||||
|
|
||||||
const comments = ref<Comment[]>([])
|
const comments = ref<Comment[]>([])
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const query = reactive({
|
const query = reactive({
|
||||||
limit: 10,
|
limit: 10,
|
||||||
page: 1,
|
page: 1,
|
||||||
problem: "",
|
problem: "",
|
||||||
})
|
})
|
||||||
|
|
||||||
const columns: DataTableColumn<Comment>[] = [
|
const columns: DataTableColumn<Comment>[] = [
|
||||||
{
|
{
|
||||||
title: "题目",
|
title: "题目",
|
||||||
key: "problem",
|
key: "problem",
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (row) =>
|
render: (row) =>
|
||||||
h(
|
h(
|
||||||
NButton,
|
NButton,
|
||||||
{
|
{
|
||||||
text: true,
|
text: true,
|
||||||
type: "info",
|
type: "info",
|
||||||
onClick: () => window.open("/problem/" + row.problem, "_blank"),
|
onClick: () => window.open("/problem/" + row.problem, "_blank"),
|
||||||
},
|
},
|
||||||
() => row.problem,
|
() => row.problem,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "提交",
|
title: "提交",
|
||||||
key: "submission",
|
key: "submission",
|
||||||
width: 200,
|
width: 200,
|
||||||
render: (row) =>
|
render: (row) =>
|
||||||
h(
|
h(
|
||||||
NButton,
|
NButton,
|
||||||
{
|
{
|
||||||
text: true,
|
text: true,
|
||||||
type: "info",
|
type: "info",
|
||||||
onClick: () => window.open("/submission/" + row.submission, "_blank"),
|
onClick: () => window.open("/submission/" + row.submission, "_blank"),
|
||||||
},
|
},
|
||||||
() => row.submission.slice(0, 12),
|
() => row.submission.slice(0, 12),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{ title: "描述评分", key: "description_rating", width: 100 },
|
{ title: "描述评分", key: "description_rating", width: 100 },
|
||||||
{ title: "难度评分", key: "difficulty_rating", width: 100 },
|
{ title: "难度评分", key: "difficulty_rating", width: 100 },
|
||||||
{ title: "综合评分", key: "comprehensive_rating", width: 100 },
|
{ title: "综合评分", key: "comprehensive_rating", width: 100 },
|
||||||
{ title: "用户", key: "user.username", width: 150 },
|
{ title: "用户", key: "user.username", width: 150 },
|
||||||
{
|
{
|
||||||
title: "时间",
|
title: "时间",
|
||||||
key: "create_time",
|
key: "create_time",
|
||||||
render: (row) => parseTime(row.create_time, "YYYY-MM-DD HH:mm:ss"),
|
render: (row) => parseTime(row.create_time, "YYYY-MM-DD HH:mm:ss"),
|
||||||
width: 200,
|
width: 200,
|
||||||
},
|
},
|
||||||
{ title: "内容", key: "content", maxWidth: 300, ellipsis: true },
|
{ title: "内容", key: "content", maxWidth: 300, ellipsis: true },
|
||||||
{
|
{
|
||||||
title: "选项",
|
title: "选项",
|
||||||
key: "action",
|
key: "action",
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (row) =>
|
render: (row) =>
|
||||||
h(CommentActions, { commentID: row.id, onDeleted: listComments }),
|
h(CommentActions, { commentID: row.id, onDeleted: listComments }),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
async function listComments() {
|
async function listComments() {
|
||||||
const offset = (query.page - 1) * query.limit
|
const offset = (query.page - 1) * query.limit
|
||||||
const res = await getCommentList(offset, query.limit, query.problem)
|
const res = await getCommentList(offset, query.limit, query.problem)
|
||||||
comments.value = res.data.results
|
comments.value = res.data.results
|
||||||
total.value = res.data.total
|
total.value = res.data.total
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(listComments)
|
onMounted(listComments)
|
||||||
watchDebounced(() => [query.problem], listComments, {
|
watchDebounced(() => [query.problem], listComments, {
|
||||||
debounce: 500,
|
debounce: 500,
|
||||||
maxWait: 1000,
|
maxWait: 1000,
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.titleWrapper {
|
.titleWrapper {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,23 +1,22 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { deleteComment } from '~/admin/api';
|
import { deleteComment } from "~/admin/api"
|
||||||
|
|
||||||
const props = defineProps<{commentID: number}>()
|
const props = defineProps<{ commentID: number }>()
|
||||||
const emit = defineEmits(["deleted"])
|
const emit = defineEmits(["deleted"])
|
||||||
|
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|
||||||
async function submit() {
|
async function submit() {
|
||||||
await deleteComment(props.commentID)
|
await deleteComment(props.commentID)
|
||||||
message.success("成功删除")
|
message.success("成功删除")
|
||||||
emit("deleted")
|
emit("deleted")
|
||||||
}
|
}
|
||||||
|
</script>
|
||||||
</script>
|
<template>
|
||||||
<template>
|
<n-popconfirm @positive-click="submit">
|
||||||
<n-popconfirm @positive-click="submit">
|
<template #trigger>
|
||||||
<template #trigger>
|
<n-button secondary size="small" type="error">删除</n-button>
|
||||||
<n-button secondary size="small" type="error">删除</n-button>
|
</template>
|
||||||
</template>
|
确定删除这条评论吗?
|
||||||
确定删除这条评论吗?
|
</n-popconfirm>
|
||||||
</n-popconfirm>
|
</template>
|
||||||
</template>
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
<template>未完待续</template>
|
<template>未完待续</template>
|
||||||
<script lang="ts" setup></script>
|
<script lang="ts" setup></script>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NSwitch, NTag } from "naive-ui"
|
import { NSwitch, NTag } from "naive-ui"
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
|
||||||
import { Contest } from "~/utils/types"
|
|
||||||
import { getContestList, editContest } from "../api"
|
|
||||||
import ContestType from "~/shared/components/ContestType.vue"
|
|
||||||
import ContestTitle from "~/shared/components/ContestTitle.vue"
|
import ContestTitle from "~/shared/components/ContestTitle.vue"
|
||||||
|
import ContestType from "~/shared/components/ContestType.vue"
|
||||||
|
import Pagination from "~/shared/components/Pagination.vue"
|
||||||
import { CONTEST_STATUS } from "~/utils/constants"
|
import { CONTEST_STATUS } from "~/utils/constants"
|
||||||
|
import { Contest } from "~/utils/types"
|
||||||
|
import { editContest, getContestList } from "../api"
|
||||||
import Actions from "./components/Actions.vue"
|
import Actions from "./components/Actions.vue"
|
||||||
|
|
||||||
const contests = ref<Contest[]>([])
|
const contests = ref<Contest[]>([])
|
||||||
@@ -79,7 +79,10 @@ async function listContests() {
|
|||||||
}
|
}
|
||||||
onMounted(listContests)
|
onMounted(listContests)
|
||||||
watch(() => [query.page, query.limit], listContests)
|
watch(() => [query.page, query.limit], listContests)
|
||||||
watchDebounced(() => query.keyword, listContests, { debounce: 500, maxWait: 1000 })
|
watchDebounced(() => query.keyword, listContests, {
|
||||||
|
debounce: 500,
|
||||||
|
maxWait: 1000,
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { getProblemList } from "~/admin/api"
|
import { getProblemList } from "~/admin/api"
|
||||||
import { AdminProblemFiltered } from "~/utils/types"
|
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
import Pagination from "~/shared/components/Pagination.vue"
|
||||||
|
import { AdminProblemFiltered } from "~/utils/types"
|
||||||
import AddButton from "./AddButton.vue"
|
import AddButton from "./AddButton.vue"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import TextEditor from "~/shared/components/TextEditor.vue"
|
|
||||||
import { unique } from "~/utils/functions"
|
|
||||||
import { BlankProblem, LANGUAGE, Tag } from "~/utils/types"
|
|
||||||
import { getProblemTagList } from "~/shared/api"
|
import { getProblemTagList } from "~/shared/api"
|
||||||
|
import TextEditor from "~/shared/components/TextEditor.vue"
|
||||||
import {
|
import {
|
||||||
LANGUAGE_SHOW_VALUE,
|
|
||||||
CODE_TEMPLATES,
|
CODE_TEMPLATES,
|
||||||
|
LANGUAGE_SHOW_VALUE,
|
||||||
STORAGE_KEY,
|
STORAGE_KEY,
|
||||||
} from "~/utils/constants"
|
} from "~/utils/constants"
|
||||||
import download from "~/utils/download"
|
import download from "~/utils/download"
|
||||||
|
import { unique } from "~/utils/functions"
|
||||||
|
import { BlankProblem, LANGUAGE, Tag } from "~/utils/types"
|
||||||
import {
|
import {
|
||||||
createContestProblem,
|
createContestProblem,
|
||||||
createProblem,
|
createProblem,
|
||||||
|
|||||||
@@ -1,14 +1,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {
|
|
||||||
getProblemList,
|
|
||||||
getProblem,
|
|
||||||
editProblem,
|
|
||||||
toggleProblemVisible,
|
|
||||||
} from "../api"
|
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
|
||||||
import { NSwitch } from "naive-ui"
|
import { NSwitch } from "naive-ui"
|
||||||
import { AdminProblemFiltered } from "~/utils/types"
|
import Pagination from "~/shared/components/Pagination.vue"
|
||||||
import { parseTime } from "~/utils/functions"
|
import { parseTime } from "~/utils/functions"
|
||||||
|
import { AdminProblemFiltered } from "~/utils/types"
|
||||||
|
import { getProblemList, toggleProblemVisible } from "../api"
|
||||||
import Actions from "./components/Actions.vue"
|
import Actions from "./components/Actions.vue"
|
||||||
import Modal from "./components/Modal.vue"
|
import Modal from "./components/Modal.vue"
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NButton, NTag } from "naive-ui"
|
import { NButton, NTag } from "naive-ui"
|
||||||
|
import { parseTime } from "~/utils/functions"
|
||||||
|
import { Server } from "~/utils/types"
|
||||||
import {
|
import {
|
||||||
|
deleteJudgeServer,
|
||||||
editWebsite,
|
editWebsite,
|
||||||
getJudgeServer,
|
getJudgeServer,
|
||||||
deleteJudgeServer,
|
|
||||||
getWebsite,
|
getWebsite,
|
||||||
listInvalidTestcases,
|
listInvalidTestcases,
|
||||||
pruneInvalidTestcases,
|
pruneInvalidTestcases,
|
||||||
} from "../api"
|
} from "../api"
|
||||||
import { Server } from "~/utils/types"
|
|
||||||
import { parseTime } from "~/utils/functions"
|
|
||||||
|
|
||||||
interface Testcase {
|
interface Testcase {
|
||||||
id: string
|
id: string
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useUserStore } from "~/shared/store/user"
|
|
||||||
import { getRank } from "oj/api"
|
|
||||||
import { getBaseInfo } from "../api"
|
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
|
||||||
import { Rank } from "~/utils/types"
|
|
||||||
import { NButton } from "naive-ui"
|
import { NButton } from "naive-ui"
|
||||||
|
import { getRank } from "oj/api"
|
||||||
|
import Pagination from "~/shared/components/Pagination.vue"
|
||||||
|
import { useUserStore } from "~/shared/store/user"
|
||||||
import { getACRate } from "~/utils/functions"
|
import { getACRate } from "~/utils/functions"
|
||||||
|
import { Rank } from "~/utils/types"
|
||||||
|
import { getBaseInfo } from "../api"
|
||||||
|
|
||||||
const userCount = ref(0)
|
const userCount = ref(0)
|
||||||
const submissionCount = ref(0)
|
const submissionCount = ref(0)
|
||||||
@@ -104,10 +104,10 @@ watch(
|
|||||||
<n-button @click="router.push('/admin/contest/create')">新比赛</n-button>
|
<n-button @click="router.push('/admin/contest/create')">新比赛</n-button>
|
||||||
<div>
|
<div>
|
||||||
<n-input
|
<n-input
|
||||||
clearable
|
clearable
|
||||||
@change="listRanks"
|
@change="listRanks"
|
||||||
v-model:value="query.username"
|
v-model:value="query.username"
|
||||||
placeholder="班级前缀"
|
placeholder="班级前缀"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<n-button @click="listRanks">用户排名</n-button>
|
<n-button @click="listRanks">用户排名</n-button>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { User } from "~/utils/types"
|
|
||||||
import { getUserRole } from "~/utils/functions"
|
import { getUserRole } from "~/utils/functions"
|
||||||
|
import { User } from "~/utils/types"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
user: User
|
user: User
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { DataTableRowKey, SelectOption } from "naive-ui"
|
|||||||
import Pagination from "~/shared/components/Pagination.vue"
|
import Pagination from "~/shared/components/Pagination.vue"
|
||||||
import { parseTime } from "~/utils/functions"
|
import { parseTime } from "~/utils/functions"
|
||||||
import { User } from "~/utils/types"
|
import { User } from "~/utils/types"
|
||||||
import { getUserList, deleteUsers, editUser, importUsers } from "../api"
|
import { deleteUsers, editUser, getUserList, importUsers } from "../api"
|
||||||
import Actions from "./components/Actions.vue"
|
import Actions from "./components/Actions.vue"
|
||||||
import Name from "./components/Name.vue"
|
import Name from "./components/Name.vue"
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ const rowKey = (row: User) => row.id
|
|||||||
|
|
||||||
const columns: DataTableColumn<User>[] = [
|
const columns: DataTableColumn<User>[] = [
|
||||||
{ type: "selection" },
|
{ type: "selection" },
|
||||||
{ title: "ID", key: "id", width: 60 },
|
{ title: "ID", key: "id", width: 100 },
|
||||||
{
|
{
|
||||||
title: "用户名",
|
title: "用户名",
|
||||||
key: "username",
|
key: "username",
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { getAnnouncementList, getAnnouncement } from "~/oj/api"
|
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
|
||||||
import { parseTime } from "~/utils/functions"
|
|
||||||
import { Announcement } from "~/utils/types"
|
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
|
||||||
import { NTag } from "naive-ui"
|
import { NTag } from "naive-ui"
|
||||||
import TitleWithTag from "./components/TitleWithTag.vue"
|
import { getAnnouncement, getAnnouncementList } from "~/oj/api"
|
||||||
|
import Pagination from "~/shared/components/Pagination.vue"
|
||||||
|
import { isDesktop } from "~/shared/composables/breakpoints"
|
||||||
|
import { parseTime } from "~/utils/functions"
|
||||||
import { renderTableTitle } from "~/utils/renders"
|
import { renderTableTitle } from "~/utils/renders"
|
||||||
|
import { Announcement } from "~/utils/types"
|
||||||
|
import TitleWithTag from "./components/TitleWithTag.vue"
|
||||||
|
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const content = ref("")
|
const content = ref("")
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { parseTime } from "utils/functions"
|
|
||||||
import { useContestStore } from "oj/store/contest"
|
|
||||||
import ContestType from "~/shared/components/ContestType.vue"
|
|
||||||
import { Icon } from "@iconify/vue"
|
import { Icon } from "@iconify/vue"
|
||||||
|
import { useContestStore } from "oj/store/contest"
|
||||||
|
import { parseTime } from "utils/functions"
|
||||||
|
import ContestType from "~/shared/components/ContestType.vue"
|
||||||
|
|
||||||
const contestStore = useContestStore()
|
const contestStore = useContestStore()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { Icon } from "@iconify/vue"
|
||||||
import { CONTEST_STATUS } from "utils/constants"
|
import { CONTEST_STATUS } from "utils/constants"
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
import { isDesktop } from "~/shared/composables/breakpoints"
|
||||||
import { useContestStore } from "../store/contest"
|
import { useContestStore } from "../store/contest"
|
||||||
import ContestInfo from "./components/ContestInfo.vue"
|
import ContestInfo from "./components/ContestInfo.vue"
|
||||||
import ContestMenu from "./components/ContestMenu.vue"
|
import ContestMenu from "./components/ContestMenu.vue"
|
||||||
import { Icon } from "@iconify/vue"
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
contestID: string
|
contestID: string
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NTag } from "naive-ui"
|
import { NTag } from "naive-ui"
|
||||||
import { getContestList } from "oj/api"
|
import { getContestList } from "oj/api"
|
||||||
import { filterEmptyValue, parseTime, duration } from "utils/functions"
|
import { duration, filterEmptyValue, parseTime } from "utils/functions"
|
||||||
import { Contest } from "utils/types"
|
import { Contest } from "utils/types"
|
||||||
import { ContestType, CONTEST_STATUS } from "~/utils/constants"
|
|
||||||
import ContestTitle from "~/shared/components/ContestTitle.vue"
|
import ContestTitle from "~/shared/components/ContestTitle.vue"
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
import Pagination from "~/shared/components/Pagination.vue"
|
||||||
import { useUserStore } from "~/shared/store/user"
|
|
||||||
import { toggleLogin } from "~/shared/composables/modal"
|
import { toggleLogin } from "~/shared/composables/modal"
|
||||||
|
import { useUserStore } from "~/shared/store/user"
|
||||||
|
import { CONTEST_STATUS, ContestType } from "~/utils/constants"
|
||||||
import { renderTableTitle } from "~/utils/renders"
|
import { renderTableTitle } from "~/utils/renders"
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NButton, NIcon, useThemeVars } from "naive-ui"
|
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
|
||||||
import AcAndSubmission from "../components/AcAndSubmission.vue"
|
|
||||||
import { getContestProblems, getContestRank } from "oj/api"
|
|
||||||
import { ContestRank, ProblemFiltered } from "~/utils/types"
|
|
||||||
import { secondsToDuration } from "utils/functions"
|
|
||||||
import { ContestStatus } from "~/utils/constants"
|
|
||||||
import { useContestStore } from "~/oj/store/contest"
|
|
||||||
import { Icon } from "@iconify/vue"
|
import { Icon } from "@iconify/vue"
|
||||||
|
import { NButton, useThemeVars } from "naive-ui"
|
||||||
|
import { getContestProblems, getContestRank } from "oj/api"
|
||||||
|
import { secondsToDuration } from "utils/functions"
|
||||||
|
import { useContestStore } from "~/oj/store/contest"
|
||||||
|
import Pagination from "~/shared/components/Pagination.vue"
|
||||||
|
import { ContestStatus } from "~/utils/constants"
|
||||||
import { renderTableTitle } from "~/utils/renders"
|
import { renderTableTitle } from "~/utils/renders"
|
||||||
|
import { ContestRank, ProblemFiltered } from "~/utils/types"
|
||||||
|
import AcAndSubmission from "../components/AcAndSubmission.vue"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
contestID: string
|
contestID: string
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { SOURCES } from "utils/constants"
|
|
||||||
import { code } from "oj/composables/code"
|
import { code } from "oj/composables/code"
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
|
||||||
import { problem } from "oj/composables/problem"
|
import { problem } from "oj/composables/problem"
|
||||||
|
import { SOURCES } from "utils/constants"
|
||||||
|
import CodeEditor from "~/shared/components/CodeEditor.vue"
|
||||||
|
import { isDesktop } from "~/shared/composables/breakpoints"
|
||||||
import storage from "~/utils/storage"
|
import storage from "~/utils/storage"
|
||||||
import Form from "./Form.vue"
|
import Form from "./Form.vue"
|
||||||
import CodeEditor from "~/shared/components/CodeEditor.vue"
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const contestID = !!route.params.contestID ? route.params.contestID : null
|
const contestID = !!route.params.contestID ? route.params.contestID : null
|
||||||
|
|||||||
@@ -1,117 +1,117 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { SOURCES } from "utils/constants"
|
import { code, input, output } from "oj/composables/code"
|
||||||
import { code, input, output } from "oj/composables/code"
|
import { problem } from "oj/composables/problem"
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
import { SOURCES } from "utils/constants"
|
||||||
import { problem } from "oj/composables/problem"
|
import CodeEditor from "~/shared/components/CodeEditor.vue"
|
||||||
import storage from "~/utils/storage"
|
import { isDesktop } from "~/shared/composables/breakpoints"
|
||||||
import Form from "./Form.vue"
|
import storage from "~/utils/storage"
|
||||||
import CodeEditor from "~/shared/components/CodeEditor.vue"
|
import Form from "./Form.vue"
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const contestID = !!route.params.contestID ? route.params.contestID : null
|
const contestID = !!route.params.contestID ? route.params.contestID : null
|
||||||
|
|
||||||
const storageKey = computed(
|
const storageKey = computed(
|
||||||
() =>
|
() =>
|
||||||
`problem_${problem.value!._id}_contest_${contestID}_lang_${code.language}`,
|
`problem_${problem.value!._id}_contest_${contestID}_lang_${code.language}`,
|
||||||
)
|
)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (storage.get(storageKey.value)) {
|
if (storage.get(storageKey.value)) {
|
||||||
code.value = storage.get(storageKey.value)
|
code.value = storage.get(storageKey.value)
|
||||||
} else {
|
} else {
|
||||||
code.value =
|
code.value =
|
||||||
problem.value!.template[code.language] || SOURCES[code.language]
|
problem.value!.template[code.language] || SOURCES[code.language]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const editorHeight = computed(() =>
|
const editorHeight = computed(() =>
|
||||||
isDesktop.value ? "calc(100vh - 133px)" : "calc(100vh - 172px)",
|
isDesktop.value ? "calc(100vh - 133px)" : "calc(100vh - 172px)",
|
||||||
)
|
)
|
||||||
|
|
||||||
function changeCode(v: string) {
|
function changeCode(v: string) {
|
||||||
storage.set(storageKey.value, v)
|
storage.set(storageKey.value, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeLanguage(v: string) {
|
function changeLanguage(v: string) {
|
||||||
if (
|
if (
|
||||||
storage.get(storageKey.value) &&
|
storage.get(storageKey.value) &&
|
||||||
storageKey.value.split("_").pop() === v
|
storageKey.value.split("_").pop() === v
|
||||||
) {
|
) {
|
||||||
code.value = storage.get(storageKey.value)
|
code.value = storage.get(storageKey.value)
|
||||||
} else {
|
} else {
|
||||||
code.value =
|
code.value =
|
||||||
problem.value!.template[code.language] || SOURCES[code.language]
|
problem.value!.template[code.language] || SOURCES[code.language]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<n-flex vertical>
|
<n-flex vertical>
|
||||||
<Form
|
<Form
|
||||||
:storage-key="storageKey"
|
:storage-key="storageKey"
|
||||||
@change-language="changeLanguage"
|
@change-language="changeLanguage"
|
||||||
with-test
|
with-test
|
||||||
/>
|
/>
|
||||||
<n-split direction="horizontal" :min="1 / 3" :max="4 / 5">
|
<n-split direction="horizontal" :min="1 / 3" :max="4 / 5">
|
||||||
<template #1>
|
<template #1>
|
||||||
<CodeEditor
|
<CodeEditor
|
||||||
v-model:value="code.value"
|
v-model:value="code.value"
|
||||||
@update:model-value="changeCode"
|
@update:model-value="changeCode"
|
||||||
:language="code.language"
|
:language="code.language"
|
||||||
:height="editorHeight"
|
:height="editorHeight"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #2>
|
<template #2>
|
||||||
<n-split
|
<n-split
|
||||||
direction="vertical"
|
direction="vertical"
|
||||||
:default-size="1 / 3"
|
:default-size="1 / 3"
|
||||||
:min="1 / 5"
|
:min="1 / 5"
|
||||||
:max="3 / 5"
|
:max="3 / 5"
|
||||||
>
|
>
|
||||||
<template #1>
|
<template #1>
|
||||||
<div class="title">输入框</div>
|
<div class="title">输入框</div>
|
||||||
<n-input
|
<n-input
|
||||||
v-model:value="input"
|
v-model:value="input"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
:resizable="false"
|
:resizable="false"
|
||||||
class="box"
|
class="box"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #2>
|
<template #2>
|
||||||
<div class="title">输出框</div>
|
<div class="title">输出框</div>
|
||||||
<n-input
|
<n-input
|
||||||
class="box output"
|
class="box output"
|
||||||
v-model:value="output"
|
v-model:value="output"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
:resizable="false"
|
:resizable="false"
|
||||||
readonly
|
readonly
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</n-split>
|
</n-split>
|
||||||
</template>
|
</template>
|
||||||
</n-split>
|
</n-split>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.title {
|
.title {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height: calc(100% - 40px);
|
height: calc(100% - 40px);
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.output {
|
.output {
|
||||||
font-family: "Monaco";
|
font-family: "Monaco";
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import copyText from "copy-text-to-clipboard"
|
import copyText from "copy-text-to-clipboard"
|
||||||
import { LANGUAGE_SHOW_VALUE, SOURCES } from "utils/constants"
|
|
||||||
import { code, input, output } from "oj/composables/code"
|
import { code, input, output } from "oj/composables/code"
|
||||||
import { problem } from "oj/composables/problem"
|
import { problem } from "oj/composables/problem"
|
||||||
|
import { LANGUAGE_SHOW_VALUE, SOURCES, STORAGE_KEY } from "utils/constants"
|
||||||
import { isDesktop, isMobile } from "~/shared/composables/breakpoints"
|
import { isDesktop, isMobile } from "~/shared/composables/breakpoints"
|
||||||
import { useUserStore } from "~/shared/store/user"
|
import { useUserStore } from "~/shared/store/user"
|
||||||
import Submit from "./Submit.vue"
|
|
||||||
import storage from "~/utils/storage"
|
|
||||||
import { STORAGE_KEY } from "utils/constants"
|
|
||||||
import { LANGUAGE } from "~/utils/types"
|
|
||||||
import { createTestSubmission } from "~/utils/judge"
|
import { createTestSubmission } from "~/utils/judge"
|
||||||
|
import storage from "~/utils/storage"
|
||||||
|
import { LANGUAGE } from "~/utils/types"
|
||||||
|
import Submit from "./Submit.vue"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
storageKey: string
|
storageKey: string
|
||||||
@@ -114,7 +113,9 @@ function gotoTestCat() {
|
|||||||
:options="options"
|
:options="options"
|
||||||
/>
|
/>
|
||||||
<n-button v-if="withTest" @click="reset">重置代码</n-button>
|
<n-button v-if="withTest" @click="reset">重置代码</n-button>
|
||||||
<n-button v-if="withTest" type="primary" secondary @click="test">运行代码</n-button>
|
<n-button v-if="withTest" type="primary" secondary @click="test"
|
||||||
|
>运行代码</n-button
|
||||||
|
>
|
||||||
<n-flex align="center" v-if="!withTest">
|
<n-flex align="center" v-if="!withTest">
|
||||||
<Submit />
|
<Submit />
|
||||||
<n-button v-if="isDesktop" @click="gotoTestCat">自测猫</n-button>
|
<n-button v-if="isDesktop" @click="gotoTestCat">自测猫</n-button>
|
||||||
|
|||||||
@@ -112,11 +112,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { problem } from "oj/composables/problem"
|
|
||||||
import { createComment, getComment, getCommentStatistics } from "~/oj/api"
|
|
||||||
import { DIFFICULTY } from "utils/constants"
|
|
||||||
import { useUserStore } from "~/shared/store/user"
|
|
||||||
import { Icon } from "@iconify/vue"
|
import { Icon } from "@iconify/vue"
|
||||||
|
import { problem } from "oj/composables/problem"
|
||||||
|
import { DIFFICULTY } from "utils/constants"
|
||||||
|
import { createComment, getComment, getCommentStatistics } from "~/oj/api"
|
||||||
|
import { useUserStore } from "~/shared/store/user"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
showStatistics?: boolean
|
showStatistics?: boolean
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Copy from "~/shared/components/Copy.vue"
|
import { Icon } from "@iconify/vue"
|
||||||
|
import { useThemeVars } from "naive-ui"
|
||||||
import { code } from "oj/composables/code"
|
import { code } from "oj/composables/code"
|
||||||
import { problem } from "oj/composables/problem"
|
import { problem } from "oj/composables/problem"
|
||||||
import { Problem, ProblemStatus } from "utils/types"
|
|
||||||
import { createTestSubmission } from "utils/judge"
|
import { createTestSubmission } from "utils/judge"
|
||||||
import { useThemeVars } from "naive-ui"
|
import { Problem, ProblemStatus } from "utils/types"
|
||||||
import { Icon } from "@iconify/vue"
|
import Copy from "~/shared/components/Copy.vue"
|
||||||
|
|
||||||
type Sample = Problem["samples"][number] & {
|
type Sample = Problem["samples"][number] & {
|
||||||
id: number
|
id: number
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Pie } from "vue-chartjs"
|
import { problem } from "oj/composables/problem"
|
||||||
import { DIFFICULTY, JUDGE_STATUS } from "utils/constants"
|
import { DIFFICULTY, JUDGE_STATUS } from "utils/constants"
|
||||||
import { getACRate, getTagColor, parseTime } from "utils/functions"
|
import { getACRate, getTagColor, parseTime } from "utils/functions"
|
||||||
import { problem } from "oj/composables/problem"
|
import { Pie } from "vue-chartjs"
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
import { isDesktop } from "~/shared/composables/breakpoints"
|
||||||
|
|
||||||
const data = computed(() => {
|
const data = computed(() => {
|
||||||
@@ -16,7 +16,9 @@ const data = computed(() => {
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
labels,
|
labels,
|
||||||
datasets: [{ data: Object.values(status), hoverOffset: 5, borderRadius: 10 }],
|
datasets: [
|
||||||
|
{ data: Object.values(status), hoverOffset: 5, borderRadius: 10 },
|
||||||
|
],
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useThemeVars } from "naive-ui"
|
|
||||||
import { Icon } from "@iconify/vue"
|
import { Icon } from "@iconify/vue"
|
||||||
|
import { useThemeVars } from "naive-ui"
|
||||||
|
|
||||||
const theme = useThemeVars()
|
const theme = useThemeVars()
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useUserStore } from "~/shared/store/user"
|
|
||||||
import { Submission } from "~/utils/types"
|
|
||||||
import { parseTime } from "~/utils/functions"
|
|
||||||
import { LANGUAGE_SHOW_VALUE } from "~/utils/constants"
|
|
||||||
import { getSubmissions } from "~/oj/api"
|
|
||||||
import SubmissionResultTag from "~/shared/components/SubmissionResultTag.vue"
|
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
|
||||||
import { NButton } from "naive-ui"
|
import { NButton } from "naive-ui"
|
||||||
|
import { getSubmissions } from "~/oj/api"
|
||||||
|
import Pagination from "~/shared/components/Pagination.vue"
|
||||||
|
import SubmissionResultTag from "~/shared/components/SubmissionResultTag.vue"
|
||||||
|
import { useUserStore } from "~/shared/store/user"
|
||||||
|
import { LANGUAGE_SHOW_VALUE } from "~/utils/constants"
|
||||||
|
import { parseTime } from "~/utils/functions"
|
||||||
import { renderTableTitle } from "~/utils/renders"
|
import { renderTableTitle } from "~/utils/renders"
|
||||||
|
import { Submission } from "~/utils/types"
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { Icon } from "@iconify/vue"
|
||||||
|
import confetti from "canvas-confetti"
|
||||||
|
import { getComment, getSubmission, submitCode } from "oj/api"
|
||||||
import { code } from "oj/composables/code"
|
import { code } from "oj/composables/code"
|
||||||
import { problem } from "oj/composables/problem"
|
import { problem } from "oj/composables/problem"
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
|
||||||
import { JUDGE_STATUS, SubmissionStatus } from "utils/constants"
|
import { JUDGE_STATUS, SubmissionStatus } from "utils/constants"
|
||||||
import { submissionMemoryFormat, submissionTimeFormat } from "utils/functions"
|
import { submissionMemoryFormat, submissionTimeFormat } from "utils/functions"
|
||||||
import { Submission, SubmitCodePayload } from "utils/types"
|
import { Submission, SubmitCodePayload } from "utils/types"
|
||||||
import { getComment, getSubmission, submitCode } from "oj/api"
|
|
||||||
import SubmissionResultTag from "~/shared/components/SubmissionResultTag.vue"
|
import SubmissionResultTag from "~/shared/components/SubmissionResultTag.vue"
|
||||||
|
import { isDesktop } from "~/shared/composables/breakpoints"
|
||||||
import { useUserStore } from "~/shared/store/user"
|
import { useUserStore } from "~/shared/store/user"
|
||||||
// @ts-ignore
|
|
||||||
import confetti from "canvas-confetti"
|
|
||||||
import { Icon } from "@iconify/vue"
|
|
||||||
|
|
||||||
const ProblemComment = defineAsyncComponent(
|
const ProblemComment = defineAsyncComponent(
|
||||||
() => import("./ProblemComment.vue"),
|
() => import("./ProblemComment.vue"),
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getProblem } from "oj/api"
|
import { getProblem } from "oj/api"
|
||||||
|
import { ScreenMode } from "utils/constants"
|
||||||
import { isDesktop, isMobile } from "~/shared/composables/breakpoints"
|
import { isDesktop, isMobile } from "~/shared/composables/breakpoints"
|
||||||
import { screenMode } from "~/shared/composables/switchScreen"
|
import { screenMode } from "~/shared/composables/switchScreen"
|
||||||
import { problem } from "../composables/problem"
|
import { problem } from "../composables/problem"
|
||||||
import { ScreenMode } from "utils/constants"
|
|
||||||
|
|
||||||
const Editor = defineAsyncComponent(() => import("./components/Editor.vue"))
|
const Editor = defineAsyncComponent(() => import("./components/Editor.vue"))
|
||||||
const EditorWithTest = defineAsyncComponent(() => import("./components/EditorWithTest.vue"))
|
const EditorWithTest = defineAsyncComponent(
|
||||||
|
() => import("./components/EditorWithTest.vue"),
|
||||||
|
)
|
||||||
const ProblemContent = defineAsyncComponent(
|
const ProblemContent = defineAsyncComponent(
|
||||||
() => import("./components/ProblemContent.vue"),
|
() => import("./components/ProblemContent.vue"),
|
||||||
)
|
)
|
||||||
@@ -105,7 +107,7 @@ watch(isMobile, (value) => {
|
|||||||
</n-tabs>
|
</n-tabs>
|
||||||
</n-gi>
|
</n-gi>
|
||||||
<n-gi v-if="isDesktop && screenMode === ScreenMode.both">
|
<n-gi v-if="isDesktop && screenMode === ScreenMode.both">
|
||||||
<Editor/>
|
<Editor />
|
||||||
</n-gi>
|
</n-gi>
|
||||||
<n-gi v-if="isDesktop && screenMode === ScreenMode.code">
|
<n-gi v-if="isDesktop && screenMode === ScreenMode.code">
|
||||||
<EditorWithTest />
|
<EditorWithTest />
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { Icon } from "@iconify/vue"
|
||||||
import { NSpace, NTag } from "naive-ui"
|
import { NSpace, NTag } from "naive-ui"
|
||||||
|
import { getProblemList, getRandomProblemID } from "oj/api"
|
||||||
import { filterEmptyValue, getTagColor } from "utils/functions"
|
import { filterEmptyValue, getTagColor } from "utils/functions"
|
||||||
import { ProblemFiltered } from "utils/types"
|
import { ProblemFiltered } from "utils/types"
|
||||||
import { getProblemList, getRandomProblemID } from "oj/api"
|
|
||||||
import ProblemStatus from "./components/ProblemStatus.vue"
|
|
||||||
import { useUserStore } from "~/shared/store/user"
|
|
||||||
import { getProblemTagList } from "~/shared/api"
|
import { getProblemTagList } from "~/shared/api"
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
import Pagination from "~/shared/components/Pagination.vue"
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
import { isDesktop } from "~/shared/composables/breakpoints"
|
||||||
import { Icon } from "@iconify/vue"
|
import { useUserStore } from "~/shared/store/user"
|
||||||
import { renderTableTitle } from "~/utils/renders"
|
import { renderTableTitle } from "~/utils/renders"
|
||||||
|
import ProblemStatus from "./components/ProblemStatus.vue"
|
||||||
|
|
||||||
interface Tag {
|
interface Tag {
|
||||||
id: number
|
id: number
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NButton } from "naive-ui"
|
import { NButton } from "naive-ui"
|
||||||
import Chart from "./components/Chart.vue"
|
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
|
||||||
import { Rank } from "utils/types"
|
|
||||||
import { getRank } from "oj/api"
|
import { getRank } from "oj/api"
|
||||||
import { getACRate } from "utils/functions"
|
import { getACRate } from "utils/functions"
|
||||||
import Index from "./components/Index.vue"
|
import { Rank } from "utils/types"
|
||||||
|
import Pagination from "~/shared/components/Pagination.vue"
|
||||||
import { renderTableTitle } from "~/utils/renders"
|
import { renderTableTitle } from "~/utils/renders"
|
||||||
|
import Chart from "./components/Chart.vue"
|
||||||
|
import Index from "./components/Index.vue"
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const data = ref<Rank[]>([])
|
const data = ref<Rank[]>([])
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import copy from "copy-text-to-clipboard"
|
||||||
import { createMessage, getSubmission } from "oj/api"
|
import { createMessage, getSubmission } from "oj/api"
|
||||||
import { Submission } from "utils/types"
|
|
||||||
import { JUDGE_STATUS, LANGUAGE_FORMAT_VALUE } from "utils/constants"
|
import { JUDGE_STATUS, LANGUAGE_FORMAT_VALUE } from "utils/constants"
|
||||||
import {
|
import {
|
||||||
parseTime,
|
parseTime,
|
||||||
submissionMemoryFormat,
|
submissionMemoryFormat,
|
||||||
submissionTimeFormat,
|
submissionTimeFormat,
|
||||||
} from "utils/functions"
|
} from "utils/functions"
|
||||||
import copy from "copy-text-to-clipboard"
|
import { Submission } from "utils/types"
|
||||||
import SubmissionResultTag from "~/shared/components/SubmissionResultTag.vue"
|
import SubmissionResultTag from "~/shared/components/SubmissionResultTag.vue"
|
||||||
import { useUserStore } from "~/shared/store/user"
|
import { useUserStore } from "~/shared/store/user"
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NButton } from "naive-ui"
|
import { NButton } from "naive-ui"
|
||||||
import SubmissionResultTag from "~/shared/components/SubmissionResultTag.vue"
|
import { adminRejudge, getSubmissions } from "oj/api"
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
|
||||||
import {
|
import {
|
||||||
|
filterEmptyValue,
|
||||||
|
parseTime,
|
||||||
submissionMemoryFormat,
|
submissionMemoryFormat,
|
||||||
submissionTimeFormat,
|
submissionTimeFormat,
|
||||||
parseTime,
|
|
||||||
filterEmptyValue,
|
|
||||||
} from "utils/functions"
|
} from "utils/functions"
|
||||||
import { Submission } from "utils/types"
|
import { Submission } from "utils/types"
|
||||||
import { adminRejudge, getSubmissions } from "oj/api"
|
import Pagination from "~/shared/components/Pagination.vue"
|
||||||
|
import SubmissionResultTag from "~/shared/components/SubmissionResultTag.vue"
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
import { isDesktop } from "~/shared/composables/breakpoints"
|
||||||
import { useUserStore } from "~/shared/store/user"
|
import { useUserStore } from "~/shared/store/user"
|
||||||
import { LANGUAGE_SHOW_VALUE } from "~/utils/constants"
|
import { LANGUAGE_SHOW_VALUE } from "~/utils/constants"
|
||||||
|
import { renderTableTitle } from "~/utils/renders"
|
||||||
import ButtonWithSearch from "./components/ButtonWithSearch.vue"
|
import ButtonWithSearch from "./components/ButtonWithSearch.vue"
|
||||||
import StatisticsPanel from "./components/StatisticsPanel.vue"
|
import StatisticsPanel from "./components/StatisticsPanel.vue"
|
||||||
import SubmissionLink from "./components/SubmissionLink.vue"
|
import SubmissionLink from "./components/SubmissionLink.vue"
|
||||||
import SubmissionDetail from "./detail.vue"
|
import SubmissionDetail from "./detail.vue"
|
||||||
import { renderTableTitle } from "~/utils/renders"
|
|
||||||
|
|
||||||
interface Query {
|
interface Query {
|
||||||
username: string
|
username: string
|
||||||
|
|||||||
@@ -48,11 +48,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { getMessageList } from "oj/api"
|
import { getMessageList } from "oj/api"
|
||||||
import { Message } from "~/utils/types"
|
import { JUDGE_STATUS, LANGUAGE_FORMAT_VALUE } from "utils/constants"
|
||||||
import { parseTime } from "~/utils/functions"
|
|
||||||
import { LANGUAGE_FORMAT_VALUE, JUDGE_STATUS } from "utils/constants"
|
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
|
||||||
import Copy from "~/shared/components/Copy.vue"
|
import Copy from "~/shared/components/Copy.vue"
|
||||||
|
import Pagination from "~/shared/components/Pagination.vue"
|
||||||
|
import { parseTime } from "~/utils/functions"
|
||||||
|
import { Message } from "~/utils/types"
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const messages = ref<Message[]>([])
|
const messages = ref<Message[]>([])
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useUserStore } from "~/shared/store/user"
|
|
||||||
import { updateProfile, uploadAvatar } from "oj/api"
|
import { updateProfile, uploadAvatar } from "oj/api"
|
||||||
|
import { useUserStore } from "~/shared/store/user"
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { Codemirror } from "vue-codemirror"
|
|
||||||
import { cpp } from "@codemirror/lang-cpp"
|
import { cpp } from "@codemirror/lang-cpp"
|
||||||
import { python } from "@codemirror/lang-python"
|
import { python } from "@codemirror/lang-python"
|
||||||
import { EditorView } from "@codemirror/view"
|
import { EditorView } from "@codemirror/view"
|
||||||
|
import { Codemirror } from "vue-codemirror"
|
||||||
|
import { LANGUAGE } from "~/utils/types"
|
||||||
import { oneDark } from "../themes/oneDark"
|
import { oneDark } from "../themes/oneDark"
|
||||||
import { smoothy } from "../themes/smoothy"
|
import { smoothy } from "../themes/smoothy"
|
||||||
import { LANGUAGE } from "~/utils/types"
|
|
||||||
|
|
||||||
const styleTheme = EditorView.baseTheme({
|
const styleTheme = EditorView.baseTheme({
|
||||||
"& .cm-scroller": {
|
"& .cm-scroller": {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Contest } from "utils/types"
|
|
||||||
import { ContestType } from "utils/constants"
|
|
||||||
import { Icon } from "@iconify/vue"
|
import { Icon } from "@iconify/vue"
|
||||||
|
import { ContestType } from "utils/constants"
|
||||||
|
import { Contest } from "utils/types"
|
||||||
|
|
||||||
defineProps<{ contest: Contest }>()
|
defineProps<{ contest: Contest }>()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Contest } from "~/utils/types"
|
|
||||||
import { ContestType } from "~/utils/constants"
|
import { ContestType } from "~/utils/constants"
|
||||||
|
import { Contest } from "~/utils/types"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
contest: Contest
|
contest: Contest
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import copy from "copy-text-to-clipboard"
|
|
||||||
import { Icon } from "@iconify/vue"
|
import { Icon } from "@iconify/vue"
|
||||||
|
import copy from "copy-text-to-clipboard"
|
||||||
|
|
||||||
defineProps<{ value: string }>()
|
defineProps<{ value: string }>()
|
||||||
const [copied, toggle] = useToggle()
|
const [copied, toggle] = useToggle()
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { logout } from "../api"
|
import { Icon } from "@iconify/vue"
|
||||||
import { useUserStore } from "../store/user"
|
|
||||||
import { useConfigStore } from "../store/config"
|
|
||||||
import { toggleLogin, toggleSignup } from "~/shared/composables/modal"
|
|
||||||
import { RouterLink } from "vue-router"
|
import { RouterLink } from "vue-router"
|
||||||
import { isDesktop, isMobile } from "~/shared/composables/breakpoints"
|
import { isDesktop, isMobile } from "~/shared/composables/breakpoints"
|
||||||
|
import { toggleLogin, toggleSignup } from "~/shared/composables/modal"
|
||||||
import {
|
import {
|
||||||
screenSwitchLabel,
|
screenSwitchLabel,
|
||||||
switchScreenMode,
|
switchScreenMode,
|
||||||
} from "~/shared/composables/switchScreen"
|
} from "~/shared/composables/switchScreen"
|
||||||
import { Icon } from "@iconify/vue"
|
import { logout } from "../api"
|
||||||
|
import { useConfigStore } from "../store/config"
|
||||||
|
import { useUserStore } from "../store/user"
|
||||||
|
|
||||||
const isDark = useDark()
|
const isDark = useDark()
|
||||||
const toggleDark = useToggle(isDark)
|
const toggleDark = useToggle(isDark)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { login } from "../api"
|
import { login } from "../api"
|
||||||
import { useConfigStore } from "../store/config"
|
|
||||||
import { loginModal, toggleLogin, toggleSignup } from "../composables/modal"
|
import { loginModal, toggleLogin, toggleSignup } from "../composables/modal"
|
||||||
|
import { useConfigStore } from "../store/config"
|
||||||
import { useUserStore } from "../store/user"
|
import { useUserStore } from "../store/user"
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getCaptcha, signup, login } from "../api"
|
import { getCaptcha, login, signup } from "../api"
|
||||||
import { signupModal, toggleLogin, toggleSignup } from "../composables/modal"
|
import { signupModal, toggleLogin, toggleSignup } from "../composables/modal"
|
||||||
import { useUserStore } from "../store/user"
|
import { useUserStore } from "../store/user"
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import "@wangeditor/editor/dist/css/style.css"
|
|
||||||
import { IDomEditor, IEditorConfig, IToolbarConfig } from "@wangeditor/editor"
|
import { IDomEditor, IEditorConfig, IToolbarConfig } from "@wangeditor/editor"
|
||||||
import { Editor, Toolbar } from "@wangeditor/editor-for-vue"
|
import { Editor, Toolbar } from "@wangeditor/editor-for-vue"
|
||||||
|
import "@wangeditor/editor/dist/css/style.css"
|
||||||
import { uploadImage } from "../../admin/api"
|
import { uploadImage } from "../../admin/api"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ const options: MenuOption[] = [
|
|||||||
),
|
),
|
||||||
key: "admin problem create",
|
key: "admin problem create",
|
||||||
},
|
},
|
||||||
{label: "交流", key: "communication", disabled: true},
|
{ label: "交流", key: "communication", disabled: true },
|
||||||
{
|
{
|
||||||
label: () =>
|
label: () =>
|
||||||
h(
|
h(
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import Beian from "../components/Beian.vue"
|
||||||
|
import Header from "../components/Header.vue"
|
||||||
import Login from "../components/Login.vue"
|
import Login from "../components/Login.vue"
|
||||||
import Signup from "../components/Signup.vue"
|
import Signup from "../components/Signup.vue"
|
||||||
import Header from "../components/Header.vue"
|
|
||||||
import Beian from "../components/Beian.vue"
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
Reference in New Issue
Block a user