diff --git a/src/oj/problem/components/Form.vue b/src/oj/problem/components/Form.vue index 6c55994..1c525f5 100644 --- a/src/oj/problem/components/Form.vue +++ b/src/oj/problem/components/Form.vue @@ -71,21 +71,30 @@ const showGoSubmissionButton = computed(() => { else return false }) -const mobileMenuOptions = computed(() => { +const menuOptions = computed(() => { const options: DropdownOption[] = [] - if (showGoSubmissionButton.value) { - options.push({ - label: "提交信息", - key: "submissions", - }) - } - if (userStore.isTeacherOrAbove) { - options.push({ - label: "统计信息", - key: "statistics", - }) + // 移动端额外收纳桌面端常驻的两项 + if (!isDesktop.value) { + if (showGoSubmissionButton.value) { + options.push({ + label: "提交信息", + key: "submissions", + }) + } + if (userStore.isTeacherOrAbove) { + options.push({ + label: "统计信息", + key: "statistics", + }) + } } if (codeStore.code.language !== "Flowchart") { + if (codeStore.code.language !== "SQL") { + options.push({ + label: "自测猫", + key: "testcat", + }) + } options.push({ label: "复制代码", key: "copy", @@ -95,10 +104,16 @@ const mobileMenuOptions = computed(() => { key: "reset", }) } + if (isDesktop.value && userStore.isSuperAdmin) { + options.push({ + label: "编辑题目", + key: "edit", + }) + } return options }) -const handleMobileSelect = (key: string) => { +const handleMenuSelect = (key: string) => { switch (key) { case "submissions": goSubmissions() @@ -106,12 +121,18 @@ const handleMobileSelect = (key: string) => { case "statistics": statisticPanel.value = true break + case "testcat": + goTestCat() + break case "copy": copy() break case "reset": reset() break + case "edit": + goEdit() + break } } @@ -219,32 +240,14 @@ onMounted(() => { 统计信息 - - - + - 更多 + 更多 - - - 编辑题目 -