update
This commit is contained in:
@@ -71,21 +71,30 @@ const showGoSubmissionButton = computed(() => {
|
|||||||
else return false
|
else return false
|
||||||
})
|
})
|
||||||
|
|
||||||
const mobileMenuOptions = computed<DropdownOption[]>(() => {
|
const menuOptions = computed<DropdownOption[]>(() => {
|
||||||
const options: DropdownOption[] = []
|
const options: DropdownOption[] = []
|
||||||
if (showGoSubmissionButton.value) {
|
// 移动端额外收纳桌面端常驻的两项
|
||||||
options.push({
|
if (!isDesktop.value) {
|
||||||
label: "提交信息",
|
if (showGoSubmissionButton.value) {
|
||||||
key: "submissions",
|
options.push({
|
||||||
})
|
label: "提交信息",
|
||||||
}
|
key: "submissions",
|
||||||
if (userStore.isTeacherOrAbove) {
|
})
|
||||||
options.push({
|
}
|
||||||
label: "统计信息",
|
if (userStore.isTeacherOrAbove) {
|
||||||
key: "statistics",
|
options.push({
|
||||||
})
|
label: "统计信息",
|
||||||
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user