精修 WebUI 第二轮:数据表/表格/图表/预约卡
- workspaceHeader 加左侧 2px primary accent + uppercase eyebrow - stats 卡片:tabular-nums + uppercase 标签 + 字号统一 text-xl - table:sticky 表头 uppercase + zebra 奇偶行 + hover 高亮 + mono 列灰度 - timeline 图:4 等分水平网格虚线 + Y 轴 0/mid/max 三档 mono 标签 - 空状态:.hint 单独使用时升级为虚线圆框居中占位 + 圆形 dot - 预约卡片:reservationIndex 加圆点 + reservationValue 改 uppercase pill;hover 去 transform,纯 box-shadow 反馈 - cache-bust v4 → v5
This commit is contained in:
1 parent
b7d7f61a27
commit
299ced21c8
3 files changed
+170
-65
No files matched your search
+22
-3
@@ -654,12 +654,26 @@ function renderTimeline(containerId, timeline) {
|
||||
axis.setAttribute("fill", "none");
|
||||
svg.appendChild(axis);
|
||||
|
||||
// 水平网格线(4 等分),淡色 dashed
|
||||
const gridSteps = 4;
|
||||
for (let i = 1; i <= gridSteps; i++) {
|
||||
const gy = padT + ((H - padT - padB) * i / gridSteps);
|
||||
const gline = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
||||
gline.setAttribute("d", `M ${padL} ${gy.toFixed(2)} L ${W - padR} ${gy.toFixed(2)}`);
|
||||
gline.setAttribute("stroke", "var(--border)");
|
||||
gline.setAttribute("stroke-opacity", "0.5");
|
||||
gline.setAttribute("stroke-dasharray", "2 4");
|
||||
gline.setAttribute("fill", "none");
|
||||
svg.appendChild(gline);
|
||||
}
|
||||
|
||||
const mkText = (x, y, txt, anchor = "start") => {
|
||||
const el = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
||||
el.setAttribute("x", String(x));
|
||||
el.setAttribute("y", String(y));
|
||||
el.setAttribute("fill", "var(--muted)");
|
||||
el.setAttribute("font-size", "11");
|
||||
el.setAttribute("font-size", "10");
|
||||
el.setAttribute("font-family", "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace");
|
||||
el.setAttribute("text-anchor", anchor);
|
||||
el.textContent = txt;
|
||||
return el;
|
||||
@@ -677,8 +691,13 @@ function renderTimeline(containerId, timeline) {
|
||||
return (H - padB) - (vv / maxY) * h;
|
||||
};
|
||||
|
||||
// y 轴 max 标记
|
||||
svg.appendChild(mkText(padL, padT + 10, String(maxY), "start"));
|
||||
// y 轴刻度(0 / mid / max)
|
||||
const yMid = Math.round(maxY / 2);
|
||||
svg.appendChild(mkText(padL - 6, padT + 4, String(maxY), "end"));
|
||||
if (yMid > 0 && yMid < maxY) {
|
||||
svg.appendChild(mkText(padL - 6, padT + (H - padT - padB) / 2 + 4, String(yMid), "end"));
|
||||
}
|
||||
svg.appendChild(mkText(padL - 6, H - padB + 4, "0", "end"));
|
||||
|
||||
// x 轴 3 个时间刻度
|
||||
const fmtShort = (ts) => {
|
||||
|
||||
Reference in new issue
Block a user