Bladeren bron

feat(web): 优化工单回填与登记记录对话框

sy 3 dagen geleden
bovenliggende
commit
5fdcdd18d3

+ 69 - 26
web-scaffold/src/pages/WorkOrderRecordPage.tsx

@@ -19,7 +19,7 @@ import { ConstructionGuidePanel } from "../components/work-order/ConstructionGui
 import { ScanFieldButton } from "../components/work-order/ScanFieldButton";
 import { EvidencePhotoField, type EvidencePhoto } from "../components/work-order/EvidencePhotoField";
 import { ApprovedExitSelect, alignApprovedExit } from "../components/work-order/ApprovedExitSelect";
-import { OpsNotice, OpsStatus } from "../components/OperationsKit";
+import { OpsDialog, OpsNotice, OpsStatus } from "../components/OperationsKit";
 import { RecordTabs } from "../components/RecordTabs";
 import {
   completionGenerate, completionReceipt, completionReject, isYes, messageConfirmConflict, ticketAssign, ticketBackfill,
@@ -133,8 +133,11 @@ function gapTarget(gap: string, can: TicketDetail["actions"]): GapTarget | null
   if (can.backfill && route.includes(gap)) return { action: "backfill", focus: "routes", label: "去回填线路" };
   if (can.backfill && ip.includes(gap)) return { action: "backfill", focus: "ips", label: "去登记 IP" };
   if (can.backfill && conclusion.includes(gap)) return { action: "backfill", focus: "conclusion", label: "去登记结论" };
-  if (can.check_done && [...trio, ...note].includes(gap)) return { action: "check_done", focus: "checklist", label: "去核对条目" };
-  if (can.mark_done && note.includes(gap)) return { action: "mark_done", focus: "note", label: "去补处理记录" };
+  if (can.check_done && trio.includes(gap)) return { action: "check_done", focus: "checklist", label: "去核对条目" };
+  if (note.includes(gap)) {
+    if (can.check_done) return { action: "check_done", focus: "note", label: "去登记记录" };
+    if (can.mark_done) return { action: "mark_done", focus: "note", label: "去登记记录" };
+  }
   return null;
 }
 
