change to vite8
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import TextEditor from "shared/components/TextEditor.vue"
|
||||
import { AnnouncementEdit } from "utils/types"
|
||||
import type { AnnouncementEdit } from "utils/types"
|
||||
import { createAnnouncement, editAnnouncement, getAnnouncement } from "../api"
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { NSwitch } from "naive-ui"
|
||||
import Pagination from "shared/components/Pagination.vue"
|
||||
import { parseTime } from "utils/functions"
|
||||
import { Announcement } from "utils/types"
|
||||
import type { Announcement } from "utils/types"
|
||||
import { editAnnouncement, getAnnouncementList } from "../api"
|
||||
import Actions from "./components/Actions.vue"
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
import { NButton } from "naive-ui"
|
||||
import Pagination from "shared/components/Pagination.vue"
|
||||
import { parseTime } from "utils/functions"
|
||||
import { Comment } from "utils/types"
|
||||
import type { Comment } from "utils/types"
|
||||
import { getCommentList } from "../api"
|
||||
import CommentActions from "./components/CommentActions.vue"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { Contest } from "utils/types"
|
||||
import type { Contest } from "utils/types"
|
||||
import { cloneContest } from "../../api"
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { h } from "vue"
|
||||
import { ProblemSetBadge } from "utils/types"
|
||||
import type { ProblemSetBadge } from "utils/types"
|
||||
import { NButton, NImage } from "naive-ui"
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ProblemSetBadge } from "utils/types"
|
||||
import type { ProblemSetBadge } from "utils/types"
|
||||
|
||||
interface Props {
|
||||
show: boolean
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ProblemSetProblem } from "utils/types"
|
||||
import type { ProblemSetProblem } from "utils/types"
|
||||
|
||||
interface Props {
|
||||
show: boolean
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { h } from "vue"
|
||||
import { NDataTable, NButton, NFlex } from "naive-ui"
|
||||
import { ProblemSetProblem } from "utils/types"
|
||||
import type { ProblemSetProblem } from "utils/types"
|
||||
|
||||
interface Props {
|
||||
problems: ProblemSetProblem[]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { parseTime } from "utils/functions"
|
||||
import { ProblemSet } from "utils/types"
|
||||
import type { ProblemSet } from "utils/types"
|
||||
|
||||
interface Props {
|
||||
problemSet: ProblemSet
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { h } from "vue"
|
||||
import { NDataTable, NButton, NFlex } from "naive-ui"
|
||||
import { parseTime } from "utils/functions"
|
||||
import { ProblemSetProgress } from "utils/types"
|
||||
import type { ProblemSetProgress } from "utils/types"
|
||||
|
||||
interface Props {
|
||||
progress: ProblemSetProgress[]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { NTabPane, NTabs, NButton, NFlex } from "naive-ui"
|
||||
import {
|
||||
import type {
|
||||
ProblemSet,
|
||||
ProblemSetProblem,
|
||||
ProblemSetBadge,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { CreateProblemSetData, EditProblemSetData } from "utils/types"
|
||||
import type { CreateProblemSetData, EditProblemSetData } from "utils/types"
|
||||
import { getProblemSetDetail, createProblemSet, editProblemSet } from "../api"
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { NButton, NTag } from "naive-ui"
|
||||
import { parseTime } from "utils/functions"
|
||||
import { Server } from "utils/types"
|
||||
import type { Server } from "utils/types"
|
||||
import { useConfigStore } from "shared/store/config"
|
||||
import { useConfigWebSocket } from "shared/composables/websocket"
|
||||
import {
|
||||
|
||||
@@ -6,7 +6,7 @@ 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 type { Rank } from "utils/types"
|
||||
import { getBaseInfo, randomUser10 } from "../api"
|
||||
|
||||
const userCount = ref(0)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
import type {
|
||||
Exercise,
|
||||
ExerciseType,
|
||||
ExerciseMcqData,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import CodeEditor from "shared/components/CodeEditor.vue"
|
||||
import MarkdownEditor from "shared/components/MarkdownEditor.vue"
|
||||
import { Tutorial } from "utils/types"
|
||||
import type { Tutorial } from "utils/types"
|
||||
import { createTutorial, getTutorial, updateTutorial } from "../api"
|
||||
import ExerciseManager from "./components/ExerciseManager.vue"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { NSwitch } from "naive-ui"
|
||||
import { parseTime } from "utils/functions"
|
||||
import { Tutorial } from "utils/types"
|
||||
import type { Tutorial } from "utils/types"
|
||||
import { getTutorialList, setTutorialVisibility } from "../api"
|
||||
import Actions from "./components/Actions.vue"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { PROBLEM_PERMISSION, USER_TYPE } from "utils/constants"
|
||||
import { getUserRole } from "utils/functions"
|
||||
import { User } from "utils/types"
|
||||
import type { User } from "utils/types"
|
||||
import TextCopy from "shared/components/TextCopy.vue"
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { DataTableRowKey, SelectOption } from "naive-ui"
|
||||
import Pagination from "shared/components/Pagination.vue"
|
||||
import { usePagination } from "shared/composables/pagination"
|
||||
import { parseTime } from "utils/functions"
|
||||
import { User } from "utils/types"
|
||||
import type { User } from "utils/types"
|
||||
import {
|
||||
deleteUsers,
|
||||
editUser,
|
||||
|
||||
10
src/env.d.ts
vendored
10
src/env.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
/// <reference types="@rsbuild/core/types" />
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly PUBLIC_ENV: string
|
||||
@@ -14,11 +14,3 @@ interface ImportMetaEnv {
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv
|
||||
}
|
||||
|
||||
interface Document {
|
||||
startViewTransition?: (callback: () => void | Promise<void>) => {
|
||||
ready: Promise<void>
|
||||
finished: Promise<void>
|
||||
updateCallbackDone: Promise<void>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { NButton, NTooltip } from "naive-ui"
|
||||
import TagTitle from "./TagTitle.vue"
|
||||
import { FlowchartSummary, SolvedProblem } from "utils/types"
|
||||
import type { FlowchartSummary, SolvedProblem } from "utils/types"
|
||||
import { useAIStore } from "oj/store/ai"
|
||||
import { useBreakpoints } from "shared/composables/breakpoints"
|
||||
import { parseTime } from "utils/functions"
|
||||
|
||||
@@ -5,7 +5,7 @@ import Pagination from "shared/components/Pagination.vue"
|
||||
import { useBreakpoints } from "shared/composables/breakpoints"
|
||||
import { parseTime } from "utils/functions"
|
||||
import { renderTableTitle } from "utils/renders"
|
||||
import { Announcement } from "utils/types"
|
||||
import type { Announcement } from "utils/types"
|
||||
import TitleWithTag from "./components/TitleWithTag.vue"
|
||||
|
||||
const total = ref(0)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ContestRank } from "utils/types"
|
||||
import type { ContestRank } from "utils/types"
|
||||
|
||||
interface Props {
|
||||
rank: ContestRank
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
Tooltip,
|
||||
Legend,
|
||||
} from "chart.js"
|
||||
import { ContestRank } from "utils/types"
|
||||
import type { ContestRank } from "utils/types"
|
||||
|
||||
ChartJS.register(
|
||||
CategoryScale,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ProblemFiltered } from "utils/types"
|
||||
import type { ProblemFiltered } from "utils/types"
|
||||
import ProblemStatus from "oj/problem/components/ProblemStatus.vue"
|
||||
import { useContestStore } from "oj/store/contest"
|
||||
import { renderTableTitle } from "utils/renders"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Exercise, ExerciseDebugData } from "utils/types"
|
||||
import type { Exercise, ExerciseDebugData } from "utils/types"
|
||||
import { highlightLines } from "../composables/useCodeHighlight"
|
||||
import "./exercise-highlight.css"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Exercise, ExerciseGroupData } from "utils/types"
|
||||
import type { Exercise, ExerciseGroupData } from "utils/types"
|
||||
|
||||
const props = defineProps<{ exercise: Exercise; lang?: string }>()
|
||||
const data = computed(() => props.exercise.data as ExerciseGroupData)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Exercise, ExerciseMatchData } from "utils/types"
|
||||
import type { Exercise, ExerciseMatchData } from "utils/types"
|
||||
|
||||
const props = defineProps<{ exercise: Exercise; lang?: string }>()
|
||||
const data = computed(() => props.exercise.data as ExerciseMatchData)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Exercise, ExerciseMcqData } from "utils/types"
|
||||
import type { Exercise, ExerciseMcqData } from "utils/types"
|
||||
|
||||
const props = defineProps<{ exercise: Exercise }>()
|
||||
const data = computed(() => props.exercise.data as ExerciseMcqData)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Exercise, ExercisePredictData } from "utils/types"
|
||||
import type { Exercise, ExercisePredictData } from "utils/types"
|
||||
import { highlight } from "../composables/useCodeHighlight"
|
||||
import "./exercise-highlight.css"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import hljs from "highlight.js/lib/core"
|
||||
import python from "highlight.js/lib/languages/python"
|
||||
import c from "highlight.js/lib/languages/c"
|
||||
import { Exercise, ExerciseSortData } from "utils/types"
|
||||
import type { Exercise, ExerciseSortData } from "utils/types"
|
||||
|
||||
hljs.registerLanguage("python", python)
|
||||
hljs.registerLanguage("c", c)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Exercise } from "utils/types"
|
||||
import type { Exercise } from "utils/types"
|
||||
|
||||
const ExerciseMcq = defineAsyncComponent(() => import("./ExerciseMcq.vue"))
|
||||
const ExerciseSort = defineAsyncComponent(() => import("./ExerciseSort.vue"))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Exercise } from "utils/types"
|
||||
import type { Exercise } from "utils/types"
|
||||
|
||||
type Segment =
|
||||
| { type: "md"; content: string }
|
||||
|
||||
@@ -7,7 +7,7 @@ import CodeEditor from "shared/components/CodeEditor.vue"
|
||||
import { useBreakpoints } from "shared/composables/breakpoints"
|
||||
import { provideSyncStatus } from "oj/composables/syncStatus"
|
||||
import storage from "utils/storage"
|
||||
import { LANGUAGE } from "utils/types"
|
||||
import type { LANGUAGE } from "utils/types"
|
||||
import Form from "./Form.vue"
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
import { useBreakpoints } from "shared/composables/breakpoints"
|
||||
import { useUserStore } from "shared/store/user"
|
||||
import storage from "utils/storage"
|
||||
import { LANGUAGE } from "utils/types"
|
||||
import type { LANGUAGE } from "utils/types"
|
||||
import StatisticsPanel from "shared/components/StatisticsPanel.vue"
|
||||
import IconButton from "shared/components/IconButton.vue"
|
||||
import { Icon } from "@iconify/vue"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { Icon } from "@iconify/vue"
|
||||
import { ProblemSet, UserBadge as UserBadgeType } from "utils/types"
|
||||
import type { ProblemSet, UserBadge as UserBadgeType } from "utils/types"
|
||||
import UserBadge from "shared/components/UserBadge.vue"
|
||||
import { useUserStore } from "shared/store/user"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { Icon } from "@iconify/vue"
|
||||
import { ProblemSetProblem } from "utils/types"
|
||||
import type { ProblemSetProblem } from "utils/types"
|
||||
import { DIFFICULTY } from "utils/constants"
|
||||
import { getTagColor } from "utils/functions"
|
||||
import { useBreakpoints } from "shared/composables/breakpoints"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { h, computed, ref, onMounted, watch } from "vue"
|
||||
import { watchDebounced } from "@vueuse/core"
|
||||
import { parseTime } from "utils/functions"
|
||||
import { ProblemSetProgress } from "utils/types"
|
||||
import type { ProblemSetProgress } from "utils/types"
|
||||
import { getProblemSetUserProgress } from "../../api"
|
||||
import { NFlex, NTag } from "naive-ui"
|
||||
import { usePagination } from "shared/composables/pagination"
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
joinProblemSet,
|
||||
getUserBadges,
|
||||
} from "../api"
|
||||
import {
|
||||
import type {
|
||||
ProblemSet,
|
||||
ProblemSetProblem,
|
||||
UserBadge as UserBadgeType,
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
Colors,
|
||||
} from "chart.js"
|
||||
import { ChartType } from "utils/constants"
|
||||
import { Rank } from "utils/types"
|
||||
import type { Rank } from "utils/types"
|
||||
|
||||
// 仅注册柱状图所需的 Chart.js 组件
|
||||
ChartJS.register(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DetailsData, DurationData } from "utils/types"
|
||||
import type { DetailsData, DurationData } from "utils/types"
|
||||
import { consumeJSONEventStream } from "utils/stream"
|
||||
import {
|
||||
getAIDetailData,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { defineStore } from "pinia"
|
||||
import { STORAGE_KEY } from "utils/constants"
|
||||
import storage from "utils/storage"
|
||||
import { Code, LANGUAGE } from "utils/types"
|
||||
import type { Code, LANGUAGE } from "utils/types"
|
||||
|
||||
/**
|
||||
* 代码编辑器状态管理 Store
|
||||
|
||||
@@ -2,7 +2,7 @@ import { formatISO, getTime, parseISO } from "date-fns"
|
||||
import { useUserStore } from "shared/store/user"
|
||||
import { ContestStatus, ContestType } from "utils/constants"
|
||||
import { duration } from "utils/functions"
|
||||
import { Contest, Problem } from "utils/types"
|
||||
import type { Contest, Problem } from "utils/types"
|
||||
import {
|
||||
checkContestPassword,
|
||||
getContest,
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Icon } from "@iconify/vue"
|
||||
import { FlowchartSubmission } from "utils/types"
|
||||
import type { FlowchartSubmission } from "utils/types"
|
||||
import { useMermaid } from "shared/composables/useMermaid"
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</n-text>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { Grade } from "utils/types"
|
||||
import type { Grade } from "utils/types"
|
||||
defineProps<{
|
||||
score: number
|
||||
grade: Grade
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
submissionTimeFormat,
|
||||
utoa,
|
||||
} from "utils/functions"
|
||||
import { Submission } from "utils/types"
|
||||
import type { Submission } from "utils/types"
|
||||
import SubmissionResultTag from "shared/components/SubmissionResultTag.vue"
|
||||
import { useBreakpoints } from "shared/composables/breakpoints"
|
||||
import { useCodeStore } from "oj/store/code"
|
||||
|
||||
@@ -48,7 +48,7 @@ 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"
|
||||
import type { Message } from "utils/types"
|
||||
|
||||
const router = useRouter()
|
||||
const messages = ref<Message[]>([])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import http from "utils/http"
|
||||
import { Profile, Tag } from "utils/types"
|
||||
import type { Profile, Tag } from "utils/types"
|
||||
|
||||
export function login(data: { username: string; password: string }) {
|
||||
return http.post("login", data)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { Icon } from "@iconify/vue"
|
||||
import { ContestType } from "utils/constants"
|
||||
import { Contest } from "utils/types"
|
||||
import type { Contest } from "utils/types"
|
||||
|
||||
defineProps<{ contest: Contest }>()
|
||||
</script>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ContestType } from "utils/constants"
|
||||
import { Contest } from "utils/types"
|
||||
import type { Contest } from "utils/types"
|
||||
|
||||
interface Props {
|
||||
contest: Contest
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { JUDGE_STATUS } from "utils/constants"
|
||||
import { SUBMISSION_RESULT } from "utils/types"
|
||||
import type { SUBMISSION_RESULT } from "utils/types"
|
||||
|
||||
interface Props {
|
||||
result: SUBMISSION_RESULT
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { UserBadge } from "utils/types"
|
||||
import type { UserBadge } from "utils/types"
|
||||
import { parseTime } from "utils/functions"
|
||||
interface Props {
|
||||
badge: UserBadge
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getWebsiteConfig } from "oj/api"
|
||||
import { WebsiteConfig } from "utils/types"
|
||||
import type { WebsiteConfig } from "utils/types"
|
||||
|
||||
export const useConfigStore = defineStore("config", () => {
|
||||
const config = ref<WebsiteConfig>({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { PROBLEM_PERMISSION, STORAGE_KEY, USER_TYPE } from "utils/constants"
|
||||
import storage from "utils/storage"
|
||||
import { Profile, User } from "utils/types"
|
||||
import type { Profile, User } from "utils/types"
|
||||
import { getProfile } from "../api"
|
||||
import { useConfigStore } from "./config"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user