update
Some checks failed
Deploy / deploy (build, debian, 22, /root/OJDeploy/data/clientnext) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822, /root/OJ/data/dist) (push) Has been cancelled

This commit is contained in:
2026-07-26 08:36:49 -06:00
parent f928e79c1f
commit ccbb961d64

View File

@@ -71,8 +71,10 @@ const showGoSubmissionButton = computed(() => {
else return false else return false
}) })
const mobileMenuOptions = computed<DropdownOption[]>(() => { const menuOptions = computed<DropdownOption[]>(() => {
const options: DropdownOption[] = [] const options: DropdownOption[] = []
// 移动端额外收纳桌面端常驻的两项
if (!isDesktop.value) {
if (showGoSubmissionButton.value) { if (showGoSubmissionButton.value) {
options.push({ options.push({
label: "提交信息", label: "提交信息",
@@ -85,7 +87,14 @@ const mobileMenuOptions = computed<DropdownOption[]>(() => {
key: "statistics", key: "statistics",
}) })
} }
}
if (codeStore.code.language !== "Flowchart") { if (codeStore.code.language !== "Flowchart") {
if (codeStore.code.language !== "SQL") {
options.push({
label: "自测猫",
key: "testcat",
})
}
options.push({ options.push({
label: "复制代码", label: "复制代码",
key: "copy", key: "copy",
@@ -95,10 +104,16 @@ const mobileMenuOptions = computed<DropdownOption[]>(() => {
key: "reset", key: "reset",
}) })
} }
if (isDesktop.value && userStore.isSuperAdmin) {
options.push({
label: "编辑题目",
key: "edit",
})
}
return options return options
}) })
const handleMobileSelect = (key: string) => { const handleMenuSelect = (key: string) => {
switch (key) { switch (key) {
case "submissions": case "submissions":
goSubmissions() goSubmissions()
@@ -106,12 +121,18 @@ const handleMobileSelect = (key: string) => {
case "statistics": case "statistics":
statisticPanel.value = true statisticPanel.value = true
break break
case "testcat":
goTestCat()
break
case "copy": case "copy":
copy() copy()
break break
case "reset": case "reset":
reset() reset()
break break
case "edit":
goEdit()
break
} }
} }
@@ -219,32 +240,14 @@ onMounted(() => {
统计信息 统计信息
</n-button> </n-button>
<template v-if="codeStore.code.language !== 'Flowchart'"> <!-- 自测猫 / 复制代码 / 重置代码 / 编辑题目 收进下拉菜单移动端再加上提交信息 / 统计信息 -->
<n-button
v-if="codeStore.code.language !== 'SQL'"
:size="buttonSize"
@click="goTestCat"
>
自测猫
</n-button>
<n-button v-if="isDesktop" :size="buttonSize" @click="copy">
复制代码
</n-button>
<n-button v-if="isDesktop" :size="buttonSize" @click="reset">
重置代码
</n-button>
</template>
<!-- 移动端提交信息 / 统计信息 / 复制代码 / 重置代码 收进下拉菜单 -->
<n-dropdown <n-dropdown
v-if="!isDesktop && mobileMenuOptions.length" v-if="menuOptions.length"
trigger="click" trigger="click"
:options="mobileMenuOptions" :options="menuOptions"
@select="handleMobileSelect" @select="handleMenuSelect"
> >
<n-button size="small">更多</n-button> <n-button :size="buttonSize">更多</n-button>
</n-dropdown> </n-dropdown>
<template v-if="showSyncFeature"> <template v-if="showSyncFeature">
@@ -273,14 +276,6 @@ onMounted(() => {
</n-tag> </n-tag>
</template> </template>
</template> </template>
<n-button
v-if="isDesktop && userStore.isSuperAdmin"
:size="buttonSize"
@click="goEdit"
>
编辑题目
</n-button>
</n-flex> </n-flex>
<n-modal <n-modal