update
This commit is contained in:
@@ -49,7 +49,7 @@ const codeStore = useCodeStore()
|
||||
const problemStore = useProblemStore()
|
||||
const { problem, languages } = storeToRefs(problemStore)
|
||||
|
||||
const { isMobile, isDesktop } = useBreakpoints()
|
||||
const { isDesktop } = useBreakpoints()
|
||||
|
||||
const syncEnabled = ref(false) // 用户点击按钮后的意图状态(想要开启/关闭)
|
||||
const statisticPanel = ref(false)
|
||||
@@ -65,12 +65,6 @@ const showSyncFeature = computed(
|
||||
!isContestMode.value,
|
||||
)
|
||||
|
||||
const menu = computed<DropdownOption[]>(() => [
|
||||
{ label: "去自测猫", key: "goTestCat", show: isMobile.value },
|
||||
{ label: "复制代码", key: "copy" },
|
||||
{ label: "重置代码", key: "reset" },
|
||||
])
|
||||
|
||||
const showGoSubmissionButton = computed(() => {
|
||||
if (isContestMode.value) return true
|
||||
else if (userStore.isAdminRole) return true
|
||||
@@ -133,15 +127,6 @@ const goEdit = () => {
|
||||
window.open(router.resolve(url).href, "_blank")
|
||||
}
|
||||
|
||||
const handleMenuSelect = (key: string) => {
|
||||
const actions: Record<string, () => void> = {
|
||||
reset,
|
||||
copy,
|
||||
goTestCat,
|
||||
}
|
||||
actions[key]?.()
|
||||
}
|
||||
|
||||
const toggleSync = () => {
|
||||
syncEnabled.value = !syncEnabled.value
|
||||
emit("toggleSync", syncEnabled.value)
|
||||
@@ -174,41 +159,43 @@ onMounted(() => {
|
||||
|
||||
<SubmitCode v-else />
|
||||
|
||||
<n-button
|
||||
<IconButton
|
||||
v-if="showGoSubmissionButton"
|
||||
:size="buttonSize"
|
||||
icon="streamline-ultimate-color:task-list-text-1"
|
||||
tip="提交信息"
|
||||
@click="goSubmissions"
|
||||
>
|
||||
提交信息
|
||||
</n-button>
|
||||
/>
|
||||
|
||||
<n-button
|
||||
<IconButton
|
||||
v-if="userStore.isTeacherOrAbove"
|
||||
:size="buttonSize"
|
||||
icon="streamline-ultimate-color:analytics-pie-2"
|
||||
tip="统计信息"
|
||||
@click="statisticPanel = true"
|
||||
>
|
||||
{{ isDesktop ? "统计信息" : "统计" }}
|
||||
</n-button>
|
||||
/>
|
||||
|
||||
<n-button
|
||||
v-if="isDesktop && codeStore.code.language !== 'Flowchart'"
|
||||
@click="goTestCat"
|
||||
>
|
||||
自测猫
|
||||
</n-button>
|
||||
<template v-if="codeStore.code.language !== 'Flowchart'">
|
||||
<IconButton
|
||||
icon="streamline-ultimate-color:business-lucky-cat"
|
||||
tip="自测猫"
|
||||
@click="goTestCat"
|
||||
/>
|
||||
|
||||
<n-dropdown
|
||||
v-if="codeStore.code.language !== 'Flowchart'"
|
||||
size="large"
|
||||
:options="menu"
|
||||
@select="handleMenuSelect"
|
||||
>
|
||||
<n-button :size="buttonSize">操作</n-button>
|
||||
</n-dropdown>
|
||||
<IconButton
|
||||
icon="streamline-ultimate-color:copy-paste-1"
|
||||
tip="复制代码"
|
||||
@click="copy"
|
||||
/>
|
||||
|
||||
<IconButton
|
||||
icon="streamline-ultimate-color:synchronize-arrow"
|
||||
tip="重置代码"
|
||||
@click="reset"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<IconButton
|
||||
v-if="isDesktop && userStore.isSuperAdmin"
|
||||
icon="streamline-ultimate-color:file-code-edit"
|
||||
icon="streamline-ultimate-color:common-file-edit"
|
||||
tip="编辑题目"
|
||||
@click="goEdit"
|
||||
/>
|
||||
@@ -217,8 +204,8 @@ onMounted(() => {
|
||||
<IconButton
|
||||
:icon="
|
||||
syncEnabled
|
||||
? 'streamline-ultimate-color:flash-off'
|
||||
: 'streamline-ultimate-color:monitor-flash'
|
||||
? 'ph:wifi-slash'
|
||||
: 'ph:wifi-high'
|
||||
"
|
||||
:tip="syncEnabled ? SYNC_MESSAGES.SYNC_ON : SYNC_MESSAGES.SYNC_OFF"
|
||||
:type="syncEnabled ? 'warning' : 'default'"
|
||||
|
||||
@@ -259,7 +259,7 @@ function type(status: ProblemStatus) {
|
||||
</n-flex>
|
||||
<p class="title" :style="style">
|
||||
<n-flex align="center">
|
||||
<Icon icon="streamline-emojis:sparkles"></Icon>
|
||||
<Icon icon="streamline-emojis:scroll"></Icon>
|
||||
描述
|
||||
</n-flex>
|
||||
</p>
|
||||
@@ -271,7 +271,7 @@ function type(status: ProblemStatus) {
|
||||
|
||||
<p class="title" :style="style">
|
||||
<n-flex align="center">
|
||||
<Icon icon="streamline-emojis:four-leaf-clover"></Icon>
|
||||
<Icon icon="streamline-emojis:e-mail-1"></Icon>
|
||||
输入
|
||||
</n-flex>
|
||||
</p>
|
||||
@@ -283,7 +283,7 @@ function type(status: ProblemStatus) {
|
||||
|
||||
<p class="title" :style="style">
|
||||
<n-flex align="center">
|
||||
<Icon icon="streamline-emojis:herb"></Icon>
|
||||
<Icon icon="streamline-emojis:postbox"></Icon>
|
||||
输出
|
||||
</n-flex>
|
||||
</p>
|
||||
@@ -296,7 +296,7 @@ function type(status: ProblemStatus) {
|
||||
<div v-if="problem.hint">
|
||||
<p class="title" :style="style">
|
||||
<n-flex align="center">
|
||||
<Icon icon="streamline-emojis:seedling"></Icon>
|
||||
<Icon icon="streamline-emojis:man-tipping-hand-1"></Icon>
|
||||
提示
|
||||
</n-flex>
|
||||
</p>
|
||||
@@ -311,7 +311,7 @@ function type(status: ProblemStatus) {
|
||||
<div v-if="astRulesForDisplay.length > 0">
|
||||
<p class="title" :style="style">
|
||||
<n-flex align="center">
|
||||
<Icon icon="streamline-emojis:open-book"></Icon>
|
||||
<Icon icon="streamline-emojis:ballot-box-with-check"></Icon>
|
||||
要求
|
||||
</n-flex>
|
||||
</p>
|
||||
@@ -336,7 +336,12 @@ function type(status: ProblemStatus) {
|
||||
|
||||
<div v-for="(sample, index) of samples" :key="index">
|
||||
<n-flex align="center">
|
||||
<p class="title" :style="style">例子 {{ index + 1 }}</p>
|
||||
<p class="title" :style="style">
|
||||
<n-flex align="center">
|
||||
<Icon icon="streamline-emojis:microscope"></Icon>
|
||||
例子 {{ index + 1 }}
|
||||
</n-flex>
|
||||
</p>
|
||||
<n-button
|
||||
size="small"
|
||||
:type="type(sample.status)"
|
||||
@@ -375,7 +380,12 @@ function type(status: ProblemStatus) {
|
||||
</div>
|
||||
|
||||
<div v-if="problem.source">
|
||||
<p class="title" :style="style">来源</p>
|
||||
<p class="title" :style="style">
|
||||
<n-flex align="center">
|
||||
<Icon icon="streamline-emojis:open-book"></Icon>
|
||||
来源
|
||||
</n-flex>
|
||||
</p>
|
||||
<MdPreview
|
||||
preview-theme="vuepress"
|
||||
:model-value="problem.source"
|
||||
@@ -388,7 +398,7 @@ function type(status: ProblemStatus) {
|
||||
<n-divider />
|
||||
<p class="title" :style="style">
|
||||
<n-flex align="center">
|
||||
<Icon icon="fluent-emoji-flat:light-bulb"></Icon>
|
||||
<Icon icon="streamline-emojis:thumbs-up-1"></Icon>
|
||||
相似题目推荐
|
||||
</n-flex>
|
||||
</p>
|
||||
|
||||
@@ -16,8 +16,8 @@ const color = computed(() => {
|
||||
|
||||
<template>
|
||||
<n-icon v-if="showIcon" :color="color">
|
||||
<Icon icon="ep:select" v-if="status === 'passed'"></Icon>
|
||||
<Icon icon="ep:semi-select" v-if="status === 'failed'"></Icon>
|
||||
<Icon icon="ph:check" v-if="status === 'passed'"></Icon>
|
||||
<Icon icon="ph:minus" v-if="status === 'failed'"></Icon>
|
||||
</n-icon>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ const columns: DataTableColumn<Submission["info"]["data"][number]>[] = [
|
||||
<n-icon
|
||||
:color="rule.passed ? theme.successColor : theme.errorColor"
|
||||
>
|
||||
<Icon :icon="rule.passed ? 'ep:select' : 'ep:close-bold'" />
|
||||
<Icon :icon="rule.passed ? 'ph:check' : 'ph:x-bold'" />
|
||||
</n-icon>
|
||||
<span>{{ rule.description }}</span>
|
||||
</n-flex>
|
||||
|
||||
Reference in New Issue
Block a user