fix
This commit is contained in:
@@ -1,17 +1,14 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { NButton } from "naive-ui"
|
import { NButton, NFlex, NTooltip } from "naive-ui"
|
||||||
|
import { Icon } from "@iconify/vue"
|
||||||
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 {
|
import { JUDGE_STATUS, LANGUAGE_SHOW_VALUE } from "utils/constants"
|
||||||
JUDGE_STATUS,
|
|
||||||
LANGUAGE_SHOW_VALUE,
|
|
||||||
SubmissionStatus,
|
|
||||||
} 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 type { Submission } from "utils/types"
|
||||||
import SubmissionDetail from "oj/submission/detail.vue"
|
import SubmissionDetail from "oj/submission/detail.vue"
|
||||||
import { useBreakpoints } from "shared/composables/breakpoints"
|
import { useBreakpoints } from "shared/composables/breakpoints"
|
||||||
|
|
||||||
@@ -44,6 +41,22 @@ const columns: DataTableColumn<Submission>[] = [
|
|||||||
key: "id",
|
key: "id",
|
||||||
minWidth: 160,
|
minWidth: 160,
|
||||||
render: (row) => {
|
render: (row) => {
|
||||||
|
if (!row.show_link)
|
||||||
|
return h(NFlex, { align: "center" }, () => [
|
||||||
|
h("span", row.id.slice(0, 12)),
|
||||||
|
h(
|
||||||
|
NTooltip,
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
trigger: () =>
|
||||||
|
h(NButton, { text: true }, () =>
|
||||||
|
h(Icon, { icon: "noto:locked" }),
|
||||||
|
),
|
||||||
|
default: () =>
|
||||||
|
"这道题在你已经加入的题单中,只有在题单中完成此题,代码才可见。",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
])
|
||||||
return h(
|
return h(
|
||||||
NButton,
|
NButton,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,14 +14,26 @@
|
|||||||
查看测试详情
|
查看测试详情
|
||||||
</n-tooltip>
|
</n-tooltip>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
<span v-else>
|
<n-flex v-else-if="isOwnSubmission" align="center">
|
||||||
{{ props.submission.id.slice(0, 12) }}
|
<span>{{ props.submission.id.slice(0, 12) }}</span>
|
||||||
</span>
|
<n-tooltip>
|
||||||
|
<template #trigger>
|
||||||
|
<n-button text>
|
||||||
|
<template #icon>
|
||||||
|
<Icon icon="noto:locked"></Icon>
|
||||||
|
</template>
|
||||||
|
</n-button>
|
||||||
|
</template>
|
||||||
|
这道题在你已经加入的题单中,只有在题单中完成此题,代码才可见。
|
||||||
|
</n-tooltip>
|
||||||
|
</n-flex>
|
||||||
|
<span v-else>{{ props.submission.id.slice(0, 12) }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Icon } from "@iconify/vue"
|
import { Icon } from "@iconify/vue"
|
||||||
import { SubmissionListItem } from "utils/types"
|
import { useUserStore } from "shared/store/user"
|
||||||
|
import type { SubmissionListItem } from "utils/types"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
submission: SubmissionListItem
|
submission: SubmissionListItem
|
||||||
@@ -29,6 +41,9 @@ interface Props {
|
|||||||
const props = defineProps<Props>()
|
const props = defineProps<Props>()
|
||||||
defineEmits(["showCode"])
|
defineEmits(["showCode"])
|
||||||
|
|
||||||
|
const userStore = useUserStore()
|
||||||
|
const isOwnSubmission = computed(() => userStore.profile?.id === props.submission.user_id)
|
||||||
|
|
||||||
function goto() {
|
function goto() {
|
||||||
window.open("/submission/" + props.submission.id, "_blank")
|
window.open("/submission/" + props.submission.id, "_blank")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SUBMISSION_RESULT } from "./types"
|
import type { SUBMISSION_RESULT } from "./types"
|
||||||
|
|
||||||
export enum SubmissionStatus {
|
export enum SubmissionStatus {
|
||||||
compile_error = -2,
|
compile_error = -2,
|
||||||
|
|||||||
Reference in New Issue
Block a user