@@ -385,22 +388,23 @@ function Repeater({ title, hint, required, onAdd, addDisabled, foot, children, d
   </div>;
 }
 
-/** 动作抽屉的具体表单(按 action 分发)。移动端全屏回填复用同一组件(`presentation="page"`)。 */
+/** 工单动作表单。移动端全屏回填也复用该表单。 */
 export function TicketActionSheet({ action, detail, onClose, onDone, focus, onReload, presentation = "drawer" }: {
   action: string;
   detail: TicketDetail;
   onClose: () => void;
   onDone: (msg: string) => void;
-  /** 缺口「去处理」带来的落点:打开抽屉后滚到对应表单段并短暂高亮。 */
+  /** 从缺口入口打开时定位并高亮对应字段。 */
   focus?: GapFocus;
   /** 乐观锁冲突后的「重新读取」:由详情页重取,⛔ 在本抽屉里静默重试写请求。 */
   onReload: () => void;
-  presentation?: "drawer" | "page";
+  presentation?: "drawer" | "dialog" | "page";
 }) {
   const submit = useSubmit();
   const me = useDemoIdentity();
   const formRef = useRef<HTMLFormElement>(null);
   const extFormRef = useRef<TicketExtFormHandle>(null);
+  const dialogView = presentation === "dialog";
   const t = detail.ticket;
   const version = Number(t.row_version);
   // 执行锁(2026-11-17):开通类计划执行日=订阅服务开始日。表单侧据此给日期输入的 `min`
@@ -469,7 +473,9 @@ export function TicketActionSheet({ action, detail, onClose, onDone, focus, onRe
   });
   const patchPath = (k: string, p: Partial<PathDraft>) => setPathRows((prev) => prev.map((r) => (r.key === k ? { ...r, ...p } : r)));
   /** 通路卡展开态;默认全部收起,点开一条再编。 */
-  const [pathOpen, setPathOpen] = useState<Record<string, boolean>>({});
+  const [pathOpen, setPathOpen] = useState<Record<string, boolean>>(() =>
+    focus === "routes" && pathRows[0] ? { [pathRows[0].key]: true } : {},
+  );
   const pathIsOpen = (k: string) => (Object.prototype.hasOwnProperty.call(pathOpen, k) ? pathOpen[k] : false);
   const togglePathOpen = (k: string) => setPathOpen((prev) => ({ ...prev, [k]: !pathIsOpen(k) }));
   /**
@@ -520,11 +526,16 @@ export function TicketActionSheet({ action, detail, onClose, onDone, focus, onRe
     if (!focus) return;
     const node = formRef.current?.querySelector<HTMLElement>(`[data-gap-focus="${focus}"]`);
     if (!node) return;
-    node.scrollIntoView({ block: "center", behavior: "smooth" });
+    node.scrollIntoView?.(presentation === "dialog" ? { block: "start" } : { block: "center", behavior: "smooth" });
     node.classList.add("is-gap-focus");
     const timer = window.setTimeout(() => node.classList.remove("is-gap-focus"), 2400);
-    return () => window.clearTimeout(timer);
-  }, [focus]);
+    return () => { window.clearTimeout(timer); node.classList.remove("is-gap-focus"); };
+  }, [focus, presentation]);
+
+  useEffect(() => {
+    if (presentation !== "dialog" || !tip) return;
+    formRef.current?.querySelector(".work-order-form-error")?.scrollIntoView?.({ block: "nearest" });
+  }, [presentation, tip]);
 
   /** 核定出口到位后:单值自动带入空行;多值把不在集合内的草稿/历史值清掉逼重选。 */
   useEffect(() => {
@@ -754,12 +765,13 @@ export function TicketActionSheet({ action, detail, onClose, onDone, focus, onRe
     {action === "assign" && !candidates.length && <p className="work-order-detail-footnote"><CircleAlert size={15} />候选人来自「待分派队列」:名单为空说明本团队没有具备该工单类型接单资质的成员、也没有负责范围覆盖该客户的运营账号,请先配置工单类型或运营团队负责范围。</p>}
     {action === "delegate" && <label className="wide">代管人(承接团队在册成员)<select value={trustee} onChange={(e) => setTrustee(e.target.value)}><option value="">请选择</option>{members.map((m) => <option key={m.user_id} value={m.user_id}>{m.display_name ?? m.username ?? m.user_id}</option>)}</select></label>}
     {action === "check_done" && <div className="wide work-order-gap-anchor" data-gap-focus="checklist">
+      {dialogView && <h3 className="wide work-order-action-section-title">服务清单与开通日期</h3>}
       <div className="wide work-order-checklist">{detail.service_items.map((item) => <label key={item.item_id}><input type="checkbox" disabled={item.check_result !== "pending"} checked={item.check_result === "done" || pickedItems.includes(item.item_id)} onChange={(e) => setPickedItems((prev) => e.target.checked ? [...prev, item.item_id] : prev.filter((id) => id !== item.item_id))} /><span>{item.item_name ?? item.item_id}{item.check_result === "done" && <small> 已核对</small>}{item.check_result === "absent" && <small> 缺项</small>}</span></label>)}</div>
       <label className="wide">实际开通日期 <em>*</em><Input type="date" value={mainDate} min={execNotBefore ?? undefined} max={todayStr} onChange={(e) => setMainDate(e.target.value)} /></label>
       <TicketExtForm ref={extFormRef} ext={extMeta} values={extValues} onChange={setExtValues} enforceRequired />
     </div>}
     {action === "check_done" && execLocked && <p className="work-order-detail-footnote wide"><CircleAlert size={15} />本单计划执行日(服务开始日)为 {execNotBefore ? fmtDate(execNotBefore) : "待定"},未到该日不可核对竣工;实际开通日也⛔ 早于该日。</p>}
-    {action === "check_done" && <p className="work-order-detail-footnote wide"><Info size={15} />三件套=服务清单全部核对 ∧ 实际开通日不晚于当天 ∧ 处理记录非空。服务开通单没有「施工回填」口(扩展字段随本核对口提交);变更协议单可另走结论区回填,实际开通日亦可随本次核对登记并回写该条订阅。</p>}
+    {action === "check_done" && !dialogView && <p className="work-order-detail-footnote wide"><Info size={15} />三件套=服务清单全部核对 ∧ 实际开通日不晚于当天 ∧ 处理记录非空。服务开通单没有「施工回填」口(扩展字段随本核对口提交);变更协议单可另走结论区回填,实际开通日亦可随本次核对登记并回写该条订阅。</p>}
     {action === "backfill" && <>
       {execLocked && <p className="work-order-detail-footnote wide"><CircleAlert size={15} />本单计划执行日(服务开始日)为 {execNotBefore ? fmtDate(execNotBefore) : "待定"},未到该日不可回填;实际开通日也⛔ 早于该日。</p>}
       {draftHint && (
@@ -773,13 +785,19 @@ export function TicketActionSheet({ action, detail, onClose, onDone, focus, onRe
       {draftSavedNote && (
         <p className="wide work-order-detail-footnote" role="status"><Info size={15} />{draftSavedNote}</p>
       )}
-      <div className="wide"><ConstructionGuidePanel guide={detail.construction_guide} /></div>
+      {detail.construction_guide && (dialogView
+        ? <details className="wide work-order-action-guide">
+          <summary>施工指导<ChevronDown size={16} aria-hidden="true" /></summary>
+          <ConstructionGuidePanel guide={detail.construction_guide} />
+        </details>
+        : <div className="wide"><ConstructionGuidePanel guide={detail.construction_guide} /></div>)}
       {isUpdown && <div className="wide work-order-gap-anchor" data-gap-focus="checklist">
         <p className="work-order-subhead">服务清单核对 <em>*</em></p>
         <div className="wide work-order-checklist">{detail.service_items.map((item) => <label key={item.item_id}><input type="checkbox" disabled={item.check_result !== "pending"} checked={item.check_result === "done" || pickedItems.includes(item.item_id)} onChange={(e) => setPickedItems((prev) => e.target.checked ? [...prev, item.item_id] : prev.filter((id) => id !== item.item_id))} /><span>{item.item_name ?? item.item_id}{item.spec_before || item.spec_after ? <small> {item.spec_before ?? "—"} → {item.spec_after ?? item.spec_text ?? "—"}</small> : null}{item.check_result === "done" && <small> 已核对</small>}</span></label>)}</div>
         <label className="wide">核对处理记录 <em>*</em><textarea rows={2} maxLength={500} value={note} onChange={(e) => setNote(e.target.value)} /></label>
       </div>}
       <div className="wide work-order-gap-anchor" data-gap-focus="conclusion">
+        {dialogView && <h3 className="wide work-order-action-section-title">执行结论与凭证</h3>}
         <label>执行结论 <em>*</em><select value={conclusion} onChange={(e) => setConclusion(e.target.value)}>{isStop
           ? <><option value="success">成功</option><option value="fail">失败</option></>
           : <><option value="success">成功</option><option value="partial">部分成功</option><option value="fail">失败</option></>}</select></label>
@@ -950,7 +968,15 @@ export function TicketActionSheet({ action, detail, onClose, onDone, focus, onRe
     {(action === "close" || action === "withdraw" || action === "revert") && <label className="wide">原因 <em>*</em><textarea rows={3} maxLength={500} value={reason} onChange={(e) => setReason(e.target.value)} /></label>}
     {/* 客户确认闭环:与列表页弹框同口径(门户册 9 §7.5.1,7 天未确认由系统自动关闭)。 */}
     {action === "confirm_close" && <p className="work-order-detail-footnote wide"><Info size={15} />运维已标记完成,确认后工单立即关闭并形成服务闭环;7 天内未确认由系统自动关闭。该动作与列表页「确认完成,关闭工单」是同一个(`ticket/confirm_close@v1`)。</p>}
-    {(action === "check_done" || action === "mark_done" || action === "confirm_receipt") && <label className="wide" data-gap-focus={action === "mark_done" ? "note" : undefined}>备注<textarea rows={3} maxLength={500} value={note} onChange={(e) => setNote(e.target.value)} /></label>}
+    {dialogView && (action === "check_done" || action === "mark_done") ? <div className="wide work-order-action-note" data-gap-focus="note">
+      <label>处理记录{action === "check_done" && <em> *</em>}
+        <textarea rows={5} maxLength={500} value={note} aria-required={action === "check_done" || undefined} placeholder="填写处理经过和结果" onChange={(e) => setNote(e.target.value)} />
+      </label>
+      <div className="work-order-action-note-meta">
+        {action === "mark_done" && <p>提交后工单标记为完成,等待客户确认。</p>}
+        <span>{note.length} / 500</span>
+      </div>
+    </div> : (action === "check_done" || action === "mark_done" || action === "confirm_receipt") && <label className="wide" data-gap-focus={action === "mark_done" ? "note" : undefined}>备注<textarea rows={3} maxLength={500} value={note} onChange={(e) => setNote(e.target.value)} /></label>}
     {(action === "defer_open_stop" || action === "defer_ticket") && <p className="work-order-detail-footnote wide"><Info size={15} />延期只顺延提醒期限,不改变账户状态或计费;期限由服务端按超期天数推进。</p>}
   </div>;
 
@@ -966,6 +992,10 @@ export function TicketActionSheet({ action, detail, onClose, onDone, focus, onRe
     backfill: isUpdown ? ["核对并回填", "清单核对与执行结论同批"] : ["施工回填", "执行结论与日期"],
   };
   const [title, subtitle] = titles[action] ?? ["处理工单", ""];
+  const dialogTitle = action === "mark_done" ? "登记处理记录" : action === "check_done" ? "核对并登记记录" : title;
+  const submitLabel = dialogView
+    ? action === "mark_done" ? "登记并完成" : action === "check_done" ? "提交核对结果" : "提交回填"
+    : "提交";
 
   async function saveDraft() {
     setTip("");
@@ -1021,8 +1051,7 @@ export function TicketActionSheet({ action, detail, onClose, onDone, focus, onRe
     }
   }
 
-  return <Sheet title={title} subtitle={subtitle} onClose={onClose} presentation={presentation}>
-    <form ref={formRef} className="work-order-editor" onSubmit={submitForm}>
+  const body = <>
       <section>{rows}</section>
       {tip && <p className="work-order-form-error" role="alert">{tip}</p>}
       {/请刷新后(重新填写|重试)|20417/.test(`${submit.error?.code ?? ""} ${submit.error?.message ?? ""}`) && <div className="work-order-form-error" role="alert">
@@ -1034,15 +1063,22 @@ export function TicketActionSheet({ action, detail, onClose, onDone, focus, onRe
         <ul className="work-order-gap-list">{gapGroups.map((g) => <li key={g}>{g}</li>)}</ul>
       </div>}
       {submit.busy && <p className="work-order-editor-note">提交中…</p>}
-      <footer>
-        <Button variant="outline" type="button" onClick={onClose}>取消</Button>
-        {action === "backfill" && (
-          <Button variant="outline" type="button" disabled={submit.busy} onClick={() => void saveDraft()}>暂存草稿</Button>
-        )}
-        <Button type="submit" disabled={submit.busy}><Check size={16} />提交</Button>
-      </footer>
-    </form>
-  </Sheet>;
+  </>;
+  const editor = <form ref={formRef} className="work-order-editor" onSubmit={submitForm}>
+    {dialogView ? <div className="work-order-action-body">{body}</div> : body}
+    <footer>
+      <Button variant="outline" type="button" onClick={onClose}>取消</Button>
+      {action === "backfill" && (
+        <Button variant="outline" type="button" disabled={submit.busy} onClick={() => void saveDraft()}>暂存草稿</Button>
+      )}
+      <Button type="submit" disabled={submit.busy}><Check size={16} />{submitLabel}</Button>
+    </footer>
+  </form>;
+  if (presentation === "dialog") return <OpsDialog title={dialogTitle} subtitle={[t.ticket_no, t.title].filter(Boolean).join(" · ")}
+    className={`work-order-action-dialog${action === "mark_done" ? "" : " is-wide"}`} onClose={onClose}>
+    {editor}
+  </OpsDialog>;
+  return <Sheet title={title} subtitle={subtitle} onClose={onClose} presentation={presentation}>{editor}</Sheet>;
 }
 
 /** @deprecated 内部别名:详情页仍用 ActionSheet 名,导出名见 TicketActionSheet。 */
@@ -1350,7 +1386,12 @@ export function WorkOrderRecordPage() {
     <div className="work-order-gaps-head"><strong>闭环还缺 {d.gaps.length} 项</strong><span>缺口由服务端判定,不可人工放行竣工</span></div>
     <ul>{d.gaps.map((g) => {
       const target = gapTarget(g, can);
-      return <li key={g}><div><b>{groupLabel(g)}</b><p>{gapHint(g)}</p></div>{target && !viewerReadOnly && <Button variant="outline" size="sm" onClick={() => openSheet(target.action, target.focus)}>{target.label}<ArrowRight size={14} /></Button>}</li>;
+      const usesSoftButton = target?.focus === "routes" || target?.focus === "note";
+      return <li key={g}><div><b>{groupLabel(g)}</b><p>{gapHint(g)}</p></div>
+        {target && !viewerReadOnly && <Button size="sm" variant={usesSoftButton ? "ghost" : "outline"}
+          className={usesSoftButton ? "org-button org-button-compact org-button-scope" : undefined}
+          onClick={() => openSheet(target.action, target.focus)}>{target.label}<ArrowRight size={14} aria-hidden="true" /></Button>}
+      </li>;
     })}</ul>
     <p className="work-order-detail-footnote"><Info size={15} />缺口清单由服务端判定,不得在此人工放行竣工;{can.generate_completion ? "可生成竣工" : "生成竣工入口保持关闭"}。</p>
   </div>);
@@ -1735,7 +1776,9 @@ export function WorkOrderRecordPage() {
     {/* 窄屏(≤900px)底部固定条:主按钮与返回不随正文滚走。桌面隐藏,见 CSS。 */}
     {nextStep && !viewerReadOnly && <div className="work-order-sticky-bar"><Button variant="outline" onClick={goBack}><ArrowLeft size={16} />返回</Button><Button className="work-order-sticky-next" onClick={runNextStep}><ArrowRight size={16} />{nextStep.label}</Button></div>}
     {materialOpen && <Sheet title="补充过程材料" subtitle="现场照片、处理截图等过程留痕" onClose={() => setMaterialOpen(false)}><MaterialForm ticketId={t.ticket_id} onDone={(m) => { setMaterialOpen(false); setNotice(m); detail.reload(); }} /></Sheet>}
-    {sheet && <ActionSheet action={sheet} detail={d} focus={sheetFocus} onReload={detail.reload} onClose={() => { setSheet(null); setSheetFocus(undefined); if (sheet === "backfill") detail.reload(); }} onDone={(message) => { setSheet(null); setSheetFocus(undefined); setNotice(message); detail.reload(); }} />}
+    {sheet && <ActionSheet action={sheet} detail={d} focus={sheetFocus}
+      presentation={sheet === "backfill" || sheet === "mark_done" || sheetFocus === "note" ? "dialog" : "drawer"}
+      onReload={detail.reload} onClose={() => { setSheet(null); setSheetFocus(undefined); if (sheet === "backfill") detail.reload(); }} onDone={(message) => { setSheet(null); setSheetFocus(undefined); setNotice(message); detail.reload(); }} />}
     {refStack.length > 0 && <ReferenceDrawer stack={refStack} onPush={openRef} onBack={() => setRefStack((stack) => stack.slice(0, -1))} onClose={() => setRefStack([])} />}
   </section>;
 }

+ 41 - 1
web-scaffold/src/pages/__tests__/work-order-record-tabs.test.tsx

@@ -30,7 +30,7 @@ const detail = {
 };
 
 function renderRecord(overrides: object = {}) {
-  useTicketDetail.mockReturnValue({ data: { ...detail, ...overrides } });
+  useTicketDetail.mockReturnValue({ data: { ...detail, ...overrides }, reload: vi.fn(), reloadAsync: async () => {} });
   return render(<MemoryRouter initialEntries={["/work-orders/1001"]}>
     <Routes><Route path="/work-orders/:id" element={<WorkOrderRecordPage />} /></Routes>
   </MemoryRouter>);
@@ -38,6 +38,46 @@ function renderRecord(overrides: object = {}) {
 
 afterEach(cleanup);
 
+it.each([
+  { gap: "route_or_stop_account", type: "open", action: "backfill", label: "去回填线路", title: "施工回填" },
+  { gap: "处理记录", type: "fault", action: "mark_done", label: "去登记记录", title: "登记处理记录" },
+  { gap: "处理记录", type: "service_open", action: "check_done", label: "去登记记录", title: "核对并登记记录" },
+])("从 $label 打开 $title 对话框并定位到对应字段", async ({ gap, type, action, label, title }) => {
+  const prototype = HTMLDialogElement.prototype;
+  const { showModal, close } = prototype;
+  Object.assign(prototype, {
+    showModal(this: HTMLDialogElement) { this.open = true; },
+    close(this: HTMLDialogElement) { this.open = false; },
+  });
+  try {
+    renderRecord({ ticket: { ...detail.ticket, ticket_type: type }, actions: { [action]: true }, gaps: [gap] });
+    const entry = screen.getByRole("button", { name: label });
+    expect(entry.classList.contains("org-button-scope")).toBe(true);
+    fireEvent.click(entry);
+
+    const dialog = await screen.findByRole("dialog", { name: title });
+    expect(dialog.classList.contains("ops-content-dialog")).toBe(true);
+    const controls = within(dialog);
+    if (action === "backfill") {
+      expect(controls.getByRole("button", { name: /^通路 1/, expanded: true })).toBeTruthy();
+      expect(dialog.querySelector('[data-gap-focus="routes"]')?.classList.contains("is-gap-focus")).toBe(true);
+      expect(controls.getByRole("button", { name: "暂存草稿" }).closest("footer")).toBeTruthy();
+      expect(controls.getByRole("button", { name: "提交回填" })).toBeTruthy();
+    } else {
+      const note = controls.getByRole("textbox", { name: /^处理记录/ });
+      expect(note.closest('[data-gap-focus="note"]')?.classList.contains("is-gap-focus")).toBe(true);
+      fireEvent.change(note, { target: { value: "已处理" } });
+      expect(controls.getByText("3 / 500")).toBeTruthy();
+      expect(controls.getByRole("button", { name: action === "mark_done" ? "登记并完成" : "提交核对结果" }).closest("footer")).toBeTruthy();
+    }
+    fireEvent.click(controls.getByRole("button", { name: "取消" }));
+    expect(screen.queryByRole("dialog", { name: title })).toBeNull();
+  } finally {
+    cleanup();
+    Object.assign(prototype, { showModal, close });
+  }
+});
+
 it("概况默认显示,支持键盘切换,各页签共用处理入口和处理记录", () => {
   renderRecord();
   expect(screen.getByRole("link", { name: "返回工单列表" }).getAttribute("href")).toBe("/work-orders");

+ 46 - 0
web-scaffold/src/styles/work-order-record.css

@@ -337,6 +337,52 @@
 .work-order-trace-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 3px; }
 .work-order-trace-missing { color: var(--danger, #b42318); }
 
+/* 工单动作对话框,正文独立滚动。 */
+.ops-dialog.work-order-action-dialog {
+  position: fixed;
+  inset: 0;
+  width: min(520px, calc(100vw - 24px));
+  max-height: min(860px, calc(100dvh - 24px));
+  overflow: hidden;
+}
+.ops-dialog.work-order-action-dialog.is-wide { width: min(940px, calc(100vw - 24px)); }
+.work-order-action-dialog[open] { display: flex; flex-direction: column; }
+.work-order-action-dialog > header { position: static; flex: none; }
+.work-order-action-dialog > header p { color: var(--primary-soft-foreground); font-weight: 500; overflow-wrap: anywhere; }
+.work-order-action-dialog > .work-order-editor { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; padding: 0; }
+.work-order-action-body { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px 24px; }
+.work-order-action-body > section > .work-order-form-grid { margin-top: 0; }
+.work-order-action-body [data-gap-focus] { scroll-margin-block: 12px; }
+.work-order-action-dialog .work-order-editor > footer { flex: none; flex-wrap: wrap; gap: 8px; margin: 0; padding: 12px 24px; border-color: var(--border-subtle); background: var(--card); }
+.work-order-action-section-title { margin: 0; color: var(--foreground); font-size: var(--type-comfort); font-weight: 600; }
+.work-order-action-dialog :is(.work-order-gap-anchor, [data-gap-focus="routes"]) { min-width: 0; padding: 14px; border: 1px solid var(--border-subtle); border-radius: var(--radius-control); }
+.work-order-action-dialog [data-gap-focus="routes"] { gap: 10px; background: var(--surface-subtle); }
+.work-order-action-dialog .wo-path-card { min-width: 0; padding-inline: 12px; }
+.work-order-action-dialog .wo-path-card:not(.is-collapsed) { gap: 12px; padding-block: 10px 13px; }
+.work-order-action-dialog .work-order-repeater-row .work-order-repeater-flag { white-space: normal; }
+.work-order-action-guide { min-width: 0; border: 1px solid var(--border-subtle); border-radius: var(--radius-control); }
+.work-order-action-guide > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 13px; color: var(--text-secondary); font-size: var(--type-support); font-weight: 600; cursor: pointer; list-style: none; }
+.work-order-action-guide > summary::-webkit-details-marker { display: none; }
+.work-order-action-guide > summary:hover { color: var(--primary); }
+.work-order-action-guide[open] > summary { border-bottom: 1px solid var(--border-subtle); }
+.work-order-action-guide[open] > summary svg { transform: rotate(180deg); }
+.work-order-action-guide > .wo-guide { padding: 12px; }
+.work-order-action-guide > .wo-guide > .work-order-section-title { display: none; }
+.work-order-action-guide > .wo-guide > .wo-guide-hint { margin-top: 0; }
+.work-order-action-note { min-width: 0; border-radius: var(--radius-control); }
+.work-order-action-note label { font-weight: 500; }
+.work-order-action-note textarea { margin-top: 6px; line-height: 1.55; font-weight: 400; }
+.work-order-action-note-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 4px 10px; margin-top: 7px; color: var(--muted-foreground); font-size: var(--type-meta); }
+.work-order-action-note-meta p { flex: 1 1 210px; line-height: 1.5; }
+.work-order-action-note-meta span { font-variant-numeric: tabular-nums; }
+.work-order-action-dialog :is(.work-order-action-note, .work-order-gap-anchor, .work-order-repeater).is-gap-focus { scroll-margin-inline: 3px; }
+@media (max-width: 599px) {
+  .work-order-action-body, .work-order-action-dialog .work-order-editor > footer { padding-inline: 14px; }
+  .work-order-action-dialog :is(.work-order-form-grid, .work-order-form-grid.cols-3, .work-order-gap-anchor, .work-order-repeater-row.cols) { grid-template-columns: minmax(0, 1fr); }
+  .work-order-action-dialog .work-order-form-grid > label { grid-column: 1 / -1 !important; }
+  .work-order-action-dialog :is(.work-order-form-grid .wide, .work-order-gap-anchor .wide) { grid-column: 1 / -1; }
+}
+
 /* 材料登记抽屉:表单自带边框,抽屉里要留出与页首一致的左右留白(⛔ 贴着抽屉边) */
 .work-order-drawer > .work-order-process-form { margin: 18px 25px 25px; }
 /* 文件选择:浏览器原生控件在深色主题下要与输入框等高,且截断长文件名 */