仪表盘与后台界面

社区服务日历热力面板

在社区服务场景中完成日历热力面板:包含真实内容、可操作控件、清晰状态反馈和跨尺寸布局。

仪表盘与后台界面日历热力面板HTMLCanvasJavaScript
启用 JavaScript 后可编辑、运行和保存此案例。固定源码如下:
<!doctype html>
<html lang="zh-Hans" dir="ltr">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>社区服务日历热力面板</title>
  <style>
    :root { --ink:#111111; --paper:#f8f8f4; --accent:#111111; --secondary:#8d8d88; --line:color-mix(in srgb, var(--ink) 18%, transparent); --shadow:0 24px 60px color-mix(in srgb, var(--ink) 16%, transparent); color-scheme:light; }
    * { box-sizing:border-box; }
    html { min-width:320px; background:var(--paper); }
    body { min-height:100vh; margin:0; overflow-x:hidden; color:var(--ink); font-family:Helvetica,"PingFang SC",sans-serif; background:repeating-linear-gradient(0deg,transparent 0 31px,color-mix(in srgb,var(--ink) 7%,transparent) 32px),var(--paper); }
    button,input,select,textarea { color:inherit; font:inherit; }
    button,[role="button"],input,select,textarea { accent-color:var(--accent); }
    button { cursor:pointer; }
    button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
    [hidden] { display:none !important; }
    @media (max-width:700px) { .mast h1 { line-height:1.08 !important; letter-spacing:-.035em !important; overflow-wrap:anywhere; } }
    @media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; } }
    .page{width:min(1120px,calc(100% - 30px));margin:auto;padding:48px 0 80px}.mast{display:grid;grid-template-columns:1fr auto;border-top:10px solid var(--ink);padding-top:20px;gap:20px;align-items:end;margin-bottom:26px}.mast h1{font-family:Helvetica,"PingFang SC",sans-serif;font-weight:900;font-size:clamp(44px,10vw,106px);letter-spacing:-.075em;margin:0;line-height:.82}.eyebrow{display:inline-block;margin-bottom:12px;padding:5px 8px;color:var(--paper);background:var(--ink);font:900 10px/1 ui-monospace,monospace;letter-spacing:.14em}.intro{max-width:700px;line-height:1.55}.scenario{padding:9px 12px;border:3px solid var(--ink);font-weight:900}.demo{border:3px solid var(--ink);border-radius:0;box-shadow:12px 12px 0 var(--ink);position:relative;min-height:410px;overflow:hidden;padding:clamp(22px,4vw,46px);background:var(--paper)}@media(max-width:700px){.page{width:calc(100% - 18px);padding:20px 0}.mast{grid-template-columns:1fr}.demo{padding:15px}}
    .panel{padding:16px;border:3px double var(--accent);background:var(--paper)}.stack{display:grid;gap:14px}.row{display:grid;grid-auto-flow:column;grid-auto-columns:max-content;gap:10px;overflow:auto}.action{padding:10px 15px;border:1px solid var(--accent);background:transparent;font-family:Didot,serif;letter-spacing:.06em}.action.primary,.action.is-active{color:var(--paper);background:var(--ink)}.metric{font-family:Didot,serif;font-size:clamp(36px,8vw,74px);letter-spacing:.04em}.status{min-height:24px;padding:9px;border-inline:1px solid var(--accent);text-align:center}.muted{line-height:1.8}.chip{padding:5px 14px;border-inline:1px solid var(--accent);letter-spacing:.1em}.meter{height:5px;background:var(--line)}.meter>i{display:block;height:100%;background:linear-gradient(90deg,var(--accent),var(--secondary))}
    .composition-index{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px}.index-mark{display:grid;align-content:space-between;width:76px;padding:16px 10px;border:1px solid var(--line);color:var(--accent);background:color-mix(in srgb,var(--paper) 82%,transparent);text-align:center}.index-mark strong{font:900 34px/1 ui-monospace,monospace}.index-mark span{writing-mode:vertical-rl;font:800 10px/1.2 ui-monospace,monospace;letter-spacing:.18em}.composition-index .demo{grid-column:1;grid-row:1}.composition-index::before{content:"";position:absolute;left:-12px;top:38px;width:5px;height:45%;background:linear-gradient(var(--accent),var(--secondary))}@media(max-width:700px){.composition-index{grid-template-columns:1fr}.index-mark{grid-row:1;width:auto;grid-template-columns:auto 1fr}.index-mark span{writing-mode:horizontal-tb}.composition-index .demo{grid-row:2}}
    .calendar-heatmap-demo{display:grid;gap:12px;max-width:760px;margin:auto}.calendar-heatmap-demo header{display:flex;justify-content:space-between;gap:18px;align-items:end}.calendar-heatmap-demo h2{margin:.3em 0}.weekday-row,.calendar-heatmap{display:grid;grid-template-columns:repeat(7,1fr);gap:7px}.weekday-row{text-align:center;font-size:12px}.calendar-heatmap button{aspect-ratio:1;border:0;border-radius:8px;background:color-mix(in srgb,var(--accent) calc(var(--heat)*20%),var(--paper))}.calendar-heatmap [data-heat="0"]{--heat:0}.calendar-heatmap [data-heat="1"]{--heat:1}.calendar-heatmap [data-heat="2"]{--heat:2}.calendar-heatmap [data-heat="3"]{--heat:3}.calendar-heatmap [data-heat="4"]{--heat:4;color:var(--paper)}.calendar-heatmap button[aria-selected="true"]{outline:3px solid var(--ink);outline-offset:2px}.calendar-heatmap-demo footer{display:flex;gap:5px;justify-content:flex-end;align-items:center}.calendar-heatmap-demo footer i{width:16px;height:16px;border-radius:4px;background:var(--line)}.calendar-heatmap-demo footer i:nth-of-type(2){background:color-mix(in srgb,var(--accent) 25%,var(--paper))}.calendar-heatmap-demo footer i:nth-of-type(3){background:color-mix(in srgb,var(--accent) 50%,var(--paper))}.calendar-heatmap-demo footer i:nth-of-type(4){background:color-mix(in srgb,var(--accent) 75%,var(--paper))}.calendar-heatmap-demo footer i:nth-of-type(5){background:var(--accent)}.workflow-guide{display:grid;grid-template-columns:190px minmax(0,1fr);grid-template-areas:"rail core" "rail evidence";gap:14px 18px}.guide-rail{grid-area:rail;display:grid;align-content:start;gap:15px;padding:18px;border-right:1px solid var(--line)}.guide-rail ol{display:grid;gap:8px;padding:0;margin:0;list-style:none}.guide-rail li{display:grid;grid-template-columns:30px 1fr;gap:8px;align-items:center;padding:9px;opacity:.5}.guide-rail li[aria-current="step"]{opacity:1;color:var(--paper);background:var(--ink)}.guide-rail li.is-complete{opacity:1;color:var(--accent)}.guide-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}.guide-actions .action{padding-inline:8px}#workflowGuideProgress{height:6px;background:var(--line)}#workflowGuideProgress i{display:block;width:0;height:100%;background:var(--accent)}.guide-core{grid-area:core;min-width:0;padding:16px;border:1px solid var(--line)}.guide-core>p{margin:0 0 14px;padding:10px;border-left:4px solid var(--accent);background:color-mix(in srgb,var(--secondary) 12%,transparent)}.guide-core[data-guide-step="1"]{border-radius:28px}.guide-core[data-guide-step="2"]{box-shadow:inset 0 0 0 4px color-mix(in srgb,var(--accent) 35%,transparent)}.guide-evidence{grid-area:evidence;display:grid;grid-template-columns:1fr 1fr auto;gap:12px;align-items:start}.guide-evidence details,.guide-evidence form{padding:12px;border:1px solid var(--line)}.guide-evidence label{display:grid;gap:7px}.guide-evidence textarea{width:100%;padding:9px;border:1px solid var(--line);background:var(--paper)}@media(max-width:900px){.workflow-guide{grid-template-columns:1fr;grid-template-areas:"core" "rail" "evidence"}.guide-rail{border-right:0;border-bottom:1px solid var(--line)}.guide-rail ol{grid-template-columns:repeat(3,1fr)}.guide-evidence{grid-template-columns:1fr}}.evidence-shell{--evidence-zoom:100;display:grid;gap:18px;padding:clamp(16px,4vw,26px);border:1px solid var(--line);border-radius:30px;background:linear-gradient(180deg,color-mix(in srgb,var(--secondary) 8%,transparent),color-mix(in srgb,var(--paper) 94%,transparent));box-shadow:var(--shadow)}.evidence-head{display:flex;justify-content:space-between;gap:18px;align-items:end}.evidence-head h2{margin:.2em 0}.evidence-tools{display:grid;gap:10px;justify-items:end}.evidence-tools output{padding:10px 14px;border-radius:999px;border:1px solid var(--line);background:var(--paper);font-weight:900}.evidence-body{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(230px,.55fr);gap:16px}.evidence-stage{display:grid;gap:12px;min-width:0}.evidence-ribbon{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.evidence-ribbon button{display:grid;gap:6px;min-height:110px;padding:14px;border:1px solid var(--line);border-radius:18px;background:var(--paper);text-align:left}.evidence-ribbon button[aria-pressed="true"]{border-color:var(--accent);box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent)}.evidence-ribbon span{font:800 11px/1 ui-monospace,monospace;letter-spacing:.14em}.evidence-ribbon small{opacity:.72;line-height:1.5}.evidence-core-shell{min-width:0;padding:clamp(12px,3vw,20px);overflow:auto;border:1px solid var(--line);border-radius:24px;background:color-mix(in srgb,var(--paper) 92%,transparent)}.evidence-core-shell>*{display:block;width:calc(10000%/var(--evidence-zoom));max-width:none;transform:scale(calc(var(--evidence-zoom)/100));transform-origin:top left}.evidence-rail{display:grid;align-content:start;gap:14px;padding:18px;border-radius:22px;color:var(--paper);background:var(--ink)}.evidence-rail label{display:grid;gap:8px}.evidence-rail input,.evidence-rail select{width:100%;padding:10px;border:1px solid #ffffff2e;border-radius:10px;color:inherit;background:#ffffff12}.evidence-checklist,.evidence-log{display:grid;gap:8px;padding-left:18px;margin:0}.evidence-checklist li.is-active{color:var(--secondary);font-weight:900}.evidence-checklist li.is-done{color:var(--accent);font-weight:900}.evidence-log li{line-height:1.55}.evidence-shell[data-board-mode="proof"] .evidence-core-shell{outline:4px solid color-mix(in srgb,var(--accent) 32%,transparent);outline-offset:2px}.evidence-shell[data-board-mode="handoff"] .evidence-rail{background:color-mix(in srgb,var(--ink) 82%,#0a1512)}@media(max-width:920px){.evidence-body{grid-template-columns:1fr}.evidence-ribbon{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:560px){.evidence-head{align-items:stretch;flex-direction:column}.evidence-tools{justify-items:start}.evidence-ribbon{grid-template-columns:1fr}.evidence-core-shell>*{width:100%;transform:none}}
  </style>
