Files
AskaEth 6483acf9ad feat: 人员年龄/号码布、图片上传、多显示器菜单、Console 两栏、exe 改名等一批改动
人员与报名:
- 人员唯一标识改为「证件号 或 号码布」二选一(0013/0014 迁移 + 导入匹配/回填/冲突)
- 人员新增「年龄」(0015 迁移):表单/列表/导入模板表头 11 列;冲突比较只在两边
  都有值且不同时才算差异,旧数据不误报
- 冲突决策键改为「证件号优先 → 号码布」(前端原先只用 idCard,号码布行会互相覆盖)
- 报名选择器支持无证件号但有号码布的运动员

大屏与 Console:
- 大屏控制新增「显示器」菜单:可给指定显示器重建全屏窗口;单屏/主显示器强制窗口化,
  限制在 Console 侧判定,不信任页面传参
- Console 服务管理窗口改左右两栏,运行日志独占右栏满高;窗口默认尺寸 1280×860
- 大屏右上角时钟精确到秒(同时把刷新间隔 15s 改为 1s)

图片与配置:
- 新增图片上传 POST /api/uploads(recorder+,png/jpg/webp/gif,≤5MiB)与匿名静态
  访问 GET /uploads/{name}(防目录穿越);文件落赛事项目目录 uploads/,随赛事包
  一起导出/导入
- 「赛事信息」新增赛事会标 / 大屏会标 / 大屏背景图三个上传项
- 参赛单位 logo 输入框右侧加上传按钮

关于页与构建:
- 构建时间打通:version.BuildTime + /api/system/about 返回 + build.bat 注入
  (用 PowerShell 取时间戳,避免本地化 %DATE% 的非 ASCII 星期)

安装包:
- 主程序改名 Scoreboard_Console.exe(win.executableName;productName/显示名不变)
- 记住上次安装目录:自定义 NSIS 宏优先沿用自存路径(卸载不清除),并在 customInit
  里补写回 electron-builder 的键,避免安装模式页把 $INSTDIR 打回默认

自检:服务端 12 包全绿;前端 vue-tsc + build 通过、node --test 58/58;console 12 文件通过。
2026-09-10 09:05:06 +08:00

514 lines
8.5 KiB
CSS

