Regression / regression (push) Canceled after 0s
## 品牌标识(本次会话) 起因:品牌此前没有任何图形标识 —— 唯一 favicon 是内联 data-URI 里的字母「A」, 那是 v2.0.0「Aurora Admin → Kole UI」改名漏掉的一处(PC 顶栏也是「A」, 移动端站已是「K」;移动端文档站则完全没有 favicon)。 - 几何:24 网格三个互不接触的笔画(竖 + 两斜),圆头描边; 描边 2.25 → 16px 标签页尺寸下正好 1.5px = 规范原文「描边1.5px」 - 取色分两套(刻意):favicon 硬编码品牌蓝/白(渲染在浏览器标签栏,不继承 kole-dark); 顶栏标记走 currentColor(实测暗色下自动转 rgb(20,22,28)) - 新增 theme-color 双条(light #FFFFFF / dark #1C1F26,取 --kole-color-card-bg) - 修 site/app.js hero 标语 KOLE ADMIN → KOLE UI(改名变形残留) - 移动端 7 个模板补 favicon(此前计数 0) 验收:门禁 9 条全 OK(site-routing/site-routes/mobile-docs/mobile-site/isolation/ theme/nav/i18n/icons);PC 回归 1464/1464 · 移动端 807/807,各连跑 8 次一致; 两端 favicon 405 字节逐字节一致;PC 站控制台错误 1→0。 ## 并行会话成果(本次一并入库) - 图标系统:2576 图标(TDesign/Element Plus,MIT)+ 11 端注入 + 5 个构建门禁工具 + IconPreview 预览页 + ICON-SPEC.md 冻结规格 - 移动端平台:47 组件 × 6 端 + 文档站 53 页 + 隔离门禁 - PC 组件:103 个大后台组件 / 组件11 批次 - uni-app:PC 端试点 + 移动端端实现 + 真实编译验证 ## 工程 - .gitignore 补 .scratch/ 与 .zcode-preexisting-*.txt(会话中间产物,实测 9.1MB,不入库) - CHANGELOG 补品牌标识条目 - ROADMAP 登 S8-P4(品牌标识任务包 + og:image/apple-touch-icon 未做部分)
107 lines
4.8 KiB
Plaintext
107 lines
4.8 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Kole UI · RangeQuickPicker</title>
|
|
<link rel="stylesheet" href="../.design_library/kole-ui/colors_and_type.css" />
|
|
<link rel="stylesheet" href="./RangeQuickPicker.css" />
|
|
</head>
|
|
<body>
|
|
<div class="kole-page">
|
|
<h2 class="kole-h2">RangeQuickPicker 日期范围快捷选择</h2>
|
|
<p class="kole-desc">内置快捷选项(今天、近7天、本月等),也支持自定义起止日期。</p>
|
|
|
|
<div class="kole-demo">
|
|
<div class="kole-demo__title">报表时间筛选</div>
|
|
<div class="kole-range" id="range">
|
|
<div class="kole-range-trigger" role="button" tabindex="0" aria-haspopup="listbox" aria-expanded="false" id="trigger">
|
|
<span id="label" class="kole-range-placeholder" role="button" tabindex="0">请选择时间范围</span>
|
|
</div>
|
|
<div class="kole-range-pop" id="pop" style="display:none">
|
|
<div class="kole-range-presets" id="presets"></div>
|
|
<div class="kole-range-custom">
|
|
<input type="date" id="start" />
|
|
<span class="kole-range-tilde">~</span>
|
|
<input type="date" id="end" />
|
|
</div>
|
|
<div class="kole-range-actions">
|
|
<button class="kole-range-cancel" id="cancel">取消</button>
|
|
<button class="kole-range-ok" id="ok">确定</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<p class="kole-code-tip" id="out"></p>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
var PRESETS = [
|
|
{ label: '今天', days: 0 },
|
|
{ label: '昨天', days: -1, len: 1 },
|
|
{ label: '近7天', days: -6 },
|
|
{ label: '近30天', days: -29 },
|
|
{ label: '本月', month: 'this' },
|
|
{ label: '上月', month: 'last' },
|
|
{ label: '本年', year: 'this' }
|
|
];
|
|
function fmt(d) {
|
|
return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0');
|
|
}
|
|
function presetRange(p) {
|
|
var end = new Date(); end.setHours(0, 0, 0, 0);
|
|
var start = new Date(end);
|
|
if (p.year === 'this') { start = new Date(end.getFullYear(), 0, 1); }
|
|
else if (p.month === 'this') { start = new Date(end.getFullYear(), end.getMonth(), 1); }
|
|
else if (p.month === 'last') { start = new Date(end.getFullYear(), end.getMonth() - 1, 1); var e = new Date(end.getFullYear(), end.getMonth(), 1); end = new Date(e - 1); }
|
|
else { start.setDate(end.getDate() + (p.days || 0)); }
|
|
if (p.days === -1 && !p.len) { start = new Date(end); }
|
|
if (p.days === -1 && p.len) { start = new Date(end); start.setDate(end.getDate() - (p.len - 1)); }
|
|
return { start: fmt(start), end: fmt(end) };
|
|
}
|
|
|
|
var range = document.getElementById('range');
|
|
var trigger = document.getElementById('trigger');
|
|
var pop = document.getElementById('pop');
|
|
var label = document.getElementById('label');
|
|
var out = document.getElementById('out');
|
|
var cur = { start: '', end: '' };
|
|
|
|
var presetsEl = document.getElementById('presets');
|
|
PRESETS.forEach(function (p, i) {
|
|
var b = document.createElement('button');
|
|
b.className = 'kole-range-preset'; b.textContent = p.label;
|
|
b.onclick = function () {
|
|
var r = presetRange(p);
|
|
cur = r; document.getElementById('start').value = r.start; document.getElementById('end').value = r.end;
|
|
Array.prototype.forEach.call(presetsEl.children, function (c) { c.classList.remove('is-active'); });
|
|
b.classList.add('is-active');
|
|
};
|
|
presetsEl.appendChild(b);
|
|
});
|
|
|
|
function refresh() {
|
|
if (cur.start && cur.end) {
|
|
label.innerHTML = cur.start + ' <span class="kole-range-sep">~</span> ' + cur.end;
|
|
label.classList.remove('kole-range-placeholder');
|
|
out.textContent = '已选范围:' + cur.start + ' 至 ' + cur.end;
|
|
}
|
|
}
|
|
trigger.onclick = function (e) {
|
|
e.stopPropagation();
|
|
pop.style.display = pop.style.display === 'none' ? 'block' : 'none';
|
|
trigger.classList.toggle('is-focus', pop.style.display === 'block');
|
|
};
|
|
document.getElementById('ok').onclick = function () {
|
|
cur.start = document.getElementById('start').value;
|
|
cur.end = document.getElementById('end').value;
|
|
pop.style.display = 'none'; trigger.classList.remove('is-focus');
|
|
Array.prototype.forEach.call(presetsEl.children, function (c) { c.classList.remove('is-active'); });
|
|
refresh();
|
|
};
|
|
document.getElementById('cancel').onclick = function () { pop.style.display = 'none'; trigger.classList.remove('is-focus'); };
|
|
document.addEventListener('click', function (e) { if (!range.contains(e.target)) { pop.style.display = 'none'; trigger.classList.remove('is-focus'); } });
|
|
</script>
|
|
</body>
|
|
</html>
|