diff --git a/ELECTRON.md b/ELECTRON.md index 8a17b5d..1087c1e 100644 --- a/ELECTRON.md +++ b/ELECTRON.md @@ -29,6 +29,7 @@ pnpm electron:build:dir 选择结果保存在本机,下次启动会继续使用上一次的环境。切换环境时应用会清除当前登录状态,防止跨环境复用 Token。 Electron 的登录 Token 使用窗口级 `sessionStorage` 保存,以兼容 `ydevent://` 自定义协议;关闭应用后需要重新登录。 +接口环境面板位于右下角,可点击“收起”隐藏为贴边小按钮;收起状态会被保存。 启动应用前也可以通过环境变量覆盖地址: diff --git a/src/App.vue b/src/App.vue index 5bec1ae..0512025 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,16 +6,33 @@ -
- 接口环境 - - - +
+ +
@@ -51,10 +68,19 @@ const selectedApiEnvironment = ref<'test' | 'production'>('production'); const currentApiEnvironment = ref<'test' | 'production'>('production'); const apiEnvironmentOptions = ref([]); const apiEnvironmentChanging = ref(false); +const apiEnvironmentCollapsed = ref(Local.get('electronApiEnvironmentCollapsed') === true); +const currentApiEnvironmentLabel = computed( + () => apiEnvironmentOptions.value.find((item) => item.value === currentApiEnvironment.value)?.label || '正式服' +); const showApiEnvironmentSwitcher = computed( () => Boolean(window.electron?.isDesktop) && route.meta.isPublic !== true && route.query.presentation !== '1' ); +const toggleApiEnvironmentSwitcher = () => { + apiEnvironmentCollapsed.value = !apiEnvironmentCollapsed.value; + Local.set('electronApiEnvironmentCollapsed', apiEnvironmentCollapsed.value); +}; + const loadApiEnvironment = async () => { if (!window.electron?.apiEnvironment) return; const state = await window.electron.apiEnvironment.get(); @@ -154,7 +180,7 @@ watch( position: fixed; z-index: 9999; right: 18px; - top: 14px; + bottom: 18px; display: flex; align-items: center; gap: 9px; @@ -168,7 +194,49 @@ watch( backdrop-filter: blur(10px); } +.electron-environment-switcher.collapsed { + right: 0; + bottom: 72px; + padding: 0; + border: 0; + background: transparent; + box-shadow: none; + backdrop-filter: none; +} + .electron-environment-switcher .el-select { width: 240px; } + +.environment-collapse-button, +.environment-reopen-button { + border: 1px solid var(--el-border-color-light); + color: var(--el-text-color-regular); + background: var(--el-bg-color); + cursor: pointer; +} + +.environment-collapse-button { + padding: 5px 8px; + border-radius: 6px; + font-size: 12px; +} + +.environment-collapse-button:hover, +.environment-reopen-button:hover { + color: var(--el-color-primary); + border-color: var(--el-color-primary-light-5); +} + +.environment-reopen-button { + width: 30px; + min-height: 58px; + padding: 7px 5px; + border-right: 0; + border-radius: 8px 0 0 8px; + box-shadow: 0 5px 18px rgba(20, 45, 80, 0.12); + font-size: 12px; + line-height: 1.4; + writing-mode: vertical-rl; +} diff --git a/src/views/scoring/screen/index.vue b/src/views/scoring/screen/index.vue index eebfc77..f94df4b 100644 --- a/src/views/scoring/screen/index.vue +++ b/src/views/scoring/screen/index.vue @@ -1,19 +1,18 @@ diff --git a/src/views/scoring/workbench/index.vue b/src/views/scoring/workbench/index.vue index aac3556..43dca5e 100644 --- a/src/views/scoring/workbench/index.vue +++ b/src/views/scoring/workbench/index.vue @@ -47,17 +47,25 @@ LIVE
当前正在展示:{{ currentCastSummary }}{{ formatTime(currentCast.castTime) }}
查看大屏撤回投屏
-
- - - - - - - - - - +
+ + + + + + + + + + + + + + + + + +