diff --git a/apps/web/src/shared/components/CollabHost.vue b/apps/web/src/shared/components/CollabHost.vue index 257b308..6a4006c 100644 --- a/apps/web/src/shared/components/CollabHost.vue +++ b/apps/web/src/shared/components/CollabHost.vue @@ -1,20 +1,23 @@ diff --git a/apps/web/src/shared/components/Header.vue b/apps/web/src/shared/components/Header.vue index d503046..6480eb0 100644 --- a/apps/web/src/shared/components/Header.vue +++ b/apps/web/src/shared/components/Header.vue @@ -1,15 +1,16 @@ - + {{ configStore.config?.websiteName }} @@ -244,9 +246,6 @@ const options = computed>(() => [ - - 自学 - >(() => [ > {{ link.label }} + + + 自学 + + + + + 更多 + + - - - - 后台 + + + + + 课堂看板 菜单 - - - - - - - {{ userStore.user!.username }} - + + {{ userStore.user!.username }} + + 登录 @@ -296,19 +301,22 @@ const options = computed>(() => [ > 注册 + + + + + + - - - - - + + @@ -326,8 +334,12 @@ const options = computed>(() => [ white-space: nowrap; } +.bar.compact { + gap: 20px; +} + /* 窄屏放不下一行:允许折行,高度跟着内容走 */ -.bar.mobile { +.bar.wrap { height: auto; min-height: 55px; padding: 8px 12px; @@ -349,13 +361,18 @@ const options = computed>(() => [ .nav { display: flex; align-items: center; - gap: 22px; + gap: 2px; flex: none; } .nav-link { - padding: 0; + height: 32px; + padding: 0 10px; + display: flex; + align-items: center; + gap: 3px; border: 0; + border-radius: 6px; background: transparent; font: inherit; cursor: pointer; @@ -364,11 +381,14 @@ const options = computed>(() => [ } .nav-link:hover { - color: v-bind("theme.primaryColor"); + background: v-bind("theme.hoverColor"); } +/* 当前页:浅绿底块(设计稿「顶栏重设计 · 定稿」)。字色在暗色下换浅一档, + 深绿放在暗底上看不清 —— 和题目页课堂条同一个做法 */ .nav-link.active { - color: v-bind("theme.primaryColorPressed"); + background: v-bind("tone.activeBg"); + color: v-bind("tone.activeText"); font-weight: 600; } @@ -379,11 +399,11 @@ const options = computed>(() => [ .actions { display: flex; align-items: center; - gap: 12px; + gap: 14px; flex: none; } -.admin-link { +.tool-link { display: flex; align-items: center; gap: 5px; @@ -391,7 +411,8 @@ const options = computed>(() => [ text-decoration: none; } -.admin-link:hover { +.tool-link:hover, +.tool-link.active { color: v-bind("theme.primaryColor"); } @@ -401,7 +422,45 @@ const options = computed>(() => [ background-color: v-bind("theme.dividerColor"); } -.jump { - width: 180px; +/* 学生用户名最长有 25 个字符:按钮最宽 160,多出来的省略,全名在 title 里 */ +.name { + max-width: 160px; +} + +/* 1024 宽、老师那版、名字按最长的算,160 会挤进右边距 */ +.bar.compact .name { + max-width: 120px; +} + +.name :deep(.n-button__content) { + min-width: 0; + gap: 4px; +} + +.name-text { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; +} + +.caret { + flex: none; +} + + + + diff --git a/apps/web/src/shared/components/HelpButton.vue b/apps/web/src/shared/components/HelpButton.vue new file mode 100644 index 0000000..69dd96f --- /dev/null +++ b/apps/web/src/shared/components/HelpButton.vue @@ -0,0 +1,108 @@ + + + + + + {{ count }} 人举手 + + + + diff --git a/apps/web/src/shared/components/ProblemJumpBox.vue b/apps/web/src/shared/components/ProblemJumpBox.vue new file mode 100644 index 0000000..cfc55f3 --- /dev/null +++ b/apps/web/src/shared/components/ProblemJumpBox.vue @@ -0,0 +1,280 @@ + + + + + + + + + + + + + + + + {{ lessonStore.label }} + 做完 {{ done }}/{{ lesson?.problems.length }} + + + + {{ item.problemDisplayId }} + {{ item.title }} + 下一道 + + + {{ keyword.trim() ? "回车按题号直达,对不上就去题库搜" : "也可以直接输入题号,回车打开" }} + + + + + + diff --git a/apps/web/src/shared/layout/admin.vue b/apps/web/src/shared/layout/admin.vue index 73ed7c8..2323762 100644 --- a/apps/web/src/shared/layout/admin.vue +++ b/apps/web/src/shared/layout/admin.vue @@ -7,6 +7,7 @@ import { useDarkTransition } from "shared/composables/darkTransition" import { STORAGE_KEY } from "utils/constants" import storage from "utils/storage" import { useUserStore } from "../store/user" +import HelpButton from "../components/HelpButton.vue" import type { MenuOption } from "naive-ui" const route = useRoute() @@ -284,6 +285,9 @@ onMounted(async () => { {{ userStore.user.username }} + +