初始提交:5G 基站退服时长智能分析与故障闭环管控系统
Flask + SQLite 后端,免构建 React + ECharts 前端,含合成样例数据。 测试参考数据(FOR-TEST-ONLY)与运行时数据库不入库。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
f8d1ccc526
39 files changed
+29010
No files matched your search
+244
@@ -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; }
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,30 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
||||
<!-- 5G 基站退服分析系统图标:Apple 风格圆角方块 + 系统色渐变(systemTeal → systemBlue → systemIndigo)+ 白色基站信号图形 -->
|
||||
<defs>
|
||||
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
|
||||
<stop offset="0" stop-color="#5ac8fa"/>
|
||||
<stop offset="0.55" stop-color="#007aff"/>
|
||||
<stop offset="1" stop-color="#5856d6"/>
|
||||
</linearGradient>
|
||||
<!-- 顶部柔和高光,呼应界面的玻璃质感 -->
|
||||
<radialGradient id="shine" cx="0.3" cy="0" r="0.9">
|
||||
<stop offset="0" stop-color="#fff" stop-opacity="0.35"/>
|
||||
<stop offset="0.6" stop-color="#fff" stop-opacity="0"/>
|
||||
</radialGradient>
|
||||
</defs>
|
||||
|
||||
<rect width="1024" height="1024" rx="230" fill="url(#bg)"/>
|
||||
<rect width="1024" height="1024" rx="230" fill="url(#shine)"/>
|
||||
|
||||
<g fill="none" stroke="#fff" stroke-width="56" stroke-linecap="round" stroke-linejoin="round">
|
||||
<!-- 信号波:内外两层 -->
|
||||
<path d="M405 310 A140 140 0 0 0 405 490 M619 310 A140 140 0 0 1 619 490"/>
|
||||
<path d="M321 239 A250 250 0 0 0 321 561 M703 239 A250 250 0 0 1 703 561" opacity="0.6"/>
|
||||
<!-- 铁塔:两条塔腿 -->
|
||||
<path d="M512 470 L412 790 M512 470 L612 790"/>
|
||||
</g>
|
||||
<!-- 铁塔桁架:交叉斜撑(比横撑更像铁塔,也避免看成字母 A) -->
|
||||
<path d="M471 600 L596 740 M553 600 L428 740" fill="none" stroke="#fff" stroke-width="36" stroke-linecap="round"/>
|
||||
<!-- 天线 -->
|
||||
<circle cx="512" cy="400" r="50" fill="#fff"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,27 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<title>5G 基站退服时长智能分析与故障闭环管控系统</title>
|
||||
<!-- 图标:标签页(SVG,旧浏览器用 PNG)、iOS 主屏幕 -->
|
||||
<link rel="icon" href="/static/icon.svg" type="image/svg+xml">
|
||||
<link rel="icon" href="/static/favicon-32.png" sizes="32x32" type="image/png">
|
||||
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
|
||||
<meta name="apple-mobile-web-app-title" content="基站退服">
|
||||
<meta name="theme-color" content="#f5f5f7" media="(prefers-color-scheme: light)">
|
||||
<meta name="theme-color" content="#000000" media="(prefers-color-scheme: dark)">
|
||||
<link rel="stylesheet" href="/static/vendor/vendor.css">
|
||||
<link rel="stylesheet" href="/static/app.css">
|
||||
<!-- 模块别名:页面代码中 import ... from 'vendor' / 'echarts' 即指向下面的文件 -->
|
||||
<script type="importmap">
|
||||
{"imports": {"vendor": "/static/vendor/vendor.js", "echarts": "/static/vendor/echarts.js"}}
|
||||
</script>
|
||||
<link rel="modulepreload" href="/static/vendor/vendor.js">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/static/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,155 @@
|
||||
import {
|
||||
GlassButton, GlassIconButton, GlassSurface, html, Sidebar, Suspense, TextField, useEffect, useMemo, useState,
|
||||
} from 'vendor';
|
||||
import {api, AppContext} from './api.js';
|
||||
import {num, ROLE_NAME} from './format.js';
|
||||
import {Icon} from './components/icons.js';
|
||||
import {Loading, Select} from './components/ui.js';
|
||||
import {Login} from './Login.js';
|
||||
import {GROUPS, PAGES} from './pages/index.js';
|
||||
|
||||
/** 根组件:请求 /api/meta,未登录(401)时显示登录页 */
|
||||
export function Root() {
|
||||
const [meta, setMeta] = useState(null);
|
||||
const [status, setStatus] = useState('loading'); // loading | login | ready | error
|
||||
|
||||
const load = async () => {
|
||||
try {
|
||||
setMeta(await api('/api/meta'));
|
||||
setStatus('ready');
|
||||
} catch (err) {
|
||||
if (err.status === 401) {
|
||||
setStatus('login');
|
||||
} else {
|
||||
setStatus('error');
|
||||
}
|
||||
}
|
||||
};
|
||||
useEffect(() => { load(); }, []);
|
||||
|
||||
// 导入站点等操作后刷新下拉选项和侧边栏的数据概况;只更新数据,不重新挂载页面
|
||||
const refreshMeta = async () => {
|
||||
setMeta(await api('/api/meta'));
|
||||
};
|
||||
|
||||
if (status === 'loading') return html`<div className="center-screen"><${Loading}/></div>`;
|
||||
if (status === 'login') return html`<${Login} onLogin=${load}/>`;
|
||||
if (status === 'error') return html`<div className="center-screen">服务器连接失败,请刷新重试</div>`;
|
||||
return html`<${Shell} meta=${meta} refreshMeta=${refreshMeta}/>`;
|
||||
}
|
||||
|
||||
// 当前页面 id 保存在地址栏 hash 中(#/outages),刷新后停留在当前页
|
||||
const pageFromHash = () => location.hash.replace('#/', '') || 'dashboard';
|
||||
|
||||
function Shell({meta, refreshMeta}) {
|
||||
const isAdmin = meta.role === 'admin';
|
||||
const pages = PAGES.filter(p => isAdmin || !p.admin);
|
||||
const [pageId, setPageId] = useState(pageFromHash);
|
||||
const [filters, setFilters] = useState({});
|
||||
const [menuOpen, setMenuOpen] = useState(false); // 仅窄屏:侧边栏抽屉
|
||||
const page = pages.find(p => p.id === pageId) || pages[0];
|
||||
|
||||
useEffect(() => {
|
||||
const onHash = () => { setPageId(pageFromHash()); setMenuOpen(false); };
|
||||
addEventListener('hashchange', onHash);
|
||||
return () => removeEventListener('hashchange', onHash);
|
||||
}, []);
|
||||
useEffect(() => { document.title = `${page.title} · 5G 基站退服分析`; }, [page]);
|
||||
|
||||
const ctx = useMemo(() => ({meta, isAdmin, filters, refreshMeta}), [meta, isAdmin, filters]);
|
||||
const Page = page.component;
|
||||
|
||||
const navGroup = group => html`
|
||||
<nav key=${group} className="nav-group" aria-label=${group}>
|
||||
<div className="nav-title">${group}</div>
|
||||
${pages.filter(p => p.group === group).map(p => html`
|
||||
<a key=${p.id} href=${`#/${p.id}`} className="nav-item" aria-current=${p.id === page.id ? 'page' : undefined}>
|
||||
<${Icon} name=${p.icon}/>${p.title}
|
||||
</a>`)}
|
||||
</nav>`;
|
||||
|
||||
return html`
|
||||
<${AppContext.Provider} value=${ctx}>
|
||||
<div className="shell" data-menu=${menuOpen ? 'open' : undefined}>
|
||||
<${Sidebar} aria-label="主导航" className="side" header=${html`<${Brand}/>`} footer=${html`<${SideFooter} meta=${meta}/>`}>
|
||||
${GROUPS.map(navGroup)}
|
||||
</${Sidebar}>
|
||||
<div className="scrim" onClick=${() => setMenuOpen(false)}></div>
|
||||
<main className="main">
|
||||
<${TopBar} title=${page.title} meta=${meta} filters=${filters} onFilters=${setFilters} onMenu=${() => setMenuOpen(true)}/>
|
||||
<${Suspense} fallback=${html`<${Loading}/>`}>
|
||||
<${Page} key=${page.id}/>
|
||||
</${Suspense}>
|
||||
</main>
|
||||
</div>
|
||||
</${AppContext.Provider}>`;
|
||||
}
|
||||
|
||||
const Brand = () => html`
|
||||
<div className="brand">
|
||||
<img className="logo" src="/static/icon.svg" alt=""/>
|
||||
<div>
|
||||
<b>5G 基站退服</b>
|
||||
<small>智能分析 · 闭环管控</small>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
/** 侧边栏底部:数据概况 + 当前用户 */
|
||||
const SideFooter = ({meta}) => html`
|
||||
<div className="side-footer">
|
||||
<dl className="overview">
|
||||
<div><dt>站点</dt><dd>${num(meta.overview.sites)}</dd></div>
|
||||
<div><dt>退服流水</dt><dd>${num(meta.overview.records)}</dd></div>
|
||||
<div><dt><i className="dot" aria-hidden="true"></i>未闭环</dt><dd>${num(meta.overview.open)}</dd></div>
|
||||
</dl>
|
||||
<div className="userbox">
|
||||
<div className="avatar" aria-hidden="true">${meta.user.slice(0, 1).toUpperCase()}</div>
|
||||
<div className="grow">
|
||||
<b>${meta.user}</b>
|
||||
<small>${ROLE_NAME[meta.role]}</small>
|
||||
</div>
|
||||
<${GlassButton} variant="plain" controlSize="small" icon=${html`<${Icon} name="logout" size=${16}/>`}
|
||||
onClick=${() => { location.href = '/logout'; }}>注销</${GlassButton}>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
/**
|
||||
* 顶栏(玻璃浮层):页面标题 + 全局筛选。
|
||||
* 窄屏下筛选项折叠到“筛选”按钮后面,避免玻璃面板占满首屏。
|
||||
*/
|
||||
function TopBar({title, meta, filters, onFilters, onMenu}) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const active = Object.values(filters).filter(Boolean).length; // 已生效的筛选条件个数
|
||||
|
||||
// 修改一个筛选条件,其余条件保持不变
|
||||
const setFilter = (key, value) => {
|
||||
onFilters(old => ({...old, [key]: value}));
|
||||
};
|
||||
|
||||
return html`
|
||||
<${GlassSurface} className="topbar" radius=${22} data-filters=${open ? 'open' : undefined}>
|
||||
<${GlassIconButton} className="only-narrow" aria-label="打开导航" icon=${html`<${Icon} name="menu"/>`} onClick=${onMenu}/>
|
||||
<h1 className="topbar-title">${title}</h1>
|
||||
<${GlassButton} className="only-narrow" controlSize="small" icon=${html`<${Icon} name="filter" size=${16}/>`}
|
||||
onClick=${() => setOpen(o => !o)} aria-expanded=${open}>
|
||||
筛选${active ? ` · ${active}` : ''}
|
||||
</${GlassButton}>
|
||||
<div className="filters">
|
||||
<${Select} label="场景" all="全部场景" options=${meta.scenes} value=${filters.scene}
|
||||
onChange=${value => setFilter('scene', value)}/>
|
||||
<${Select} label="片区" all="全部片区" options=${meta.regions} value=${filters.region}
|
||||
onChange=${value => setFilter('region', value)}/>
|
||||
<${Select} label="厂家" all="全部厂家" options=${meta.vendors} value=${filters.vendor}
|
||||
onChange=${value => setFilter('vendor', value)}/>
|
||||
<${Select} label="站型" all="全部站型" options=${meta.site_types} value=${filters.site_type}
|
||||
onChange=${value => setFilter('site_type', value)}/>
|
||||
<${Select} label="月份" all="全部月份" options=${meta.months} value=${filters.month}
|
||||
onChange=${value => setFilter('month', value)}/>
|
||||
<${TextField} type="date" label="开始日期" labelHidden controlSize="small" value=${filters.date_from || ''}
|
||||
onChange=${e => setFilter('date_from', e.target.value)}/>
|
||||
<${TextField} type="date" label="结束日期" labelHidden controlSize="small" value=${filters.date_to || ''}
|
||||
onChange=${e => setFilter('date_to', e.target.value)}/>
|
||||
<${GlassButton} controlSize="small" variant="plain" disabled=${!active} onClick=${() => onFilters({})}>重置</${GlassButton}>
|
||||
</div>
|
||||
</${GlassSurface}>`;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import {GlassButton, GlassSurface, html, TextField, useState} from 'vendor';
|
||||
import {api} from './api.js';
|
||||
|
||||
/** 登录页。系统不开放自助注册,账号由管理员在「用户管理」中分配。 */
|
||||
export function Login({onLogin}) {
|
||||
const [error, setError] = useState('');
|
||||
const [busy, setBusy] = useState(false);
|
||||
|
||||
const submit = async e => {
|
||||
e.preventDefault();
|
||||
setBusy(true);
|
||||
setError('');
|
||||
try {
|
||||
await api('/login', {json: Object.fromEntries(new FormData(e.currentTarget))});
|
||||
history.replaceState(null, '', '/');
|
||||
onLogin();
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
|
||||
return html`
|
||||
<div className="center-screen">
|
||||
<${GlassSurface} size="large" radius=${28} className="login-card">
|
||||
<img className="logo lg" src="/static/icon.svg" alt=""/>
|
||||
<h1>5G 基站退服智能分析</h1>
|
||||
<p className="hint">故障闭环管控系统 · 南宁城区</p>
|
||||
<form onSubmit=${submit} className="login-form">
|
||||
<${TextField} name="username" label="用户名" autoComplete="username" required controlSize="large" autoFocus/>
|
||||
<${TextField} name="password" label="密码" type="password" autoComplete="current-password" required
|
||||
controlSize="large" error=${error || undefined}/>
|
||||
<${GlassButton} type="submit" variant="glassProminent" controlSize="large" loading=${busy}>登录</${GlassButton}>
|
||||
</form>
|
||||
<p className="hint small">默认账号 admin / admin123(管理员)· user / user123(普通用户)</p>
|
||||
</${GlassSurface}>
|
||||
</div>`;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/* 与 Flask /api 通信。所有请求都经过 api(),页面取数用 useFetch()。 */
|
||||
import {createContext, useContext, useEffect, useState, useToast} from 'vendor';
|
||||
|
||||
/** 对象 -> 查询串,自动丢弃空值。qs({a: 1, b: ''}) === 'a=1' */
|
||||
export function qs(params = {}) {
|
||||
const pairs = Object.entries(params).filter(([, v]) => v !== '' && v != null && v !== false);
|
||||
return new URLSearchParams(pairs).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送请求并返回 JSON;失败时抛出 Error(err.status 为 HTTP 状态码)。
|
||||
* api('/api/meta')
|
||||
* api('/api/outages', {json: {...}}) // POST JSON
|
||||
* api('/api/outages/1', {method: 'PUT', json: {}})
|
||||
* api('/api/import/preview', {body: formData}) // 上传文件
|
||||
*/
|
||||
export async function api(url, {json, method, body} = {}) {
|
||||
const init = {method: method || (json || body ? 'POST' : 'GET'), body};
|
||||
if (json) {
|
||||
init.headers = {'Content-Type': 'application/json'};
|
||||
init.body = JSON.stringify(json);
|
||||
}
|
||||
const res = await fetch(url, init);
|
||||
const data = await res.json().catch(() => ({error: '服务器响应异常'}));
|
||||
if (!res.ok || data.error) throw Object.assign(new Error(data.error || '请求失败'), {status: res.status});
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面取数:url 或参数变化时自动重新请求,出错时弹出提示。
|
||||
* const {data, reload} = useFetch('/api/dashboard', filters);
|
||||
* data 在首次加载完成前为 null;url 传 null 时不发请求。
|
||||
*/
|
||||
export function useFetch(url, params) {
|
||||
const toast = useToast();
|
||||
const [data, setData] = useState(null);
|
||||
const [version, setVersion] = useState(0);
|
||||
const query = qs(params);
|
||||
|
||||
useEffect(() => {
|
||||
if (!url) return;
|
||||
let current = true; // 参数快速变化时,丢弃过期请求的结果
|
||||
api(query ? `${url}?${query}` : url).then(
|
||||
result => current && setData(result),
|
||||
err => current && toast({message: err.message, tone: 'error'}));
|
||||
return () => { current = false; };
|
||||
}, [url, query, version]);
|
||||
|
||||
return {data, reload: () => setVersion(v => v + 1)};
|
||||
}
|
||||
|
||||
/** 浏览器原生下载(导出 Excel) */
|
||||
export function download(url, params) {
|
||||
location.href = params ? `${url}?${qs(params)}` : url;
|
||||
}
|
||||
|
||||
/**
|
||||
* 全局上下文,任意页面通过 const {meta, isAdmin, filters} = useApp() 读取:
|
||||
* meta 下拉选项(场景、站型、根因、月份、片区、厂家、状态)、当前用户、数据概况
|
||||
* isAdmin 是否管理员
|
||||
* filters 顶栏全局筛选条件
|
||||
*/
|
||||
export const AppContext = createContext(null);
|
||||
export const useApp = () => useContext(AppContext);
|
||||
@@ -0,0 +1,80 @@
|
||||
import {GlassButton, GlassCheckbox, html} from 'vendor';
|
||||
import {num} from '../format.js';
|
||||
|
||||
/**
|
||||
* 通用表格。
|
||||
* columns: [{key, title, render?(value, row), sortable?, wrap?}]
|
||||
* sort: {key, asc},配合 onSort(key) 实现点击表头排序
|
||||
* selected / onSelect: 传入时显示勾选列(selected 为 Set<id>)
|
||||
*/
|
||||
export function DataTable({columns, rows, rowKey = 'id', sort, onSort, selected, onSelect, maxHeight = 560}) {
|
||||
const selectable = !!onSelect;
|
||||
|
||||
// 表头“全选”框的状态:全部选中 / 部分选中(显示横线)/ 未选中
|
||||
let headerChecked = false;
|
||||
if (selectable && rows.length > 0) {
|
||||
const allOn = rows.every(r => selected.has(r[rowKey]));
|
||||
const someOn = rows.some(r => selected.has(r[rowKey]));
|
||||
if (allOn) {
|
||||
headerChecked = true;
|
||||
} else if (someOn) {
|
||||
headerChecked = 'mixed';
|
||||
}
|
||||
}
|
||||
|
||||
const toggleAll = on => onSelect(new Set(on ? rows.map(r => r[rowKey]) : []));
|
||||
const toggleOne = (id, on) => {
|
||||
const next = new Set(selected);
|
||||
on ? next.add(id) : next.delete(id);
|
||||
onSelect(next);
|
||||
};
|
||||
|
||||
const header = (c, i) => html`
|
||||
<th key=${c.key + i} aria-sort=${sort?.key === c.key ? (sort.asc ? 'ascending' : 'descending') : undefined}>
|
||||
${c.sortable && onSort
|
||||
? html`<button className="th-sort" onClick=${() => onSort(c.key)}>
|
||||
${c.title}<span aria-hidden="true">${sort?.key === c.key ? (sort.asc ? '↑' : '↓') : '↕'}</span>
|
||||
</button>`
|
||||
: c.title}
|
||||
</th>`;
|
||||
|
||||
const row = (r, ri) => html`
|
||||
<tr key=${r[rowKey] ?? ri}>
|
||||
${selectable && html`
|
||||
<td className="check">
|
||||
<${GlassCheckbox} aria-label="选择" checked=${selected.has(r[rowKey])} onCheckedChange=${on => toggleOne(r[rowKey], on)}/>
|
||||
</td>`}
|
||||
${columns.map((c, i) => html`
|
||||
<td key=${c.key + i} className=${c.wrap ? 'wrap' : undefined}>${c.render ? c.render(r[c.key], r) : r[c.key]}</td>`)}
|
||||
</tr>`;
|
||||
|
||||
return html`
|
||||
<div className="table-wrap" style=${{maxHeight}}>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
${selectable && html`
|
||||
<th className="check">
|
||||
<${GlassCheckbox} aria-label="全选" checked=${headerChecked} onCheckedChange=${toggleAll}/>
|
||||
</th>`}
|
||||
${columns.map(header)}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
${rows.length === 0 && html`<tr><td className="empty" colSpan=${columns.length + (selectable ? 1 : 0)}>暂无数据</td></tr>`}
|
||||
${rows.map(row)}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
/** 分页条 */
|
||||
export function Pager({page, size, total, onPage, prefix}) {
|
||||
const pages = Math.max(1, Math.ceil(total / size));
|
||||
return html`
|
||||
<div className="pager">
|
||||
<span>${prefix ?? `共 ${num(total)} 条`} · 第 ${page}/${pages} 页</span>
|
||||
<${GlassButton} variant="gray" controlSize="small" disabled=${page <= 1} onClick=${() => onPage(page - 1)}>上一页</${GlassButton}>
|
||||
<${GlassButton} variant="gray" controlSize="small" disabled=${page >= pages} onClick=${() => onPage(page + 1)}>下一页</${GlassButton}>
|
||||
</div>`;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* ECharts 图表组件。
|
||||
* html`<${EChart} option=${{xAxis: ..., series: [...]}} height=${320}/>`
|
||||
* - 坐标轴、提示框、文字颜色由下面两套 Apple 风格主题统一提供,页面里只写数据相关的配置。
|
||||
* - 跟随系统深浅色:主题变化时重建图表。
|
||||
* - echarts.js 只在打开带图表的页面时才下载。
|
||||
*/
|
||||
import echarts from 'echarts';
|
||||
import {html, useEffect, useGlassPolicy, useRef} from 'vendor';
|
||||
import {PALETTE} from '../format.js';
|
||||
|
||||
// 柱子默认用中性灰(systemGray4 / 深色 systemGray3),需要强调的那一项由页面用 accentMax() 标成蓝色
|
||||
function appleTheme({label, secondary, grid, line, tooltip, bar}) {
|
||||
const axis = {
|
||||
axisLine: {lineStyle: {color: line}}, axisTick: {show: false},
|
||||
axisLabel: {color: secondary}, splitLine: {lineStyle: {color: grid}}, nameTextStyle: {color: secondary},
|
||||
};
|
||||
return {
|
||||
color: PALETTE,
|
||||
backgroundColor: 'transparent',
|
||||
textStyle: {fontFamily: 'inherit', color: secondary},
|
||||
categoryAxis: axis, valueAxis: axis,
|
||||
legend: {textStyle: {color: secondary}},
|
||||
tooltip: {backgroundColor: tooltip, borderWidth: 0, textStyle: {color: label},
|
||||
extraCssText: 'border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.16)'},
|
||||
// 柱顶数字用次要文字色、去掉描边(默认描边在深色模式下会糊成一团)
|
||||
bar: {barMaxWidth: 28, itemStyle: {borderRadius: 6, color: bar},
|
||||
label: {color: secondary, fontSize: 11, textBorderWidth: 0}},
|
||||
pie: {label: {color: secondary, textBorderWidth: 0}},
|
||||
line: {smooth: true, symbolSize: 6, lineStyle: {width: 2.5}},
|
||||
};
|
||||
}
|
||||
|
||||
// 颜色取自 Apple 人机界面指南的系统色(label / secondaryLabel / separator / systemGray)
|
||||
echarts.registerTheme('light', appleTheme({label: '#1d1d1f', secondary: '#6e6e73', grid: 'rgba(0,0,0,.06)',
|
||||
line: '#d2d2d7', tooltip: 'rgba(255,255,255,.96)', bar: '#c7c7cc'}));
|
||||
echarts.registerTheme('dark', appleTheme({label: '#f5f5f7', secondary: '#98989d', grid: 'rgba(255,255,255,.08)',
|
||||
line: '#424245', tooltip: 'rgba(44,44,46,.96)', bar: '#48484a'}));
|
||||
|
||||
const GRID = {left: 12, right: 18, top: 30, bottom: 10, containLabel: true};
|
||||
|
||||
export function EChart({option, height = 320}) {
|
||||
const box = useRef(null);
|
||||
const chart = useRef(null);
|
||||
const {resolvedTheme, reduceMotion} = useGlassPolicy();
|
||||
|
||||
// 创建 / 主题切换时重建;容器尺寸变化时自适应
|
||||
useEffect(() => {
|
||||
chart.current = echarts.init(box.current, resolvedTheme);
|
||||
const ro = new ResizeObserver(() => chart.current.resize());
|
||||
ro.observe(box.current);
|
||||
return () => { ro.disconnect(); chart.current.dispose(); };
|
||||
}, [resolvedTheme]);
|
||||
|
||||
// 页面每次渲染都会传入新的 option 对象;内容没变时跳过重绘(例如打开弹窗不会让图表重播动画)
|
||||
const key = JSON.stringify(option);
|
||||
useEffect(() => {
|
||||
chart.current.setOption({animation: !reduceMotion, grid: GRID, ...option}, true);
|
||||
}, [key, resolvedTheme, reduceMotion]);
|
||||
|
||||
return html`<div ref=${box} style=${{height}}></div>`;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import {GlassButton, GlassDialog, html, useState} from 'vendor';
|
||||
|
||||
/**
|
||||
* 表单弹窗:提交时把表单内所有带 name 的字段收集成对象,交给 onSubmit(data)。
|
||||
* onSubmit 抛出异常(校验失败、接口报错)时弹窗保持打开,成功则自动关闭。
|
||||
*/
|
||||
export function FormDialog({onClose, title, description = '', submitText = '保存', onSubmit, children}) {
|
||||
const [busy, setBusy] = useState(false);
|
||||
|
||||
const submit = async e => {
|
||||
e.preventDefault();
|
||||
const data = Object.fromEntries([...new FormData(e.currentTarget)].map(([k, v]) => [k, String(v).trim()]));
|
||||
setBusy(true);
|
||||
try {
|
||||
await onSubmit(data);
|
||||
onClose();
|
||||
} catch {
|
||||
// 错误已由 onSubmit 提示,弹窗保持打开
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
|
||||
return html`
|
||||
<${GlassDialog} open onOpenChange=${o => !o && onClose()} title=${title} description=${description} className="form-dialog">
|
||||
<form onSubmit=${submit}>
|
||||
<div className="form-grid">${children}</div>
|
||||
<div className="dialog-actions">
|
||||
<${GlassButton} type="button" variant="gray" onClick=${onClose}>取消</${GlassButton}>
|
||||
<${GlassButton} type="submit" variant="glassProminent" loading=${busy}>${submitText}</${GlassButton}>
|
||||
</div>
|
||||
</form>
|
||||
</${GlassDialog}>`;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/* 导航图标:20px 线性图标,颜色跟随文字(currentColor)。新增图标时在 PATHS 中加一项。 */
|
||||
import {html} from 'vendor';
|
||||
|
||||
const PATHS = {
|
||||
dashboard: 'M3 3h6v8H3zM11 3h6v5h-6zM11 10h6v7h-6zM3 13h6v4H3z',
|
||||
outages: 'M4 4h12M4 8h12M4 12h8M4 16h6M15 13v4M13 15h4',
|
||||
import: 'M10 3v10M6 9l4 4 4-4M4 15v2h12v-2',
|
||||
sites: 'M10 17V9M6 6a5.5 5.5 0 0 1 8 0M3.5 3.5a9 9 0 0 1 13 0M8 17h4',
|
||||
rank: 'M4 16V10M8 16V6M12 16v-4M16 16V4',
|
||||
rootcause: 'M9 3a6 6 0 1 0 0 12A6 6 0 0 0 9 3zM13.5 13.5 17 17M9 6v3l2 2',
|
||||
impact: 'M3 15l4-5 3 3 4-6 3 3M3 17h14',
|
||||
stats: 'M10 3v7h7A7 7 0 1 1 10 3zM12.5 1.5v6h6a6 6 0 0 0-6-6z',
|
||||
reports: 'M5 2h7l4 4v12H5zM12 2v4h4M8 11h6M8 14h4',
|
||||
users: 'M7 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM2 17a5 5 0 0 1 10 0M13 4a3 3 0 0 1 0 5M15 12a5 5 0 0 1 3 5',
|
||||
logout: 'M8 4H4v12h4M12 6l4 4-4 4M16 10H8',
|
||||
menu: 'M3 5h14M3 10h14M3 15h14',
|
||||
filter: 'M3 5h14M6 10h8M9 15h2',
|
||||
};
|
||||
|
||||
export function Icon({name, size = 20}) {
|
||||
return html`
|
||||
<svg width=${size} height=${size} viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.6"
|
||||
strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
||||
<path d=${PATHS[name]}/>
|
||||
</svg>`;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/* 内容层组件。只放有实际逻辑的组件;纯布局直接写 className(.grid / .row / .grow / .note / .chips,见 app.css)。 */
|
||||
import {Card, Fragment, html, Picker, useState} from 'vendor';
|
||||
import {CAUSE_COLOR, LEVEL_TONE, STATUS_TONE} from '../format.js';
|
||||
|
||||
/** 内容卡片:不透明,可带标题栏。span 为 12 栅格中占的列数 */
|
||||
export function Section({title, hint, extra, span = 12, children}) {
|
||||
return html`
|
||||
<${Card} radius=${18} padding=${20} className=${`section span-${span}`}>
|
||||
${(title || extra) && html`
|
||||
<header className="section-head">
|
||||
<h3>${title}</h3>
|
||||
${hint && html`<span className="hint">${hint}</span>`}
|
||||
<span className="grow"></span>
|
||||
${extra}
|
||||
</header>`}
|
||||
${children}
|
||||
</${Card}>`;
|
||||
}
|
||||
|
||||
/** 指标卡 */
|
||||
export function Kpi({title, value, unit, sub}) {
|
||||
return html`
|
||||
<div className="kpi">
|
||||
<div className="kpi-title">${title}</div>
|
||||
<div className="kpi-value">${value}<small>${unit}</small></div>
|
||||
${sub && html`<div className="kpi-sub">${sub}</div>`}
|
||||
</div>`;
|
||||
}
|
||||
|
||||
/** 彩色文字标签(颜色之外始终带文字,不单靠颜色传达状态) */
|
||||
export const LevelTag = ({value}) => value && html`<span className="tag" data-tone=${LEVEL_TONE[value]}>${value}</span>`;
|
||||
|
||||
/** 闭环状态标签:未闭环(待处理 / 处理中)前面加一个圆点,和侧边栏“未闭环”数量的圆点是同一个记号 */
|
||||
export function StatusTag({value}) {
|
||||
if (!value) return null;
|
||||
let dot = null;
|
||||
if (value !== '已闭环') {
|
||||
dot = html`<i className="dot" aria-hidden="true"></i>`;
|
||||
}
|
||||
return html`<span className="tag" data-tone=${STATUS_TONE[value]}>${dot}${value}</span>`;
|
||||
}
|
||||
|
||||
/** 根因:色点 + 名称 */
|
||||
export const Cause = ({value}) => value && html`
|
||||
<span className="cause"><i style=${{background: CAUSE_COLOR[value] || '#8e8e93'}}></i>${value}</span>`;
|
||||
|
||||
export const Loading = () => html`<div className="loading"><span></span>加载中…</div>`;
|
||||
|
||||
/**
|
||||
* 下拉选择(组件库 Picker)。options 可以是字符串数组或 {value, label} 数组。
|
||||
* - 传 onChange:受控用法,用于筛选条件。
|
||||
* - 传 name:表单用法,value 为初始值;Picker 本身不参与表单提交,所以用隐藏 input 带上选中值。
|
||||
* - 传 all:最前面加一个值为 '' 的“全部”选项。
|
||||
*/
|
||||
export function Select({label, options, all, value, onChange, name, showLabel = false}) {
|
||||
const items = options.map(o => (typeof o === 'string' ? {value: o, label: o} : o));
|
||||
if (all) items.unshift({value: '', label: all});
|
||||
const [own, setOwn] = useState(value ?? items[0]?.value ?? '');
|
||||
const current = onChange ? value ?? '' : own;
|
||||
return html`
|
||||
<${Fragment}>
|
||||
<${Picker} label=${label} labelHidden=${!showLabel} options=${items} presentation="menu"
|
||||
value=${current} onValueChange=${onChange || setOwn}/>
|
||||
${name && html`<input type="hidden" name=${name} value=${current}/>`}
|
||||
</${Fragment}>`;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/* 显示格式与颜色常量。颜色全部取自 Apple 系统色(浅色模式值),同一实体在所有图表中颜色固定。 */
|
||||
|
||||
export const num = v => (v == null || v === '' ? '' : Number(v).toLocaleString('zh-CN'));
|
||||
|
||||
/** 站名精简:去掉运营商前缀、行政区与 BBU 后缀,便于图表标签展示 */
|
||||
export const shortSite = n =>
|
||||
String(n).replace(/^[A-Z]+/, '').replace(/^南宁(市)?(邕宁区)?/, '').replace(/[-_]?BBU.*$/i, '').slice(0, 14) || n;
|
||||
|
||||
/** 固定小数位,让同一屏的百分比位数一致(例如 97.0712 → 97.07,90.6 → 90.60) */
|
||||
export function fixed(value, digits = 2) {
|
||||
if (value == null || value === '') {
|
||||
return '';
|
||||
}
|
||||
return Number(value).toFixed(digits);
|
||||
}
|
||||
|
||||
export const BLUE = '#007aff';
|
||||
|
||||
/**
|
||||
* 柱状图数据:只把最大值标成强调色,其余柱子用主题里的中性灰。
|
||||
* 这样每张图只有一个视觉焦点,读者一眼看到“最需要关注的是哪一项”。
|
||||
*/
|
||||
export function accentMax(values) {
|
||||
const max = Math.max(...values);
|
||||
const data = [];
|
||||
for (const value of values) {
|
||||
if (value === max && max > 0) {
|
||||
data.push({value, itemStyle: {color: BLUE}});
|
||||
} else {
|
||||
data.push(value);
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/** 热力图格子里的数字颜色:深色格子用白字,浅色格子用深色字(格子颜色深浅模式下相同,所以不跟随主题) */
|
||||
export function heatLabelColor(value, max) {
|
||||
if (value > max * 0.6) {
|
||||
return '#ffffff';
|
||||
}
|
||||
return '#1d1d1f';
|
||||
}
|
||||
|
||||
/** 图表系列色板:systemBlue / Orange / Green / Purple / Pink / Teal / Indigo / Red */
|
||||
export const PALETTE = [BLUE, '#ff9500', '#34c759', '#af52de', '#ff2d55', '#30b0c7', '#5856d6', '#ff3b30'];
|
||||
|
||||
/** 根因颜色 */
|
||||
export const CAUSE_COLOR = {
|
||||
传输中断: BLUE, 电源故障: '#ff9500', 设备硬件: '#af52de', 天馈故障: '#34c759',
|
||||
机房环境: '#ff2d55', 割接施工: '#30b0c7', 其他: '#8e8e93',
|
||||
};
|
||||
|
||||
/** 热力图色阶:由浅到深的 systemBlue */
|
||||
export const BLUE_SCALE = ['#e8f2ff', '#a9cfff', '#4da3ff', '#0062cc'];
|
||||
|
||||
/** 断站分级、闭环状态 -> 标签色调(见 app.css 中的 .tag[data-tone]) */
|
||||
export const LEVEL_TONE = {重要: 'red', 主要: 'orange', 次要: 'gray'};
|
||||
export const STATUS_TONE = {已闭环: 'green', 处理中: 'blue', 待处理: 'yellow'};
|
||||
|
||||
export const ROLE_NAME = {admin: '管理员', user: '普通用户'};
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 前端入口。本项目前端免构建:static/js 下的文件由浏览器直接运行,改完刷新即可。
|
||||
* 组件用 html`...` 模板书写(htm 库),和 JSX 的区别只有三点:
|
||||
* 1. 组件名写成 <${Section}>,结束标签写成 </${Section}>
|
||||
* 2. 变量与表达式写成 ${...},例如 title=${t}、onClick=${fn}
|
||||
* 3. 嵌套模板也要用 html`...`,例如 ${ok && html`<b>成功</b>`}
|
||||
* 一个 html`...` 里如果有多个并列的根元素,用 <${Fragment}>...</${Fragment}> 包起来(相当于 JSX 的 <>...</>)。
|
||||
*/
|
||||
import {createRoot, GlassProvider, html, StrictMode, ToastProvider} from 'vendor';
|
||||
import {Root} from './App.js';
|
||||
|
||||
// 组件库内置文案为英文,这里替换为中文(只列出用到的项)
|
||||
const STRINGS = {close: '关闭', cancel: '取消', clearSearch: '清除', noResults: '无结果', moreToolbarItems: '更多'};
|
||||
|
||||
createRoot(document.getElementById('root')).render(html`
|
||||
<${StrictMode}>
|
||||
<${GlassProvider} theme="system" strings=${STRINGS}>
|
||||
<${ToastProvider} limit=${3}>
|
||||
<${Root}/>
|
||||
</${ToastProvider}>
|
||||
</${GlassProvider}>
|
||||
</${StrictMode}>
|
||||
`);
|
||||
@@ -0,0 +1,111 @@
|
||||
import {GlassSegmentedControl, html, useState} from 'vendor';
|
||||
import {useApp, useFetch} from '../api.js';
|
||||
import {accentMax, BLUE, BLUE_SCALE, CAUSE_COLOR, fixed, heatLabelColor, num, shortSite} from '../format.js';
|
||||
import {EChart} from '../components/EChart.js';
|
||||
import {Kpi, Loading, Section} from '../components/ui.js';
|
||||
|
||||
export default function Dashboard() {
|
||||
const {filters} = useApp();
|
||||
const {data} = useFetch('/api/dashboard', filters);
|
||||
if (!data) return html`<${Loading}/>`;
|
||||
const k = data.kpi;
|
||||
|
||||
// 横向条形图自下而上绘制,反转后最大值在最上
|
||||
const rank = [...data.rank].reverse();
|
||||
const scenes = [...new Set(data.heat.map(h => h[0]))];
|
||||
const bench = data.bench.filter(x => x.count);
|
||||
|
||||
// 热力图:每个格子单独设置数字颜色,深色格子用白字
|
||||
const heatMax = Math.max(1, ...data.heat.map(h => h[2]));
|
||||
const heatCells = [];
|
||||
for (const [scene, month, hours] of data.heat) {
|
||||
heatCells.push({
|
||||
value: [data.months.indexOf(month), scenes.indexOf(scene), hours],
|
||||
label: {color: heatLabelColor(hours, heatMax)},
|
||||
});
|
||||
}
|
||||
|
||||
const rankChart = {
|
||||
tooltip: {trigger: 'axis', axisPointer: {type: 'shadow'}, formatter: ([s]) => {
|
||||
const r = rank[s.dataIndex];
|
||||
return `${r.site_name}<br>场景:${r.scene}<br>累计:<b>${s.value} h</b>(${r.count} 次)`;
|
||||
}},
|
||||
xAxis: {type: 'value'},
|
||||
yAxis: {type: 'category', data: rank.map(r => shortSite(r.site_name)), axisLabel: {fontSize: 11}},
|
||||
series: [{type: 'bar', barMaxWidth: 16, itemStyle: {borderRadius: [0, 6, 6, 0]},
|
||||
data: accentMax(rank.map(r => +(r.total_min / 60).toFixed(1)))}],
|
||||
};
|
||||
const pieChart = {
|
||||
tooltip: {trigger: 'item', formatter: '{b}<br>{c} 次({d}%)'},
|
||||
legend: {bottom: 0, icon: 'circle', itemWidth: 8},
|
||||
series: [{type: 'pie', radius: ['50%', '74%'], center: ['50%', '44%'], padAngle: 2,
|
||||
itemStyle: {borderRadius: 6}, label: {formatter: '{d}%'},
|
||||
data: data.pie.map(([name, value]) => ({name, value, itemStyle: {color: CAUSE_COLOR[name]}}))}],
|
||||
};
|
||||
const heatChart = {
|
||||
tooltip: {formatter: s => `${scenes[s.value[1]]} · ${data.months[s.value[0]]}<br><b>${s.value[2]} h</b>`},
|
||||
grid: {left: 12, right: 70, top: 10, bottom: 10, containLabel: true},
|
||||
xAxis: {type: 'category', data: data.months},
|
||||
yAxis: {type: 'category', data: scenes},
|
||||
visualMap: {min: 0, max: heatMax, right: 0, top: 'middle',
|
||||
itemHeight: 160, calculable: true, inRange: {color: BLUE_SCALE}},
|
||||
series: [{type: 'heatmap', data: heatCells,
|
||||
itemStyle: {borderColor: 'transparent', borderWidth: 2, borderRadius: 6},
|
||||
label: {show: true, fontSize: 10}}],
|
||||
};
|
||||
const hourChart = {
|
||||
tooltip: {trigger: 'axis', formatter: ([s]) => `${s.name}:00 - ${s.name}:59<br><b>${s.value} 次</b>`},
|
||||
xAxis: {type: 'category', data: [...Array(24).keys()]},
|
||||
yAxis: {type: 'value'},
|
||||
series: [{type: 'bar', barMaxWidth: 12, data: accentMax(data.hours)}],
|
||||
};
|
||||
const benchChart = {
|
||||
tooltip: {trigger: 'axis', formatter: ([s]) =>
|
||||
`${s.name}<br>平均退服时长 <b>${s.value} min</b><br>退服率 ${bench[s.dataIndex].outage_rate}%`},
|
||||
xAxis: {type: 'category', data: bench.map(x => x.scene)},
|
||||
yAxis: {type: 'value'},
|
||||
series: [{type: 'bar', data: accentMax(bench.map(x => x.avg_min)), label: {show: true, position: 'top'}}],
|
||||
};
|
||||
|
||||
return html`
|
||||
<div className="grid">
|
||||
<${Section} title="运维考核指标" hint=${`计算耗时 ${data.elapsed}s`}>
|
||||
<div className="kpis">
|
||||
<${Kpi} title="退服次数" value=${num(k.count)} unit="次" sub=${`覆盖 ${k.sites} 个基站`}/>
|
||||
<${Kpi} title="累计退服时长" value=${num(k.total_h)} unit="h"/>
|
||||
<${Kpi} title="平均退服时长" value=${k.avg_min} unit="min"/>
|
||||
<${Kpi} title="退服率" value=${fixed(k.outage_rate)} unit="%" sub="退服时长 / (站点数 × 统计时长)"/>
|
||||
<${Kpi} title="网络可用率" value=${fixed(k.availability)} unit="%"/>
|
||||
<${Kpi} title="超长退服占比" value=${fixed(k.long_ratio)} unit="%"/>
|
||||
<${Kpi} title="重复退服率" value=${fixed(k.repeat_rate)} unit="%" sub="高频站点 / 有退服站点"/>
|
||||
<${Kpi} title="受影响用户" value=${num(k.users)} unit="人次"/>
|
||||
<${Kpi} title="根因判定准确率" value=${fixed(k.acc)} unit="%"/>
|
||||
<${Kpi} title="闭环率" value=${fixed(k.closed)} unit="%"/>
|
||||
<${Kpi} title="上报时长差错" value=${k.dur_fix} unit="条" sub="已按起止时间重算纠正"/>
|
||||
</div>
|
||||
</${Section}>
|
||||
<${Section} span=${5} title="站点累计退服时长 Top 15" hint="单位:小时"><${EChart} height=${380} option=${rankChart}/></${Section}>
|
||||
<${TrendCard} trend=${data.trend}/>
|
||||
<${Section} span=${4} title="退服根因占比"><${EChart} option=${pieChart}/></${Section}>
|
||||
<${Section} span=${8} title="场景 × 月份 退服时长热力图" hint="单位:小时"><${EChart} option=${heatChart}/></${Section}>
|
||||
<${Section} span=${7} title="退服发生时段分布" hint="单位:次"><${EChart} option=${hourChart}/></${Section}>
|
||||
<${Section} span=${5} title="分场景平均退服时长对标" hint="单位:分钟"><${EChart} option=${benchChart}/></${Section}>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
/** 月度趋势:看板的主图(最宽、唯一带面积填充的图),可切换次数 / 时长 */
|
||||
function TrendCard({trend}) {
|
||||
const [key, setKey] = useState('n');
|
||||
const switcher = html`
|
||||
<${GlassSegmentedControl} aria-label="趋势指标" value=${key} onValueChange=${setKey}
|
||||
items=${[{value: 'n', label: '次数'}, {value: 'h', label: '时长(h)'}]}/>`;
|
||||
const option = {
|
||||
tooltip: {trigger: 'axis'},
|
||||
xAxis: {type: 'category', data: trend.map(t => t.month), boundaryGap: false},
|
||||
yAxis: {type: 'value', name: key === 'n' ? '次' : '小时'},
|
||||
series: [{type: 'line', data: trend.map(t => t[key]), color: BLUE,
|
||||
areaStyle: {color: {type: 'linear', x: 0, y: 0, x2: 0, y2: 1,
|
||||
colorStops: [{offset: 0, color: 'rgba(0,122,255,.22)'}, {offset: 1, color: 'rgba(0,122,255,0)'}]}}}],
|
||||
};
|
||||
return html`<${Section} span=${7} title="月度退服趋势" extra=${switcher}><${EChart} height=${380} option=${option}/></${Section}>`;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
import {html} from 'vendor';
|
||||
import {useApp, useFetch} from '../api.js';
|
||||
import {accentMax, fixed, num} from '../format.js';
|
||||
import {EChart} from '../components/EChart.js';
|
||||
import {DataTable} from '../components/DataTable.js';
|
||||
import {Kpi, Loading, Section} from '../components/ui.js';
|
||||
|
||||
const BENCH_COLUMNS = [
|
||||
{key: 'scene', title: '场景'}, {key: 'sites', title: '站点数'}, {key: 'count', title: '退服次数'},
|
||||
{key: 'total_h', title: '累计时长(h)'}, {key: 'avg_min', title: '平均时长(min)'}, {key: 'outage_rate', title: '退服率(%)'},
|
||||
{key: 'availability', title: '可用率(%)'}, {key: 'long_ratio', title: '超长占比(%)'}, {key: 'repeat_rate', title: '重复退服率(%)'},
|
||||
{key: 'users', title: '受影响用户', render: num}, {key: 'loss_gb', title: '业务损失(GB)', render: num},
|
||||
];
|
||||
|
||||
/** 场景柱状图配置:最大的场景用强调色标出 */
|
||||
const sceneBar = (bench, values) => ({
|
||||
tooltip: {trigger: 'axis', axisPointer: {type: 'shadow'}},
|
||||
xAxis: {type: 'category', data: bench.map(x => x.scene)},
|
||||
yAxis: {type: 'value'},
|
||||
series: [{type: 'bar', barMaxWidth: 34, label: {show: true, position: 'top'}, data: accentMax(values)}],
|
||||
});
|
||||
|
||||
export default function Impact() {
|
||||
const {filters} = useApp();
|
||||
const {data} = useFetch('/api/dashboard', filters);
|
||||
if (!data) return html`<${Loading}/>`;
|
||||
const {kpi: k, bench} = data;
|
||||
|
||||
return html`
|
||||
<div className="grid">
|
||||
<${Section} title="影响评估">
|
||||
<div className="kpis">
|
||||
<${Kpi} title="受影响用户" value=${num(k.users)} unit="人次" sub="小区数 × 单小区在线用户 × 忙闲时系数"/>
|
||||
<${Kpi} title="业务损失" value=${num(k.loss_gb)} unit="GB" sub="小区话务 × 退服时长"/>
|
||||
<${Kpi} title="退服率" value=${fixed(k.outage_rate)} unit="%"/>
|
||||
<${Kpi} title="网络可用率" value=${fixed(k.availability)} unit="%"/>
|
||||
<${Kpi} title="平均退服时长" value=${k.avg_min} unit="min"/>
|
||||
<${Kpi} title="超长退服占比" value=${fixed(k.long_ratio)} unit="%"/>
|
||||
<${Kpi} title="重复退服率" value=${fixed(k.repeat_rate)} unit="%"/>
|
||||
</div>
|
||||
</${Section}>
|
||||
<${Section} span=${6} title="分场景退服率" hint="单位:%">
|
||||
<${EChart} option=${sceneBar(bench, bench.map(x => x.outage_rate))}/>
|
||||
</${Section}>
|
||||
<${Section} span=${6} title="分场景受影响用户" hint="单位:万人次">
|
||||
<${EChart} option=${sceneBar(bench, bench.map(x => +(x.users / 1e4).toFixed(1)))}/>
|
||||
</${Section}>
|
||||
<${Section} title="通信场景运维考核指标横向对标">
|
||||
<${DataTable} rowKey="scene" columns=${BENCH_COLUMNS} rows=${bench}/>
|
||||
</${Section}>
|
||||
</div>`;
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
import {GlassButton, html, useState, useToast} from 'vendor';
|
||||
import {api, download, useApp} from '../api.js';
|
||||
import {DataTable} from '../components/DataTable.js';
|
||||
import {Icon} from '../components/icons.js';
|
||||
import {Loading, Section} from '../components/ui.js';
|
||||
|
||||
// 问题行表格:站点工参没有时间列
|
||||
const ERROR_COLUMNS = [
|
||||
{key: 'row', title: '文件行号'}, {key: 'key', title: '编号 / 名称'}, {key: 'start_time', title: '时间'},
|
||||
{key: 'reason', title: '问题原因', render: v => html`<span className="text-red">${v}</span>`},
|
||||
];
|
||||
const SITE_ERROR_COLUMNS = [
|
||||
{key: 'row', title: '文件行号'}, {key: 'key', title: '基站编号 / 名称'},
|
||||
{key: 'reason', title: '问题原因', render: v => html`<span className="text-red">${v}</span>`},
|
||||
];
|
||||
|
||||
// 合格数据预览表格,按文件类型显示不同的列
|
||||
const PREVIEW_COLUMNS = {
|
||||
outage: [
|
||||
{key: 'record_id', title: '流水号'}, {key: 'ne_id', title: '基站编号'}, {key: 'start_time', title: '开始时间'},
|
||||
{key: 'end_time', title: '恢复时间'}, {key: 'duration_min', title: '计算时长(分)'},
|
||||
{key: 'reported_min', title: '上报时长(分)'}, {key: 'cause_category', title: '原因大类'}, {key: 'cause_code', title: '原因码'},
|
||||
],
|
||||
alarm: [
|
||||
{key: 'alarm_id', title: '告警编号'}, {key: 'ne_id', title: '基站编号'}, {key: 'alarm_name', title: '告警名称'},
|
||||
{key: 'alarm_level', title: '级别'}, {key: 'category', title: '归入类别'}, {key: 'start_time', title: '发生时间'},
|
||||
{key: 'clear_time', title: '清除时间'}, {key: 'parent_alarm_id', title: '父告警'},
|
||||
],
|
||||
site: [
|
||||
{key: 'action', title: '操作'}, {key: 'ne_id', title: '基站编号'}, {key: 'site_name', title: '基站名称'},
|
||||
{key: 'district', title: '片区'}, {key: 'scene', title: '推断场景'}, {key: 'site_type', title: '站型'},
|
||||
{key: 'vendor', title: '厂家'}, {key: 'cells', title: '小区数'}, {key: 'lng', title: '经度'}, {key: 'lat', title: '纬度'},
|
||||
],
|
||||
};
|
||||
|
||||
/**
|
||||
* 导入分两步:上传预览(服务端识别类型并校验,不入库)→ 确认入库。
|
||||
* 退服流水入库后对新记录做根因分析;告警入库后对全部流水重新关联;站点入库后刷新下拉选项。
|
||||
*/
|
||||
export default function Import() {
|
||||
const {refreshMeta} = useApp();
|
||||
const toast = useToast();
|
||||
const [dragOver, setDragOver] = useState(false);
|
||||
const [checking, setChecking] = useState(false);
|
||||
const [saving, setSaving] = useState(false);
|
||||
const [preview, setPreview] = useState(null); // 服务端校验结果
|
||||
const [result, setResult] = useState(null); // 入库结果
|
||||
|
||||
const upload = async file => {
|
||||
if (!file) return;
|
||||
const body = new FormData();
|
||||
body.append('file', file);
|
||||
setChecking(true);
|
||||
setPreview(null);
|
||||
setResult(null);
|
||||
try {
|
||||
setPreview(await api('/api/import/preview', {body}));
|
||||
} catch (e) {
|
||||
toast({message: e.message, tone: 'error'});
|
||||
}
|
||||
setChecking(false);
|
||||
};
|
||||
|
||||
const confirmImport = async () => {
|
||||
setSaving(true);
|
||||
try {
|
||||
const r = await api('/api/import/confirm', {json: {token: preview.token}});
|
||||
setResult({...r, label: preview.label});
|
||||
setPreview(null);
|
||||
toast({message: `${preview.label}入库完成`, tone: 'success'});
|
||||
if (r.kind === 'site') {
|
||||
await refreshMeta(); // 新站点可能带来新的片区、厂家,并改变站点总数
|
||||
}
|
||||
} catch (e) {
|
||||
toast({message: e.message, tone: 'error'});
|
||||
}
|
||||
setSaving(false);
|
||||
};
|
||||
|
||||
const templateButton = html`
|
||||
<${GlassButton} variant="gray" onClick=${() => download('/api/template')}>下载退服流水模板</${GlassButton}>`;
|
||||
|
||||
return html`
|
||||
<${Section} title="数据批量导入" extra=${templateButton}>
|
||||
<label className="drop" data-over=${dragOver || undefined}
|
||||
onDragOver=${e => { e.preventDefault(); setDragOver(true); }} onDragLeave=${() => setDragOver(false)}
|
||||
onDrop=${e => { e.preventDefault(); setDragOver(false); upload(e.dataTransfer.files[0]); }}>
|
||||
<input type="file" accept=".xlsx,.xls,.csv" hidden onChange=${e => { upload(e.target.files[0]); e.target.value = ''; }}/>
|
||||
<div className="drop-icon" aria-hidden="true"><${Icon} name="import" size=${28}/></div>
|
||||
<b>点击或拖拽 Excel / CSV 文件到此处,系统自动识别文件类型</b>
|
||||
<p>
|
||||
<b>退服流水</b>:必填 ne_id、start_time、end_time(支持中文表头),系统按起止时间重算退服时长并核对上报值。<br/>
|
||||
<b>告警流</b>:本系统口径(含 alarm_code 列)或华为网管「当前告警浏览」导出 CSV,按告警名称自动归入根因类别。<br/>
|
||||
<b>站点工参</b>:电信 / 移动 5G 工参表,按基站汇总小区并按站名推断通信场景,已有基站只更新不重复。
|
||||
</p>
|
||||
</label>
|
||||
|
||||
${checking && html`<${Loading}/>`}
|
||||
${result && html`<${ImportResult} result=${result}/>`}
|
||||
${preview && html`<${PreviewPanel} preview=${preview} saving=${saving} onConfirm=${confirmImport}/>`}
|
||||
</${Section}>`;
|
||||
}
|
||||
|
||||
/** 入库完成后的说明 */
|
||||
function ImportResult({result}) {
|
||||
let detail = `入库 ${result.n} 条`;
|
||||
if (result.kind === 'site') {
|
||||
detail = `新增站点 ${result.added} 个,更新站点 ${result.updated} 个`;
|
||||
}
|
||||
return html`
|
||||
<div className="note">
|
||||
${result.label}:${detail},耗时 ${result.elapsed}s。可到「退服流水管理」或「场景与站点分级」查看。
|
||||
</div>`;
|
||||
}
|
||||
|
||||
/** 校验结果:统计数字 + 问题行 + 合格数据预览 */
|
||||
function PreviewPanel({preview, saving, onConfirm}) {
|
||||
const isSite = preview.kind === 'site';
|
||||
let errorColumns = ERROR_COLUMNS;
|
||||
if (isSite) {
|
||||
errorColumns = SITE_ERROR_COLUMNS;
|
||||
}
|
||||
|
||||
let confirmText = `确认导入 ${preview.ok} 条合格数据`;
|
||||
if (isSite) {
|
||||
confirmText = `确认导入 ${preview.ok} 个站点`;
|
||||
}
|
||||
|
||||
return html`
|
||||
<div>
|
||||
<div className="chips">
|
||||
<div className="chip"><span>文件类型</span>${preview.label}</div>
|
||||
<div className="chip"><span>文件行数</span>${preview.total}</div>
|
||||
<div className="chip" data-tone="green"><span>${isSite ? '汇总站点' : '校验通过'}</span>${preview.ok}</div>
|
||||
<div className="chip" data-tone="red"><span>问题行</span>${preview.bad}</div>
|
||||
${preview.diff > 0 && html`<div className="chip" data-tone="orange"><span>上报时长差错(已纠正)</span>${preview.diff}</div>`}
|
||||
${preview.kind === 'alarm' && html`<div className="chip"><span>匹配站点库</span>${preview.matched}</div>`}
|
||||
${isSite && html`<div className="chip"><span>新增 / 更新</span>${preview.added} / ${preview.updated}</div>`}
|
||||
<div className="chip"><span>校验耗时</span>${preview.elapsed}s</div>
|
||||
<span className="grow"></span>
|
||||
<${GlassButton} variant="glassProminent" disabled=${!preview.ok} loading=${saving} onClick=${onConfirm}>
|
||||
${confirmText}
|
||||
</${GlassButton}>
|
||||
</div>
|
||||
|
||||
${preview.kind === 'alarm' && preview.matched < preview.ok && html`
|
||||
<p className="hint">
|
||||
有 ${preview.ok - preview.matched} 条告警的基站不在站点库中:可以入库留档,但不会参与本系统站点的根因分析。
|
||||
可先导入对应的站点工参。
|
||||
</p>`}
|
||||
|
||||
${preview.bad > 0 && html`
|
||||
<div>
|
||||
<h4 className="sub-title">问题数据(不会入库,最多显示 500 条)</h4>
|
||||
<${DataTable} columns=${errorColumns} rows=${preview.errors} maxHeight=${320}/>
|
||||
</div>`}
|
||||
|
||||
<h4 className="sub-title">合格数据预览(前 50 条)</h4>
|
||||
<${DataTable} columns=${PREVIEW_COLUMNS[preview.kind] || PREVIEW_COLUMNS.outage} rows=${preview.preview}/>
|
||||
</div>`;
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
import {Fragment, GlassButton, GlassCheckbox, html, SearchField, TextField, useState, useToast} from 'vendor';
|
||||
import {api, useApp, useFetch} from '../api.js';
|
||||
import {DataTable, Pager} from '../components/DataTable.js';
|
||||
import {FormDialog} from '../components/FormDialog.js';
|
||||
import {Cause, LevelTag, Loading, Section, Select, StatusTag} from '../components/ui.js';
|
||||
|
||||
const PAGE_SIZE = 20;
|
||||
|
||||
export default function Outages() {
|
||||
const {meta, filters, isAdmin} = useApp();
|
||||
const toast = useToast();
|
||||
const [draft, setDraft] = useState({}); // 工具栏中正在编辑的条件
|
||||
const [query, setQuery] = useState({}); // 点击“查询”后生效的条件
|
||||
const [page, setPage] = useState(1);
|
||||
const [sort, setSort] = useState({key: 'start_time', asc: false});
|
||||
const [selected, setSelected] = useState(new Set());
|
||||
const [editing, setEditing] = useState(null); // null=关闭;{}=新增;记录=编辑
|
||||
|
||||
const {data, reload} = useFetch('/api/outages', {
|
||||
...filters, ...query, page, size: PAGE_SIZE, sort: sort.key, asc: sort.asc ? 1 : 0,
|
||||
});
|
||||
|
||||
const setD = key => value => setDraft(d => ({...d, [key]: value}));
|
||||
const search = () => { setQuery(draft); setPage(1); setSelected(new Set()); };
|
||||
const onSort = key => { setSort(s => ({key, asc: s.key === key ? !s.asc : false})); setPage(1); };
|
||||
|
||||
const remove = async row => {
|
||||
if (!confirm(`确认删除退服记录 ${row.record_id}?`)) return;
|
||||
try {
|
||||
await api(`/api/outages/${row.id}`, {method: 'DELETE'});
|
||||
toast({message: '已删除', tone: 'success'});
|
||||
reload();
|
||||
} catch (e) {
|
||||
toast({message: e.message, tone: 'error'});
|
||||
}
|
||||
};
|
||||
|
||||
const batch = async action => {
|
||||
const ids = [...selected];
|
||||
if (!ids.length) return toast({message: '请先勾选记录', tone: 'warning'});
|
||||
if (action === 'delete' && !confirm(`确认删除选中的 ${ids.length} 条记录?`)) return;
|
||||
try {
|
||||
await api('/api/outages/batch', {json: {ids, action, status: '已闭环'}});
|
||||
toast({message: action === 'delete' ? '已删除' : `已闭环 ${ids.length} 条`, tone: 'success'});
|
||||
setSelected(new Set());
|
||||
reload();
|
||||
} catch (e) {
|
||||
toast({message: e.message, tone: 'error'});
|
||||
}
|
||||
};
|
||||
|
||||
const columns = [
|
||||
{key: 'record_id', title: '流水号'}, {key: 'ne_id', title: '基站编号'}, {key: 'site_name', title: '基站名称'},
|
||||
{key: 'scene', title: '场景'}, {key: 'site_type', title: '站型'},
|
||||
{key: 'start_time', title: '退服开始', sortable: true}, {key: 'end_time', title: '恢复时间'},
|
||||
{key: 'duration_min', title: '计算时长(分)', sortable: true},
|
||||
{key: 'reported_min', title: '上报时长', render: (v, r) => r.dur_diff
|
||||
? html`<span className="text-red" title="与起止时间不符,已按系统计算值纠正">${v} ⚠</span>` : v},
|
||||
{key: 'cause_category', title: '上报原因', render: (v, r) => v && html`<span>${v} <span className="hint">${r.cause_code}</span></span>`},
|
||||
{key: 'root_cause', title: '判定根因', render: v => html`<${Cause} value=${v}/>`},
|
||||
{key: 'level', title: '分级', render: v => html`<${LevelTag} value=${v}/>`},
|
||||
{key: 'status', title: '状态', render: v => html`<${StatusTag} value=${v}/>`},
|
||||
{key: 'affected_users', title: '影响用户', sortable: true},
|
||||
{key: 'id', title: '操作', render: (_, r) => html`
|
||||
<div className="row nowrap">
|
||||
<${GlassButton} variant="tinted" controlSize="small" onClick=${() => setEditing(r)}>${isAdmin ? '编辑' : '处理'}</${GlassButton}>
|
||||
${isAdmin && html`<${GlassButton} variant="destructive" controlSize="small" onClick=${() => remove(r)}>删除</${GlassButton}>`}
|
||||
</div>`},
|
||||
];
|
||||
|
||||
return html`
|
||||
<${Section}>
|
||||
<div className="row toolbar">
|
||||
<${SearchField} aria-label="基站编号或名称" placeholder="基站编号 / 名称关键字" value=${draft.site || ''}
|
||||
onValueChange=${setD('site')} onSubmitQuery=${search}/>
|
||||
<${Select} label="上报原因" all="全部上报原因" options=${meta.causes} value=${draft.cause_category} onChange=${setD('cause_category')}/>
|
||||
<${Select} label="判定根因" all="全部判定根因" options=${meta.causes} value=${draft.root_cause} onChange=${setD('root_cause')}/>
|
||||
<${Select} label="闭环状态" all="全部闭环状态" options=${meta.status} value=${draft.status} onChange=${setD('status')}/>
|
||||
<${GlassCheckbox} label="仅超长" checked=${!!draft.long} onCheckedChange=${v => setD('long')(v ? 1 : '')}/>
|
||||
<${GlassCheckbox} label="仅时长差错" checked=${!!draft.diff} onCheckedChange=${v => setD('diff')(v ? 1 : '')}/>
|
||||
<${GlassButton} variant="glassProminent" onClick=${search}>查询</${GlassButton}>
|
||||
<span className="grow"></span>
|
||||
${isAdmin && html`
|
||||
<div className="row">
|
||||
<${GlassButton} onClick=${() => setEditing({})}>新增记录</${GlassButton}>
|
||||
<${GlassButton} onClick=${() => batch('status')}>批量闭环</${GlassButton}>
|
||||
<${GlassButton} variant="destructive" onClick=${() => batch('delete')}>批量删除</${GlassButton}>
|
||||
</div>`}
|
||||
</div>
|
||||
${data ? html`
|
||||
<div>
|
||||
<${DataTable} columns=${columns} rows=${data.rows} sort=${sort} onSort=${onSort}
|
||||
selected=${isAdmin ? selected : undefined} onSelect=${isAdmin ? setSelected : undefined}/>
|
||||
<${Pager} page=${page} size=${PAGE_SIZE} total=${data.total} onPage=${setPage}/>
|
||||
</div>` : html`<${Loading}/>`}
|
||||
${editing && html`<${OutageDialog} row=${editing} onClose=${() => setEditing(null)} onSaved=${reload}/>`}
|
||||
</${Section}>`;
|
||||
}
|
||||
|
||||
/** 新增 / 编辑 / 闭环处理弹窗。管理员可改全部字段;普通用户只能更新处理进度 */
|
||||
function OutageDialog({row, onClose, onSaved}) {
|
||||
const {meta, isAdmin} = useApp();
|
||||
const toast = useToast();
|
||||
const {data: sites} = useFetch(isAdmin ? '/api/sites' : null); // 管理员需要站点列表做输入提示
|
||||
const isNew = !row.id;
|
||||
const dt = v => (v || '').replace(' ', 'T').slice(0, 16); // "2026-10-01 08:00:00" -> datetime-local 格式
|
||||
|
||||
const save = async d => {
|
||||
if (isAdmin && (!d.ne_id || !d.start_time || !d.end_time)) {
|
||||
toast({message: '基站编号与起止时间必填', tone: 'error'});
|
||||
throw new Error('invalid');
|
||||
}
|
||||
try {
|
||||
if (isNew) {
|
||||
await api('/api/outages', {method: 'POST', json: d});
|
||||
} else {
|
||||
await api(`/api/outages/${row.id}`, {method: 'PUT', json: d});
|
||||
}
|
||||
} catch (e) {
|
||||
toast({message: e.message, tone: 'error'});
|
||||
throw e;
|
||||
}
|
||||
toast({message: '已保存', tone: 'success'});
|
||||
onSaved();
|
||||
};
|
||||
|
||||
// 管理员才有的字段:基站、流水号、原因、起止时间
|
||||
const adminFields = html`<${Fragment}>
|
||||
<${TextField} className="full" name="ne_id" label="基站编号(可输入站名搜索)" list="site-list" defaultValue=${row.ne_id}/>
|
||||
<datalist id="site-list">${sites?.rows?.map(s => html`<option key=${s.ne_id} value=${s.ne_id}>${s.site_name}</option>`)}</datalist>
|
||||
<${TextField} name="record_id" label="流水号" defaultValue=${row.record_id}/>
|
||||
<${TextField} name="ticket_id" label="工单号" defaultValue=${row.ticket_id}/>
|
||||
<${Select} name="cause_category" label="上报原因大类" showLabel all="(未填写)" options=${meta.causes} value=${row.cause_category}/>
|
||||
<${TextField} name="cause_detail" label="原因细项" defaultValue=${row.cause_detail}/>
|
||||
<${TextField} name="start_time" label="退服开始时间" type="datetime-local" defaultValue=${dt(row.start_time)}/>
|
||||
<${TextField} name="end_time" label="退服恢复时间" type="datetime-local" defaultValue=${dt(row.end_time)}/>
|
||||
</${Fragment}>`;
|
||||
|
||||
let title = '闭环处理';
|
||||
let description = `流水号 ${row.record_id} · ${row.site_name}`;
|
||||
if (isNew) {
|
||||
title = '新增退服记录';
|
||||
description = '填写退服基本信息';
|
||||
} else if (isAdmin) {
|
||||
title = '编辑退服记录';
|
||||
}
|
||||
|
||||
return html`
|
||||
<${FormDialog} onClose=${onClose} onSubmit=${save} title=${title} description=${description}>
|
||||
${isAdmin && adminFields}
|
||||
<${Select} name="status" label="闭环状态" showLabel options=${meta.status} value=${row.status || '待处理'}/>
|
||||
<${TextField} name="handler" label="处理人" defaultValue=${row.handler}/>
|
||||
<${TextField} className="full" name="remark" label="处理说明" multiline rows=${2} defaultValue=${row.remark}/>
|
||||
${row.advice && html`<div className="note full"><b>系统判定根因:${row.root_cause}</b>(${row.evidence})<br/>${row.advice}</div>`}
|
||||
</${FormDialog}>`;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import {GlassButton, GlassSegmentedControl, html, useState} from 'vendor';
|
||||
import {download, useApp, useFetch} from '../api.js';
|
||||
import {DataTable} from '../components/DataTable.js';
|
||||
import {Cause, Loading, Section} from '../components/ui.js';
|
||||
|
||||
const COLUMNS = [
|
||||
{key: 'ne_id', title: '基站编号'}, {key: 'site_name', title: '基站名称'}, {key: 'scene', title: '场景'},
|
||||
{key: 'site_type', title: '站型'}, {key: 'region', title: '片区'}, {key: 'count', title: '退服次数'},
|
||||
{key: 'total_min', title: '累计时长(分)'}, {key: 'avg_min', title: '平均时长(分)'}, {key: 'max_min', title: '最长单次(分)'},
|
||||
{key: 'long_min', title: '时长阈值'}, {key: 'freq_count', title: '次数阈值'},
|
||||
{key: 'top_cause', title: '主要根因', render: v => html`<${Cause} value=${v}/>`},
|
||||
{key: 'advice', title: '处置建议', wrap: true},
|
||||
];
|
||||
|
||||
export default function Rank() {
|
||||
const {filters} = useApp();
|
||||
const [kind, setKind] = useState('long');
|
||||
const {data} = useFetch('/api/sites/rank', {...filters, kind});
|
||||
|
||||
return html`
|
||||
<${Section}>
|
||||
<div className="row toolbar">
|
||||
<${GlassSegmentedControl} aria-label="站点类型" value=${kind} onValueChange=${setKind}
|
||||
items=${[{value: 'long', label: '超长退服站点'}, {value: 'repeat', label: '高频重复退服站点'}]}/>
|
||||
${data && html`<span className="hint">共 ${data.rows.length} 个站点</span>`}
|
||||
<span className="grow"></span>
|
||||
<${GlassButton} variant="glassProminent" onClick=${() => download('/api/export/long', filters)}>导出清单</${GlassButton}>
|
||||
</div>
|
||||
<div className="note gap-bottom">
|
||||
判定规则:<b>超长退服站点</b>=月均超长退服(单次时长 ≥ 场景超长阈值)≥ 1 次;
|
||||
<b>高频重复退服站点</b>=月均退服次数 ≥ 场景次数阈值。阈值在「场景与站点分级」中配置,每个入选站点均按主要根因给出处置建议。
|
||||
</div>
|
||||
${data ? html`<${DataTable} rowKey="ne_id" columns=${COLUMNS} rows=${data.rows}/>` : html`<${Loading}/>`}
|
||||
</${Section}>`;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import {GlassButton, html} from 'vendor';
|
||||
import {download, useApp, useFetch} from '../api.js';
|
||||
import {DataTable} from '../components/DataTable.js';
|
||||
import {Loading, Section} from '../components/ui.js';
|
||||
|
||||
const REPORTS = [
|
||||
{kind: 'stats', title: '退服统计表', desc: '考核指标汇总 + 站点维度累计/平均退服时长、次数、超长次数、受影响用户'},
|
||||
{kind: 'long', title: '超长退服站点清单', desc: '超长与高频重复退服站点、阈值、主要根因与处置建议'},
|
||||
{kind: 'advice', title: '根因处置建议清单', desc: '全部超长退服记录的判定根因、关联告警证据、分级与处置建议'},
|
||||
];
|
||||
const LOG_COLUMNS = [
|
||||
{key: 'ts', title: '时间'}, {key: 'username', title: '用户'}, {key: 'action', title: '操作'},
|
||||
{key: 'detail', title: '详情', wrap: true},
|
||||
];
|
||||
|
||||
export default function Reports() {
|
||||
const {filters, isAdmin} = useApp();
|
||||
const {data: logs} = useFetch(isAdmin ? '/api/logs' : null); // 操作日志仅管理员可见
|
||||
|
||||
let logContent = html`<${Loading}/>`;
|
||||
if (!isAdmin) {
|
||||
logContent = html`<p className="hint">仅管理员可查看操作日志</p>`;
|
||||
} else if (logs) {
|
||||
logContent = html`<${DataTable} rows=${logs.rows} columns=${LOG_COLUMNS}/>`;
|
||||
}
|
||||
|
||||
return html`
|
||||
<div className="grid">
|
||||
${REPORTS.map(r => html`
|
||||
<${Section} key=${r.kind} span=${4} title=${r.title}>
|
||||
<p className="hint report-desc">${r.desc}</p>
|
||||
<${GlassButton} variant="tinted" onClick=${() => download(`/api/export/${r.kind}`, filters)}>导出 Excel</${GlassButton}>
|
||||
</${Section}>`)}
|
||||
<${Section} title="操作日志">${logContent}</${Section}>
|
||||
</div>`;
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
import {Fragment, GlassButton, html, useState, useToast} from 'vendor';
|
||||
import {api, download, useApp, useFetch} from '../api.js';
|
||||
import {BLUE_SCALE, CAUSE_COLOR, heatLabelColor, num} from '../format.js';
|
||||
import {EChart} from '../components/EChart.js';
|
||||
import {DataTable, Pager} from '../components/DataTable.js';
|
||||
import {Cause, LevelTag, Loading, Section, Select, StatusTag} from '../components/ui.js';
|
||||
|
||||
const PAGE_SIZE = 15;
|
||||
|
||||
export default function RootCause() {
|
||||
const {filters, isAdmin} = useApp();
|
||||
const toast = useToast();
|
||||
const {data: confusion} = useFetch('/api/confusion', filters);
|
||||
const {data: stats} = useFetch('/api/stats', {...filters, dim: 'root_cause'});
|
||||
const [lastRun, setLastRun] = useState(null);
|
||||
const [running, setRunning] = useState(false);
|
||||
|
||||
const runAnalysis = async () => {
|
||||
setRunning(true);
|
||||
try {
|
||||
const r = await api('/api/analyze', {method: 'POST'});
|
||||
setLastRun(r);
|
||||
toast({message: `全量分析完成:${num(r.n)} 条,耗时 ${r.elapsed}s,准确率 ${r.acc}%`, tone: 'success'});
|
||||
} catch (e) {
|
||||
toast({message: e.message, tone: 'error'});
|
||||
}
|
||||
setRunning(false);
|
||||
};
|
||||
|
||||
if (!confusion || !stats) return html`<${Loading}/>`;
|
||||
|
||||
// 交叉矩阵:matrix[i][j] = 上报原因 i、系统判定 j 的条数;对角线 i === j 为判定一致
|
||||
const {causes, matrix} = confusion;
|
||||
const n = causes.length;
|
||||
let total = 0;
|
||||
let hit = 0;
|
||||
let maxCount = 1;
|
||||
for (const row of matrix) {
|
||||
maxCount = Math.max(maxCount, ...row);
|
||||
}
|
||||
// 热力图数据 value = [列, 行, 条数];行号倒过来,让第一个原因显示在最上面;深色格子用白字
|
||||
const cells = [];
|
||||
for (let i = 0; i < n; i++) {
|
||||
for (let j = 0; j < n; j++) {
|
||||
const count = matrix[i][j];
|
||||
total += count;
|
||||
if (i === j) hit += count;
|
||||
cells.push({value: [j, n - 1 - i, count], label: {color: heatLabelColor(count, maxCount)}});
|
||||
}
|
||||
}
|
||||
|
||||
const matrixChart = {
|
||||
tooltip: {formatter: s => `上报:${causes[n - 1 - s.value[1]]}<br>判定:${causes[s.value[0]]}<br><b>${s.value[2]} 条</b>`},
|
||||
grid: {left: 12, right: 12, top: 10, bottom: 30, containLabel: true},
|
||||
xAxis: {type: 'category', data: causes, name: '判定', nameLocation: 'center', nameGap: 26},
|
||||
yAxis: {type: 'category', data: [...causes].reverse()},
|
||||
visualMap: {show: false, min: 0, max: maxCount, inRange: {color: BLUE_SCALE}},
|
||||
series: [{type: 'heatmap', data: cells, label: {show: true},
|
||||
itemStyle: {borderColor: 'transparent', borderWidth: 2, borderRadius: 6}}],
|
||||
};
|
||||
const causeChart = {
|
||||
tooltip: {trigger: 'axis', axisPointer: {type: 'shadow'}, formatter: ([s]) => {
|
||||
const r = stats.rows[s.dataIndex];
|
||||
return `${r.key}<br>次数 ${r.count}<br>平均时长 <b>${r.avg_min} min</b><br>超长占比 ${r.long_ratio}%`;
|
||||
}},
|
||||
xAxis: {type: 'category', data: stats.rows.map(r => r.key)},
|
||||
yAxis: {type: 'value'},
|
||||
series: [{type: 'bar', barMaxWidth: 40, label: {show: true, position: 'top'},
|
||||
data: stats.rows.map(r => ({value: r.avg_min, itemStyle: {color: CAUSE_COLOR[r.key]}}))}],
|
||||
};
|
||||
const runButton = isAdmin && html`
|
||||
<${GlassButton} variant="glassProminent" loading=${running} onClick=${runAnalysis}>全量重新分析</${GlassButton}>`;
|
||||
|
||||
return html`
|
||||
<div className="grid">
|
||||
<${Section} span=${5} title="根因判定规则" extra=${runButton}>
|
||||
<div className="note">
|
||||
<b>第一级 · 告警衍生关系</b>:“小区退服”告警若带 parent_alarm_id,直接取父告警类别作为根因。<br/>
|
||||
<b>第二级 · 时间窗关联</b>:回溯同站在退服前仍未清除的告警,按优先级取首个命中:<br/>
|
||||
① 割接施工 30 分钟 ② 电源故障 300 分钟(考虑蓄电池后备)③ 机房环境 180 分钟(考虑过热保护延时)<br/>
|
||||
④ 传输中断 15 分钟 ⑤ 天馈故障 30 分钟 ⑥ 设备硬件 15 分钟<br/>
|
||||
停电衍生的传输告警因优先级归为电源故障;均未命中判为“其他”,派单现场核查。
|
||||
</div>
|
||||
<div className="chips">
|
||||
<div className="chip"><span>参与校验</span>${num(total)} 条</div>
|
||||
<div className="chip" data-tone="green"><span>判定准确率</span>${total ? (hit / total * 100).toFixed(2) : 0}%</div>
|
||||
<div className="chip"><span>上次分析</span>${lastRun ? `${num(lastRun.n)} 条 / ${lastRun.elapsed}s` : '—'}</div>
|
||||
</div>
|
||||
</${Section}>
|
||||
<${Section} span=${7} title="上报原因 × 系统判定根因 交叉矩阵" hint="对角线为判定一致"><${EChart} option=${matrixChart}/></${Section}>
|
||||
<${Section} title="根因维度统计" hint="柱高为平均退服时长(分钟)"><${EChart} height=${260} option=${causeChart}/></${Section}>
|
||||
<${AdviceList}/>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
/** 超长退服记录 + 分级处置建议(分页) */
|
||||
function AdviceList() {
|
||||
const {meta, filters} = useApp();
|
||||
const [cause, setCause] = useState('');
|
||||
const [page, setPage] = useState(1);
|
||||
const params = {...filters, long: 1, root_cause: cause};
|
||||
const {data} = useFetch('/api/outages', {...params, sort: 'duration_min', page, size: PAGE_SIZE});
|
||||
|
||||
const tools = html`<${Fragment}>
|
||||
<${Select} label="根因" all="全部根因" options=${meta.causes} value=${cause} onChange=${v => { setCause(v); setPage(1); }}/>
|
||||
<${GlassButton} onClick=${() => download('/api/export/advice', params)}>导出建议清单</${GlassButton}>
|
||||
</${Fragment}>`;
|
||||
const columns = [
|
||||
{key: 'ne_id', title: '基站编号'}, {key: 'site_name', title: '基站名称'}, {key: 'scene', title: '场景'},
|
||||
{key: 'start_time', title: '退服开始'}, {key: 'duration_min', title: '时长(分)'},
|
||||
{key: 'root_cause', title: '根因', render: v => html`<${Cause} value=${v}/>`}, {key: 'evidence', title: '关联告警证据'},
|
||||
{key: 'level', title: '分级', render: v => html`<${LevelTag} value=${v}/>`},
|
||||
{key: 'status', title: '状态', render: v => html`<${StatusTag} value=${v}/>`},
|
||||
{key: 'advice', title: '处置建议', wrap: true},
|
||||
];
|
||||
|
||||
return html`
|
||||
<${Section} title="超长退服根因与分级处置建议" extra=${tools}>
|
||||
${data ? html`
|
||||
<div>
|
||||
<${DataTable} rows=${data.rows} columns=${columns}/>
|
||||
<${Pager} page=${page} size=${PAGE_SIZE} total=${data.total} onPage=${setPage}
|
||||
prefix=${`超长退服 ${num(data.total)} 条,100% 已生成处置建议`}/>
|
||||
</div>` : html`<${Loading}/>`}
|
||||
</${Section}>`;
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
import {Fragment, GlassButton, html, SearchField, TextField, useState, useToast} from 'vendor';
|
||||
import {api, useApp, useFetch} from '../api.js';
|
||||
import {EChart} from '../components/EChart.js';
|
||||
import {DataTable} from '../components/DataTable.js';
|
||||
import {FormDialog} from '../components/FormDialog.js';
|
||||
import {Loading, Section, Select} from '../components/ui.js';
|
||||
|
||||
const SCENE_FIELDS = [
|
||||
{key: 'long_min', title: '超长阈值(分钟)'}, {key: 'freq_count', title: '高频阈值(次/月)'},
|
||||
{key: 'users_per_cell', title: '单小区在线用户'}, {key: 'gb_per_cell_h', title: '单小区话务(GB/h)', step: '0.1'},
|
||||
];
|
||||
|
||||
export default function Sites() {
|
||||
const {meta, isAdmin} = useApp();
|
||||
const toast = useToast();
|
||||
const {data, reload} = useFetch('/api/sites');
|
||||
const [scene, setScene] = useState('');
|
||||
const [keyword, setKeyword] = useState('');
|
||||
const [editScene, setEditScene] = useState(null);
|
||||
const [editSite, setEditSite] = useState(null);
|
||||
|
||||
if (!data) return html`<${Loading}/>`;
|
||||
|
||||
const sites = data.rows.filter(r =>
|
||||
(!scene || r.scene === scene) && (!keyword || r.site_name.includes(keyword) || r.ne_id.includes(keyword)));
|
||||
|
||||
// 保存场景阈值或站点分级:成功提示并刷新,失败提示并让弹窗保持打开
|
||||
const save = async (url, body, message) => {
|
||||
try {
|
||||
await api(url, {method: 'PUT', json: body});
|
||||
} catch (e) {
|
||||
toast({message: e.message, tone: 'error'});
|
||||
throw e;
|
||||
}
|
||||
toast({message, tone: 'success'});
|
||||
reload();
|
||||
};
|
||||
const editColumn = onEdit => isAdmin
|
||||
? [{key: '_edit', title: '', render: (_, r) => html`
|
||||
<${GlassButton} variant="tinted" controlSize="small" onClick=${() => onEdit(r)}>编辑</${GlassButton}>`}]
|
||||
: [];
|
||||
|
||||
const mixChart = {
|
||||
tooltip: {trigger: 'axis', axisPointer: {type: 'shadow'}},
|
||||
legend: {top: 0, icon: 'roundRect', itemWidth: 10},
|
||||
grid: {left: 12, right: 12, top: 36, bottom: 6, containLabel: true},
|
||||
xAxis: {type: 'category', data: meta.scenes},
|
||||
yAxis: {type: 'value'},
|
||||
series: meta.site_types.map(t => ({
|
||||
type: 'bar', name: t, stack: 'sites', itemStyle: {borderRadius: 0},
|
||||
data: meta.scenes.map(s => data.rows.filter(r => r.scene === s && r.site_type === t).length),
|
||||
})),
|
||||
};
|
||||
const siteFilters = html`<${Fragment}>
|
||||
<${Select} label="场景" all="全部场景" options=${meta.scenes} value=${scene} onChange=${setScene}/>
|
||||
<${SearchField} aria-label="站点名称关键字" placeholder="站点名称 / 编号" value=${keyword} onValueChange=${setKeyword}/>
|
||||
</${Fragment}>`;
|
||||
|
||||
return html`
|
||||
<div className="grid">
|
||||
<${Section} span=${7} title="分场景阈值配置" hint="阈值用于超长 / 高频站点判定,用户数与话务用于影响评估">
|
||||
<${DataTable} rowKey="scene" rows=${data.scenes} columns=${[{key: 'scene', title: '场景'}, ...SCENE_FIELDS, ...editColumn(setEditScene)]}/>
|
||||
</${Section}>
|
||||
<${Section} span=${5} title="场景 × 站型 站点数量"><${EChart} option=${mixChart}/></${Section}>
|
||||
<${Section} title="站点场景标签与站型分级" extra=${siteFilters}>
|
||||
<${DataTable} rowKey="ne_id" rows=${sites} columns=${[
|
||||
{key: 'ne_id', title: '基站编号'}, {key: 'site_name', title: '站点名称'}, {key: 'vendor', title: '厂家'},
|
||||
{key: 'district', title: '片区'}, {key: 'scene', title: '场景标签'}, {key: 'site_type', title: '站型'},
|
||||
{key: 'cells', title: '小区数'}, {key: 'lng', title: '经度'}, {key: 'lat', title: '纬度'},
|
||||
...editColumn(setEditSite)]}/>
|
||||
</${Section}>
|
||||
|
||||
${editScene && html`
|
||||
<${FormDialog} onClose=${() => setEditScene(null)} title=${`场景阈值 · ${editScene.scene}`} description="保存后立即生效"
|
||||
onSubmit=${d => save(`/api/scenes/${editScene.scene}`, d, '阈值已更新')}>
|
||||
${SCENE_FIELDS.map(f => html`
|
||||
<${TextField} key=${f.key} name=${f.key} label=${f.title} type="number" step=${f.step || '1'} min="0" required
|
||||
defaultValue=${editScene[f.key]}/>`)}
|
||||
</${FormDialog}>`}
|
||||
${editSite && html`
|
||||
<${FormDialog} onClose=${() => setEditSite(null)} title="编辑站点分级" description=${`${editSite.ne_id} · ${editSite.site_name}`}
|
||||
onSubmit=${d => save(`/api/sites/${editSite.ne_id}`, d, '站点已更新')}>
|
||||
<${Select} name="district" label="片区" showLabel options=${meta.regions} value=${editSite.district}/>
|
||||
<${Select} name="scene" label="场景标签" showLabel options=${meta.scenes} value=${editSite.scene}/>
|
||||
<${Select} name="site_type" label="站型" showLabel options=${meta.site_types} value=${editSite.site_type}/>
|
||||
</${FormDialog}>`}
|
||||
</div>`;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
import {html, useState} from 'vendor';
|
||||
import {useApp, useFetch} from '../api.js';
|
||||
import {accentMax, CAUSE_COLOR, num, shortSite} from '../format.js';
|
||||
import {EChart} from '../components/EChart.js';
|
||||
import {DataTable} from '../components/DataTable.js';
|
||||
import {Loading, Section, Select} from '../components/ui.js';
|
||||
|
||||
const DIMS = [
|
||||
{value: 'scene', label: '场景'}, {value: 'region', label: '片区'}, {value: 'site_type', label: '站型'},
|
||||
{value: 'vendor', label: '厂家'}, {value: 'month', label: '月份'}, {value: 'root_cause', label: '判定根因'},
|
||||
{value: 'cause_category', label: '上报原因'}, {value: 'cause_code', label: '原因码'},
|
||||
{value: 'level', label: '断站分级'}, {value: 'site_name', label: '基站'},
|
||||
];
|
||||
const COLUMNS = [
|
||||
{key: 'key', title: '维度值'}, {key: 'count', title: '退服次数', sortable: true},
|
||||
{key: 'total_min', title: '累计时长(分)', sortable: true}, {key: 'avg_min', title: '平均时长(分)', sortable: true},
|
||||
{key: 'max_min', title: '最长单次(分)', sortable: true}, {key: 'long_count', title: '超长次数', sortable: true},
|
||||
{key: 'long_ratio', title: '超长占比(%)', sortable: true}, {key: 'sites', title: '涉及站点', sortable: true},
|
||||
{key: 'users', title: '受影响用户', sortable: true, render: num}, {key: 'loss_gb', title: '业务损失(GB)', sortable: true, render: num},
|
||||
];
|
||||
|
||||
/** 多维统计:选择维度 → 后端分组聚合;点击表头切换排序指标,图表同步显示该指标前 20 名 */
|
||||
export default function Stats() {
|
||||
const {filters} = useApp();
|
||||
const [dim, setDim] = useState('scene');
|
||||
const [sort, setSort] = useState({key: 'total_min', asc: false});
|
||||
const {data} = useFetch('/api/stats', {...filters, dim, sort: sort.key, asc: sort.asc ? 1 : 0});
|
||||
const onSort = key => setSort(s => ({key, asc: s.key === key ? !s.asc : false}));
|
||||
|
||||
const top = data ? data.rows.slice(0, 20) : [];
|
||||
const metric = COLUMNS.find(c => c.key === sort.key).title;
|
||||
|
||||
// 按根因统计时每根柱子用各自的根因色(全站统一);其他维度只把第一名标成强调色
|
||||
let barData;
|
||||
if (dim === 'root_cause') {
|
||||
barData = top.map(r => ({value: r[sort.key], itemStyle: {color: CAUSE_COLOR[r.key]}}));
|
||||
} else {
|
||||
barData = accentMax(top.map(r => r[sort.key]));
|
||||
}
|
||||
const chart = {
|
||||
tooltip: {trigger: 'axis', axisPointer: {type: 'shadow'}},
|
||||
xAxis: {type: 'category', data: top.map(r => (dim === 'site_name' ? shortSite(r.key) : r.key)),
|
||||
axisLabel: {rotate: top.length > 8 ? 30 : 0}},
|
||||
yAxis: {type: 'value', name: metric},
|
||||
series: [{type: 'bar', name: metric, barMaxWidth: 34, data: barData}],
|
||||
};
|
||||
|
||||
return html`
|
||||
<${Section}>
|
||||
<div className="row toolbar">
|
||||
<${Select} label="统计维度" showLabel options=${DIMS} value=${dim} onChange=${setDim}/>
|
||||
<span className="grow"></span>
|
||||
<span className="hint">点击表头排序,图表同步切换指标</span>
|
||||
</div>
|
||||
${data ? html`
|
||||
<div>
|
||||
<${EChart} option=${chart}/>
|
||||
<${DataTable} rowKey="key" columns=${COLUMNS} rows=${data.rows} sort=${sort} onSort=${onSort}/>
|
||||
</div>` : html`<${Loading}/>`}
|
||||
</${Section}>`;
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
import {GlassButton, html, TextField, useState, useToast} from 'vendor';
|
||||
import {api, useFetch} from '../api.js';
|
||||
import {ROLE_NAME} from '../format.js';
|
||||
import {DataTable} from '../components/DataTable.js';
|
||||
import {FormDialog} from '../components/FormDialog.js';
|
||||
import {Loading, Section, Select} from '../components/ui.js';
|
||||
|
||||
const ROLES = [{value: 'user', label: '普通用户'}, {value: 'admin', label: '管理员'}];
|
||||
|
||||
export default function Users() {
|
||||
const toast = useToast();
|
||||
const {data, reload} = useFetch('/api/users');
|
||||
const [adding, setAdding] = useState(false);
|
||||
const [resetting, setResetting] = useState(null);
|
||||
|
||||
/** 发送请求:成功提示并刷新列表;失败提示后继续抛出(让表单弹窗保持打开) */
|
||||
const send = async (url, options, message) => {
|
||||
try {
|
||||
await api(url, options);
|
||||
} catch (e) {
|
||||
toast({message: e.message, tone: 'error'});
|
||||
throw e;
|
||||
}
|
||||
toast({message, tone: 'success'});
|
||||
reload();
|
||||
};
|
||||
const checkPassword = password => {
|
||||
if (password.length >= 6) return;
|
||||
toast({message: '密码至少 6 位', tone: 'error'});
|
||||
throw new Error('invalid');
|
||||
};
|
||||
|
||||
const addUser = d => { checkPassword(d.password); return send('/api/users', {json: d}, '已新增'); };
|
||||
const resetPassword = d => {
|
||||
checkPassword(d.password);
|
||||
return send(`/api/users/${resetting.id}`, {method: 'PUT', json: d}, '密码已重置');
|
||||
};
|
||||
const toggleRole = u =>
|
||||
send(`/api/users/${u.id}`, {method: 'PUT', json: {role: u.role === 'admin' ? 'user' : 'admin'}}, '角色已更新').catch(() => {});
|
||||
const removeUser = u => {
|
||||
if (confirm(`确认删除用户「${u.username}」?`)) send(`/api/users/${u.id}`, {method: 'DELETE'}, '已删除').catch(() => {});
|
||||
};
|
||||
|
||||
const columns = [
|
||||
{key: 'id', title: 'ID'}, {key: 'username', title: '用户名'}, {key: 'role', title: '角色', render: v => ROLE_NAME[v]},
|
||||
{key: 'created_at', title: '创建时间'},
|
||||
{key: '_ops', title: '操作', render: (_, u) => html`
|
||||
<div className="row nowrap">
|
||||
<${GlassButton} variant="tinted" controlSize="small" onClick=${() => setResetting(u)}>重置密码</${GlassButton}>
|
||||
<${GlassButton} variant="gray" controlSize="small" onClick=${() => toggleRole(u)}>
|
||||
设为${u.role === 'admin' ? '普通用户' : '管理员'}
|
||||
</${GlassButton}>
|
||||
<${GlassButton} variant="destructive" controlSize="small" onClick=${() => removeUser(u)}>删除</${GlassButton}>
|
||||
</div>`},
|
||||
];
|
||||
|
||||
return html`
|
||||
<${Section}>
|
||||
<div className="row toolbar">
|
||||
<span className="hint">密码使用 PBKDF2-SHA256 加盐哈希存储。管理员:全部功能;普通用户:查询、统计、看板、导出,以及更新闭环处理进度。</span>
|
||||
<span className="grow"></span>
|
||||
<${GlassButton} variant="glassProminent" onClick=${() => setAdding(true)}>新增用户</${GlassButton}>
|
||||
</div>
|
||||
${data ? html`<${DataTable} columns=${columns} rows=${data.rows}/>` : html`<${Loading}/>`}
|
||||
|
||||
${adding && html`
|
||||
<${FormDialog} onClose=${() => setAdding(false)} onSubmit=${addUser} title="新增用户" description="系统不开放自助注册,由管理员分配账号">
|
||||
<${TextField} name="username" label="用户名" required autoComplete="off"/>
|
||||
<${TextField} name="password" label="初始密码(≥6 位)" type="password" required autoComplete="new-password"/>
|
||||
<${Select} name="role" label="角色" showLabel options=${ROLES} value="user"/>
|
||||
</${FormDialog}>`}
|
||||
${resetting && html`
|
||||
<${FormDialog} onClose=${() => setResetting(null)} onSubmit=${resetPassword} title="重置密码" description=${`用户:${resetting.username}`}>
|
||||
<${TextField} className="full" name="password" label="新密码(≥6 位)" type="password" required autoComplete="new-password"/>
|
||||
</${FormDialog}>`}
|
||||
</${Section}>`;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/* 页面注册表:导航分组、顺序、标题、图标与权限都在这里维护。页面按需加载,首屏只下载当前页代码。 */
|
||||
import {lazy} from 'vendor';
|
||||
|
||||
export const GROUPS = ['分析', '数据管理', '系统'];
|
||||
|
||||
export const PAGES = [
|
||||
{id: 'dashboard', group: '分析', title: '可视化看板', icon: 'dashboard', component: lazy(() => import('./Dashboard.js'))},
|
||||
{id: 'rootcause', group: '分析', title: '根因分析与处置', icon: 'rootcause', component: lazy(() => import('./RootCause.js'))},
|
||||
{id: 'rank', group: '分析', title: '超长 / 高频站点', icon: 'rank', component: lazy(() => import('./Rank.js'))},
|
||||
{id: 'impact', group: '分析', title: '影响评估与考核', icon: 'impact', component: lazy(() => import('./Impact.js'))},
|
||||
{id: 'stats', group: '分析', title: '统计分析', icon: 'stats', component: lazy(() => import('./Stats.js'))},
|
||||
{id: 'outages', group: '数据管理', title: '退服流水管理', icon: 'outages', component: lazy(() => import('./Outages.js'))},
|
||||
{id: 'import', group: '数据管理', title: '数据导入校验', icon: 'import', admin: true, component: lazy(() => import('./Import.js'))},
|
||||
{id: 'sites', group: '数据管理', title: '场景与站点分级', icon: 'sites', component: lazy(() => import('./Sites.js'))},
|
||||
{id: 'reports', group: '系统', title: '报表导出与日志', icon: 'reports', component: lazy(() => import('./Reports.js'))},
|
||||
{id: 'users', group: '系统', title: '用户管理', icon: 'users', admin: true, component: lazy(() => import('./Users.js'))},
|
||||
];
|
||||
Vendored
+40
@@ -0,0 +1,40 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */var Eu=function(r,t){return Eu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Eu(r,t)};function N(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Eu(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var g_=function(){function r(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return r}(),y_=function(){function r(){this.browser=new g_,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return r}(),Z=new y_;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(Z.wxa=!0,Z.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?Z.worker=!0:typeof navigator>"u"||navigator.userAgent.indexOf("Node.js")===0?(Z.node=!0,Z.svgSupported=!0):m_(navigator.userAgent,Z);function m_(r,t){var e=t.browser,i=r.match(/Firefox\/([\d.]+)/),n=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),a=r.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(r);i&&(e.firefox=!0,e.version=i[1]),n&&(e.ie=!0,e.version=n[1]),a&&(e.edge=!0,e.version=a[1],e.newEdge=+a[1].split(".")[0]>18),o&&(e.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!e.ie&&!e.edge,t.pointerEventsSupported="onpointerdown"in window&&(e.edge||e.ie&&+e.version>=11),t.domSupported=typeof document<"u";var s=document.documentElement.style;t.transform3dSupported=(e.ie&&"transition"in s||e.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),t.transformSupported=t.transform3dSupported||e.ie&&+e.version>=9}var Wf=12,__="sans-serif",yi=Wf+"px "+__,S_=20,w_=100,b_="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function x_(r){var t={};if(typeof JSON>"u")return t;for(var e=0;e<r.length;e++){var i=String.fromCharCode(e+32),n=(r.charCodeAt(e)-S_)/w_;t[i]=n}return t}var T_=x_(b_),Oe={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:function(){var r,t;return function(e,i){if(!r){var n=Oe.createCanvas();r=n&&n.getContext("2d")}if(r)return t!==i&&(t=r.font=i||yi),r.measureText(e);e=e||"",i=i||yi;var a=/((?:\d+)?\.?\d*)px/.exec(i),o=a&&+a[1]||Wf,s=0;if(i.indexOf("mono")>=0)s=o*e.length;else for(var l=0;l<e.length;l++){var u=T_[e[l]];s+=u==null?o:u*o}return{width:s}}}(),loadImage:function(r,t,e){var i=new Image;return i.onload=t,i.onerror=e,i.src=r,i}};function ig(r){for(var t in Oe)r[t]&&(Oe[t]=r[t])}var ng=Ke(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(r,t){return r["[object "+t+"]"]=!0,r},{}),ag=Ke(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(r,t){return r["[object "+t+"Array]"]=!0,r},{}),ln=Object.prototype.toString,Ms=Array.prototype,C_=Ms.forEach,M_=Ms.filter,Uf=Ms.slice,D_=Ms.map,sv=(function(){}).constructor,Fa=sv?sv.prototype:null,Yf="__proto__",A_=2311;function Xf(){return A_++}function Ds(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];typeof console<"u"&&console.error.apply(console,r)}function X(r){if(r==null||typeof r!="object")return r;var t=r,e=ln.call(r);if(e==="[object Array]"){if(!Ki(r)){t=[];for(var i=0,n=r.length;i<n;i++)t[i]=X(r[i])}}else if(ag[e]){if(!Ki(r)){var a=r.constructor;if(a.from)t=a.from(r);else{t=new a(r.length);for(var i=0,n=r.length;i<n;i++)t[i]=r[i]}}}else if(!ng[e]&&!Ki(r)&&!nn(r)){t={};for(var o in r)r.hasOwnProperty(o)&&o!==Yf&&(t[o]=X(r[o]))}return t}function rt(r,t,e){if(!G(t)||!G(r))return e?X(t):r;for(var i in t)if(t.hasOwnProperty(i)&&i!==Yf){var n=r[i],a=t[i];G(a)&&G(n)&&!F(a)&&!F(n)&&!nn(a)&&!nn(n)&&!Ou(a)&&!Ou(n)&&!Ki(a)&&!Ki(n)?rt(n,a,e):(e||!(i in r))&&(r[i]=X(t[i]))}return r}function I_(r,t){for(var e=r[0],i=1,n=r.length;i<n;i++)e=rt(e,r[i],t);return e}function B(r,t){if(Object.assign)Object.assign(r,t);else for(var e in t)t.hasOwnProperty(e)&&e!==Yf&&(r[e]=t[e]);return r}function at(r,t,e){for(var i=ct(t),n=0;n<i.length;n++){var a=i[n];(e?t[a]!=null:r[a]==null)&&(r[a]=t[a])}return r}var L_=Oe.createCanvas;function ut(r,t){if(r){if(r.indexOf)return r.indexOf(t);for(var e=0,i=r.length;e<i;e++)if(r[e]===t)return e}return-1}function $f(r,t){var e=r.prototype;function i(){}i.prototype=t.prototype,r.prototype=new i;for(var n in e)e.hasOwnProperty(n)&&(r.prototype[n]=e[n]);r.prototype.constructor=r,r.superClass=t}function Se(r,t,e){if(r="prototype"in r?r.prototype:r,t="prototype"in t?t.prototype:t,Object.getOwnPropertyNames)for(var i=Object.getOwnPropertyNames(t),n=0;n<i.lengtLine truncated
|
||||
`),a=n.length;if(a===1)return Pv(n[0],t,e,i);for(var o=new nt(0,0,0,0),s=0;s<n.length;s++){var l=Pv(n[s],t,e,i);s===0?o.copy(l):o.union(l)}return o}function Vn(r,t,e){return e==="right"?r-=t:e==="center"&&(r-=t/2),r}function Yi(r,t,e){return e==="middle"?r-=t/2:e==="bottom"&&(r-=t),r}function nh(r){return oe("国",r)}function Qe(r,t){return typeof r=="string"?r.lastIndexOf("%")>=0?parseFloat(r)/100*t:parseFloat(r):r}function rs(r,t,e){var i=t.position||"inside",n=t.distance!=null?t.distance:5,a=e.height,o=e.width,s=a/2,l=e.x,u=e.y,f="left",h="top";if(i instanceof Array)l+=Qe(i[0],e.width),u+=Qe(i[1],e.height),f=null,h=null;else switch(i){case"left":l-=n,u+=s,f="right",h="middle";break;case"right":l+=n+o,u+=s,h="middle";break;case"top":l+=o/2,u-=n,f="center",h="bottom";break;case"bottom":l+=o/2,u+=a+n,f="center";break;case"inside":l+=o/2,u+=s,f="center",h="middle";break;case"insideLeft":l+=n,u+=s,h="middle";break;case"insideRight":l+=o-n,u+=s,f="right",h="middle";break;case"insideTop":l+=o/2,u+=n,f="center";break;case"insideBottom":l+=o/2,u+=a-n,f="center",h="bottom";break;case"insideTopLeft":l+=n,u+=n;break;case"insideTopRight":l+=o-n,u+=n,f="right";break;case"insideBottomLeft":l+=n,u+=a-n,h="bottom";break;case"insideBottomRight":l+=o-n,u+=a-n,f="right",h="bottom";break}return r=r||{},r.x=l,r.y=u,r.align=f,r.verticalAlign=h,r}var Cl="__zr_normal__",Ml=la.concat(["ignore"]),K1=Ke(la,function(r,t){return r[t]=!0,r},{ignore:!1}),Pi={},Q1=new nt(0,0,0,0),Ls=function(){function r(t){this.id=Xf(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return r.prototype._init=function(t){this.attr(t)},r.prototype.drift=function(t,e,i){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0;break}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=t,n[5]+=e,this.decomposeTransform(),this.markRedraw()},r.prototype.beforeUpdate=function(){},r.prototype.afterUpdate=function(){},r.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},r.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var i=this.textConfig,n=i.local,a=e.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=n?this:null;var u=!1;if(a.copyTransform(e),i.position!=null){var f=Q1;i.layoutRect?f.copy(i.layoutRect):f.copy(this.getBoundingRect()),n||f.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Pi,i,f):rs(Pi,i,f),a.x=Pi.x,a.y=Pi.y,o=Pi.align,s=Pi.verticalAlign;var h=i.origin;if(h&&i.rotation!=null){var c=void 0,v=void 0;h==="center"?(c=f.width*.5,v=f.height*.5):(c=Qe(h[0],f.width),v=Qe(h[1],f.height)),u=!0,a.originX=-a.x+c+(n?0:f.x),a.originY=-a.y+v+(n?0:f.y)}}i.rotation!=null&&(a.rotation=i.rotation);var p=i.offset;p&&(a.x+=p[0],a.y+=p[1],u||(a.originX=-p[0],a.originY=-p[1]));var g=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,d=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),y=void 0,m=void 0,_=void 0;g&&this.canBeInsideText()?(y=i.insideFill,m=i.insideStroke,(y==null||y==="auto")&&(y=this.getInsideTextFill()),(m==null||m==="auto")&&(m=this.getInsideTextStroke(y),_=!0)):(y=i.outsideFill,m=i.outsideStroke,(y==null||y==="auto")&&(y=this.getOutsideFill()),(m==null||m==="auto")&&(m=this.getOutsideStroke(y),_=!0)),y=y||"#000",(y!==d.fill||m!==d.stroke||_!==d.autoStroke||o!==d.align||s!==d.verticalAlign)&&(l=!0,d.fill=y,d.stroke=m,d.autoStroke=_,d.align=o,d.verticalAlign=s,e.setDefaultTextStyle(d)),e.__dirty|=ae,l&&e.dirtyStyle(!0)}},r.prototype.canBeInsideText=function(){return!0},r.prototype.getInsideTextFill=function(){return"#fff"},r.prototype.getInsideTextStroke=function(t){return"#000"},r.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Ku:qu},r.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),i=typeof e=="string"&&ee(e);i||(i=[255,255,255,1]);for(var n=i[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*n+(a?0:255)*(1-n);return i[3]=1,Pe(i,"rgba")},r.prototype.traverse=function(t,e){},r.prototype.attrKV=function(t,e){t==="textConfig"?this.setTextConfig(e):t==="textContent"?this.setTextContent(e):t==="clipPath"?this.setClipPath(e):t==="extra"?(this.extra=this.extra||{},B(this.extra,e)):this[t]=e},r.prototype.hide=function(){this.ignore=!0,this.markRedraw()},r.prototype.show=function(){this.ignore=!1,this.markRedraw()},r.prototype.attr=function(t,e){if(typeof t=="string")this.attrKV(t,e);else if(G(t))for(var i=t,n=ct(i),a=0;a<n.length;a++){var o=n[a];this.attrKV(o,t[o])}return this.markRedraw(),this},r.prototype.saveCurrentToNormalState=function(t){this._innerSaveToNormal(t);for(var e=this._normalState,i=0;i<this.animators.length;i++){var n=this.animators[i],a=n.__fromStateTransition;if(!(n.getLoop()||a&&a!==Cl)){var o=n.targetName,s=o?e[o]:e;n.saveTo(s)}}},r.prototype._innerSaveToNormal=function(t){var e=this._normalState;e||(e=this._normalState={}),t.textConfi
Line truncated
|
||||
* ZRender, a high performance 2d drawing library.
|
||||
*
|
||||
* Copyright (c) 2013, Baidu Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* LICENSE
|
||||
* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
|
||||
*/var Bo={},si={};function rS(r){delete si[r]}function iS(r){if(!r)return!1;if(typeof r=="string")return sa(r,1)<Zu;if(r.colorStops){for(var t=r.colorStops,e=0,i=t.length,n=0;n<i;n++)e+=sa(t[n].color,1);return e/=i,e<Zu}return!1}var nS=function(){function r(t,e,i){var n=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,i=i||{},this.dom=e,this.id=t;var a=new y1,o=i.renderer||"canvas";Bo[o]||(o=ct(Bo)[0]),i.useDirtyRect=i.useDirtyRect==null?!1:i.useDirtyRect;var s=new Bo[o](e,a,i,t),l=i.ssr||s.ssrOnly;this.storage=a,this.painter=s;var u=!Z.node&&!Z.worker&&!l?new $1(s.getViewportRoot(),s.root):null,f=i.useCoarsePointer,h=f==null||f==="auto"?Z.touchEventsSupported:!!f,c=44,v;h&&(v=j(i.pointerSize,c)),this.handler=new _g(a,s,u,s.root,v),this.animation=new V1({stage:{update:l?null:function(){return n._flush(!0)}}}),l||this.animation.start()}return r.prototype.add=function(t){this._disposed||!t||(this.storage.addRoot(t),t.addSelfToZr(this),this.refresh())},r.prototype.remove=function(t){this._disposed||!t||(this.storage.delRoot(t),t.removeSelfFromZr(this),this.refresh())},r.prototype.configLayer=function(t,e){this._disposed||(this.painter.configLayer&&this.painter.configLayer(t,e),this.refresh())},r.prototype.setBackgroundColor=function(t){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(t),this.refresh(),this._backgroundColor=t,this._darkMode=iS(t))},r.prototype.getBackgroundColor=function(){return this._backgroundColor},r.prototype.setDarkMode=function(t){this._darkMode=t},r.prototype.isDarkMode=function(){return this._darkMode},r.prototype.refreshImmediately=function(t){this._disposed||(t||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},r.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},r.prototype.flush=function(){this._disposed||this._flush(!1)},r.prototype._flush=function(t){var e,i=Xi();this._needsRefresh&&(e=!0,this.refreshImmediately(t)),this._needsRefreshHover&&(e=!0,this.refreshHoverImmediately());var n=Xi();e?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:n-i})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},r.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},r.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},r.prototype.refreshHover=function(){this._needsRefreshHover=!0},r.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},r.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},r.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},r.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},r.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},r.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},r.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},r.prototype.on=function(t,e,i){return this._disposed||this.handler.on(t,e,i),this},r.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},r.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},r.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e<t.length;e++)t[e]instanceof St&&t[e].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},r.prototype.dispose=function(){this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,rS(this.id))},r}();function Qu(r,t){var e=new nS(Xf(),r,t);return si[e.id]=e,e}function aS(r){r.dispose()}function oS(){for(var r in si)si.hasOwnProperty(r)&&si[r].dispose();si={}}function sS(r){return si[r]}function Og(r,t){Bo[r]=t}var Ju;function lS(r){if(typeof Ju=="function")return Ju(r)}function kg(r){Ju=r}var uS="5.6.0";const fS=Object.freeze(Object.defineProperty({__proto__:null,dispose:aS,disposeAll:oS,getElementSSRData:lS,getInstance:sS,init:Qu,registerPainter:Og,registerSSRDataGetter:kg,version:uS},Symbol.toStringTag,{value:"Module"}));var Rv=1e-4,Bg=20;function hS(r){return r.replace(/^\s+|\s+$/g,"")}function Be(r,t,e,i){var n=t[0],a=t[1],o=e[0],s=e[1],l=a-n,u=s-o;if(l===0)return u===0?o:(o+s)/2;if(i)if(l>0){if(r<=n)return o;if(r>=a)return s}else{if(r>=n)return o;if(r<=a)return s}else{if(r===n)return o;if(r===a)return s}return(r-n)/l*u+o}function dt(r,t){switch(r){case"center":case"middle":r="50%";break;case"left":case"top":r="0%";break;case"right":case"bottom":r="100%";break}return H(r)?hS(r).match(/%$/)?parseFloat(r)/100*t:parseLine truncated
|
||||
`);n=Qg(t,e,i,n);for(var o=0,s=a.length;o<s;o++)a[o]=Jg(a[o],n);return a.join(`
|
||||
`)}function Qg(r,t,e,i){i=i||{};var n=B({},i);n.font=t,e=j(e,"..."),n.maxIterations=j(i.maxIterations,2);var a=n.minChar=j(i.minChar,0);n.cnCharWidth=oe("国",t);var o=n.ascCharWidth=oe("a",t);n.placeholder=j(i.placeholder,"");for(var s=r=Math.max(0,r-1),l=0;l<a&&s>=o;l++)s-=o;var u=oe(e,t);return u>s&&(e="",u=0),s=r-u,n.ellipsis=e,n.ellipsisWidth=u,n.contentWidth=s,n.containerWidth=r,n}function Jg(r,t){var e=t.containerWidth,i=t.font,n=t.contentWidth;if(!e)return"";var a=oe(r,i);if(a<=e)return r;for(var o=0;;o++){if(a<=n||o>=t.maxIterations){r+=t.ellipsis;break}var s=o===0?YS(r,n,t.ascCharWidth,t.cnCharWidth):a>0?Math.floor(r.length*n/a):0;r=r.substr(0,s),a=oe(r,i)}return r===""&&(r=t.placeholder),r}function YS(r,t,e,i){for(var n=0,a=0,o=r.length;a<o&&n<t;a++){var s=r.charCodeAt(a);n+=0<=s&&s<=127?e:i}return a}function XS(r,t){r!=null&&(r+="");var e=t.overflow,i=t.padding,n=t.font,a=e==="truncate",o=nh(n),s=j(t.lineHeight,o),l=!!t.backgroundColor,u=t.lineOverflow==="truncate",f=t.width,h;f!=null&&(e==="break"||e==="breakAll")?h=r?jg(r,t.font,f,e==="breakAll",0).lines:[]:h=r?r.split(`
|
||||
`):[];var c=h.length*s,v=j(t.height,c);if(c>v&&u){var p=Math.floor(v/s);h=h.slice(0,p)}if(r&&a&&f!=null)for(var g=Qg(f,n,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),d=0;d<h.length;d++)h[d]=Jg(h[d],g);for(var y=v,m=0,d=0;d<h.length;d++)m=Math.max(oe(h[d],n),m);f==null&&(f=m);var _=m;return i&&(y+=i[0]+i[2],_+=i[1]+i[3],f+=i[1]+i[3]),l&&(_=f),{lines:h,height:v,outerWidth:_,outerHeight:y,lineHeight:s,calculatedLineHeight:o,contentWidth:m,contentHeight:c,width:f}}var $S=function(){function r(){}return r}(),Nv=function(){function r(t){this.tokens=[],t&&(this.tokens=t)}return r}(),ZS=function(){function r(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[]}return r}();function qS(r,t){var e=new ZS;if(r!=null&&(r+=""),!r)return e;for(var i=t.width,n=t.height,a=t.overflow,o=(a==="break"||a==="breakAll")&&i!=null?{width:i,accumWidth:0,breakAll:a==="breakAll"}:null,s=Ll.lastIndex=0,l;(l=Ll.exec(r))!=null;){var u=l.index;u>s&&Pl(e,r.substring(s,u),t,o),Pl(e,l[2],t,o,l[1]),s=Ll.lastIndex}s<r.length&&Pl(e,r.substring(s,r.length),t,o);var f=[],h=0,c=0,v=t.padding,p=a==="truncate",g=t.lineOverflow==="truncate";function d(O,k,z){O.width=k,O.lineHeight=z,h+=z,c=Math.max(c,k)}t:for(var y=0;y<e.lines.length;y++){for(var m=e.lines[y],_=0,w=0,b=0;b<m.tokens.length;b++){var S=m.tokens[b],x=S.styleName&&t.rich[S.styleName]||{},T=S.textPadding=x.padding,D=T?T[1]+T[3]:0,A=S.font=x.font||t.font;S.contentHeight=nh(A);var M=j(x.height,S.contentHeight);if(S.innerHeight=M,T&&(M+=T[0]+T[2]),S.height=M,S.lineHeight=qi(x.lineHeight,t.lineHeight,M),S.align=x&&x.align||t.align,S.verticalAlign=x&&x.verticalAlign||"middle",g&&n!=null&&h+S.lineHeight>n){b>0?(m.tokens=m.tokens.slice(0,b),d(m,w,_),e.lines=e.lines.slice(0,y+1)):e.lines=e.lines.slice(0,y);break t}var I=x.width,L=I==null||I==="auto";if(typeof I=="string"&&I.charAt(I.length-1)==="%")S.percentWidth=I,f.push(S),S.contentWidth=oe(S.text,A);else{if(L){var P=x.backgroundColor,R=P&&P.image;R&&(R=US(R),Es(R)&&(S.width=Math.max(S.width,R.width*M/R.height)))}var E=p&&i!=null?i-w:null;E!=null&&E<S.width?!L||E<D?(S.text="",S.width=S.contentWidth=0):(S.text=Kg(S.text,E-D,A,t.ellipsis,{minChar:t.truncateMinChar}),S.width=S.contentWidth=oe(S.text,A)):S.contentWidth=oe(S.text,A)}S.width+=D,w+=S.width,x&&(_=Math.max(_,S.lineHeight))}d(m,w,_)}e.outerWidth=e.width=j(i,c),e.outerHeight=e.height=j(n,h),e.contentHeight=h,e.contentWidth=c,v&&(e.outerWidth+=v[1]+v[3],e.outerHeight+=v[0]+v[2]);for(var y=0;y<f.length;y++){var S=f[y],V=S.percentWidth;S.width=parseInt(V,10)/100*e.width}return e}function Pl(r,t,e,i,n){var a=t==="",o=n&&e.rich[n]||{},s=r.lines,l=o.font||e.font,u=!1,f,h;if(i){var c=o.padding,v=c?c[1]+c[3]:0;if(o.width!=null&&o.width!=="auto"){var p=Qe(o.width,i.width)+v;s.length>0&&p+i.accumWidth>i.width&&(f=t.split(`
|
||||
`),u=!0),i.accumWidth=p}else{var g=jg(t,l,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+v,h=g.linesWidths,f=g.lines}}else f=t.split(`
|
||||
`);for(var d=0;d<f.length;d++){var y=f[d],m=new $S;if(m.styleName=n,m.text=y,m.isLineHolder=!y&&!a,typeof o.width=="number"?m.width=o.width:m.width=h?h[d]:oe(y,l),!d&&!u){var _=(s[s.length-1]||(s[0]=new Nv)).tokens,w=_.length;w===1&&_[0].isLineHolder?_[0]=m:(y||!w||a)&&_.push(m)}else s.push(new Nv([m]))}}function KS(r){var t=r.charCodeAt(0);return t>=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var QS=Ke(",&?/;] ".split(""),function(r,t){return r[t]=!0,r},{});function JS(r){return KS(r)?!!QS[r]:!0}function jg(r,t,e,i,n){for(var a=[],o=[],s="",l="",u=0,f=0,h=0;h<r.length;h++){var c=r.charAt(h);if(c===`
|
||||
`){l&&(s+=l,f+=u),a.push(s),o.push(f),s="",l="",u=0,f=0;continue}var v=oe(c,t),p=i?!1:!JS(c);if(a.length?f+v>e:n+f+v>e){f?(s||l)&&(p?(s||(s=l,l="",u=0,f=u),a.push(s),o.push(f-u),l+=c,u+=v,s="",f=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(f),s=c,f=v)):p?(a.push(l),o.push(u),l=c,u=v):(a.push(c),o.push(v));continue}f+=v,p?(l+=c,u+=v):(l&&(s+=l,l="",u=0),s+=c)}return!a.length&&!s&&(s=r,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(f)),a.length===1&&(f+=n),{accumWidth:f,lines:a,linesWidths:o}}var rf="__zr_style_"+Math.round(Math.random()*10),ci={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Os={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};ci[rf]=!0;var Fv=["z","z2","invisible"],jS=["invisible"],La=function(r){N(t,r);function t(e){return r.call(this,e)||this}return t.prototype._init=function(e){for(var i=ct(e),n=0;n<i.length;n++){var a=i[n];a==="style"?this.useStyle(e[a]):r.prototype.attrKV.call(this,a,e[a])}this.style||this.useStyle({})},t.prototype.beforeBrush=function(){},t.prototype.afterBrush=function(){},t.prototype.innerBeforeBrush=function(){},t.prototype.innerAfterBrush=function(){},t.prototype.shouldBePainted=function(e,i,n,a){var o=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&tw(this,e,i)||o&&!o[0]&&!o[3])return!1;if(n&&this.__clipPaths){for(var s=0;s<this.__clipPaths.length;++s)if(this.__clipPaths[s].isZeroArea())return!1}if(a&&this.parent)for(var l=this.parent;l;){if(l.ignore)return!1;l=l.parent}return!0},t.prototype.contain=function(e,i){return this.rectContain(e,i)},t.prototype.traverse=function(e,i){e.call(i,this)},t.prototype.rectContain=function(e,i){var n=this.transformCoordToLocal(e,i),a=this.getBoundingRect();return a.contain(n[0],n[1])},t.prototype.getPaintRect=function(){var e=this._paintRect;if(!this._paintRect||this.__dirty){var i=this.transform,n=this.getBoundingRect(),a=this.style,o=a.shadowBlur||0,s=a.shadowOffsetX||0,l=a.shadowOffsetY||0;e=this._paintRect||(this._paintRect=new nt(0,0,0,0)),i?nt.applyTransform(e,n,i):e.copy(n),(o||s||l)&&(e.width+=o*2+Math.abs(s),e.height+=o*2+Math.abs(l),e.x=Math.min(e.x,e.x+s-o),e.y=Math.min(e.y,e.y+l-o));var u=this.dirtyRectTolerance;e.isZero()||(e.x=Math.floor(e.x-u),e.y=Math.floor(e.y-u),e.width=Math.ceil(e.width+1+u*2),e.height=Math.ceil(e.height+1+u*2))}return e},t.prototype.setPrevPaintRect=function(e){e?(this._prevPaintRect=this._prevPaintRect||new nt(0,0,0,0),this._prevPaintRect.copy(e)):this._prevPaintRect=null},t.prototype.getPrevPaintRect=function(){return this._prevPaintRect},t.prototype.animateStyle=function(e){return this.animate("style",e)},t.prototype.updateDuringAnimation=function(e){e==="style"?this.dirtyStyle():this.markRedraw()},t.prototype.attrKV=function(e,i){e!=="style"?r.prototype.attrKV.call(this,e,i):this.style?this.setStyle(i):this.useStyle(i)},t.prototype.setStyle=function(e,i){return typeof e=="string"?this.style[e]=i:B(this.style,e),this.dirtyStyle(),this},t.prototype.dirtyStyle=function(e){e||this.markRedraw(),this.__dirty|=Fn,this._rect&&(this._rect=null)},t.prototype.dirty=function(){this.dirtyStyle()},t.prototype.styleChanged=function(){return!!(this.__dirty&Fn)},t.prototype.styleUpdated=function(){this.__dirty&=~Fn},t.prototype.createStyle=function(e){return Ta(ci,e)},t.prototype.useStyle=function(e){e[rf]||(e=this.createStyle(e)),this.__inHover?this.__hoverStyle=e:this.style=e,this.dirtyStyle()},t.prototype.isStyleObject=function(e){return e[rf]},t.prototype._innerSaveToNormal=function(e){r.prototype._innerSaveToNormal.call(this,e);var i=this._normalState;e.style&&!i.style&&(i.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(e,i,Fv)},t.prototype._applyStateObj=function(e,i,n,a,o,s){r.prototype._applyStateObj.call(this,e,i,n,a,o,s);var l=!(i&&a),u;if(i&&i.style?o?a?u=i.style:(u=this._mergeStyle(this.createStyle(),n.style),this._mergeStyle(u,i.style)):(u=this._mergeStyle(this.createStyle(),a?this.style:n.style),this._mergeStyle(u,i.style)):l&&(u=n.style),u)if(o){var f=this.style;if(this.style=this.createStyle(l?{}:f),l)for(var h=ct(f),c=0;c<h.length;c++){var v=h[c];v in u&&(u[v]=u[v],this.style[v]=f[v])}for(var p=ct(u),c=0;c<p.length;c++){var v=p[c];this.style[v]=this.style[v]}this._transitionState(e,{style:u},s,this.getAnimationStyleProps())}else this.useStyle(u);for(var g=this.__inHover?jS:Fv,c=0;c<g.length;c++){var v=g[c];i&&i[v]!=null?this[v]=i[v]:l&&n[v]!=null&&(this[v]=n[v])}},t.prototype._mergeStates=function(e){for(var i=r.prototype._mergeStates.call(this,e),n,a=0;a<e.length;a++){var o=e[a];o.style&&(n=n||{},this._mergeStyle(n,o.style))}return n&&(i.style=n),i},t.prototype._mergeStyle=function(e,i){return B(e,i),e},t.prototype.getAnimationStyleProps=function(){return Os},t.initDefaultProps=function(){var e=t.prototype;e.type="displayable",e.invisible=!1,e.z=0,e.z2=0,e.zlevel=0,e.culling=!1,e.cursor="pointer",e.rectHover=!1,e.incremental=!1,e._rect=null,e.dirty
Line truncated
|
||||
yyyy`);var i=me(t),n=e?"getUTC":"get",a=i[n+"FullYear"](),o=i[n+"Month"]()+1,s=i[n+"Date"](),l=i[n+"Hours"](),u=i[n+"Minutes"](),f=i[n+"Seconds"](),h=i[n+"Milliseconds"]();return r=r.replace("MM",Gt(o,2)).replace("M",o).replace("yyyy",a).replace("yy",Gt(a%100+"",2)).replace("dd",Gt(s,2)).replace("d",s).replace("hh",Gt(l,2)).replace("h",l).replace("mm",Gt(u,2)).replace("m",u).replace("ss",Gt(f,2)).replace("s",f).replace("SSS",Gt(h,3)),r}function ex(r){return r&&r.charAt(0).toUpperCase()+r.substr(1)}function xi(r,t){return t=t||"transparent",H(r)?r:G(r)&&r.colorStops&&(r.colorStops[0]||{}).color||t}var Vo=C,rx=["left","right","top","bottom","width","height"],io=[["width","left","right"],["height","top","bottom"]];function Lh(r,t,e,i,n){var a=0,o=0;i==null&&(i=1/0),n==null&&(n=1/0);var s=0;t.eachChild(function(l,u){var f=l.getBoundingRect(),h=t.childAt(u+1),c=h&&h.getBoundingRect(),v,p;if(r==="horizontal"){var g=f.width+(c?-c.x+f.x:0);v=a+g,v>i||l.newline?(a=0,v=g,o+=s+e,s=f.height):s=Math.max(s,f.height)}else{var d=f.height+(c?-c.y+f.y:0);p=o+d,p>n||l.newline?(a+=s+e,o=0,p=d,s=f.width):s=Math.max(s,f.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),r==="horizontal"?a=v+e:o=p+e)})}var rn=Lh;yt(Lh,"vertical");yt(Lh,"horizontal");function Br(r,t,e){e=hn(e||0);var i=t.width,n=t.height,a=dt(r.left,i),o=dt(r.top,n),s=dt(r.right,i),l=dt(r.bottom,n),u=dt(r.width,i),f=dt(r.height,n),h=e[2]+e[0],c=e[1]+e[3],v=r.aspect;switch(isNaN(u)&&(u=i-s-c-a),isNaN(f)&&(f=n-l-h-o),v!=null&&(isNaN(u)&&isNaN(f)&&(v>i/n?u=i*.8:f=n*.8),isNaN(u)&&(u=v*f),isNaN(f)&&(f=u/v)),isNaN(a)&&(a=i-s-u-c),isNaN(o)&&(o=n-l-f-h),r.left||r.right){case"center":a=i/2-u/2-e[3];break;case"right":a=i-u-c;break}switch(r.top||r.bottom){case"middle":case"center":o=n/2-f/2-e[0];break;case"bottom":o=n-f-h;break}a=a||0,o=o||0,isNaN(u)&&(u=i-c-a-(s||0)),isNaN(f)&&(f=n-h-o-(l||0));var p=new nt(a+e[3],o+e[0],u,f);return p.margin=e,p}function ix(r,t,e,i,n,a){a=a||r,a.x=r.x,a.y=r.y;var o;if(o=r.getBoundingRect(),r.needLocalTransform()){var s=r.getLocalTransform();o=o.clone(),o.applyTransform(s)}var l=Br(at({width:o.width,height:o.height},t),e,i),u=l.x-o.x,f=l.y-o.y;return a.x+=u,a.y+=f,a===r&&r.markRedraw(),!0}function da(r){var t=r.layoutMode||r.constructor.layoutMode;return G(t)?t:t?{type:t}:null}function on(r,t,e){var i=e&&e.ignoreSize;!F(i)&&(i=[i,i]);var n=o(io[0],0),a=o(io[1],1);u(io[0],r,n),u(io[1],r,a);function o(f,h){var c={},v=0,p={},g=0,d=2;if(Vo(f,function(_){p[_]=r[_]}),Vo(f,function(_){s(t,_)&&(c[_]=p[_]=t[_]),l(c,_)&&v++,l(p,_)&&g++}),i[h])return l(t,f[1])?p[f[2]]=null:l(t,f[2])&&(p[f[1]]=null),p;if(g===d||!v)return p;if(v>=d)return c;for(var y=0;y<f.length;y++){var m=f[y];if(!s(c,m)&&s(r,m)){c[m]=r[m];break}}return c}function s(f,h){return f.hasOwnProperty(h)}function l(f,h){return f[h]!=null&&f[h]!=="auto"}function u(f,h,c){Vo(f,function(v){h[v]=c[v]})}}function Js(r){return nx({},r)}function nx(r,t){return t&&r&&Vo(rx,function(e){t.hasOwnProperty(e)&&(r[e]=t[e])}),r}var ax=Tt(),ot=function(r){N(t,r);function t(e,i,n){var a=r.call(this,e,i,n)||this;return a.uid=Xs("ec_cpt_model"),a}return t.prototype.init=function(e,i,n){this.mergeDefaultAndTheme(e,n)},t.prototype.mergeDefaultAndTheme=function(e,i){var n=da(this),a=n?Js(e):{},o=i.getTheme();rt(e,o.get(this.mainType)),rt(e,this.getDefaultOption()),n&&on(e,a,n)},t.prototype.mergeOption=function(e,i){rt(this.option,e,!0);var n=da(this);n&&on(this.option,e,n)},t.prototype.optionUpdated=function(e,i){},t.prototype.getDefaultOption=function(){var e=this.constructor;if(!kS(e))return e.defaultOption;var i=ax(this);if(!i.defaultOption){for(var n=[],a=e;a;){var o=a.prototype.defaultOption;o&&n.push(o),a=a.superClass}for(var s={},l=n.length-1;l>=0;l--)s=rt(s,n[l],!0);i.defaultOption=s}return i.defaultOption},t.prototype.getReferringComponents=function(e,i){var n=e+"Index",a=e+"Id";return Ia(this.ecModel,e,{index:this.get(n,!0),id:this.get(a,!0)},i)},t.prototype.getBoxLayoutParams=function(){var e=this;return{left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")}},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type="component",e.id="",e.name="",e.mainType="",e.subType="",e.componentIndex=0}(),t}(pt);Zg(ot,pt);Rs(ot);Gb(ot);Wb(ot,ox);function ox(r){var t=[];return C(ot.getClassesByMainType(r),function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])}),t=W(t,function(e){return qe(e).main}),r!=="dataset"&&ut(t,"dataset")<=0&&t.unshift("dataset"),t}var Yy="";typeof navigator<"u"&&(Yy=navigator.platform||"");var Bi="rgba(0, 0, 0, 0.2)";const sx={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Bi,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Bi,symbol:"cir
Line truncated
|
||||
`,`
|
||||
|
||||
`,`
|
||||
|
||||
|
||||
`];function ya(r,t){return t.type=r,t}function pf(r){return r.type==="section"}function vm(r){return pf(r)?lT:uT}function cm(r){if(pf(r)){var t=0,e=r.blocks.length,i=e>1||e>0&&!r.noHeader;return C(r.blocks,function(n){var a=cm(n);a>=t&&(t=a+ +(i&&(!a||pf(n)&&!n.noHeader)))}),t}return 0}function lT(r,t,e,i){var n=t.noHeader,a=fT(cm(t)),o=[],s=t.blocks||[];ke(!s||F(s)),s=s||[];var l=r.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(_i(u,l)){var f=new Xx(u[l],null);s.sort(function(p,g){return f.evaluate(p.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}C(s,function(p,g){var d=t.valueFormatter,y=vm(p)(d?B(B({},r),{valueFormatter:d}):r,p,g>0?a.html:0,i);y!=null&&o.push(y)});var h=r.renderMode==="richText"?o.join(a.richText):df(o.join(""),n?e:a.html);if(n)return h;var c=hf(t.header,"ordinal",r.useUTC),v=hm(i,r.renderMode).nameStyle;return r.renderMode==="richText"?pm(r,c,v)+a.richText+h:df('<div style="'+v+";"+fm+';">'+Qt(c)+"</div>"+h,e)}function uT(r,t,e,i){var n=r.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,l=t.name,u=r.useUTC,f=t.valueFormatter||r.valueFormatter||function(w){return w=F(w)?w:[w],W(w,function(b,S){return hf(b,F(v)?v[S]:v,u)})};if(!(a&&o)){var h=s?"":r.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||"#333",n),c=a?"":hf(l,"ordinal",u),v=t.valueType,p=o?[]:f(t.value,t.dataIndex),g=!s||!a,d=!s&&a,y=hm(i,n),m=y.nameStyle,_=y.valueStyle;return n==="richText"?(s?"":h)+(a?"":pm(r,c,m))+(o?"":cT(r,p,g,d,_)):df((s?"":h)+(a?"":hT(c,!s,m))+(o?"":vT(p,g,d,_)),e)}}function Zc(r,t,e,i,n,a){if(r){var o=vm(r),s={useUTC:n,renderMode:e,orderMode:i,markupStyleCreator:t,valueFormatter:r.valueFormatter};return o(s,r,0,a)}}function fT(r){return{html:oT[r],richText:sT[r]}}function df(r,t){var e='<div style="clear:both"></div>',i="margin: "+t+"px 0 0";return'<div style="'+i+";"+fm+';">'+r+e+"</div>"}function hT(r,t,e){var i=t?"margin-left:2px":"";return'<span style="'+e+";"+i+'">'+Qt(r)+"</span>"}function vT(r,t,e,i){var n=e?"10px":"20px",a=t?"float:right;margin-left:"+n:"";return r=F(r)?r:[r],'<span style="'+a+";"+i+'">'+W(r,function(o){return Qt(o)}).join(" ")+"</span>"}function pm(r,t,e){return r.markupStyleCreator.wrapRichTextStyle(t,e)}function cT(r,t,e,i,n){var a=[n],o=i?10:20;return e&&a.push({padding:[0,0,0,o],align:"right"}),r.markupStyleCreator.wrapRichTextStyle(F(t)?t.join(" "):t,a)}function pT(r,t){var e=r.getData().getItemVisual(t,"style"),i=e[r.visualDrawType];return xi(i)}function dm(r,t){var e=r.get("padding");return e??(t==="richText"?[8,10]:10)}var eu=function(){function r(){this.richTextStyles={},this._nextStyleNameId=Gg()}return r.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},r.prototype.makeTooltipMarker=function(t,e,i){var n=i==="richText"?this._generateStyleName():null,a=Uy({color:e,type:t,renderMode:i,markerId:n});return H(a)?a:(this.richTextStyles[n]=a.style,a.content)},r.prototype.wrapRichTextStyle=function(t,e){var i={};F(e)?C(e,function(a){return B(i,a)}):B(i,e);var n=this._generateStyleName();return this.richTextStyles[n]=i,"{"+n+"|"+t+"}"},r}();function dT(r){var t=r.series,e=r.dataIndex,i=r.multipleSeries,n=t.getData(),a=n.mapDimensionsAll("defaultedTooltip"),o=a.length,s=t.getRawValue(e),l=F(s),u=pT(t,e),f,h,c,v;if(o>1||l&&!o){var p=gT(s,t,e,a,u);f=p.inlineValues,h=p.inlineValueTypes,c=p.blocks,v=p.inlineValues[0]}else if(o){var g=n.getDimensionInfo(a[0]);v=f=sn(n,e,a[0]),h=g.type}else v=f=l?s[0]:s;var d=lh(t),y=d&&t.name||"",m=n.getName(e),_=i?y:m;return ya("section",{header:y,noHeader:i||!d,sortParam:v,blocks:[ya("nameValue",{markerType:"item",markerColor:u,name:_,noName:!Ae(_),value:f,valueType:h,dataIndex:e})].concat(c||[])})}function gT(r,t,e,i,n){var a=t.getData(),o=Ke(r,function(h,c,v){var p=a.getDimensionInfo(v);return h=h||p&&p.tooltip!==!1&&p.displayName!=null},!1),s=[],l=[],u=[];i.length?C(i,function(h){f(sn(a,e,h),h)}):C(r,f);function f(h,c){var v=a.getDimensionInfo(c);!v||v.otherDims.tooltip===!1||(o?u.push(ya("nameValue",{markerType:"subItem",markerColor:n,name:v.displayName,value:h,valueType:v.type})):(s.push(h),l.push(v.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var gr=Tt();function oo(r,t){return r.getName(t)||r.getId(t)}var yT="__universalTransitionEnabled",$t=function(r){N(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}return t.prototype.init=function(e,i,n){this.seriesIndex=this.componentIndex,this.dataTask=ea({count:_T,reset:ST}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n);var a=gr(this).sourceManager=new aT(this);a.prepareSource();var o=this.getInitialData(e,n);Kc(o,this),this.dataTask.context.data=o,gr(this).dataBeforeProcessed=o,qc(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(e,i){var n=da(this),a=n?Js(e):{},o=this.subType;ot.hasClass(o)&&(o+="Series"),rt(e,i.getTheme().get(this.subType)),rt(e,this.getDefaultOption(
Line truncated
|
||||
|
||||
`:"<br/>",y=h.join(d);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(e,u)?this._updatePosition(s,v,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,y,u,Math.random()+"",o[0],o[1],v,null,c)})},t.prototype._showSeriesItemTooltip=function(e,i,n){var a=this._ecModel,o=it(i),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,f=o.dataIndex,h=o.dataType,c=u.getData(h),v=this._renderMode,p=e.positionDefault,g=Bn([c.getItemModel(f),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),d=g.get("trigger");if(!(d!=null&&d!=="item")){var y=u.getDataParams(f,h),m=new eu;y.marker=m.makeTooltipMarker("item",xi(y.color),v);var _=Wc(u.formatTooltip(f,!1,h)),w=g.get("order"),b=g.get("valueFormatter"),S=_.frag,x=S?Zc(b?B({valueFormatter:b},S):S,m,v,w,a.get("useUTC"),g.get("textStyle")):_.text,T="item_"+u.name+"_"+f;this._showOrMove(g,function(){this._showTooltipContent(g,x,y,T,e.offsetX,e.offsetY,e.position,e.target,m)}),n({type:"showTip",dataIndexInside:f,dataIndex:c.getRawIndex(f),seriesIndex:s,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,i,n){var a=this._renderMode==="html",o=it(i),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(H(l)){var f=l;l={content:f,formatter:f},u=!0}u&&a&&l.content&&(l=X(l),l.content=Qt(l.content));var h=[l],c=this._ecModel.getComponent(o.componentMainType,o.componentIndex);c&&h.push(c),h.push({formatter:l.content});var v=e.positionDefault,p=Bn(h,this._tooltipModel,v?{position:v}:null),g=p.get("content"),d=Math.random()+"",y=new eu;this._showOrMove(p,function(){var m=X(p.get("formatterParams")||{});this._showTooltipContent(p,g,m,d,e.offsetX,e.offsetY,e.position,i,y)}),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,i,n,a,o,s,l,u,f){if(this._ticket="",!(!e.get("showContent")||!e.get("show"))){var h=this._tooltipContent;h.setEnterable(e.get("enterable"));var c=e.get("formatter");l=l||e.get("position");var v=i,p=this._getNearestPoint([o,s],n,e.get("trigger"),e.get("borderColor")),g=p.color;if(c)if(H(c)){var d=e.ecModel.get("useUTC"),y=F(n)?n[0]:n,m=y&&y.axisType&&y.axisType.indexOf("time")>=0;v=c,m&&(v=ka(y.axisValue,v,d)),v=Ih(v,n,!0)}else if(q(c)){var _=J(function(w,b){w===this._ticket&&(h.setContent(b,f,e,g,l),this._updatePosition(e,l,o,s,h,n,u))},this);this._ticket=a,v=c(n,a,_)}else v=c;h.setContent(v,f,e,g,l),h.show(e,g),this._updatePosition(e,l,o,s,h,n,u)}},t.prototype._getNearestPoint=function(e,i,n,a){if(n==="axis"||F(i))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!F(i))return{color:a||i.color||i.borderColor}},t.prototype._updatePosition=function(e,i,n,a,o,s,l){var u=this._api.getWidth(),f=this._api.getHeight();i=i||e.get("position");var h=o.getSize(),c=e.get("align"),v=e.get("verticalAlign"),p=l&&l.getBoundingRect().clone();if(l&&p.applyTransform(l.transform),q(i)&&(i=i([n,a],s,o.el,p,{viewSize:[u,f],contentSize:h.slice()})),F(i))n=dt(i[0],u),a=dt(i[1],f);else if(G(i)){var g=i;g.width=h[0],g.height=h[1];var d=Br(g,{width:u,height:f});n=d.x,a=d.y,c=null,v=null}else if(H(i)&&l){var y=vL(i,p,h,e.get("borderWidth"));n=y[0],a=y[1]}else{var y=fL(n,a,o,u,f,c?null:20,v?null:20);n=y[0],a=y[1]}if(c&&(n-=Bd(c)?h[0]/2:c==="right"?h[0]:0),v&&(a-=Bd(v)?h[1]/2:v==="bottom"?h[1]:0),i_(e)){var y=hL(n,a,o,u,f);n=y[0],a=y[1]}o.moveTo(n,a)},t.prototype._updateContentNotChangedOnAxis=function(e,i){var n=this._lastDataByCoordSys,a=this._cbParamsList,o=!!n&&n.length===e.length;return o&&C(n,function(s,l){var u=s.dataByAxis||[],f=e[l]||{},h=f.dataByAxis||[];o=o&&u.length===h.length,o&&C(u,function(c,v){var p=h[v]||{},g=c.seriesDataIndices||[],d=p.seriesDataIndices||[];o=o&&c.value===p.value&&c.axisType===p.axisType&&c.axisId===p.axisId&&g.length===d.length,o&&C(g,function(y,m){var _=d[m];o=o&&y.seriesIndex===_.seriesIndex&&y.dataIndex===_.dataIndex}),a&&C(c.seriesDataIndices,function(y){var m=y.seriesIndex,_=i[m],w=a[m];_&&w&&w.data!==_.data&&(o=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=i,!!o},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,i){Z.node||!i.getDom()||(yf(this,"_updatePosition"),this._tooltipContent.dispose(),Ff("itemTooltip",i))},t.type="tooltip",t}(ie);function Bn(r,t,e){var i=t.ecModel,n;e?(n=new pt(e,i,i),n=new pt(t.option,n,i)):n=t;for(var a=r.length-1;a>=0;a--){var o=r[a];o&&(o instanceof pt&&(o=o.get("tooltip",!0)),H(o)&&(o={formatter:o}),o&&(n=new pt(o,n,i)))}return n}function kd(r,t){return r.dispatchAction||J(t.dispatchAction,t)}function fL(r,t,e,i,n,a,o){var s=e.getSize(),l=s[0],u=s[1];return a!=null&&(r+l+a+2>i?r-=l+a:r+=a),o!=null&&(t+u+o>n?t-=u+o:t+=o),[r,t]}function hL(r,t,e,i,n){var a=e.getSize(),o=a[0],s=a[1];return r=Math.min(r+o,i)-o,t=Math.min(t+s,n)-s,r=Math.max(r,0),t=Math.max(t,0),[r,t]}function vL(r,t,e,i){var n=e[0],a=e[1],o=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=t.width,f=t.height;switch(r){case"inside":s=t.x+u/2-n/2,l=t.y+f/2-a/2;break;case"top":s=t.x+u
Line truncated
|
||||
`)){var d=new Mo;d.newline=!0,u.add(d);return}var y=n.getSeriesByName(g)[0];if(!f.get(g))if(y){var m=y.getData(),_=m.getVisual("legendLineStyle")||{},w=m.getVisual("legendIcon"),b=m.getVisual("style"),S=this._createItem(y,g,p,v,i,e,_,b,w,h,a);S.on("click",Gi(Vd,g,null,a,c)).on("mouseover",Gi(Hf,y.name,null,a,c)).on("mouseout",Gi(Gf,y.name,null,a,c)),n.ssr&&S.eachChild(function(x){var T=it(x);T.seriesIndex=y.seriesIndex,T.dataIndex=p,T.ssrType="legend"}),f.set(g,!0)}else n.eachRawSeries(function(x){if(!f.get(g)&&x.legendVisualProvider){var T=x.legendVisualProvider;if(!T.containName(g))return;var D=T.indexOfName(g),A=T.getItemVisual(D,"style"),M=T.getItemVisual(D,"legendIcon"),I=ee(A.fill);I&&I[3]===0&&(I[3]=.2,A=B(B({},A),{fill:Pe(I,"rgba")}));var L=this._createItem(x,g,p,v,i,e,{},A,M,h,a);L.on("click",Gi(Vd,null,g,a,c)).on("mouseover",Gi(Hf,null,g,a,c)).on("mouseout",Gi(Gf,null,g,a,c)),n.ssr&&L.eachChild(function(P){var R=it(P);R.seriesIndex=x.seriesIndex,R.dataIndex=p,R.ssrType="legend"}),f.set(g,!0)}},this)},this),o&&this._createSelector(o,i,a,s,l)},t.prototype._createSelector=function(e,i,n,a,o){var s=this.getSelectorGroup();Vf(e,function(u){var f=u.type,h=new _t({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:f==="all"?"legendAllSelect":"legendInverseSelect"})}});s.add(h);var c=i.getModel("selectorLabel"),v=i.getModel(["emphasis","selectorLabel"]);fn(h,{normal:c,emphasis:v},{defaultText:u.title}),ss(h)})},t.prototype._createItem=function(e,i,n,a,o,s,l,u,f,h,c){var v=e.visualDrawType,p=o.get("itemWidth"),g=o.get("itemHeight"),d=o.isSelected(i),y=a.get("symbolRotate"),m=a.get("symbolKeepAspect"),_=a.get("icon");f=_||f||"roundRect";var w=mL(f,a,l,u,v,d,c),b=new Mo,S=a.getModel("textStyle");if(q(e.getLegendIcon)&&(!_||_==="inherit"))b.add(e.getLegendIcon({itemWidth:p,itemHeight:g,icon:f,iconRotate:y,itemStyle:w.itemStyle,lineStyle:w.lineStyle,symbolKeepAspect:m}));else{var x=_==="inherit"&&e.getData().getVisual("symbol")?y==="inherit"?e.getData().getVisual("symbolRotate"):y:0;b.add(_L({itemWidth:p,itemHeight:g,icon:f,iconRotate:x,itemStyle:w.itemStyle,symbolKeepAspect:m}))}var T=s==="left"?p+5:-5,D=s,A=o.get("formatter"),M=i;H(A)&&A?M=A.replace("{name}",i??""):q(A)&&(M=A(i));var I=d?S.getTextColor():a.get("inactiveColor");b.add(new _t({style:Ee(S,{text:M,x:T,y:g/2,fill:I,align:D,verticalAlign:"middle"},{inheritColor:I})}));var L=new gt({shape:b.getBoundingRect(),style:{fill:"transparent"}}),P=a.getModel("tooltip");return P.get("show")&&Sh({el:L,componentModel:o,itemName:i,itemTooltipOption:P.option}),b.add(L),b.eachChild(function(R){R.silent=!0}),L.silent=!h,this.getContentGroup().add(b),ss(b),b.__legendDataIndex=n,b},t.prototype.layoutInner=function(e,i,n,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();rn(e.get("orient"),l,e.get("itemGap"),n.width,n.height);var f=l.getBoundingRect(),h=[-f.x,-f.y];if(u.markRedraw(),l.markRedraw(),o){rn("horizontal",u,e.get("selectorItemGap",!0));var c=u.getBoundingRect(),v=[-c.x,-c.y],p=e.get("selectorButtonGap",!0),g=e.getOrient().index,d=g===0?"width":"height",y=g===0?"height":"width",m=g===0?"y":"x";s==="end"?v[g]+=f[d]+p:h[g]+=c[d]+p,v[1-g]+=f[y]/2-c[y]/2,u.x=v[0],u.y=v[1],l.x=h[0],l.y=h[1];var _={x:0,y:0};return _[d]=f[d]+p+c[d],_[y]=Math.max(f[y],c[y]),_[m]=Math.min(0,c[m]+v[1-g]),_}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(ie);function mL(r,t,e,i,n,a,o){function s(d,y){d.lineWidth==="auto"&&(d.lineWidth=y.lineWidth>0?2:0),Vf(d,function(m,_){d[_]==="inherit"&&(d[_]=y[_])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),f=r.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?i.decal:bf(h,o),u.fill==="inherit"&&(u.fill=i[n]),u.stroke==="inherit"&&(u.stroke=i[f]),u.opacity==="inherit"&&(u.opacity=(n==="fill"?i:e).opacity),s(u,i);var c=t.getModel("lineStyle"),v=c.getLineStyle();if(s(v,e),u.fill==="auto"&&(u.fill=i.fill),u.stroke==="auto"&&(u.stroke=i.fill),v.stroke==="auto"&&(v.stroke=i.fill),!a){var p=t.get("inactiveBorderWidth"),g=u[f];u.lineWidth=p==="auto"?i.lineWidth>0&&g?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),v.stroke=c.get("inactiveColor"),v.lineWidth=c.get("inactiveWidth")}return{itemStyle:u,lineStyle:v}}function _L(r){var t=r.icon||"roundRect",e=Je(t,0,0,r.itemWidth,r.itemHeight,r.itemStyle.fill,r.symbolKeepAspect);return e.setStyle(r.itemStyle),e.rotation=(r.iconRotate||0)*Math.PI/180,e.setOrigin([r.itemWidth/2,r.itemHeight/2]),t.indexOf("empty")>-1&&(e.style.stroke=e.style.fill,e.style.fill="#fff",e.style.lineWidth=2),e}function Vd(r,t,e,i){Gf(r,t,e,i),e.dispatchAction({type:"legendToggleSelect",name:r??t}),Hf(r,t,e,i)}function l_(r){for(var t=r.getZr().storage.getDisplayList(),e,i=0,n=t.length;i<n&&!(e=t[i].states.emphasis);)i++;return e&&e.hoverLayer}function Hf(r,t,e,i){l_(e)||e.
Line truncated
|
||||
`||u==="")){var f=o.isSelected(u);i.hasOwnProperty(u)?i[u]=i[u]&&f:i[u]=f}})}),r==="allSelect"||r==="inverseSelect"?{selected:i}:{name:t.name,selected:i}}function wL(r){r.registerAction("legendToggleSelect","legendselectchanged",yt(Nn,"toggleSelected")),r.registerAction("legendAllSelect","legendselectall",yt(Nn,"allSelect")),r.registerAction("legendInverseSelect","legendinverseselect",yt(Nn,"inverseSelect")),r.registerAction("legendSelect","legendselected",yt(Nn,"select")),r.registerAction("legendUnSelect","legendunselected",yt(Nn,"unSelect"))}function u_(r){r.registerComponentModel(zf),r.registerComponentView(s_),r.registerProcessor(r.PRIORITY.PROCESSOR.SERIES_FILTER,SL),r.registerSubTypeDefaulter("legend",function(){return"plain"}),wL(r)}var bL=function(r){N(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(e,i,n){var a=Js(e);r.prototype.init.call(this,e,i,n),Hd(this,e,a)},t.prototype.mergeOption=function(e,i){r.prototype.mergeOption.call(this,e,i),Hd(this,this.option,e)},t.type="legend.scroll",t.defaultOption=$s(zf.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),t}(zf);function Hd(r,t,e){var i=r.getOrient(),n=[1,1];n[i.index]=0,on(t,e,{type:"box",ignoreSize:!!n})}var Gd=St,Iu=["width","height"],Lu=["x","y"],xL=function(r){N(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.newlineDisabled=!0,e._currentIndex=0,e}return t.prototype.init=function(){r.prototype.init.call(this),this.group.add(this._containerGroup=new Gd),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new Gd)},t.prototype.resetInner=function(){r.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},t.prototype.renderInner=function(e,i,n,a,o,s,l){var u=this;r.prototype.renderInner.call(this,e,i,n,a,o,s,l);var f=this._controllerGroup,h=i.get("pageIconSize",!0),c=F(h)?h:[h,h];p("pagePrev",0);var v=i.getModel("pageTextStyle");f.add(new _t({name:"pageText",style:{text:"xx/xx",fill:v.getTextColor(),font:v.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),p("pageNext",1);function p(g,d){var y=g+"DataIndex",m=Ws(i.get("pageIcons",!0)[i.getOrient().name][d],{onclick:J(u._pageGo,u,y,i,a)},{x:-c[0]/2,y:-c[1]/2,width:c[0],height:c[1]});m.name=g,f.add(m)}},t.prototype.layoutInner=function(e,i,n,a,o,s){var l=this.getSelectorGroup(),u=e.getOrient().index,f=Iu[u],h=Lu[u],c=Iu[1-u],v=Lu[1-u];o&&rn("horizontal",l,e.get("selectorItemGap",!0));var p=e.get("selectorButtonGap",!0),g=l.getBoundingRect(),d=[-g.x,-g.y],y=X(n);o&&(y[f]=n[f]-g[f]-p);var m=this._layoutContentAndController(e,a,y,u,f,c,v,h);if(o){if(s==="end")d[u]+=m[f]+p;else{var _=g[f]+p;d[u]-=_,m[h]-=_}m[f]+=g[f]+p,d[1-u]+=m[v]+m[c]/2-g[c]/2,m[c]=Math.max(m[c],g[c]),m[v]=Math.min(m[v],g[v]+d[1-u]),l.x=d[0],l.y=d[1],l.markRedraw()}return m},t.prototype._layoutContentAndController=function(e,i,n,a,o,s,l,u){var f=this.getContentGroup(),h=this._containerGroup,c=this._controllerGroup;rn(e.get("orient"),f,e.get("itemGap"),a?n.width:null,a?null:n.height),rn("horizontal",c,e.get("pageButtonItemGap",!0));var v=f.getBoundingRect(),p=c.getBoundingRect(),g=this._showController=v[o]>n[o],d=[-v.x,-v.y];i||(d[a]=f[u]);var y=[0,0],m=[-p.x,-p.y],_=j(e.get("pageButtonGap",!0),e.get("itemGap",!0));if(g){var w=e.get("pageButtonPosition",!0);w==="end"?m[a]+=n[o]-p[o]:y[a]+=p[o]+_}m[1-a]+=v[s]/2-p[s]/2,f.setPosition(d),h.setPosition(y),c.setPosition(m);var b={x:0,y:0};if(b[o]=g?n[o]:v[o],b[s]=Math.max(v[s],p[s]),b[l]=Math.min(0,p[l]+m[1-a]),h.__rectSize=n[o],g){var S={x:0,y:0};S[o]=Math.max(n[o]-p[o]-_,0),S[s]=b[s],h.setClipPath(new gt({shape:S})),h.__rectSize=S[o]}else c.eachChild(function(T){T.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(e);return x.pageIndex!=null&&zt(f,{x:x.contentPosition[0],y:x.contentPosition[1]},g?e:null),this._updatePageInfoView(e,x),b},t.prototype._pageGo=function(e,i,n){var a=this._getPageInfo(i)[e];a!=null&&n.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:i.id})},t.prototype._updatePageInfoView=function(e,i){var n=this._controllerGroup;C(["pagePrev","pageNext"],function(f){var h=f+"DataIndex",c=i[h]!=null,v=n.childOfName(f);v&&(v.setStyle("fill",c?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),v.cursor=c?"pointer":"default")});var a=n.childOfName("pageText"),o=e.get("pageFormatter"),s=i.pageIndex,l=s!=null?s+1:0,u=i.pageCount;a&&o&&a.setStyle("text",H(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==nul
Line truncated
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
/*! @ttqtt/liquid-glass-react 0.0.2 | MIT */@layer lg.tokens{:root{--lg-font-text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;--lg-font-display: var(--lg-font-text);--lg-font-rounded: ui-rounded, "SF Pro Rounded", var(--lg-font-text);--lg-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;--lg-font: var(--lg-font-text);--lg-text-scale: 1;--lg-text-largetitle-size: calc(34px * var(--lg-text-scale));--lg-text-largetitle-leading: calc(41px * var(--lg-text-scale));--lg-text-largetitle-tracking: .012em;--lg-text-title1-size: calc(28px * var(--lg-text-scale));--lg-text-title1-leading: calc(34px * var(--lg-text-scale));--lg-text-title1-tracking: .014em;--lg-text-title2-size: calc(22px * var(--lg-text-scale));--lg-text-title2-leading: calc(28px * var(--lg-text-scale));--lg-text-title2-tracking: -.012em;--lg-text-title3-size: calc(20px * var(--lg-text-scale));--lg-text-title3-leading: calc(25px * var(--lg-text-scale));--lg-text-title3-tracking: -.023em;--lg-text-headline-size: calc(17px * var(--lg-text-scale));--lg-text-headline-leading: calc(22px * var(--lg-text-scale));--lg-text-headline-tracking: -.026em;--lg-text-body-size: calc(17px * var(--lg-text-scale));--lg-text-body-leading: calc(22px * var(--lg-text-scale));--lg-text-body-tracking: -.026em;--lg-text-callout-size: calc(16px * var(--lg-text-scale));--lg-text-callout-leading: calc(21px * var(--lg-text-scale));--lg-text-callout-tracking: -.02em;--lg-text-subhead-size: calc(15px * var(--lg-text-scale));--lg-text-subhead-leading: calc(20px * var(--lg-text-scale));--lg-text-subhead-tracking: -.016em;--lg-text-footnote-size: calc(13px * var(--lg-text-scale));--lg-text-footnote-leading: calc(18px * var(--lg-text-scale));--lg-text-footnote-tracking: -.006em;--lg-text-caption1-size: calc(12px * var(--lg-text-scale));--lg-text-caption1-leading: calc(16px * var(--lg-text-scale));--lg-text-caption1-tracking: 0em;--lg-text-caption2-size: calc(11px * var(--lg-text-scale));--lg-text-caption2-leading: calc(13px * var(--lg-text-scale));--lg-text-caption2-tracking: .006em;--lg-weight-regular: 400;--lg-weight-medium: 500;--lg-weight-semibold: 600;--lg-weight-bold: 700;--lg-space-1: 4px;--lg-space-2: 8px;--lg-space-3: 12px;--lg-space-4: 16px;--lg-space-5: 20px;--lg-space-6: 24px;--lg-space-8: 32px;--lg-space-10: 40px;--lg-margin: 16px;--lg-margin-regular: 20px;--lg-hit-min: 44px;--lg-hit-width: 0px;--lg-height-compact: 36px;--lg-height-comfortable: 44px;--lg-height-small: 32px;--lg-height-large: 50px;--lg-height-extra-large: 60px;--lg-height-field-small: 36px;--lg-height-field-large: 52px;--lg-field-font: max(16px, var(--lg-text-body-size));--lg-control-font: var(--lg-text-subhead-size);--lg-field-padding-block: var(--lg-space-2);--lg-readable: 672px;--lg-sidebar-width: 260px;--lg-radius-xs: 6px;--lg-radius-s: 10px;--lg-radius-m: 14px;--lg-radius-l: 20px;--lg-radius-xl: 26px;--lg-radius-xxl: 34px;--lg-radius-capsule: 9999px;--lg-radius-sheet: 38px;--lg-radius-window: 24px;--lg-radius-container: var(--lg-radius-xl);--lg-concentric-inset: 0px;--lg-z-content: 0;--lg-z-scroll-edge: 10;--lg-z-sidebar: 15;--lg-z-tabbar: 20;--lg-z-sheet-backdrop: 30;--lg-z-sheet: 31;--lg-z-menu: 40;--lg-z-alert: 41;--lg-z-toast: 60;--lg-duration-press: 90ms;--lg-duration-release: .22s;--lg-duration-layout: .28s;--lg-duration-spring: .52s;--lg-duration-overlay: .36s;--lg-duration-exit: .22s;--lg-ease: cubic-bezier(.2,.8,.2,1);--lg-ease-out: cubic-bezier(.16,1,.3,1);--lg-spring: linear(0, .008 1.1%, .03 2.2%, .118 4.6%, .43 9.6%, .657 13.4%, .84 17.4%, .94 20.7%, 1.006 23.9%, 1.05 27.5%, 1.072 31.5%, 1.07 35.9%, 1.05 41.4%, 1.011 51.3%, .995 61.4%, .994 70.3%, 1.001 87.4%, 1);--lg-spring-soft: linear(0, .011 1.6%, .045 3.4%, .164 7%, .49 14%, .71 19.4%, .866 24.8%, .955 30.3%, 1.004 36%, 1.02 42.2%, 1.018 49.3%, 1.005 61.3%, .999 78%, 1);--lg-spring-bouncy: linear(0, .01 .9%, .043 2%, .152 4.3%, .49 9.2%, .74 12.9%, .91 16.2%, 1.05 19.8%, 1.13 23.4%, 1.16 26.4%, 1.15 29.5%, 1.11 33.6%, 1.03 40.8%, .985 47.3%, .972 53.2%, .985 63%, 1.004 75.2%, 1);--lg-press-scale: 1.06;--lg-press-scale-shared: 1.07;--lg-hover-scale: 1.015;--lg-stretch-gain: 1;--lg-focus-width: 2px;--lg-focus-offset: 2px;--lg-glass-rim-width: 1px;--lg-light-angle: 145deg;--lg-glass-contrast: 1.05;--lg-material-blur: 30px}:root[data-lg-text-size=xs]{--lg-text-scale: .824}:root[data-lg-text-size=s]{--lg-text-scale: .882}:root[data-lg-text-size=m]{--lg-text-scale: .941}:root[data-lg-text-size=l]{--lg-text-scale: 1}:root[data-lg-text-size=xl]{--lg-text-scale: 1.118}:root[data-lg-text-size=xxl]{--lg-text-scale: 1.235}:root[data-lg-text-size=xxxl]{--lg-text-scale: 1.353}:root[data-lg-text-size=ax1]{--lg-text-scale: 1.647}:root[data-lg-text-size=ax2]{--lg-text-scale: 1.941}:root[data-lg-text-size=ax3]{--lg-text-scale: 2.353}:root[data-lg-text-size=ax4]{--lg-text-scale: 2.765}:root[data-lg-text-size=ax5]{--lg-text-scale: 3.118}@media (pointer: fine) and (min-wLine truncated
|
||||
Vendored
+50
@@ -0,0 +1,50 @@
|
||||
var cv=Object.defineProperty;var sv=(i,s,o)=>s in i?cv(i,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[s]=o;var uu=(i,s,o)=>sv(i,typeof s!="symbol"?s+"":s,o);var Gc={exports:{}},be={};/**
|
||||
* @license React
|
||||
* react.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Xd;function ov(){if(Xd)return be;Xd=1;var i=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),v=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),O=Symbol.iterator;function x(y){return y===null||typeof y!="object"?null:(y=O&&y[O]||y["@@iterator"],typeof y=="function"?y:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,S={};function C(y,B,le){this.props=y,this.context=B,this.refs=S,this.updater=le||w}C.prototype.isReactComponent={},C.prototype.setState=function(y,B){if(typeof y!="object"&&typeof y!="function"&&y!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,y,B,"setState")},C.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function _(){}_.prototype=C.prototype;function k(y,B,le){this.props=y,this.context=B,this.refs=S,this.updater=le||w}var T=k.prototype=new _;T.constructor=k,j(T,C.prototype),T.isPureReactComponent=!0;var L=Array.isArray,A={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function Q(y,B,le,$,F,P){return le=P.ref,{$$typeof:i,type:y,key:B,ref:le!==void 0?le:null,props:P}}function q(y,B){return Q(y.type,B,void 0,void 0,void 0,y.props)}function R(y){return typeof y=="object"&&y!==null&&y.$$typeof===i}function Y(y){var B={"=":"=0",":":"=2"};return"$"+y.replace(/[=:]/g,function(le){return B[le]})}var K=/\/+/g;function D(y,B){return typeof y=="object"&&y!==null&&y.key!=null?Y(""+y.key):B.toString(36)}function te(){}function W(y){switch(y.status){case"fulfilled":return y.value;case"rejected":throw y.reason;default:switch(typeof y.status=="string"?y.then(te,te):(y.status="pending",y.then(function(B){y.status==="pending"&&(y.status="fulfilled",y.value=B)},function(B){y.status==="pending"&&(y.status="rejected",y.reason=B)})),y.status){case"fulfilled":return y.value;case"rejected":throw y.reason}}throw y}function ne(y,B,le,$,F){var P=typeof y;(P==="undefined"||P==="boolean")&&(y=null);var ce=!1;if(y===null)ce=!0;else switch(P){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(y.$$typeof){case i:case s:ce=!0;break;case z:return ce=y._init,ne(ce(y._payload),B,le,$,F)}}if(ce)return F=F(y),ce=$===""?"."+D(y,0):$,L(F)?(le="",ce!=null&&(le=ce.replace(K,"$&/")+"/"),ne(F,B,le,"",function(ve){return ve})):F!=null&&(R(F)&&(F=q(F,le+(F.key==null||y&&y.key===F.key?"":(""+F.key).replace(K,"$&/")+"/")+ce)),B.push(F)),1;ce=0;var se=$===""?".":$+":";if(L(y))for(var de=0;de<y.length;de++)$=y[de],P=se+D($,de),ce+=ne($,B,le,P,F);else if(de=x(y),typeof de=="function")for(y=de.call(y),de=0;!($=y.next()).done;)$=$.value,P=se+D($,de++),ce+=ne($,B,le,P,F);else if(P==="object"){if(typeof y.then=="function")return ne(W(y),B,le,$,F);throw B=String(y),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return ce}function V(y,B,le){if(y==null)return y;var $=[],F=0;return ne(y,$,"","",function(P){return B.call(le,P,F++)}),$}function ie(y){if(y._status===-1){var B=y._result;B=B(),B.then(function(le){(y._status===0||y._status===-1)&&(y._status=1,y._result=le)},function(le){(y._status===0||y._status===-1)&&(y._status=2,y._result=le)}),y._status===-1&&(y._status=0,y._result=B)}if(y._status===1)return y._result.default;throw y._result}var I=typeof reportError=="function"?reportError:function(y){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof y=="object"&&y!==null&&typeof y.message=="string"?String(y.message):String(y),error:y});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",y);return}console.error(y)};function J(){}return be.Children={map:V,forEach:function(y,B,le){V(y,function(){B.apply(this,arguments)},le)},count:function(y){var B=0;return V(y,function(){B++}),B},toArray:function(y){return V(y,function(B){return B})||[]},only:function(y){if(!R(y))throw Error("React.Children.only expected to receive a single React element child.");return y}},be.Component=C,be.Fragment=o,be.Profiler=d,be.PureComponent=k,be.StrictMode=r,be.Suspense=p,be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,be.act=function(){throw Error("act(...) is not supported in production builds of React.")},be.cache=function(y){return function(){return y.apply(null,arguments)}},be.cloneElement=function(y,B,le){if(y==null)throw Error("The argument must be a React element, but you passed
Line truncated
|
||||
`||r==="\r"?(m(),g=2):v+=r),g===3&&v==="!--"&&(g=4,p=p[0])}return m(),p}(i)),s),arguments,[])).length>1?s:s[0]}var Yc={exports:{}},iu={},Xc={exports:{}},Vc={};/**
|
||||
* @license React
|
||||
* scheduler.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Zd;function dv(){return Zd||(Zd=1,function(i){function s(V,ie){var I=V.length;V.push(ie);e:for(;0<I;){var J=I-1>>>1,y=V[J];if(0<d(y,ie))V[J]=ie,V[I]=y,I=J;else break e}}function o(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var ie=V[0],I=V.pop();if(I!==ie){V[0]=I;e:for(var J=0,y=V.length,B=y>>>1;J<B;){var le=2*(J+1)-1,$=V[le],F=le+1,P=V[F];if(0>d($,I))F<y&&0>d(P,$)?(V[J]=P,V[F]=I,J=F):(V[J]=$,V[le]=I,J=le);else if(F<y&&0>d(P,I))V[J]=P,V[F]=I,J=F;else break e}}return ie}function d(V,ie){var I=V.sortIndex-ie.sortIndex;return I!==0?I:V.id-ie.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var g=performance;i.unstable_now=function(){return g.now()}}else{var v=Date,b=v.now();i.unstable_now=function(){return v.now()-b}}var p=[],m=[],z=1,O=null,x=3,w=!1,j=!1,S=!1,C=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function T(V){for(var ie=o(m);ie!==null;){if(ie.callback===null)r(m);else if(ie.startTime<=V)r(m),ie.sortIndex=ie.expirationTime,s(p,ie);else break;ie=o(m)}}function L(V){if(S=!1,T(V),!j)if(o(p)!==null)j=!0,W();else{var ie=o(m);ie!==null&&ne(L,ie.startTime-V)}}var A=!1,M=-1,Q=5,q=-1;function R(){return!(i.unstable_now()-q<Q)}function Y(){if(A){var V=i.unstable_now();q=V;var ie=!0;try{e:{j=!1,S&&(S=!1,_(M),M=-1),w=!0;var I=x;try{t:{for(T(V),O=o(p);O!==null&&!(O.expirationTime>V&&R());){var J=O.callback;if(typeof J=="function"){O.callback=null,x=O.priorityLevel;var y=J(O.expirationTime<=V);if(V=i.unstable_now(),typeof y=="function"){O.callback=y,T(V),ie=!0;break t}O===o(p)&&r(p),T(V)}else r(p);O=o(p)}if(O!==null)ie=!0;else{var B=o(m);B!==null&&ne(L,B.startTime-V),ie=!1}}break e}finally{O=null,x=I,w=!1}ie=void 0}}finally{ie?K():A=!1}}}var K;if(typeof k=="function")K=function(){k(Y)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,te=D.port2;D.port1.onmessage=Y,K=function(){te.postMessage(null)}}else K=function(){C(Y,0)};function W(){A||(A=!0,K())}function ne(V,ie){M=C(function(){V(i.unstable_now())},ie)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(V){V.callback=null},i.unstable_continueExecution=function(){j||w||(j=!0,W())},i.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<V?Math.floor(1e3/V):5},i.unstable_getCurrentPriorityLevel=function(){return x},i.unstable_getFirstCallbackNode=function(){return o(p)},i.unstable_next=function(V){switch(x){case 1:case 2:case 3:var ie=3;break;default:ie=x}var I=x;x=ie;try{return V()}finally{x=I}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(V,ie){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var I=x;x=V;try{return ie()}finally{x=I}},i.unstable_scheduleCallback=function(V,ie,I){var J=i.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?J+I:J):I=J,V){case 1:var y=-1;break;case 2:y=250;break;case 5:y=1073741823;break;case 4:y=1e4;break;default:y=5e3}return y=I+y,V={id:z++,callback:ie,priorityLevel:V,startTime:I,expirationTime:y,sortIndex:-1},I>J?(V.sortIndex=I,s(m,V),o(p)===null&&V===o(m)&&(S?(_(M),M=-1):S=!0,ne(L,I-J))):(V.sortIndex=y,s(p,V),j||w||(j=!0,W())),V},i.unstable_shouldYield=R,i.unstable_wrapCallback=function(V){var ie=x;return function(){var I=x;x=ie;try{return V.apply(this,arguments)}finally{x=I}}}}(Vc)),Vc}var Kd;function hv(){return Kd||(Kd=1,Xc.exports=dv()),Xc.exports}var Qc={exports:{}},mt={};/**
|
||||
* @license React
|
||||
* react-dom.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var $d;function mv(){if($d)return mt;$d=1;var i=ts();function s(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var z=2;z<arguments.length;z++)m+="&args[]="+encodeURIComponent(arguments[z])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var r={d:{f:o,r:function(){throw Error(s(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},d=Symbol.for("react.portal");function g(p,m,z){var O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:O==null?null:""+O,children:p,containerInfo:m,implementation:z}}var v=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function b(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return mt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,mt.createPortal=function(p,m){var z=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(s(299));return g(p,m,null,z)},mt.flushSync=function(p){var m=v.T,z=r.p;try{if(v.T=null,r.p=2,p)return p()}finally{v.T=m,r.p=z,r.d.f()}},mt.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(p,m))},mt.prefetchDNS=function(p){typeof p=="string"&&r.d.D(p)},mt.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var z=m.as,O=b(z,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,w=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;z==="style"?r.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:O,integrity:x,fetchPriority:w}):z==="script"&&r.d.X(p,{crossOrigin:O,integrity:x,fetchPriority:w,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},mt.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var z=b(m.as,m.crossOrigin);r.d.M(p,{crossOrigin:z,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(p)},mt.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var z=m.as,O=b(z,m.crossOrigin);r.d.L(p,z,{crossOrigin:O,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},mt.preloadModule=function(p,m){if(typeof p=="string")if(m){var z=b(m.as,m.crossOrigin);r.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:z,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(p)},mt.requestFormReset=function(p){r.d.r(p)},mt.unstable_batchedUpdates=function(p,m){return p(m)},mt.useFormState=function(p,m,z){return v.H.useFormState(p,m,z)},mt.useFormStatus=function(){return v.H.useHostTransitionStatus()},mt.version="19.0.0",mt}var Jd;function gv(){if(Jd)return Qc.exports;Jd=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(s){console.error(s)}}return i(),Qc.exports=mv(),Qc.exports}/**
|
||||
* @license React
|
||||
* react-dom-client.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Wd;function vv(){if(Wd)return iu;Wd=1;var i=hv(),s=ts(),o=gv();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}var g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),x=Symbol.for("react.consumer"),w=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),L=Symbol.for("react.memo_cache_sentinel"),A=Symbol.iterator;function M(e){return e===null||typeof e!="object"?null:(e=A&&e[A]||e["@@iterator"],typeof e=="function"?e:null)}var Q=Symbol.for("react.client.reference");function q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case p:return"Fragment";case b:return"Portal";case z:return"Profiler";case m:return"StrictMode";case S:return"Suspense";case C:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case w:return(e.displayName||"Context")+".Provider";case x:return(e._context.displayName||"Context")+".Consumer";case j:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _:return t=e.displayName||null,t!==null?t:q(e.type)||"Memo";case k:t=e._payload,e=e._init;try{return q(e(t))}catch{}}return null}var R=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.assign,K,D;function te(e){if(K===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);K=t&&t[1]||"",D=-1<l.stack.indexOf(`
|
||||
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||||
`+K+e+D}var W=!1;function ne(e,t){if(!e||W)return"";W=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(ee){var Z=ee}Reflect.construct(e,[],re)}else{try{re.call()}catch(ee){Z=ee}e.call(re.prototype)}}else{try{throw Error()}catch(ee){Z=ee}(re=e())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(ee){if(ee&&Z&&typeof ee.stack=="string")return[ee.stack,Z.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),c=u[0],h=u[1];if(c&&h){var E=c.split(`
|
||||
`),H=h.split(`
|
||||
`);for(n=a=0;a<E.length&&!E[a].includes("DetermineComponentFrameRoot");)a++;for(;n<H.length&&!H[n].includes("DetermineComponentFrameRoot");)n++;if(a===E.length||n===H.length)for(a=E.length-1,n=H.length-1;1<=a&&0<=n&&E[a]!==H[n];)n--;for(;1<=a&&0<=n;a--,n--)if(E[a]!==H[n]){if(a!==1||n!==1)do if(a--,n--,0>n||E[a]!==H[n]){var ae=`
|
||||
`+E[a].replace(" at new "," at ");return e.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",e.displayName)),ae}while(1<=a&&0<=n);break}}}finally{W=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?te(l):""}function V(e){switch(e.tag){case 26:case 27:case 5:return te(e.type);case 16:return te("Lazy");case 13:return te("Suspense");case 19:return te("SuspenseList");case 0:case 15:return e=ne(e.type,!1),e;case 11:return e=ne(e.type.render,!1),e;case 1:return e=ne(e.type,!0),e;default:return""}}function ie(e){try{var t="";do t+=V(e),e=e.return;while(e);return t}catch(l){return`
|
||||
Error generating stack: `+l.message+`
|
||||
`+l.stack}}function I(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function J(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(I(e)!==e)throw Error(r(188))}function B(e){var t=e.alternate;if(!t){if(t=I(e),t===null)throw Error(r(188));return t!==e?null:e}for(var l=e,a=t;;){var n=l.return;if(n===null)break;var u=n.alternate;if(u===null){if(a=n.return,a!==null){l=a;continue}break}if(n.child===u.child){for(u=n.child;u;){if(u===l)return y(n),e;if(u===a)return y(n),t;u=u.sibling}throw Error(r(188))}if(l.return!==a.return)l=n,a=u;else{for(var c=!1,h=n.child;h;){if(h===l){c=!0,l=n,a=u;break}if(h===a){c=!0,a=n,l=u;break}h=h.sibling}if(!c){for(h=u.child;h;){if(h===l){c=!0,l=u,a=n;break}if(h===a){c=!0,a=u,l=n;break}h=h.sibling}if(!c)throw Error(r(189))}}if(l.alternate!==a)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?e:t}function le(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=le(e),t!==null)return t;e=e.sibling}return null}var $=Array.isArray,F=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},ce=[],se=-1;function de(e){return{current:e}}function ve(e){0>se||(e.current=ce[se],ce[se]=null,se--)}function he(e,t){se++,ce[se]=e.current,e.current=t}var Be=de(null),He=de(null),ke=de(null),et=de(null);function Ve(e,t){switch(he(ke,t),he(He,e),he(Be,null),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?pd(t):0;break;default:if(e=e===8?t.parentNode:t,t=e.tagName,e=e.namespaceURI)e=pd(e),t=bd(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ve(Be),he(Be,t)}function Ot(){ve(Be),ve(He),ve(ke)}function rl(e){e.memoizedState!==null&&he(et,e);var t=Be.current,l=bd(t,e.type);t!==l&&(he(He,e),he(Be,l))}function Ct(e){He.current===e&&(ve(Be),ve(He)),et.current===e&&(ve(et),eu._currentValue=P)}var xe=Object.prototype.hasOwnProperty,je=i.unstable_scheduleCallback,Oe=i.unstable_cancelCallback,pt=i.unstable_shouldYield,bt=i.unstable_requestPaint,Je=i.unstable_now,el=i.unstable_getCurrentPriorityLevel,cn=i.unstable_ImmediatePriority,sn=i.unstable_UserBlockingPriority,Ut=i.unstable_NormalPriority,cl=i.unstable_LowPriority,hu=i.unstable_IdlePriority,Ci=i.log,$t=i.unstable_setDisableYieldValue,zl=null,it=null;function Pl(e){if(it&&typeof it.onCommitFiberRoot=="function")try{it.onCommitFiberRoot(zl,e,void 0,(e.current.flags&128)===128)}catch{}}function xt(e){if(typeof Ci=="function"&&$t(e),it&&typeof it.setStrictMode=="function")try{it.setStrictMode(zl,e)}catch{}}var ft=Math.clz32?Math.clz32:_i,mu=Math.log,Ui=Math.LN2;function _i(e){return e>>>=0,e===0?32:31-(mu(e)/Ui|0)|0}var gu=128,vu=4194304;function Il(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function yu(e,t){var l=e.pendingLanes;if(l===0)return 0;var a=0,n=e.suspendedLanes,u=e.pingedLanes,c=e.warmLanes;e=e.finishedLanes!==0;var h=l&134217727;return h!==0?(l=h&~n,l!==0?a=Il(l):(u&=h,u!==0?a=Il(u):e||(c=h&~c,c!==0&&(a=Il(c))))):(h=l&~n,h!==0?a=Il(h):u!==0?a=Il(u):e||(c=l&~c,c!==0&&(a=Il(c)))),a===0?0:t!==0&&t!==a&&!(t&n)&&(n=a&-a,c=t&-t,n>=c||n===32&&(c&4194176)!==0)?t:a}function on(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Wh(e,t){switch(e){case 1:case 2:case 4:case 8:return t+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function cs(){var e=gu;return gu<<=1,!(gu&4194176)&&(gu=128),e}function ss(){var e=vu;return vu<<=1,!(vu&62914560)&&(vu=4194304),e}function Hi(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function fn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Fh(e,t,l,a,n,u){var c=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var h=e.entanglements,E=e.expirationTimes,H=e.hiddenUpdates;for(l=c&~l;0<l;){var ae=31-ft(l),re=1<<ae;h[ae
Line truncated
|
||||
`).replace(Dg,"")}function yd(e,t){return t=vd(t),vd(e)===t}function fi(){}function De(e,t,l,a,n,u){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||wa(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&wa(e,""+a);break;case"className":bu(e,"class",a);break;case"tabIndex":bu(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":bu(e,l,a);break;case"style":js(e,a,u);break;case"data":if(t!=="object"){bu(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Eu(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(l==="formAction"?(t!=="input"&&De(e,t,"name",n.name,n,null),De(e,t,"formEncType",n.formEncType,n,null),De(e,t,"formMethod",n.formMethod,n,null),De(e,t,"formTarget",n.formTarget,n,null)):(De(e,t,"encType",n.encType,n,null),De(e,t,"method",n.method,n,null),De(e,t,"target",n.target,n,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Eu(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=fi);break;case"onScroll":a!=null&&Me("scroll",e);break;case"onScrollEnd":a!=null&&Me("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(r(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(r(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=Eu(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":Me("beforetoggle",e),Me("toggle",e),pu(e,"popover",a);break;case"xlinkActuate":ol(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":ol(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":ol(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":ol(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":ol(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":ol(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":ol(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":ol(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":ol(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":pu(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=im.get(l)||l,pu(e,l,a))}}function jc(e,t,l,a,n,u){switch(l){case"style":js(e,a,u);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(r(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(r(60));e.innerHTML=l}}break;case"children":typeof a=="string"?wa(e,a):(typeof a=="number"||typeof a=="bigint")&&wa(e,""+a);break;case"onScroll":a!=null&&Me("scroll",e);break;case"onScrollEnd":a!=null&&Me("scrollend",e);break;case"onClick":a!=null&&(e.onclick=fi);break;case"suppressContentEditableWarning":case"suppressHydrationWar
Line truncated
|
||||
* @license React
|
||||
* react-jsx-runtime.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Pd;function bv(){if(Pd)return ru;Pd=1;var i=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function o(r,d,g){var v=null;if(g!==void 0&&(v=""+g),d.key!==void 0&&(v=""+d.key),"key"in d){g={};for(var b in d)b!=="key"&&(g[b]=d[b])}else g=d;return d=g.ref,{$$typeof:i,type:r,key:v,ref:d!==void 0?d:null,props:g}}return ru.Fragment=s,ru.jsx=o,ru.jsxs=o,ru}var Id;function xv(){return Id||(Id=1,Zc.exports=bv()),Zc.exports}var f=xv();const Sv={regular:{small:{blur:14,saturation:1.15,refraction:18,edge:16},large:{blur:40,saturation:1.3,refraction:26,edge:22}},clear:{small:{blur:1.5,saturation:1.08,refraction:32,edge:18},large:{blur:6,saturation:1.12,refraction:40,edge:24}}},Ev={compact:{controlHeight:36,radius:12,gap:6},comfortable:{controlHeight:44,radius:18,gap:8}},k0={press:90,release:220,layout:280,spring:520,overlay:360},G0={space1:4,space2:8,space3:12,space4:16,space5:20,space6:24,space8:32,space10:40,margin:16,marginRegular:20,hitMin:44,readable:672,sidebarWidth:260,controlGap:8},Y0={xs:6,s:10,m:14,l:20,xl:26,xxl:34,sheet:38,window:24},X0={largeTitle:{size:34,leading:41,tracking:.012,weight:400,emphasizedWeight:700},title1:{size:28,leading:34,tracking:.014,weight:400,emphasizedWeight:700},title2:{size:22,leading:28,tracking:-.012,weight:400,emphasizedWeight:700},title3:{size:20,leading:25,tracking:-.023,weight:400,emphasizedWeight:600},headline:{size:17,leading:22,tracking:-.026,weight:600,emphasizedWeight:600},body:{size:17,leading:22,tracking:-.026,weight:400,emphasizedWeight:600},callout:{size:16,leading:21,tracking:-.02,weight:400,emphasizedWeight:600},subhead:{size:15,leading:20,tracking:-.016,weight:400,emphasizedWeight:600},footnote:{size:13,leading:18,tracking:-.006,weight:400,emphasizedWeight:600},caption1:{size:12,leading:16,tracking:0,weight:400,emphasizedWeight:600},caption2:{size:11,leading:13,tracking:.006,weight:400,emphasizedWeight:600}},V0={xs:.824,s:.882,m:.941,l:1,xl:1.118,xxl:1.235,xxxl:1.353,ax1:1.647,ax2:1.941,ax3:2.353,ax4:2.765,ax5:3.118},Q0={content:0,scrollEdge:10,sidebar:15,tabBar:20,sheetBackdrop:30,sheet:31,menu:40,alert:41,toast:60},Nv={material:"regular",renderer:"auto",quality:"balanced",theme:"system",density:"comfortable",transparency:"system",motion:"system",contrast:"system",platform:"auto"},Mv={close:"Close",cancel:"Cancel",decrease:"Decrease",increase:"Increase",clearSearch:"Clear search",searchCommands:"Search commands",noResults:"No matching commands",back:"Back to",resizeSidebar:"Resize sidebar",sheetHeight:i=>`${i} height`,morePathLevels:"More levels",moreToolbarItems:"More",collapsePanel:i=>`Collapse ${i}`,expandPanel:i=>`Expand ${i}`,movePanel:i=>`Move ${i}`},jh=N.createContext(Mv),jv=jh.Provider;function jt(){return N.useContext(jh)}const zh={...Nv,resolvedTheme:"light",resolvedPlatform:"touch",reduceTransparency:!1,reduceMotion:!1,increaseContrast:!1,forcedColors:!1,enableSvgAuto:!1},Wc=N.createContext(zh);function Jl(i){const s=N.useMemo(()=>({subscribe(o){const r=window.matchMedia(i);return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},getSnapshot:()=>typeof window<"u"&&window.matchMedia(i).matches,getServerSnapshot:()=>!1}),[i]);return N.useSyncExternalStore(s.subscribe,s.getSnapshot,s.getServerSnapshot)}function Z0({children:i,strings:s,...o}){const r=N.useContext(Wc),d=jt(),g=Jl("(prefers-color-scheme: dark)"),v=Jl("(prefers-reduced-motion: reduce)"),b=Jl("(prefers-reduced-transparency: reduce)"),p=Jl("(prefers-contrast: more)"),m=Jl("(forced-colors: active)"),z=Jl("(pointer: fine) and (min-width: 768px)"),O=Object.fromEntries(Object.entries(o).filter(([,A])=>A!==void 0)),x={...r,...O},w={...x,resolvedTheme:x.theme==="system"?g?"dark":"light":x.theme,reduceMotion:r.reduceMotion||v||x.motion!=="system",reduceTransparency:r.reduceTransparency||b||m||x.transparency!=="system",increaseContrast:r.increaseContrast||p||m||x.contrast!=="system",forcedColors:r.forcedColors||m,resolvedPlatform:x.platform==="auto"?z?"desktop":"touch":x.platform},j=r===zh,{motion:S,transparency:C,contrast:_,platform:k}=x,{resolvedTheme:T}=w;N.useEffect(()=>{if(!j||typeof document>"u")return;const A=document.documentElement,M=[["data-lg-theme",T],["data-lg-motion",S==="system"?null:S],["data-lg-transparency",C==="system"?null:C],["data-lg-contrast",_==="system"?null:_],["data-lg-platform",k==="auto"?null:k]],Q=M.map(([q])=>[q,A.getAttribute(q)]);for(const[q,R]of M)R===null?A.removeAttribute(q):A.setAttribute(q,R);return()=>{for(const[q,R]of Q)R===null?A.removeAttribute(q):A.setAttribute(q,R)}},[j,T,S,C,_,k]);const L=N.useMemo(()=>s?{...d,...s}:d,[d,s]);return f.jsx(Wc.Provider,{value:w,children:f.jsx(jv,{value:L,children:i})})}const Dt=()=>N.useContext(Wc),zv=768;function wi(){return Jl(`(min-width: ${zv}px)`)?"regular":"compact"}const ls=N.createContext("mixed"),Av=()=>N.useContext(ls);function K0({tone:i,children:s}){return f.jsx(ls.Provider,{value:i,children:s})}function $0({tone:i,children:s,ref:o,...r}){return f.jsx("div",{...r,reLine truncated
|
||||
Reference in new issue
Block a user