iter(g286): 新增 noticeBar 单行通知条组件

This commit is contained in:
HIsheR
2026-10-26 23:16:30 +08:00
parent c4cf0afc7b
commit 85812abb6c
12 changed files with 288 additions and 12 deletions
+18
View File
@@ -57,6 +57,7 @@ import {
treeSelect,
tree,
notification,
noticeBar,
result,
upload,
watermark,
@@ -1897,6 +1898,23 @@ content.append(
),
);
// 通知条:页顶播报的「一行版 alert」,scroll 让超宽文案自己走过去
content.append(
section(
'sec-notice',
'通知条',
'noticeBar:单行横条,语义色 + 左侧符号 + 关闭;scroll 开启后正文跑马灯(悬停暂停),减少动效偏好下停成静态首屏。',
h(
'div',
{ class: 'col' },
noticeBar({ text: '系统将于今晚 23:00 维护约 10 分钟,期间提交会排队重试。', onClose: () => toast.info('已关闭维护公告') }),
noticeBar({ text: '长公告示例:新版表格已支持列宽记忆与筛选快照,若发现列宽异常可在设置里一键重置;滚动模式下悬停会自动暂停。', variant: 'warning', scroll: true }),
noticeBar({ text: '构建成功:12 项门禁全部通过。', variant: 'success', closable: false }),
noticeBar({ text: '连接已断开,正在重试第 3 次…', variant: 'danger', icon: '⚠' }),
),
),
);
// 悬浮按钮:fixed 定位,挂 body 不参与页面布局
document.body.append(
floatButton({ icon: '+', label: '新建工单', tooltip: '新建工单', position: 'left-bottom', onClick: () => toast.success('已新建工单') }),