fix.
This commit is contained in:
@@ -71,7 +71,7 @@ const options = {
|
||||
</n-space>
|
||||
</n-descriptions-item>
|
||||
</n-descriptions>
|
||||
<div class="pie">
|
||||
<div class="pie" v-if="problem.submission_number > 0">
|
||||
<Pie :data="data" :options="options" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -8,10 +8,12 @@ import { Problem, Submission, SubmitCodePayload } from "utils/types"
|
||||
import { getSubmission, submitCode } from "oj/api"
|
||||
import SubmissionResultTag from "~/shared/SubmissionResultTag.vue"
|
||||
import type { DataTableColumn } from "naive-ui"
|
||||
import { useUserStore } from "~/shared/store/user"
|
||||
|
||||
const userStore = useUserStore()
|
||||
const route = useRoute()
|
||||
|
||||
const problem = inject<Ref<Problem>>("problem")
|
||||
|
||||
const route = useRoute()
|
||||
const contestID = <string>route.params.contestID ?? ""
|
||||
|
||||
const submissionId = ref("")
|
||||
@@ -60,6 +62,9 @@ const submitting = computed(
|
||||
)
|
||||
|
||||
const submitDisabled = computed(() => {
|
||||
if (!userStore.isAuthed) {
|
||||
return true
|
||||
}
|
||||
const value = code.value
|
||||
if (
|
||||
value.trim() === "" ||
|
||||
@@ -81,6 +86,9 @@ const submitDisabled = computed(() => {
|
||||
})
|
||||
|
||||
const submitLabel = computed(() => {
|
||||
if (!userStore.isAuthed) {
|
||||
return "请先登录"
|
||||
}
|
||||
if (submitting.value) {
|
||||
return "正在提交"
|
||||
}
|
||||
@@ -154,6 +162,9 @@ const columns: DataTableColumn<Submission["info"]["data"][number]>[] = [
|
||||
]
|
||||
|
||||
async function submit() {
|
||||
if (!userStore.isAuthed) {
|
||||
return
|
||||
}
|
||||
const data: SubmitCodePayload = {
|
||||
problem_id: problem!.value.id,
|
||||
language: code.language,
|
||||
|
||||
@@ -41,7 +41,7 @@ provide("problem", readonly(problem))
|
||||
<n-grid v-if="problem" x-gap="16" :cols="2">
|
||||
<n-gi :span="isDesktop ? 1 : 2">
|
||||
<n-scrollbar v-if="isDesktop" style="max-height: calc(100vh - 92px)">
|
||||
<n-tabs default-value="content">
|
||||
<n-tabs default-value="content" type="segment">
|
||||
<n-tab-pane name="content" tab="题目描述">
|
||||
<ProblemContent :problem="problem" />
|
||||
</n-tab-pane>
|
||||
@@ -50,7 +50,7 @@ provide("problem", readonly(problem))
|
||||
</n-tab-pane>
|
||||
</n-tabs>
|
||||
</n-scrollbar>
|
||||
<n-tabs v-else default-value="content">
|
||||
<n-tabs v-else default-value="content" type="segment">
|
||||
<n-tab-pane name="content" tab="题目描述">
|
||||
<ProblemContent :problem="problem" />
|
||||
</n-tab-pane>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { useUserStore } from "~/shared/store/user"
|
||||
import { filterEmptyValue, getTagColor } from "utils/functions"
|
||||
import { ProblemFiltered } from "utils/types"
|
||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
||||
import { isMobile } from "~/shared/composables/breakpoints"
|
||||
import { getProblemList, getRandomProblemID } from "oj/api"
|
||||
import Pagination from "~/shared/Pagination.vue"
|
||||
import { DataTableColumn, NSpace, NTag } from "naive-ui"
|
||||
@@ -169,7 +169,8 @@ function rowProps(row: ProblemFiltered) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-form :inline="isDesktop" label-placement="left">
|
||||
<n-space :vertical="isMobile">
|
||||
<n-form inline label-placement="left">
|
||||
<n-form-item label="难度">
|
||||
<n-select
|
||||
class="select"
|
||||
@@ -178,8 +179,14 @@ function rowProps(row: ProblemFiltered) {
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item>
|
||||
<n-input placeholder="输入编号或标题后回车" clearable @change="search" />
|
||||
<n-input
|
||||
placeholder="输入编号或标题后回车"
|
||||
clearable
|
||||
@change="search"
|
||||
/>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
<n-form inline label-placement="left">
|
||||
<n-form-item>
|
||||
<n-space>
|
||||
<n-button @click="search(query.keyword)">搜索</n-button>
|
||||
@@ -188,6 +195,7 @@ function rowProps(row: ProblemFiltered) {
|
||||
</n-space>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</n-space>
|
||||
<n-space>
|
||||
<div class="tagTitle">标签</div>
|
||||
<n-button
|
||||
|
||||
@@ -5,7 +5,7 @@ import Header from "../Header.vue"
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-layout position="absolute">
|
||||
<n-layout>
|
||||
<n-layout-header bordered class="header">
|
||||
<Header />
|
||||
</n-layout-header>
|
||||
|
||||
Reference in New Issue
Block a user