</head>
<body data-aesthetic="monochrome" data-composition="field-index">
  <main class="page">
    <header class="mast"><div><span class="eyebrow">monochrome / 日历热力面板 / INTERMEDIATE</span><h1>社区服务日历热力面板</h1><p class="intro">在社区服务场景中完成日历热力面板:包含真实内容、可操作控件、清晰状态反馈和跨尺寸布局。</p></div><span class="scenario">社区服务</span></header>
    <div class="composition-index"><section class="demo" aria-label="社区服务日历热力面板交互区域"><section id="evidenceShell" class="evidence-shell" data-board-mode="scan"><header class="evidence-head"><div><span class="eyebrow">社区服务 / EVIDENCE BOARD</span><h2>日历热力面板观测面板</h2><p>把主案例放入证据看板,用单独的观察卡片、日志和模式切换记录当前结果。</p></div><div class="evidence-tools"><div class="row"><button class="action primary" type="button" data-board-mode="scan">扫描</button><button class="action" type="button" data-board-mode="proof">核验</button><button class="action" type="button" data-board-mode="handoff">交接</button></div><output id="evidenceStatus">等待采样</output></div></header><div class="evidence-body"><section class="evidence-stage"><div class="evidence-ribbon"><button type="button" data-evidence-card="0" aria-pressed="true"><span>01</span><strong>社区服务协作</strong><small>检查状态变化是否可见</small></button><button type="button" data-evidence-card="1" aria-pressed="false"><span>02</span><strong>社区服务进度</strong><small>确认键盘与点击入口一致</small></button><button type="button" data-evidence-card="2" aria-pressed="false"><span>03</span><strong>社区服务提醒</strong><small>观察布局在窄屏下是否回退</small></button><button type="button" data-evidence-card="3" aria-pressed="false"><span>04</span><strong>社区服务收藏</strong><small>记录当前复核结论</small></button></div><div id="evidenceCoreShell" class="evidence-core-shell"><div class="workflow-guide"><nav class="guide-rail" aria-label="服务处置引导"><span class="eyebrow">社区服务 GUIDE</span><ol><li data-workflow-guide-step="0" aria-current="step"><b>1</b><span>咨询服务</span></li><li data-workflow-guide-step="1"><b>2</b><span>生活协助</span></li><li data-workflow-guide-step="2"><b>3</b><span>紧急支持</span></li></ol><div class="guide-actions"><button id="workflowGuideBack" class="action" type="button" disabled>上一步</button><button id="workflowGuideNext" class="action primary" type="button">完成本步</button></div><div id="workflowGuideProgress" role="progressbar" aria-label="服务处置完成度" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><i></i></div></nav><section id="workflowCore" class="workflow-core guide-core" data-guide-step="0" aria-describedby="workflowGuideInstruction"><p id="workflowGuideInstruction">请在主案例中完成“咨询服务”相关操作。</p><!-- 11DZ_CORE_START:dashboards-admin-calendar-heatmap --><div class="calendar-heatmap-demo"><header><span class="eyebrow">CALENDAR HEATMAP</span><h2>社区服务活跃日历</h2><output id="heatmapSelection">选择日期查看活跃度</output></header><div class="weekday-row"><span>一</span><span>二</span><span>三</span><span>四</span><span>五</span><span>六</span><span>日</span></div><div class="calendar-heatmap" role="grid" aria-label="7 月活跃度"><button type="button" role="gridcell" data-heat="3" aria-label="7 月 1 日,活跃度 3" data-core-bridge="dashboards-admin-calendar-heatmap">1</button><button type="button" role="gridcell" data-heat="0" aria-label="7 月 2 日,活跃度 0">2</button><button type="button" role="gridcell" data-heat="2" aria-label="7 月 3 日,活跃度 2">3</button><button type="button" role="gridcell" data-heat="4" aria-label="7 月 4 日,活跃度 4">4</button><button type="button" role="gridcell" data-heat="1" aria-label="7 月 5 日,活跃度 1">5</button><button type="button" role="gridcell" data-heat="3" aria-label="7 月 6 日,活跃度 3">6</button><button type="button" role="gridcell" data-heat="0" aria-label="7 月 7 日,活跃度 0">7</button><button type="button" role="gridcell" data-heat="2" aria-label="7 月 8 日,活跃度 2">8</button><button type="button" role="gridcell" data-heat="4" aria-label="7 月 9 日,活跃度 4">9</button><button type="button" role="gridcell" data-heat="1" aria-label="7 月 10 日,活跃度 1">10</button><button type="button" role="gridcell" data-heat="3" aria-label="7 月 11 日,活跃度 3">11</button><button type="button" role="gridcell" data-heat="0" aria-label="7 月 12 日,活跃度 0">12</button><button type="button" role="gridcell" data-heat="2" aria-label="7 月 13 日,活跃度 2">13</button><button type="button" role="gridcell" data-heat="4" aria-label="7 月 14 日,活跃度 4">14</button><button type="button" role="gridcell" data-heat="1" aria-label="7 月 15 日,活跃度 1">15</button><button type="button" role="gridcell" data-heat="3" aria-label="7 月 16 日,活跃度 3">16</button><button type="button" role="gridcell" data-heat="0" aria-label="7 月 17 日,活跃度 0">17</button><button type="button" role="gridcell" data-heat="2" aria-label="7 月 18 日,活跃度 2">18</button><button type="button" role="gridcell" data-heat="4" aria-label="7 月 19 日,活跃度 4">19</button><button type="button" role="gridcell" data-heat="1" aria-label="7 月 20 日,活跃度 1">20</button><button type="button" role="gridcell" data-heat="3" aria-label="7 月 21 日,活跃度 3">21</button><button type="button" role="gridcell" data-heat="0" aria-label="7 月 22 日,活跃度 0">22</button><button type="button" role="gridcell" data-heat="2" aria-label="7 月 23 日,活跃度 2">23</button><button type="button" role="gridcell" data-heat="4" aria-label="7 月 24 日,活跃度 4">24</button><button type="button" role="gridcell" data-heat="1" aria-label="7 月 25 日,活跃度 1">25</button><button type="button" role="gridcell" data-heat="3" aria-label="7 月 26 日,活跃度 3">26</button><button type="button" role="gridcell" data-heat="0" aria-label="7 月 27 日,活跃度 0">27</button><button type="button" role="gridcell" data-heat="2" aria-label="7 月 28 日,活跃度 2">28</button><button type="button" role="gridcell" data-heat="4" aria-label="7 月 29 日,活跃度 4">29</button><button type="button" role="gridcell" data-heat="1" aria-label="7 月 30 日,活跃度 1">30</button><button type="button" role="gridcell" data-heat="3" aria-label="7 月 31 日,活跃度 3">31</button></div><footer><span>少</span><i data-heat="0"></i><i data-heat="1"></i><i data-heat="2"></i><i data-heat="3"></i><i data-heat="4"></i><span>多</span></footer></div><!-- 11DZ_CORE_END --></section><aside class="guide-evidence"><details id="workflowGuideDetails"><summary>查看验收要求</summary><ul><li>咨询服务需要一次可见状态变化</li><li>生活协助需要一次可见状态变化</li><li>紧急支持需要一次可见状态变化</li></ul></details><form id="workflowGuideEvidenceForm"><label>本步证据<textarea id="workflowGuideEvidence" rows="3" placeholder="记录观察到的状态"></textarea></label><input class="action" type="submit" value="保存证据"></form><output id="workflowGuideSummary">0 / 3 步完成</output></aside></div></div></section><aside class="evidence-rail"><label>画布缩放<input id="evidenceZoom" type="range" min="88" max="128" value="100"><output id="evidenceZoomValue">100%</output></label><label>当前取样<select id="evidenceStep"><option value="0">社区服务协作</option><option value="1">社区服务进度</option><option value="2">社区服务提醒</option><option value="3">社区服务收藏</option></select></label><ul id="evidenceChecklist" class="evidence-checklist"><li>社区服务协作</li><li>社区服务进度</li><li>社区服务提醒</li><li>社区服务收藏</li></ul><button id="evidenceCapture" class="action primary" type="button">写入证据</button><ol id="evidenceLog" class="evidence-log"><li>尚未写入证据</li></ol></aside></div></section><p id="status" class="status" role="status" aria-live="polite"></p></section><aside class="index-mark" aria-hidden="true"><strong>05</strong><span>社区服务 FIELD INDEX</span></aside></div>
  </main>
  <script>
    'use strict';
    const statusOutput = document.querySelector('#status');
    const announce = message => { statusOutput.textContent = message; };
    /* 11DZ_CORE_SCRIPT_START:dashboards-admin-calendar-heatmap */
