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