This commit is contained in:
2023-01-13 22:11:28 +08:00
parent 46fcccda35
commit d45783334d
41 changed files with 544 additions and 256 deletions

View File

@@ -1,11 +1,11 @@
<script lang="ts" setup>
import { LANGUAGE_LABEL, SOURCES } from "../../../utils/constants"
import { Problem } from "../../../utils/types"
import { useCodeStore } from "../../store/code"
import { submissionExists } from "../../api"
import { SOURCES } from "utils/constants"
import { Problem } from "utils/types"
import Monaco from "~/shared/Monaco/index.vue"
import { useCodeStore } from "oj/store/code"
import { submissionExists } from "oj/api"
import { TabsPaneContext } from "element-plus"
import Monaco from "../../../shared/Monaco/index.vue"
import SubmitPanel from "./SubmitPanel.vue"
import TestcasePanel from "./TestcasePanel.vue"
@@ -54,12 +54,9 @@ function onTab(pane: TabsPaneContext) {
<el-form inline>
<el-form-item label="语言" label-width="60">
<el-select v-model="code.language" class="language">
<el-option
v-for="item in problem.languages"
:key="item"
:value="item"
:label="LANGUAGE_LABEL[item]"
>
<el-option v-for="item in problem.languages" :key="item" :value="item">
<img class="logo" :src="`/${item}.svg`" alt="logo" />&nbsp;&nbsp;
<span>{{ item }}</span>
</el-option>
</el-select>
</el-form-item>
@@ -82,10 +79,14 @@ function onTab(pane: TabsPaneContext) {
<style scoped>
.language {
width: 100px;
width: 110px;
}
.editor {
min-height: 200px;
}
.logo {
width: 12px;
}
</style>

View File

@@ -1,9 +1,9 @@
<script setup lang="ts">
import { Problem } from "../../../utils/types"
import { Flag, CloseBold, Select } from "@element-plus/icons-vue"
import { useCodeStore } from "../../store/code"
import { SOURCES } from "../../../utils/constants"
import { createTestSubmission } from "../../../utils/judge"
import { useCodeStore } from "oj/store/code"
import { SOURCES } from "utils/constants"
import { Problem } from "utils/types"
import { createTestSubmission } from "utils/judge"
interface Props {
problem: Problem

View File

@@ -1,8 +1,8 @@
<script setup lang="ts">
import { DIFFICULTY } from "../../../utils/constants"
import { getACRate, getTagColor, parseTime } from "../../../utils/functions"
import { isDesktop } from "../../../utils/breakpoints"
import { Problem } from "../../../utils/types"
import { DIFFICULTY } from "utils/constants"
import { getACRate, getTagColor, parseTime } from "utils/functions"
import { isDesktop } from "utils/breakpoints"
import { Problem } from "utils/types"
interface Props {
problem: Problem

View File

@@ -0,0 +1,18 @@
<script setup lang="ts">
import Pagination from "~/shared/Pagination/index.vue"
const query = reactive({
page: 1,
limit: 10,
})
const total = ref(100)
</script>
<template>
<el-table max-height="calc(100vh - 171px)"></el-table>
<Pagination
:total="total"
v-model:limit="query.limit"
v-model:page="query.page"
/>
</template>
<style scoped></style>

View File

@@ -1,20 +1,13 @@
<script setup lang="ts">
import party from "party-js"
import { Ref } from "vue"
import {
SOURCES,
JUDGE_STATUS,
SubmissionStatus,
} from "../../../utils/constants"
import {
submissionMemoryFormat,
submissionTimeFormat,
} from "../../../utils/functions"
import { Problem, Submission, SubmitCodePayload } from "../../../utils/types"
import { getSubmission, submitCode } from "../../api"
import { SOURCES, JUDGE_STATUS, SubmissionStatus } from "utils/constants"
import { submissionMemoryFormat, submissionTimeFormat } from "utils/functions"
import { Problem, Submission, SubmitCodePayload } from "utils/types"
import { getSubmission, submitCode } from "oj/api"
import { useCodeStore } from "oj/store/code"
import SubmissionResultTag from "../../components/SubmissionResultTag.vue"
import { useCodeStore } from "../../store/code"
const problem = inject<Ref<Problem>>("problem")
const { code } = useCodeStore()
@@ -198,7 +191,12 @@ defineExpose({ submit })
<el-scrollbar v-if="msg" height="354" class="result" noresize>
<div>{{ msg }}</div>
</el-scrollbar>
<el-table v-if="infoTable.length" height="354" :data="infoTable" stripe>
<el-table
v-if="infoTable.length"
max-height="354"
:data="infoTable"
stripe
>
<el-table-column prop="test_case" label="测试用例" align="center" />
<el-table-column label="测试状态" width="120" align="center">
<template #default="scope">

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import { createTestSubmission } from "../../../utils/judge"
import { useCodeStore } from "../../store/code"
import { createTestSubmission } from "utils/judge"
import { useCodeStore } from "oj/store/code"
const input = ref("")
const result = ref("")