const heatCells=[...document.querySelectorAll('.calendar-heatmap button')];heatCells.forEach((cell,index)=>cell.addEventListener('click',()=>{heatCells.forEach(item=>item.removeAttribute('aria-selected'));cell.setAttribute('aria-selected','true');document.querySelector('#heatmapSelection').textContent='7 月 '+(index+1)+' 日 · 活跃度 '+cell.dataset.heat;announce(document.querySelector('#heatmapSelection').textContent);}));
/* 11DZ_CORE_SCRIPT_END */
const workflowBridgeSpec={"name":"dashboards-admin-calendar-heatmap","selector":"[data-core-bridge=\"dashboards-admin-calendar-heatmap\"]","mode":"click","key":"Enter"};const workflowBridgeCore=document.querySelector('#workflowCore');const workflowBridgeControl=workflowBridgeCore.querySelector(workflowBridgeSpec.selector);if(!workflowBridgeControl)throw new Error('Missing core bridge: '+workflowBridgeSpec.name);const workflowBridgeControlledId=workflowBridgeControl.getAttribute('aria-controls');const workflowBridgeControlled=workflowBridgeControlledId?document.getElementById(workflowBridgeControlledId):null;workflowBridgeCore.dataset.workflowBridge=workflowBridgeSpec.name;workflowBridgeCore.dataset.workflowVersion='0';function workflowBridgeSerialize(){const visualNode=workflowBridgeCore.firstElementChild||workflowBridgeCore;const visual=getComputedStyle(visualNode);const outputs=[...workflowBridgeCore.querySelectorAll('output,[role="status"],[aria-live],meter,progress')].map(node=>node.textContent.trim()+'|'+node.getAttribute('aria-valuenow')+'|'+node.getAttribute('value'));const canvas=[...workflowBridgeCore.querySelectorAll('canvas')].map(node=>{try{return node.toDataURL().slice(-160);}catch{return 'canvas-unavailable';}});return JSON.stringify({html:workflowBridgeCore.innerHTML,status:statusOutput.textContent,outputs,canvas,visual:[visual.display,visual.visibility,visual.opacity,visual.transform,visual.filter,visual.backgroundColor,visual.width,visual.height],scroll:workflowBridgeSpec.mode==='scroll'?workflowBridgeControl.scrollTop:null});}let workflowBridgeLastEffect=workflowBridgeSerialize();function workflowBridgeSummary(){const label=(workflowBridgeControl.getAttribute('aria-label')||workflowBridgeControl.textContent||workflowBridgeControl.value||workflowBridgeSpec.name).trim().replace(/\s+/g,' ').slice(0,72);return label+' · 核心版本 '+workflowBridgeCore.dataset.workflowVersion;}function workflowBridgeCommit(){const effect=workflowBridgeSerialize();if(effect===workflowBridgeLastEffect)return {changed:false,summary:workflowBridgeSummary()};workflowBridgeLastEffect=effect;workflowBridgeCore.dataset.workflowVersion=String(Number(workflowBridgeCore.dataset.workflowVersion||0)+1);return {changed:true,summary:workflowBridgeSummary()};}function workflowBridgeScheduleCommit(){queueMicrotask(workflowBridgeCommit);setTimeout(workflowBridgeCommit,0);}workflowBridgeControl.addEventListener("click",workflowBridgeScheduleCommit);const workflowBridgeStateTargets=new Set(workflowBridgeCore.querySelectorAll('dialog'));if(workflowBridgeControlled&&workflowBridgeCore.contains(workflowBridgeControlled))workflowBridgeStateTargets.add(workflowBridgeControlled);workflowBridgeStateTargets.forEach(target=>['close','cancel','toggle'].forEach(eventName=>target.addEventListener(eventName,workflowBridgeScheduleCommit)));function workflowBridgeActivate(){workflowBridgeControl.focus();workflowBridgeControl.click();const result=workflowBridgeCommit();setTimeout(workflowBridgeCommit,0);return result;}function workflowBridgeReset(){workflowBridgeCore.dataset.workflowVersion='0';workflowBridgeLastEffect=workflowBridgeSerialize();}
const workflowGuideCore=document.querySelector('#workflowCore');const workflowGuideStages=["咨询服务","生活协助","紧急支持"];const workflowGuideState={step:0,completed:new Set(),evidence:new Map(),consumedVersion:0};function workflowGuideDrive(){const step=workflowGuideState.step;workflowGuideCore.dataset.guideStep=String(step);document.querySelector('#workflowGuideInstruction').textContent='请在主案例中完成“'+workflowGuideStages[step]+'”相关操作。';document.querySelectorAll('[data-workflow-guide-step]').forEach((item,index)=>{item.classList.toggle('is-complete',workflowGuideState.completed.has(index));if(index===step)item.setAttribute('aria-current','step');else item.removeAttribute('aria-current');});document.querySelector('#workflowGuideBack').disabled=step===0;document.querySelector('#workflowGuideNext').textContent=step===workflowGuideStages.length-1?'开始处置':'完成本步';const percent=Math.round(workflowGuideState.completed.size/workflowGuideStages.length*100);const progress=document.querySelector('#workflowGuideProgress');progress.setAttribute('aria-valuenow',String(percent));progress.querySelector('i').style.width=percent+'%';document.querySelector('#workflowGuideSummary').textContent=workflowGuideState.completed.size+' / '+workflowGuideStages.length+' 步完成 · '+workflowBridgeSummary();announce('服务处置当前步骤:'+workflowGuideStages[step]);}function workflowGuideAdvance(direction){if(direction>0){const bridge=workflowBridgeActivate();const version=Number(workflowGuideCore.dataset.workflowVersion||0);if(version<=workflowGuideState.consumedVersion){announce('请先完成主案例的可见状态变化');return;}workflowGuideState.consumedVersion=version;workflowGuideState.completed.add(workflowGuideState.step);announce('已记录主案例变化 · '+bridge.summary);}workflowGuideState.step=Math.max(0,Math.min(workflowGuideStages.length-1,workflowGuideState.step+direction));workflowGuideDrive();}document.querySelector('#workflowGuideBack').addEventListener('click',()=>workflowGuideAdvance(-1));document.querySelector('#workflowGuideNext').addEventListener('click',()=>workflowGuideAdvance(1));document.querySelector('#workflowGuideEvidenceForm').addEventListener('submit',event=>{event.preventDefault();const version=Number(workflowGuideCore.dataset.workflowVersion||0);if(version<=workflowGuideState.consumedVersion){announce('证据未保存:主案例尚无新变化');return;}const text=document.querySelector('#workflowGuideEvidence').value.trim();workflowGuideState.evidence.set(workflowGuideState.step,text||'已完成可见状态检查');workflowGuideState.completed.add(workflowGuideState.step);workflowGuideState.consumedVersion=version;workflowGuideDrive();announce('本步证据已保存 · '+workflowBridgeSummary());});document.querySelector('#workflowGuideDetails').addEventListener('toggle',event=>announce(event.currentTarget.open?'已展开验收要求':'已收起验收要求'));workflowGuideDrive();
workflowBridgeReset();
const evidenceShell=document.querySelector('#evidenceShell');const evidenceStatus=document.querySelector('#evidenceStatus');const evidenceZoom=document.querySelector('#evidenceZoom');const evidenceZoomValue=document.querySelector('#evidenceZoomValue');const evidenceStep=document.querySelector('#evidenceStep');const evidenceChecklistItems=[...document.querySelectorAll('#evidenceChecklist li')];const evidenceCards=[...document.querySelectorAll('[data-evidence-card]')];const evidenceLog=document.querySelector('#evidenceLog');const evidenceModeButtons=[...evidenceShell.querySelectorAll('button[data-board-mode]')];const evidenceNotes=["社区服务协作","社区服务进度","社区服务提醒","社区服务收藏"];const evidenceCore=document.querySelector('#workflowCore');let evidenceCaptures=0;function evidenceSetCard(index){evidenceCards.forEach((card,cardIndex)=>{const active=cardIndex===index;card.setAttribute('aria-pressed',String(active));});evidenceChecklistItems.forEach((item,itemIndex)=>{item.classList.toggle('is-active',itemIndex===index);item.classList.toggle('is-done',itemIndex<evidenceCaptures);});}function evidenceRender(reason){const version=evidenceCore?.dataset.workflowVersion||'0';const zoom=Number(evidenceZoom.value);const active=Math.min(evidenceNotes.length-1,Number(evidenceStep.value)||0);evidenceShell.style.setProperty('--evidence-zoom',String(zoom));evidenceZoomValue.textContent=zoom+'%';evidenceSetCard(active);evidenceStatus.textContent=reason+' · 核心版本 '+version;}evidenceModeButtons.forEach(button=>button.addEventListener('click',()=>{evidenceModeButtons.forEach(item=>item.classList.toggle('primary',item===button));evidenceShell.dataset.boardMode=button.dataset.boardMode;evidenceRender('已切换到'+button.textContent);announce('证据模式:'+button.textContent);}));evidenceCards.forEach((card,index)=>card.addEventListener('click',()=>{evidenceStep.value=String(index);evidenceRender('已切换观察卡片');announce('观察卡片:'+evidenceNotes[index]);}));evidenceZoom.addEventListener('input',()=>{evidenceRender('画布缩放已更新');announce('观测缩放 '+evidenceZoom.value+'%');});evidenceStep.addEventListener('change',()=>{const index=Number(evidenceStep.value)||0;evidenceRender('已切换取样');announce('当前取样:'+evidenceNotes[index]);});document.querySelector('#evidenceCapture').addEventListener('click',()=>{const index=Math.min(evidenceNotes.length-1,Number(evidenceStep.value)||0);const note=evidenceNotes[index];const version=evidenceCore?.dataset.workflowVersion||'0';evidenceCaptures+=1;const item=document.createElement('li');item.textContent='证据 '+evidenceCaptures+' · '+note+' · 核心版本 '+version;const empty=evidenceLog.querySelector('li')?.textContent==='尚未写入证据';if(empty)evidenceLog.replaceChildren(item);else evidenceLog.prepend(item);while(evidenceLog.children.length>6)evidenceLog.lastElementChild.remove();evidenceRender('已写入证据 '+evidenceCaptures);announce('已写入证据 '+evidenceCaptures+' · '+note);});evidenceCore?.addEventListener('focusin',()=>evidenceRender('主案例获得焦点'));evidenceCore?.addEventListener('click',()=>evidenceRender('主案例发生交互'));evidenceRender('等待采样');
  </script>
</body>
</html>
页面反馈发现问题或有改进建议?
反馈功能需要在在线版使用

请在在线版启用 JavaScript 后提交;当前工具或案例的本地功能不受影响。

前往在线版反馈