:root {
--bg: #0f1420;
--panel: #161d2d;
--panel-2: #1d2637;
--border: #27314a;
--text: #e6ecf7;
--muted: #8b98b4;
--accent: #4fd8ff;
--ok: #3ddc97;
--warn: #ffb454;
--err: #ff6b6b;
}
* {
box-sizing: border-box;
}
html,
body {
height: 100%;
margin: 0;
}
body {
display: flex;
flex-direction: column;
background: var(--bg);
color: var(--text);
font: 14px/1.5 "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}
.topbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
height: 50px;
flex: 0 0 auto;
padding: 0 8px 0 16px;
border-bottom: 1px solid var(--border);
background: var(--panel);
/* 整条标题栏拖拽,按钮区单独开洞,否则按钮点不动 */
-webkit-app-region: drag;
user-select: none;
}
.brand {
display: flex;
align-items: center;
gap: 12px;
}
.brand-mark {
width: 30px;
height: 30px;
border-radius: 8px;
object-fit: cover;
flex: none;
}
h1 {
margin: 0;
font-size: 15px;
font-weight: 600;
line-height: 1.25;
letter-spacing: 0.02em;
}
.brand-sub {
margin: 0;
font-size: 11px;
line-height: 1.3;
color: var(--muted);
}
.topbar-right {
display: flex;
align-items: center;
gap: 12px;
}
.win-controls {
display: flex;
align-items: center;
gap: 4px;
-webkit-app-region: no-drag;
}
.win-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 36px;
height: 32px;
padding: 0;
border: 1px solid transparent;
border-radius: 8px;
background: transparent;
color: var(--muted);
cursor: pointer;
transition:
background 0.15s ease,
color 0.15s ease,
border-color 0.15s ease;
}
.win-btn svg {
fill: none;
stroke: currentColor;
stroke-width: 1.7;
stroke-linecap: round;
stroke-linejoin: round;
}
.win-btn:hover {
background: rgba(255, 255, 255, 0.08);
color: var(--text);
}
.win-btn:active {
background: rgba(255, 255, 255, 0.14);
}
.win-btn:focus-visible {
outline: 2px solid var(--accent);
outline-offset: -2px;
}
/* 关闭键是唯一的破坏性操作,hover 变红做区分 */
.win-btn-close:hover {
border-color: var(--err);
background: var(--err);
color: #fff;
}
.win-btn .icon-restore {
display: none;
}
.win-btn.is-maximized .icon-max {
display: none;
}
.win-btn.is-maximized .icon-restore {
display: block;
}
main {
flex: 1;
min-height: 0;
padding: 16px 20px 20px;
display: grid;
gap: 14px;
/* 左栏稍宽放卡片,右栏整栏给运行日志 */
grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
/* 滚动交给两栏各自处理,否则整页滚动时日志也跟着跑 */
overflow: hidden;
}
.col-left {
display: flex;
flex-direction: column;
gap: 14px;
min-height: 0;
/* 左栏卡片总高超出时左栏自己滚,不影响右栏日志 */
overflow: auto;
}
.col-right {
display: flex;
flex-direction: column;
min-height: 0;
}
.card {
padding: 14px 16px;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--panel);
}
.log-card {
display: flex;
flex-direction: column;
/* 撑满右栏整高,日志区随窗口高度伸缩 */
flex: 1;
min-height: 0;
}
.card-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 10px;
}
h2 {
margin: 0;
font-size: 13px;
font-weight: 600;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.08em;
}
.actions {
display: flex;
gap: 8px;
align-items: center;
}
.btn {
padding: 6px 14px;
border: 1px solid var(--border);
border-radius: 6px;
background: var(--panel-2);
color: var(--text);
font-size: 13px;
cursor: pointer;
}
.btn:hover:not(:disabled) {
border-color: var(--accent);
}
.btn:disabled {
opacity: 0.45;
cursor: not-allowed;
}
.btn.primary {
border-color: transparent;
background: var(--accent);
color: #06202b;
font-weight: 600;
}
.status-row {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 12px;
font-size: 15px;
}
.dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: var(--muted);
}
.dot.ok {
background: var(--ok);
box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.15);
}
.dot.warn {
background: var(--warn);
box-shadow: 0 0 0 4px rgba(255, 180, 84, 0.15);
}
.dot.err {
background: var(--err);
box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.15);
}
.muted {
color: var(--muted);
}
.kv {
display: grid;
/* 左栏只有半屏宽,4 列会挤成窄条,改 2 列 */
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px 16px;
margin: 0;
}
/* 2 列下 span 2 正好是一整行,长路径仍然通栏 */
.kv > div.wide {
grid-column: span 2;
}
.kv dt {
margin: 0;
font-size: 12px;
color: var(--muted);
}
.kv dd {
margin: 2px 0 0;
word-break: break-all;
}
.mono {
font-family: Consolas, "Cascadia Mono", monospace;
font-size: 12px;
}
.warning {
margin: 12px 0 0;
padding: 8px 10px;
border-radius: 6px;
background: rgba(255, 180, 84, 0.12);
color: var(--warn);
font-size: 12px;
}
.hint {
margin: 0 0 10px;
font-size: 12px;
color: var(--muted);
}
.display-list {
margin: 0;
padding: 0;
list-style: none;
display: grid;
gap: 6px;
}
.display-list li {
display: flex;
gap: 10px;
padding: 8px 10px;
border-radius: 6px;
background: var(--panel-2);
font-size: 13px;
}
.display-list .page {
min-width: 96px;
color: var(--accent);
font-weight: 600;
}
.display-list .url {
color: var(--muted);
font-family: Consolas, "Cascadia Mono", monospace;
font-size: 12px;
word-break: break-all;
}
.display-list .state {
margin-left: auto;
flex: none;
font-weight: 600;
}
.display-list .state.online {
color: var(--ok);
}
.display-list .state.offline {
color: var(--muted);
}
.check {
display: flex;
align-items: center;
gap: 6px;
font-size: 12px;
color: var(--muted);
cursor: pointer;
}
/* 滑块式开关:勾选后轨道变强调色,不依赖任何第三方样式 */
.switch {
display: inline-flex;
align-items: center;
gap: 8px;
cursor: pointer;
}
.switch input {
appearance: none;
-webkit-appearance: none;
position: relative;
flex: none;
width: 34px;
height: 18px;
margin: 0;
border: 1px solid var(--border);
border-radius: 999px;
background: var(--panel-2);
cursor: pointer;
transition:
background 0.15s ease,
border-color 0.15s ease;
}
.switch input::after {
content: "";
position: absolute;
top: 2px;
left: 2px;
width: 12px;
height: 12px;
border-radius: 50%;
background: var(--muted);
transition:
transform 0.15s ease,
background 0.15s ease;
}
.switch input:checked {
border-color: var(--accent);
background: var(--accent);
}
.switch input:checked::after {
transform: translateX(16px);
background: #06202b;
}
.switch input:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
.switch input:disabled {
opacity: 0.45;
cursor: not-allowed;
}
.form-row {
display: grid;
/* 左栏宽度不定:够宽排 3 个,窄了自动换行成 2 个 / 1 个 */
grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
gap: 10px 16px;
}
.field {
display: flex;
flex-direction: column;
gap: 4px;
font-size: 12px;
color: var(--muted);
}
.input {
padding: 6px 10px;
border: 1px solid var(--border);
border-radius: 6px;
background: #0a0e17;
color: var(--text);
font: inherit;
font-size: 13px;
}
.input:focus {
outline: none;
border-color: var(--accent);
}
.input:disabled {
opacity: 0.55;
cursor: not-allowed;
}
.hint.ok {
color: var(--ok);
}
.hint.err {
color: var(--err);
}
.log {
flex: 1;
min-height: 0;
margin: 0;
padding: 10px 12px;
overflow: auto;
border-radius: 8px;
background: #0a0e17;
color: #b9c6e0;
font-family: Consolas, "Cascadia Mono", monospace;
font-size: 12px;
line-height: 1.55;
white-space: pre-wrap;
word-break: break-all;
}
/* 账号重置的输出框沿用 .log 的终端样式,但要限高、别把卡片撑开 */
.account-output {
max-height: 180px;
margin: 10px 0 0;
}
/* 窗口拖窄到放不下两栏时退回单栏,日志仍排在最后并保留最小高度 */
@media (max-width: 900px) {
/* 这里必须换成 flex:栅格下 auto 行会被压缩,左栏内容会被裁掉而不是撑开滚动 */
main {
display: flex;
flex-direction: column;
overflow: auto;
}
/* 单栏时整页一起滚,左栏按内容高、不再自成一个滚动区 */
.col-left {
flex: none;
overflow: visible;
}
.col-right {
flex: 1;
min-height: 200px;
}
}