统一导入
This commit is contained in:
@@ -76,10 +76,10 @@ export default defineConfig(({ envMode }) => {
|
|||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"~": "./src",
|
|
||||||
utils: "./src/utils",
|
utils: "./src/utils",
|
||||||
oj: "./src/oj",
|
oj: "./src/oj",
|
||||||
admin: "./src/admin",
|
admin: "./src/admin",
|
||||||
|
shared: "./src/shared",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { deleteAnnouncement } from "~/admin/api"
|
import { deleteAnnouncement } from "admin/api"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
announcementID: number
|
announcementID: number
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import TextEditor from "~/shared/components/TextEditor.vue"
|
import TextEditor from "shared/components/TextEditor.vue"
|
||||||
import { AnnouncementEdit } from "~/utils/types"
|
import { AnnouncementEdit } from "utils/types"
|
||||||
import { createAnnouncement, editAnnouncement, getAnnouncement } from "../api"
|
import { createAnnouncement, editAnnouncement, getAnnouncement } from "../api"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NSwitch } from "naive-ui"
|
import { NSwitch } 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 { Announcement } from "~/utils/types"
|
import { Announcement } from "utils/types"
|
||||||
import { editAnnouncement, getAnnouncementList } from "../api"
|
import { editAnnouncement, getAnnouncementList } from "../api"
|
||||||
import Actions from "./components/Actions.vue"
|
import Actions from "./components/Actions.vue"
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
Tutorial,
|
Tutorial,
|
||||||
User,
|
User,
|
||||||
WebsiteConfig,
|
WebsiteConfig,
|
||||||
} from "~/utils/types"
|
} from "utils/types"
|
||||||
|
|
||||||
export function getBaseInfo() {
|
export function getBaseInfo() {
|
||||||
return http.get("admin/dashboard_info")
|
return http.get("admin/dashboard_info")
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { NButton } from "naive-ui"
|
import { NButton } 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 { Comment } from "~/utils/types"
|
import { Comment } from "utils/types"
|
||||||
import { getCommentList } from "../api"
|
import { getCommentList } from "../api"
|
||||||
import CommentActions from "./components/CommentActions.vue"
|
import CommentActions from "./components/CommentActions.vue"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<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"])
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { Contest } from "~/utils/types"
|
import { Contest } from "utils/types"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
contest: Contest
|
contest: Contest
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { formatISO } from "date-fns"
|
import { formatISO } from "date-fns"
|
||||||
import TextEditor from "~/shared/components/TextEditor.vue"
|
import TextEditor from "shared/components/TextEditor.vue"
|
||||||
import { parseTime } from "~/utils/functions"
|
import { parseTime } from "utils/functions"
|
||||||
import { BlankContest } from "~/utils/types"
|
import { BlankContest } from "utils/types"
|
||||||
import { createContest, editContest, getContest } from "../api"
|
import { createContest, editContest, getContest } from "../api"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NSwitch, NTag } from "naive-ui"
|
import { NSwitch, NTag } from "naive-ui"
|
||||||
import ContestTitle from "~/shared/components/ContestTitle.vue"
|
import ContestTitle from "shared/components/ContestTitle.vue"
|
||||||
import ContestType from "~/shared/components/ContestType.vue"
|
import ContestType from "shared/components/ContestType.vue"
|
||||||
import Pagination from "~/shared/components/Pagination.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 { Contest } from "utils/types"
|
||||||
import { editContest, getContestList } from "../api"
|
import { editContest, getContestList } from "../api"
|
||||||
import Actions from "./components/Actions.vue"
|
import Actions from "./components/Actions.vue"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { deleteContestProblem, deleteProblem } from "~/admin/api"
|
import { deleteContestProblem, deleteProblem } from "admin/api"
|
||||||
import download from "~/utils/download"
|
import download from "utils/download"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
problemID: number
|
problemID: number
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { addProblemForContest } from "~/admin/api"
|
import { addProblemForContest } from "admin/api"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
problemID: number
|
problemID: number
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { getProblemList } from "~/admin/api"
|
import { getProblemList } from "admin/api"
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
import Pagination from "shared/components/Pagination.vue"
|
||||||
import { AdminProblemFiltered } from "~/utils/types"
|
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 { getProblemTagList } from "~/shared/api"
|
import { getProblemTagList } from "shared/api"
|
||||||
import TextEditor from "~/shared/components/TextEditor.vue"
|
import TextEditor from "shared/components/TextEditor.vue"
|
||||||
import {
|
import {
|
||||||
CODE_TEMPLATES,
|
CODE_TEMPLATES,
|
||||||
LANGUAGE_SHOW_VALUE,
|
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 { unique } from "utils/functions"
|
||||||
import { BlankProblem, LANGUAGE, Tag } from "~/utils/types"
|
import { BlankProblem, LANGUAGE, Tag } from "utils/types"
|
||||||
import {
|
import {
|
||||||
createContestProblem,
|
createContestProblem,
|
||||||
createProblem,
|
createProblem,
|
||||||
@@ -19,7 +19,7 @@ import {
|
|||||||
} from "../api"
|
} from "../api"
|
||||||
|
|
||||||
const CodeEditor = defineAsyncComponent(
|
const CodeEditor = defineAsyncComponent(
|
||||||
() => import("~/shared/components/CodeEditor.vue"),
|
() => import("shared/components/CodeEditor.vue"),
|
||||||
)
|
)
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NSwitch } from "naive-ui"
|
import { NSwitch } from "naive-ui"
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
import Pagination from "shared/components/Pagination.vue"
|
||||||
import { usePagination } from "~/shared/composables/pagination"
|
import { usePagination } from "shared/composables/pagination"
|
||||||
import { parseTime } from "~/utils/functions"
|
import { parseTime } from "utils/functions"
|
||||||
import { AdminProblemFiltered } from "~/utils/types"
|
import { AdminProblemFiltered } from "utils/types"
|
||||||
import { getProblemList, toggleProblemVisible } from "../api"
|
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"
|
||||||
import { useRouteQuery } from "@vueuse/router"
|
import { useRouteQuery } from "@vueuse/router"
|
||||||
import AuthorSelect from "~/shared/components/AuthorSelect.vue"
|
import AuthorSelect from "shared/components/AuthorSelect.vue"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
contestID?: string
|
contestID?: string
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<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 { parseTime } from "utils/functions"
|
||||||
import { Server } from "~/utils/types"
|
import { Server } from "utils/types"
|
||||||
import {
|
import {
|
||||||
deleteJudgeServer,
|
deleteJudgeServer,
|
||||||
editWebsite,
|
editWebsite,
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NButton } from "naive-ui"
|
import { NButton } from "naive-ui"
|
||||||
import { getRank } from "oj/api"
|
import { getRank } from "oj/api"
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
import Pagination from "shared/components/Pagination.vue"
|
||||||
import { useUserStore } from "~/shared/store/user"
|
import { useUserStore } from "shared/store/user"
|
||||||
import { getACRate } from "~/utils/functions"
|
import { getACRate } from "utils/functions"
|
||||||
import { Rank } from "~/utils/types"
|
import { Rank } from "utils/types"
|
||||||
import { getBaseInfo, randomUser10 } from "../api"
|
import { getBaseInfo, randomUser10 } from "../api"
|
||||||
|
|
||||||
const userCount = ref(0)
|
const userCount = ref(0)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { deleteTutorial } from "~/admin/api"
|
import { deleteTutorial } from "admin/api"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
tutorialID: number
|
tutorialID: number
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import CodeEditor from "~/shared/components/CodeEditor.vue"
|
import CodeEditor from "shared/components/CodeEditor.vue"
|
||||||
import MarkdownEditor from "~/shared/components/MarkdownEditor.vue"
|
import MarkdownEditor from "shared/components/MarkdownEditor.vue"
|
||||||
import { Tutorial } from "~/utils/types"
|
import { Tutorial } from "utils/types"
|
||||||
import { createTutorial, getTutorial, updateTutorial } from "../api"
|
import { createTutorial, getTutorial, updateTutorial } from "../api"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NSwitch } from "naive-ui"
|
import { NSwitch } from "naive-ui"
|
||||||
import { parseTime } from "~/utils/functions"
|
import { parseTime } from "utils/functions"
|
||||||
import { Tutorial } from "~/utils/types"
|
import { Tutorial } from "utils/types"
|
||||||
import { getTutorialList, setTutorialVisibility } from "../api"
|
import { getTutorialList, setTutorialVisibility } from "../api"
|
||||||
import Actions from "./components/Actions.vue"
|
import Actions from "./components/Actions.vue"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { editUser } from "~/admin/api"
|
import { editUser } from "admin/api"
|
||||||
import { User } from "~/utils/types"
|
import { User } from "utils/types"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
user: User
|
user: User
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PROBLEM_PERMISSION, USER_TYPE } from "~/utils/constants"
|
import { PROBLEM_PERMISSION, USER_TYPE } from "utils/constants"
|
||||||
import { getUserRole } from "~/utils/functions"
|
import { getUserRole } from "utils/functions"
|
||||||
import { User } from "~/utils/types"
|
import { User } from "utils/types"
|
||||||
import TextCopy from "~/shared/components/TextCopy.vue"
|
import TextCopy from "shared/components/TextCopy.vue"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
user: User
|
user: User
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { DataTableRowKey, SelectOption } from "naive-ui"
|
import { DataTableRowKey, SelectOption } from "naive-ui"
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
import Pagination from "shared/components/Pagination.vue"
|
||||||
import { usePagination } from "~/shared/composables/pagination"
|
import { usePagination } from "shared/composables/pagination"
|
||||||
import { parseTime } from "~/utils/functions"
|
import { parseTime } from "utils/functions"
|
||||||
import { User } from "~/utils/types"
|
import { User } from "utils/types"
|
||||||
import {
|
import {
|
||||||
deleteUsers,
|
deleteUsers,
|
||||||
editUser,
|
editUser,
|
||||||
@@ -13,9 +13,9 @@ import {
|
|||||||
} from "../api"
|
} 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"
|
||||||
import { PROBLEM_PERMISSION, USER_TYPE } from "~/utils/constants"
|
import { PROBLEM_PERMISSION, USER_TYPE } from "utils/constants"
|
||||||
import { useRouteQuery } from "@vueuse/router"
|
import { useRouteQuery } from "@vueuse/router"
|
||||||
import TextCopy from "~/shared/components/TextCopy.vue"
|
import TextCopy from "shared/components/TextCopy.vue"
|
||||||
|
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
</n-grid>
|
</n-grid>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
import { isDesktop } from "shared/composables/breakpoints"
|
||||||
import { formatISO, sub, type Duration } from "date-fns"
|
import { formatISO, sub, type Duration } from "date-fns"
|
||||||
import WeeklyChart from "./components/WeeklyChart.vue"
|
import WeeklyChart from "./components/WeeklyChart.vue"
|
||||||
import Details from "./components/Details.vue"
|
import Details from "./components/Details.vue"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
</n-spin>
|
</n-spin>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useAIStore } from "~/oj/store/ai"
|
import { useAIStore } from "oj/store/ai"
|
||||||
import { MdPreview } from "md-editor-v3"
|
import { MdPreview } from "md-editor-v3"
|
||||||
import "md-editor-v3/lib/preview.css"
|
import "md-editor-v3/lib/preview.css"
|
||||||
|
|
||||||
|
|||||||
@@ -47,10 +47,10 @@ import TagsChart from "./TagsChart.vue"
|
|||||||
import DifficultyChart from "./DifficultyChart.vue"
|
import DifficultyChart from "./DifficultyChart.vue"
|
||||||
import TagTitle from "./TagTitle.vue"
|
import TagTitle from "./TagTitle.vue"
|
||||||
import AI from "./AI.vue"
|
import AI from "./AI.vue"
|
||||||
import { parseTime } from "~/utils/functions"
|
import { parseTime } from "utils/functions"
|
||||||
import { SolvedProblem } from "~/utils/types"
|
import { SolvedProblem } from "utils/types"
|
||||||
import { useAIStore } from "~/oj/store/ai"
|
import { useAIStore } from "oj/store/ai"
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
import { isDesktop } from "shared/composables/breakpoints"
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
start: string
|
start: string
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { type HeatmapData } from "naive-ui"
|
import { type HeatmapData } from "naive-ui"
|
||||||
import { getAIHeatmapData } from "~/oj/api"
|
import { getAIHeatmapData } from "oj/api"
|
||||||
|
|
||||||
const data = ref<HeatmapData>([])
|
const data = ref<HeatmapData>([])
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ChartData, ChartOptions, TooltipItem } from "chart.js"
|
import type { ChartData, ChartOptions, TooltipItem } from "chart.js"
|
||||||
import { Chart } from "vue-chartjs"
|
import { Chart } from "vue-chartjs"
|
||||||
import { useAIStore } from "~/oj/store/ai"
|
import { useAIStore } from "oj/store/ai"
|
||||||
import { parseTime } from "~/utils/functions"
|
import { parseTime } from "utils/functions"
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
end: string
|
end: string
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { NTag } from "naive-ui"
|
import { NTag } from "naive-ui"
|
||||||
import { getAnnouncement, getAnnouncementList } from "~/oj/api"
|
import { getAnnouncement, getAnnouncementList } from "oj/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 { parseTime } from "~/utils/functions"
|
import { parseTime } from "utils/functions"
|
||||||
import { renderTableTitle } from "~/utils/renders"
|
import { renderTableTitle } from "utils/renders"
|
||||||
import { Announcement } from "~/utils/types"
|
import { Announcement } from "utils/types"
|
||||||
import TitleWithTag from "./components/TitleWithTag.vue"
|
import TitleWithTag from "./components/TitleWithTag.vue"
|
||||||
|
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { STORAGE_KEY } from "~/utils/constants"
|
import { STORAGE_KEY } from "utils/constants"
|
||||||
import storage from "~/utils/storage"
|
import storage from "utils/storage"
|
||||||
import { Code } from "~/utils/types"
|
import { Code } from "utils/types"
|
||||||
|
|
||||||
export const code = reactive<Code>({
|
export const code = reactive<Code>({
|
||||||
value: "",
|
value: "",
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
import { Problem } from "~/utils/types"
|
import { Problem } from "utils/types"
|
||||||
|
|
||||||
export const problem = ref<Problem | null>(null)
|
export const problem = ref<Problem | null>(null)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ContestRank } from "~/utils/types"
|
import { ContestRank } from "utils/types"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
rank: ContestRank
|
rank: ContestRank
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { Icon } from "@iconify/vue"
|
import { Icon } from "@iconify/vue"
|
||||||
import { useContestStore } from "oj/store/contest"
|
import { useContestStore } from "oj/store/contest"
|
||||||
import { parseTime } from "utils/functions"
|
import { parseTime } from "utils/functions"
|
||||||
import ContestType from "~/shared/components/ContestType.vue"
|
import ContestType from "shared/components/ContestType.vue"
|
||||||
|
|
||||||
const contestStore = useContestStore()
|
const contestStore = useContestStore()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useContestStore } from "oj/store/contest"
|
import { useContestStore } from "oj/store/contest"
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
import { isDesktop } from "shared/composables/breakpoints"
|
||||||
import { ContestStatus } from "~/utils/constants"
|
import { ContestStatus } from "utils/constants"
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Icon } from "@iconify/vue"
|
import { Icon } from "@iconify/vue"
|
||||||
import { CONTEST_STATUS, ContestStatus } from "utils/constants"
|
import { CONTEST_STATUS, ContestStatus } 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"
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ import { NTag } from "naive-ui"
|
|||||||
import { getContestList } from "oj/api"
|
import { getContestList } from "oj/api"
|
||||||
import { duration, parseTime } from "utils/functions"
|
import { duration, parseTime } from "utils/functions"
|
||||||
import { Contest } from "utils/types"
|
import { Contest } from "utils/types"
|
||||||
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 { toggleLogin } from "~/shared/composables/modal"
|
import { toggleLogin } from "shared/composables/modal"
|
||||||
import { usePagination } from "~/shared/composables/pagination"
|
import { usePagination } from "shared/composables/pagination"
|
||||||
import { useUserStore } from "~/shared/store/user"
|
import { useUserStore } from "shared/store/user"
|
||||||
import { CONTEST_STATUS, ContestType } from "~/utils/constants"
|
import { CONTEST_STATUS, ContestType } from "utils/constants"
|
||||||
import { renderTableTitle } from "~/utils/renders"
|
import { renderTableTitle } from "utils/renders"
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ProblemFiltered } from "utils/types"
|
import { ProblemFiltered } from "utils/types"
|
||||||
import ProblemStatus from "~/oj/problem/components/ProblemStatus.vue"
|
import ProblemStatus from "oj/problem/components/ProblemStatus.vue"
|
||||||
import { useContestStore } from "~/oj/store/contest"
|
import { useContestStore } from "oj/store/contest"
|
||||||
import { renderTableTitle } from "~/utils/renders"
|
import { renderTableTitle } from "utils/renders"
|
||||||
|
|
||||||
const props = defineProps<{ contestID: string }>()
|
const props = defineProps<{ contestID: string }>()
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import { Icon } from "@iconify/vue"
|
|||||||
import { NButton, useThemeVars } from "naive-ui"
|
import { NButton, useThemeVars } from "naive-ui"
|
||||||
import { getContestProblems, getContestRank } from "oj/api"
|
import { getContestProblems, getContestRank } from "oj/api"
|
||||||
import { secondsToDuration } from "utils/functions"
|
import { secondsToDuration } from "utils/functions"
|
||||||
import { useContestStore } from "~/oj/store/contest"
|
import { useContestStore } from "oj/store/contest"
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
import Pagination from "shared/components/Pagination.vue"
|
||||||
import { ContestStatus } from "~/utils/constants"
|
import { ContestStatus } from "utils/constants"
|
||||||
import { renderTableTitle } from "~/utils/renders"
|
import { renderTableTitle } from "utils/renders"
|
||||||
import { ContestRank, ProblemFiltered } from "~/utils/types"
|
import { ContestRank, ProblemFiltered } from "utils/types"
|
||||||
import AcAndSubmission from "../components/AcAndSubmission.vue"
|
import AcAndSubmission from "../components/AcAndSubmission.vue"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -68,11 +68,11 @@ import { Icon } from "@iconify/vue"
|
|||||||
|
|
||||||
import { MdPreview } from "md-editor-v3"
|
import { MdPreview } from "md-editor-v3"
|
||||||
import "md-editor-v3/lib/preview.css"
|
import "md-editor-v3/lib/preview.css"
|
||||||
import { Tutorial } from "~/utils/types"
|
import { Tutorial } from "utils/types"
|
||||||
import { getTutorial, getTutorials } from "../api"
|
import { getTutorial, getTutorials } from "../api"
|
||||||
|
|
||||||
const CodeEditor = defineAsyncComponent(
|
const CodeEditor = defineAsyncComponent(
|
||||||
() => import("~/shared/components/CodeEditor.vue"),
|
() => import("shared/components/CodeEditor.vue"),
|
||||||
)
|
)
|
||||||
|
|
||||||
const isDark = useDark()
|
const isDark = useDark()
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
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 { SOURCES } from "utils/constants"
|
import { SOURCES } from "utils/constants"
|
||||||
import CodeEditor from "~/shared/components/CodeEditor.vue"
|
import CodeEditor from "shared/components/CodeEditor.vue"
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
import { isDesktop } from "shared/composables/breakpoints"
|
||||||
import storage from "~/utils/storage"
|
import storage from "utils/storage"
|
||||||
import { LANGUAGE } from "~/utils/types"
|
import { LANGUAGE } from "utils/types"
|
||||||
import Form from "./Form.vue"
|
import Form from "./Form.vue"
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
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 { SOURCES } from "utils/constants"
|
import { SOURCES } from "utils/constants"
|
||||||
import CodeEditor from "~/shared/components/CodeEditor.vue"
|
import CodeEditor from "shared/components/CodeEditor.vue"
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
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"
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { copyToClipboard } from "~/utils/functions"
|
import { copyToClipboard } from "utils/functions"
|
||||||
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 { injectSyncStatus } from "oj/composables/syncStatus"
|
import { injectSyncStatus } from "oj/composables/syncStatus"
|
||||||
import { SYNC_MESSAGES } from "~/shared/composables/sync"
|
import { SYNC_MESSAGES } from "shared/composables/sync"
|
||||||
import { LANGUAGE_SHOW_VALUE, SOURCES, STORAGE_KEY } from "utils/constants"
|
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 { createTestSubmission } from "~/utils/judge"
|
import { createTestSubmission } from "utils/judge"
|
||||||
import storage from "~/utils/storage"
|
import storage from "utils/storage"
|
||||||
import { LANGUAGE } from "~/utils/types"
|
import { LANGUAGE } from "utils/types"
|
||||||
import Submit from "./Submit.vue"
|
import Submit from "./Submit.vue"
|
||||||
import StatisticsPanel from "~/shared/components/StatisticsPanel.vue"
|
import StatisticsPanel from "shared/components/StatisticsPanel.vue"
|
||||||
import IconButton from "~/shared/components/IconButton.vue"
|
import IconButton from "shared/components/IconButton.vue"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
storageKey: string
|
storageKey: string
|
||||||
|
|||||||
@@ -109,8 +109,8 @@
|
|||||||
import { Icon } from "@iconify/vue"
|
import { Icon } from "@iconify/vue"
|
||||||
import { problem } from "oj/composables/problem"
|
import { problem } from "oj/composables/problem"
|
||||||
import { DIFFICULTY } from "utils/constants"
|
import { DIFFICULTY } from "utils/constants"
|
||||||
import { createComment, getComment, getCommentStatistics } from "~/oj/api"
|
import { createComment, getComment, getCommentStatistics } from "oj/api"
|
||||||
import { useUserStore } from "~/shared/store/user"
|
import { useUserStore } from "shared/store/user"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
showStatistics?: boolean
|
showStatistics?: boolean
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { code } from "oj/composables/code"
|
|||||||
import { problem } from "oj/composables/problem"
|
import { problem } from "oj/composables/problem"
|
||||||
import { createTestSubmission } from "utils/judge"
|
import { createTestSubmission } from "utils/judge"
|
||||||
import { Problem, ProblemStatus } from "utils/types"
|
import { Problem, ProblemStatus } from "utils/types"
|
||||||
import Copy from "~/shared/components/Copy.vue"
|
import Copy from "shared/components/Copy.vue"
|
||||||
|
|
||||||
type Sample = Problem["samples"][number] & {
|
type Sample = Problem["samples"][number] & {
|
||||||
id: number
|
id: number
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ import { code } from "oj/composables/code"
|
|||||||
import { problem } from "oj/composables/problem"
|
import { problem } from "oj/composables/problem"
|
||||||
import { provideSyncStatus } from "oj/composables/syncStatus"
|
import { provideSyncStatus } from "oj/composables/syncStatus"
|
||||||
import { SOURCES } from "utils/constants"
|
import { SOURCES } from "utils/constants"
|
||||||
import SyncCodeEditor from "~/shared/components/SyncCodeEditor.vue"
|
import SyncCodeEditor from "shared/components/SyncCodeEditor.vue"
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
import { isDesktop } from "shared/composables/breakpoints"
|
||||||
import storage from "~/utils/storage"
|
import storage from "utils/storage"
|
||||||
import { LANGUAGE } from "~/utils/types"
|
import { LANGUAGE } from "utils/types"
|
||||||
import Form from "./Form.vue"
|
import Form from "./Form.vue"
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import { problem } from "oj/composables/problem"
|
|||||||
import { DIFFICULTY, JUDGE_STATUS } from "utils/constants"
|
import { DIFFICULTY, JUDGE_STATUS } from "utils/constants"
|
||||||
import { getACRateNumber, getTagColor, parseTime } from "utils/functions"
|
import { getACRateNumber, getTagColor, parseTime } from "utils/functions"
|
||||||
import { Pie } from "vue-chartjs"
|
import { Pie } from "vue-chartjs"
|
||||||
import { getProblemBeatRate } from "~/oj/api"
|
import { getProblemBeatRate } from "oj/api"
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
import { isDesktop } from "shared/composables/breakpoints"
|
||||||
import { registerChart } from "~/utils/registerChart"
|
import { registerChart } from "utils/registerChart"
|
||||||
|
|
||||||
const beatRate = ref("0")
|
const beatRate = ref("0")
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { NButton } from "naive-ui"
|
import { NButton } from "naive-ui"
|
||||||
import { getSubmissions, getRankOfProblem } from "~/oj/api"
|
import { getSubmissions, getRankOfProblem } from "oj/api"
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
import Pagination from "shared/components/Pagination.vue"
|
||||||
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"
|
||||||
import { LANGUAGE_SHOW_VALUE } from "~/utils/constants"
|
import { LANGUAGE_SHOW_VALUE } from "utils/constants"
|
||||||
import { parseTime } from "~/utils/functions"
|
import { parseTime } from "utils/functions"
|
||||||
import { renderTableTitle } from "~/utils/renders"
|
import { renderTableTitle } from "utils/renders"
|
||||||
import { Submission } from "~/utils/types"
|
import { Submission } from "utils/types"
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import { problem } from "oj/composables/problem"
|
|||||||
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 SubmissionResultTag from "~/shared/components/SubmissionResultTag.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"
|
||||||
|
|
||||||
const ProblemComment = defineAsyncComponent(
|
const ProblemComment = defineAsyncComponent(
|
||||||
() => import("./ProblemComment.vue"),
|
() => import("./ProblemComment.vue"),
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getProblem } from "oj/api"
|
import { getProblem } from "oj/api"
|
||||||
import { ScreenMode } from "utils/constants"
|
import { ScreenMode } from "utils/constants"
|
||||||
import { isDesktop, isMobile } from "~/shared/composables/breakpoints"
|
import { isDesktop, isMobile } from "shared/composables/breakpoints"
|
||||||
import {
|
import {
|
||||||
bothAndProblem,
|
bothAndProblem,
|
||||||
resetScreenMode,
|
resetScreenMode,
|
||||||
screenMode,
|
screenMode,
|
||||||
} from "~/shared/composables/switchScreen"
|
} from "shared/composables/switchScreen"
|
||||||
import { problem } from "../composables/problem"
|
import { problem } from "../composables/problem"
|
||||||
|
|
||||||
const ProblemEditor = defineAsyncComponent(
|
const ProblemEditor = defineAsyncComponent(
|
||||||
|
|||||||
@@ -5,15 +5,15 @@ import { useRouteQuery } from "@vueuse/router"
|
|||||||
import { getProblemList, getRandomProblemID } from "oj/api"
|
import { getProblemList, getRandomProblemID } from "oj/api"
|
||||||
import { getTagColor } from "utils/functions"
|
import { getTagColor } from "utils/functions"
|
||||||
import { ProblemFiltered } from "utils/types"
|
import { ProblemFiltered } from "utils/types"
|
||||||
import { getProblemTagList } from "~/shared/api"
|
import { getProblemTagList } from "shared/api"
|
||||||
import Hitokoto from "~/shared/components/Hitokoto.vue"
|
import Hitokoto from "shared/components/Hitokoto.vue"
|
||||||
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 { usePagination } from "~/shared/composables/pagination"
|
import { usePagination } from "shared/composables/pagination"
|
||||||
import { useUserStore } from "~/shared/store/user"
|
import { useUserStore } from "shared/store/user"
|
||||||
import { renderTableTitle } from "~/utils/renders"
|
import { renderTableTitle } from "utils/renders"
|
||||||
import ProblemStatus from "./components/ProblemStatus.vue"
|
import ProblemStatus from "./components/ProblemStatus.vue"
|
||||||
import AuthorSelect from "~/shared/components/AuthorSelect.vue"
|
import AuthorSelect from "shared/components/AuthorSelect.vue"
|
||||||
|
|
||||||
interface Tag {
|
interface Tag {
|
||||||
id: number
|
id: number
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Bar } from "vue-chartjs"
|
import { Bar } from "vue-chartjs"
|
||||||
import { ChartType } from "~/utils/constants"
|
import { ChartType } from "utils/constants"
|
||||||
import { Rank } from "~/utils/types"
|
import { Rank } from "utils/types"
|
||||||
|
|
||||||
const props = defineProps<{ rankData: Rank[]; type: ChartType }>()
|
const props = defineProps<{ rankData: Rank[]; type: ChartType }>()
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import { NButton } from "naive-ui"
|
|||||||
import { getActivityRank, getRank } from "oj/api"
|
import { getActivityRank, getRank } from "oj/api"
|
||||||
import { getACRate } from "utils/functions"
|
import { getACRate } from "utils/functions"
|
||||||
import { Rank } from "utils/types"
|
import { Rank } from "utils/types"
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
import Pagination from "shared/components/Pagination.vue"
|
||||||
import { ChartType } from "~/utils/constants"
|
import { ChartType } from "utils/constants"
|
||||||
import { renderTableTitle } from "~/utils/renders"
|
import { renderTableTitle } from "utils/renders"
|
||||||
import Chart from "./components/Chart.vue"
|
import Chart from "./components/Chart.vue"
|
||||||
import Index from "./components/Index.vue"
|
import Index from "./components/Index.vue"
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { DetailsData, WeeklyData } from "~/utils/types"
|
import { DetailsData, WeeklyData } from "utils/types"
|
||||||
import { consumeJSONEventStream } from "~/utils/stream"
|
import { consumeJSONEventStream } from "utils/stream"
|
||||||
import { getAIDetailData, getAIWeeklyData } from "../api"
|
import { getAIDetailData, getAIWeeklyData } from "../api"
|
||||||
import { getCSRFToken } from "~/utils/functions"
|
import { getCSRFToken } from "utils/functions"
|
||||||
|
|
||||||
export const useAIStore = defineStore("ai", () => {
|
export const useAIStore = defineStore("ai", () => {
|
||||||
const duration = ref("months:6")
|
const duration = ref("months:6")
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { formatISO, getTime, parseISO } from "date-fns"
|
import { formatISO, getTime, parseISO } from "date-fns"
|
||||||
import { useUserStore } from "~/shared/store/user"
|
import { useUserStore } from "shared/store/user"
|
||||||
import { ContestStatus, ContestType } from "~/utils/constants"
|
import { ContestStatus, ContestType } from "utils/constants"
|
||||||
import { duration } from "~/utils/functions"
|
import { duration } from "utils/functions"
|
||||||
import { Contest, Problem } from "~/utils/types"
|
import { Contest, Problem } from "utils/types"
|
||||||
import {
|
import {
|
||||||
checkContestPassword,
|
checkContestPassword,
|
||||||
getContest,
|
getContest,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Icon } from "@iconify/vue"
|
import { Icon } from "@iconify/vue"
|
||||||
import { SubmissionListItem } from "~/utils/types"
|
import { SubmissionListItem } from "utils/types"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
submission: SubmissionListItem
|
submission: SubmissionListItem
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import {
|
|||||||
copyToClipboard,
|
copyToClipboard,
|
||||||
} from "utils/functions"
|
} from "utils/functions"
|
||||||
import { Submission } from "utils/types"
|
import { Submission } from "utils/types"
|
||||||
import SubmissionResultTag from "~/shared/components/SubmissionResultTag.vue"
|
import SubmissionResultTag from "shared/components/SubmissionResultTag.vue"
|
||||||
import { isDesktop, isMobile } from "~/shared/composables/breakpoints"
|
import { isDesktop, isMobile } from "shared/composables/breakpoints"
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
submissionID: string
|
submissionID: string
|
||||||
|
|||||||
@@ -4,18 +4,18 @@ import { useRouteQuery } from "@vueuse/router"
|
|||||||
import { adminRejudge, getSubmissions, getTodaySubmissionCount } from "oj/api"
|
import { adminRejudge, getSubmissions, getTodaySubmissionCount } from "oj/api"
|
||||||
import { parseTime } from "utils/functions"
|
import { parseTime } from "utils/functions"
|
||||||
import { LANGUAGE, SubmissionListItem } from "utils/types"
|
import { LANGUAGE, SubmissionListItem } from "utils/types"
|
||||||
import Pagination from "~/shared/components/Pagination.vue"
|
import Pagination from "shared/components/Pagination.vue"
|
||||||
import SubmissionResultTag from "~/shared/components/SubmissionResultTag.vue"
|
import SubmissionResultTag from "shared/components/SubmissionResultTag.vue"
|
||||||
import { isDesktop, isMobile } from "~/shared/composables/breakpoints"
|
import { isDesktop, isMobile } from "shared/composables/breakpoints"
|
||||||
import { usePagination } from "~/shared/composables/pagination"
|
import { usePagination } from "shared/composables/pagination"
|
||||||
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 { renderTableTitle } from "utils/renders"
|
||||||
import ButtonWithSearch from "./components/ButtonWithSearch.vue"
|
import ButtonWithSearch from "./components/ButtonWithSearch.vue"
|
||||||
import StatisticsPanel from "~/shared/components/StatisticsPanel.vue"
|
import StatisticsPanel from "shared/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 IconButton from "~/shared/components/IconButton.vue"
|
import IconButton from "shared/components/IconButton.vue"
|
||||||
|
|
||||||
interface SubmissionQuery {
|
interface SubmissionQuery {
|
||||||
username: string
|
username: string
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Icon } from "@iconify/vue"
|
import { Icon } from "@iconify/vue"
|
||||||
import { NH2, NH3 } from "naive-ui"
|
import { NH2, NH3 } from "naive-ui"
|
||||||
import { getProfile } from "~/shared/api"
|
import { getProfile } from "shared/api"
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
import { isDesktop } from "shared/composables/breakpoints"
|
||||||
import { durationToDays, parseTime } from "~/utils/functions"
|
import { durationToDays, parseTime } from "utils/functions"
|
||||||
import { Profile } from "~/utils/types"
|
import { Profile } from "utils/types"
|
||||||
import { getMetrics } from "../api"
|
import { getMetrics } from "../api"
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|||||||
@@ -45,10 +45,10 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { getMessageList } from "oj/api"
|
import { getMessageList } from "oj/api"
|
||||||
import { JUDGE_STATUS, LANGUAGE_FORMAT_VALUE } from "utils/constants"
|
import { JUDGE_STATUS, LANGUAGE_FORMAT_VALUE } from "utils/constants"
|
||||||
import Copy from "~/shared/components/Copy.vue"
|
import Copy from "shared/components/Copy.vue"
|
||||||
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 { Message } from "~/utils/types"
|
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 { updateProfile, uploadAvatar } from "oj/api"
|
import { updateProfile, uploadAvatar } from "oj/api"
|
||||||
import { useUserStore } from "~/shared/store/user"
|
import { useUserStore } from "shared/store/user"
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { registerChart } from "./utils/registerChart"
|
|||||||
|
|
||||||
export const ojs: RouteRecordRaw = {
|
export const ojs: RouteRecordRaw = {
|
||||||
path: "/",
|
path: "/",
|
||||||
component: () => import("~/shared/layout/default.vue"),
|
component: () => import("shared/layout/default.vue"),
|
||||||
children: [
|
children: [
|
||||||
{ path: "", component: () => import("oj/problem/list.vue") },
|
{ path: "", component: () => import("oj/problem/list.vue") },
|
||||||
{
|
{
|
||||||
@@ -104,12 +104,12 @@ export const ojs: RouteRecordRaw = {
|
|||||||
|
|
||||||
export const admins: RouteRecordRaw = {
|
export const admins: RouteRecordRaw = {
|
||||||
path: "/admin",
|
path: "/admin",
|
||||||
component: () => import("~/shared/layout/admin.vue"),
|
component: () => import("shared/layout/admin.vue"),
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: "",
|
path: "",
|
||||||
name: "admin home",
|
name: "admin home",
|
||||||
component: () => import("~/admin/setting/home.vue"),
|
component: () => import("admin/setting/home.vue"),
|
||||||
meta: { requiresSuperAdmin: true },
|
meta: { requiresSuperAdmin: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -127,7 +127,7 @@ export const admins: RouteRecordRaw = {
|
|||||||
{
|
{
|
||||||
path: "user/generate",
|
path: "user/generate",
|
||||||
name: "admin user generate",
|
name: "admin user generate",
|
||||||
component: () => import("~/admin/user/generate.vue"),
|
component: () => import("admin/user/generate.vue"),
|
||||||
meta: { requiresSuperAdmin: true },
|
meta: { requiresSuperAdmin: true },
|
||||||
},
|
},
|
||||||
// admin和super_admin都可以访问的路由 (需要题目权限)
|
// admin和super_admin都可以访问的路由 (需要题目权限)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import http from "utils/http"
|
import http from "utils/http"
|
||||||
import { Profile, Tag } from "~/utils/types"
|
import { Profile, Tag } from "utils/types"
|
||||||
|
|
||||||
export function login(data: { username: string; password: string }) {
|
export function login(data: { username: string; password: string }) {
|
||||||
return http.post("login", data)
|
return http.post("login", data)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getAuthors } from "~/oj/api"
|
import { getAuthors } from "oj/api"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
all?: boolean
|
all?: boolean
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { python } from "@codemirror/lang-python"
|
|||||||
import { EditorView } from "@codemirror/view"
|
import { EditorView } from "@codemirror/view"
|
||||||
import { Codemirror } from "vue-codemirror"
|
import { Codemirror } from "vue-codemirror"
|
||||||
import type { Extension } from "@codemirror/state"
|
import type { Extension } from "@codemirror/state"
|
||||||
import { LANGUAGE } from "~/utils/types"
|
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"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ContestType } from "~/utils/constants"
|
import { ContestType } from "utils/constants"
|
||||||
import { Contest } from "~/utils/types"
|
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 { Icon } from "@iconify/vue"
|
import { Icon } from "@iconify/vue"
|
||||||
import { copyToClipboard } from "~/utils/functions"
|
import { copyToClipboard } from "utils/functions"
|
||||||
|
|
||||||
defineProps<{ value: string }>()
|
defineProps<{ value: string }>()
|
||||||
const [copied, toggle] = useToggle()
|
const [copied, toggle] = useToggle()
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Icon } from "@iconify/vue"
|
import { Icon } from "@iconify/vue"
|
||||||
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 { toggleLogin, toggleSignup } from "shared/composables/modal"
|
||||||
import { screenMode, switchScreenMode } from "~/shared/composables/switchScreen"
|
import { screenMode, switchScreenMode } from "shared/composables/switchScreen"
|
||||||
import { avatar } from "~/utils/constants"
|
import { avatar } from "utils/constants"
|
||||||
import { logout } from "../api"
|
import { logout } from "../api"
|
||||||
import { useConfigStore } from "../store/config"
|
import { useConfigStore } from "../store/config"
|
||||||
import { useUserStore } from "../store/user"
|
import { useUserStore } from "../store/user"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
import { isDesktop } from "shared/composables/breakpoints"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
total: number
|
total: number
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { python } from "@codemirror/lang-python"
|
|||||||
import { EditorView } from "@codemirror/view"
|
import { EditorView } from "@codemirror/view"
|
||||||
import { Codemirror } from "vue-codemirror"
|
import { Codemirror } from "vue-codemirror"
|
||||||
import type { Extension } from "@codemirror/state"
|
import type { Extension } from "@codemirror/state"
|
||||||
import { LANGUAGE } from "~/utils/types"
|
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 { useCodeSync, SYNC_ERROR_CODES } from "../composables/sync"
|
import { useCodeSync, SYNC_ERROR_CODES } from "../composables/sync"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</n-tooltip>
|
</n-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { copyToClipboard } from "~/utils/functions"
|
import { copyToClipboard } from "utils/functions"
|
||||||
|
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { filterEmptyValue } from "~/utils/functions"
|
import { filterEmptyValue } from "utils/functions"
|
||||||
|
|
||||||
export interface PaginationQuery {
|
export interface PaginationQuery {
|
||||||
page: number
|
page: number
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ScreenMode } from "~/utils/constants"
|
import { ScreenMode } from "utils/constants"
|
||||||
|
|
||||||
export const { state: screenMode, next: switchScreenMode } = useCycleList(
|
export const { state: screenMode, next: switchScreenMode } = useCycleList(
|
||||||
Object.values(ScreenMode),
|
Object.values(ScreenMode),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { RouterLink } from "vue-router"
|
import { RouterLink } from "vue-router"
|
||||||
import { STORAGE_KEY } from "~/utils/constants"
|
import { STORAGE_KEY } from "utils/constants"
|
||||||
import storage from "~/utils/storage"
|
import storage from "utils/storage"
|
||||||
import { useUserStore } from "../store/user"
|
import { useUserStore } from "../store/user"
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { getWebsiteConfig } from "~/oj/api"
|
import { getWebsiteConfig } from "oj/api"
|
||||||
import { WebsiteConfig } from "~/utils/types"
|
import { WebsiteConfig } from "utils/types"
|
||||||
|
|
||||||
export const useConfigStore = defineStore("config", () => {
|
export const useConfigStore = defineStore("config", () => {
|
||||||
const config = ref<WebsiteConfig>({
|
const config = ref<WebsiteConfig>({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { PROBLEM_PERMISSION, STORAGE_KEY, USER_TYPE } from "utils/constants"
|
import { PROBLEM_PERMISSION, STORAGE_KEY, USER_TYPE } from "utils/constants"
|
||||||
import storage from "utils/storage"
|
import storage from "utils/storage"
|
||||||
import { Profile, User } from "~/utils/types"
|
import { Profile, User } from "utils/types"
|
||||||
import { getProfile } from "../api"
|
import { getProfile } from "../api"
|
||||||
import { useConfigStore } from "./config"
|
import { useConfigStore } from "./config"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useUserStore } from "~/shared/store/user"
|
import { useUserStore } from "shared/store/user"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 权限检查工具函数
|
* 权限检查工具函数
|
||||||
|
|||||||
@@ -13,13 +13,13 @@
|
|||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"~/*": ["./src/*"],
|
"shared/*": ["./src/shared/*"],
|
||||||
"utils/*": ["./src/utils/*"],
|
"utils/*": ["./src/utils/*"],
|
||||||
"oj/*": ["./src/oj/*"],
|
"oj/*": ["./src/oj/*"],
|
||||||
"admin/*": ["./src/admin/*"],
|
"admin/*": ["./src/admin/*"],
|
||||||
},
|
},
|
||||||
"types": ["naive-ui/volar"]
|
"types": ["naive-ui/volar"]
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
|
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.vue"],
|
||||||
"references": [{ "path": "./tsconfig.node.json" }]
|
"references": [{ "path": "./tsconfig.node.json" }]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user