时间类组件
时间类组件
时间显示与时间选择,常用于大屏顶栏、值班计时、时间范围筛选。
下表只列各组件特有的高频参数;通用参数见组件手册总览。时间格式用 dayjs 记号(
YYYY-MM-DD HH:mm:ss)。
时钟 basic-timer
实时时间显示(日期 / 时分秒 / 星期),大屏顶栏常用。默认尺寸 [320, 60]。
参数:
| option | 类型 | 默认 | 说明 |
|---|---|---|---|
time-format | string | YYYY-MM-DD HH:mm:ss | 时间格式(dayjs 记号) |
time-zone | select | local | 时区:local / +8 / +9 / +0 / -5 / -8 |
show-weekday | boolean | false | 追加显示星期 |
text-font / font-spacing / text-position / text-vertical | — | — | 字体、字间距、对齐 |
font-shadow-* / shadow-* | — | — | 文字发光 / 投影 |
{ "type": "basic-timer", "uid": "w_clock", "options": {
"position": [1520, 24], "size": [360, 60],
"time-format": "YYYY-MM-DD HH:mm:ss", "show-weekday": true,
"text-font": { "size": 24, "color": "#5cc8ff" } } }计时器 basic-timing
正计时 / 倒计时(距目标时间、连续运行时长)。默认尺寸 [320, 80]。
参数:
| option | 类型 | 默认 | 说明 |
|---|---|---|---|
timing-mode | select | clockwise | clockwise 正计时 / anticlockwise 倒计时 |
time-begin-mode + time-begin | select | project-firing | 起始:跟随工程启动 / custom 自定义开始时间 |
anticlockwise-mode + time-duration / time-end | — | — | 倒计时:按时长(秒)或按结束时间 |
timing-unit | string | DD:HH:mm:ss | 显示格式 |
text-font 等 | — | — | 与时钟一致的字体 / 对齐 / 发光 / 投影 |
日历 basic-calendar
月历展示,可标注 / 选择日期。默认尺寸 [320, 300]。
参数:date-format(日期格式)、week-start(周起始 0 周日 / 1 周一)、calendar-header-*(头部高度 / 字体 / 背景)、week-font / cell-font / cell-today-font / cell-other-font(星期 / 日期 / 今天 / 非本月字体)、cell-selected-bg-color / cell-hover-bg-color(选中 / 悬停背景)。
数据绑定:linkage-field(string, 0~1)——选中日期 → 联动筛选。
时间选择 basic-timeselect
选择时间点 / 时间范围 → 通过联动驱动其它组件按时间筛选。默认尺寸 [260, 40]。
参数:time-type(date / datetime / time / year / month / week / daterange / datetimerange / timerange)、date-format(输出格式)、calendar-range-separator(区间分隔符)、placeholder、clearable、input-*(背景 / 文字 / 边框 / 圆角)。
数据绑定:linkage-field(string, 0~1)——把所选时间写到字段驱动筛选。
时间轴 basic-timescale
时间刻度轴,用于时间序列的进度 / 定位展示。默认尺寸 [600, 80]。
参数:cursor-size / cursor-img / cursor-color / cursor-offset-y(游标)、scale-height / scale-width / scale-color / scale-line-*(刻度与刻度线)、scale-padding(左右间隔)、scale-font(刻度文字)。