初始提交:5G 基站退服时长智能分析与故障闭环管控系统

Flask + SQLite 后端,免构建 React + ECharts 前端,含合成样例数据。
测试参考数据(FOR-TEST-ONLY)与运行时数据库不入库。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
treeandClaude Opus 5.5 committed 2026-11-18 14:01:48 +08:00
commit f8d1ccc526
39 files changed
+29010

No files matched your search

+244
View File
@@ -0,0 +1,244 @@
/*
* 应用样式(Apple 风格)。
* - 颜色取自 Apple 人机界面指南的系统色;背景为 apple.com 的 #f5f5f7 / 深色 #000。
* - 外框(导航、按钮、文字)保持中性灰阶,systemBlue 只用来标记选中项、主操作和图表里最需要关注的那一项。
* - 间距统一取 4 的倍数;字重只用 400 / 500,数字和标题偶尔用 600。
* - 玻璃只用于侧边栏、顶栏、弹窗、提示;内容卡片保持不透明(层级清晰,也更省 GPU)。
* - 组件库控件(按钮、下拉、输入框)沿用库自带样式,这里只写布局和业务小组件。
*/
/* ---------- 颜色与基础 ---------- */
:root {
--bg: #f5f5f7;
--card: #ffffff;
--label: #1d1d1f;
--secondary: #6e6e73;
--tertiary: #86868b;
--separator: rgba(0, 0, 0, .08);
--fill: rgba(118, 118, 128, .12);
--blue: #007aff; --green: #34c759; --orange: #ff9500; --red: #ff3b30; --yellow: #ffcc00;
--gap: 16px;
--side-w: 248px;
--radius: 18px;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #000000;
--card: #1c1c1e;
--label: #f5f5f7;
--secondary: #98989d;
--tertiary: #6e6e73;
--separator: rgba(255, 255, 255, .1);
--fill: rgba(118, 118, 128, .24);
--blue: #0a84ff; --green: #30d158; --orange: #ff9f0a; --red: #ff453a; --yellow: #ffd60a;
}
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
min-height: 100dvh;
background: var(--bg);
color: var(--label);
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
font-size: 14px;
-webkit-font-smoothing: antialiased;
}
h1, h3, h4 { margin: 0; }
/* 只有大标题收紧字距;小字收紧会更难读 */
h1, h3 { letter-spacing: -.01em; }
a { color: var(--blue); }
/* 通用小工具 */
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1; }
.hint { color: var(--secondary); font-size: 12px; }
.small { font-size: 12px; }
.text-red { color: var(--red); }
.toolbar { margin-bottom: 16px; }
.gap-bottom { margin-bottom: 16px; }
.sub-title { margin: 20px 0 8px; font-size: 13px; color: var(--secondary); font-weight: 500; }
.center-screen { min-height: 100dvh; display: grid; place-items: center; padding: 16px; color: var(--secondary); }
/* 标志细节:未闭环圆点。只出现在“未闭环数量”和“待处理 / 处理中”状态上,表示这件事还没处理完 */
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
margin-right: 4px; vertical-align: middle; }
/* ---------- 外壳:侧边栏 + 主区 ---------- */
.shell {
display: grid;
grid-template-columns: var(--side-w) minmax(0, 1fr);
gap: var(--gap);
padding: var(--gap);
min-height: 100dvh;
}
.main { min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
/* 侧边栏:撑满视口高度,导航在中间滚动,数据概况与用户固定在底部 */
.side { top: var(--gap); }
.side .lg-sidebar-surface { height: calc(100dvh - 2 * var(--gap)); }
.side .lg-sidebar-body { flex: 1; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 8px; }
.brand b, .brand small, .userbox b, .userbox small { display: block; }
.brand b { font-size: 15px; font-weight: 600; }
.brand small, .userbox small { color: var(--secondary); font-size: 12px; margin-top: 2px; }
/* 系统图标(static/icon.svg):圆角和颜色都画在图里,不再额外加彩色发光 */
.logo { width: 36px; height: 36px; flex: none; }
.logo.lg { width: 72px; height: 72px; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .12)); }
/* 分组标题离自己的条目近(8px),离上一组远(16px),一眼能看出分组 */
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.nav-title { padding: 0 10px 8px; font-size: 12px; font-weight: 500; color: var(--tertiary); }
.nav-item {
display: flex; align-items: center; gap: 10px;
min-height: 36px; padding: 0 10px; border-radius: 10px;
color: var(--label); text-decoration: none; font-size: 14px;
transition: background-color .15s;
}
.nav-item svg { color: var(--secondary); flex: none; }
.nav-item:hover { background: color-mix(in srgb, var(--fill) 60%, transparent); }
/* 选中项:灰色底面 + 细描边,只有图标用强调色,不再整块蓝底 */
.nav-item[aria-current="page"] { background: var(--fill); box-shadow: inset 0 0 0 1px var(--separator); font-weight: 500; }
.nav-item[aria-current="page"] svg { color: var(--blue); }
.nav-item:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.side-footer { display: flex; flex-direction: column; gap: 12px; }
.overview {
display: grid; grid-template-columns: repeat(3, 1fr); margin: 0;
padding: 12px 4px; border-radius: 12px; background: var(--fill); text-align: center;
}
.overview dt { font-size: 11px; color: var(--secondary); }
.overview dt .dot { background: var(--orange); }
.overview dd { margin: 4px 0 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.userbox { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.avatar {
width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
background: var(--fill); color: var(--secondary); font-weight: 500;
}
/* 顶栏(玻璃) */
.topbar { position: sticky; top: var(--gap); z-index: 5; }
.topbar, .topbar > .lg-content { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.topbar { padding: 12px 16px; }
.topbar-title { font-size: 22px; font-weight: 600; margin-right: auto; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.filters .lg-field { width: 152px; }
.only-narrow, .scrim { display: none; }
/* ---------- 内容 ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.section { grid-column: span 12; min-width: 0; background: var(--card); border-radius: var(--radius); }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 32px; margin-bottom: 16px; }
.section-head h3 { font-size: 17px; font-weight: 600; }
.report-desc { margin: 0 0 16px; min-height: 3em; line-height: 1.6; }
/* 指标:同一张卡片内的网格,用细分隔线区分 */
/* 每项左侧一条分隔线,向左偏移 1px 后由 overflow 裁掉每行第一项的线 */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); row-gap: 12px; overflow: hidden; }
.kpi { margin-left: -1px; border-left: 1px solid var(--separator); padding: 4px 16px; min-width: 0; }
.kpi-title { font-size: 12px; color: var(--secondary); }
.kpi-value { margin-top: 4px; font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-value small { margin-left: 4px; font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--secondary); }
.kpi-sub { margin-top: 4px; font-size: 11px; color: var(--tertiary); }
/* 表格 */
.table-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--separator); }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--separator); }
th { position: sticky; top: 0; z-index: 1; background: var(--card); color: var(--secondary); font-size: 12px; font-weight: 500; }
tbody tr:hover td { background: color-mix(in srgb, var(--fill) 50%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
td.wrap { white-space: normal; min-width: 260px; line-height: 1.55; }
td.empty { text-align: center; color: var(--tertiary); padding: 32px; }
th.check, td.check { width: 40px; padding-right: 0; }
.th-sort { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.th-sort span { opacity: .4; font-size: 11px; }
.th-sort:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
th[aria-sort] .th-sort { color: var(--blue); }
th[aria-sort] .th-sort span { opacity: 1; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px;
color: var(--secondary); font-size: 13px; }
/* 标签、根因、提示 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500;
background: var(--fill); color: var(--secondary); }
.tag[data-tone="red"] { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.tag[data-tone="orange"] { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.tag[data-tone="green"] { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.tag[data-tone="blue"] { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.tag[data-tone="yellow"] { background: color-mix(in srgb, var(--yellow) 22%, transparent); color: color-mix(in srgb, var(--yellow) 55%, var(--label)); }
.cause { display: inline-flex; align-items: center; gap: 8px; }
.cause i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.note { padding: 12px 16px; border-radius: 12px; line-height: 1.75; font-size: 13px; color: var(--secondary);
background: var(--fill); }
.note b { color: var(--label); font-weight: 500; }
.note.full { grid-column: 1 / -1; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0; }
.chip { padding: 8px 12px; border-radius: 12px; background: var(--fill); font-weight: 500; font-variant-numeric: tabular-nums; }
.chip span { margin-right: 6px; font-size: 12px; font-weight: 400; color: var(--secondary); }
.chip[data-tone="green"] { color: var(--green); }
.chip[data-tone="red"] { color: var(--red); }
.chip[data-tone="orange"] { color: var(--orange); }
/* 导入拖拽区:中性虚线框,悬停 / 拖入时才出现浅灰底 */
.drop { display: block; padding: 32px; text-align: center; cursor: pointer; border-radius: 12px; color: var(--secondary);
border: 1.5px dashed color-mix(in srgb, var(--label) 20%, transparent); transition: background-color .15s, border-color .15s; }
.drop:hover, .drop[data-over] { background: color-mix(in srgb, var(--fill) 60%, transparent); border-color: var(--blue); }
.drop b { color: var(--label); font-weight: 500; }
.drop-icon { display: flex; justify-content: center; margin-bottom: 8px; color: var(--secondary); }
.drop p { margin: 8px auto 0; max-width: 820px; font-size: 13px; line-height: 1.7; }
/* 弹窗表单:外框玻璃,表单放在不透明面板上保证可读性 */
.form-dialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.form-dialog form { padding: 16px; border-radius: 14px; background: var(--card); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid > .full { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
/* 加载与登录 */
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 48px; color: var(--secondary); }
.loading span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--fill); border-top-color: var(--secondary);
animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-card, .login-card > .lg-content { display: grid; justify-items: center; gap: 12px; text-align: center; }
.login-card { width: min(400px, 100%); padding: 40px 32px; }
.login-card h1 { font-size: 24px; font-weight: 600; color: var(--label); }
.login-card p { margin: 0; }
.login-form { display: grid; gap: 12px; width: 100%; margin: 8px 0 4px; text-align: start; }
/* ---------- 响应式(按窗口宽度) ---------- */
@media (max-width: 1280px) {
.span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}
/* 窄屏:侧边栏变成抽屉,顶栏只保留标题 + 菜单 + 筛选按钮,筛选项点开才显示 */
@media (max-width: 900px) {
:root { --gap: 12px; }
.shell { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
.shell .side {
position: fixed; z-index: 30; top: var(--gap); bottom: var(--gap); left: var(--gap);
width: min(280px, 82vw); transform: translateX(calc(-100% - 24px)); transition: transform .25s ease;
}
.side .lg-sidebar-surface { height: 100%; }
.shell[data-menu="open"] .side { transform: none; }
.shell[data-menu="open"] .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .3); }
.topbar { top: 0; margin: 0 calc(-1 * var(--gap)); padding: 8px 12px; border-radius: 0 0 18px 18px; }
.topbar-title { font-size: 17px; font-weight: 600; margin: 0 auto; }
.only-narrow { display: inline-flex; }
.filters { display: none; width: 100%; }
.topbar[data-filters="open"] .filters { display: flex; }
.filters .lg-field { width: calc(50% - 4px); }
.section { padding: 16px !important; }
.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi-value { font-size: 22px; }
.form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
.loading span { animation: none; }
.shell .side { transition: none; }
}