فهرست منبع

feat(web): 将待分派抽屉改为居中对话框

sy 3 روز پیش
والد
کامیت
5d6f973095
2فایلهای تغییر یافته به همراه29 افزوده شده و 7 حذف شده
  1. 17 7
      web-scaffold/src/pages/TeamQueuePage.tsx
  2. 12 0
      web-scaffold/src/styles/work-order-ledger.css

+ 17 - 7
web-scaffold/src/pages/TeamQueuePage.tsx

@@ -17,7 +17,7 @@ import { Link, useSearchParams } from "react-router";
 import { Button } from "../components/ui/button";
 import { Button } from "../components/ui/button";
 import { FilterSelect } from "../components/ui/filter-select";
 import { FilterSelect } from "../components/ui/filter-select";
 import { FieldHint } from "../components/ui/field-hint";
 import { FieldHint } from "../components/ui/field-hint";
-import { OpsDrawer, OpsNotice } from "../components/OperationsKit";
+import { OpsDialog, OpsNotice } from "../components/OperationsKit";
 import { WorkspaceEmpty, WorkspaceHeading } from "../components/RoleWorkspaceKit";
 import { WorkspaceEmpty, WorkspaceHeading } from "../components/RoleWorkspaceKit";
 import { SearchInput } from "../components/ui/search-input";
 import { SearchInput } from "../components/ui/search-input";
 import { TicketState } from "../components/ticketState";
 import { TicketState } from "../components/ticketState";
@@ -180,15 +180,25 @@ export function QueueBoard({ teamId, teamName, showTeamColumn = false, canAutoDi
         return updated;
         return updated;
       }, { replace: true })} />}
       }, { replace: true })} />}
     </section>
     </section>
-    {action && <OpsDrawer title={action === "auto" ? "确认自动平均分派" : "指定接单成员"} subtitle={teamName ?? "权限范围内"} onClose={() => setAction(null)}>
+    {action && <OpsDialog title={action === "auto" ? "确认自动平均分派" : "指定接单成员"} subtitle={teamName ?? "权限范围内"} onClose={() => { if (!submit.busy) setAction(null); }}>
       <div className="workspace-form">
       <div className="workspace-form">
         {action === "auto" ? <>
         {action === "auto" ? <>
-          <Shuffle size={28} className="text-primary" />
-          <h3>分派本团队的待分派工单</h3>
-          <p className="text-sm leading-7 text-muted-foreground">服务端每张选择符合类型与可派条件的成员,优先分给未完成工单最少者;没有合适成员的工单留在队列。若团队分派方式不是「自动平均分派」,服务端会拒绝并说明原因。</p>
+          <div className="work-order-queue-dialog-context">
+            <Shuffle size={18} aria-hidden="true" />
+            <div>
+              <h3>分派本团队的待分派工单</h3>
+              <p>工单优先分给未完成工单最少的合适成员。没有合适成员的工单会留在队列。团队须启用自动平均分派。</p>
+            </div>
+          </div>
           {summary && <p className="text-sm leading-7">上轮回执:分派 {summary.dispatched.length} 张 / 扫描 {summary.scanned} 张 / 跳过 {summary.skipped.length} 张。</p>}
           {summary && <p className="text-sm leading-7">上轮回执:分派 {summary.dispatched.length} 张 / 扫描 {summary.scanned} 张 / 跳过 {summary.skipped.length} 张。</p>}
         </> : <>
         </> : <>
-          <p className="text-sm leading-7">{action.ticket_no ?? "未编号"}<br />{action.customer_name ?? "-"} · {typeLabel(action.ticket_type)}</p>
+          <div className="work-order-queue-dialog-context">
+            <ClipboardList size={18} aria-hidden="true" />
+            <div>
+              <h3>{action.ticket_no ?? "未编号"}</h3>
+              <p>{action.customer_name ?? "—"} · {typeLabel(action.ticket_type)}</p>
+            </div>
+          </div>
           {candLoading && <p className="text-sm text-muted-foreground">正在按工单类型与负责范围计算候选人…</p>}
           {candLoading && <p className="text-sm text-muted-foreground">正在按工单类型与负责范围计算候选人…</p>}
           <label className="workspace-field"><span>接单成员 <em>*</em><FieldHint label="接单成员说明">{candidates.length ? "名单由服务端按工单类型、成员负责范围与账号状态过滤(运营账号按客户负责范围入池),不支持指派名单之外的成员。" : candLoading ? "正在计算…" : "没有符合条件的成员,请先在成员与负责范围中配置后重试。"}</FieldHint></span>
           <label className="workspace-field"><span>接单成员 <em>*</em><FieldHint label="接单成员说明">{candidates.length ? "名单由服务端按工单类型、成员负责范围与账号状态过滤(运营账号按客户负责范围入池),不支持指派名单之外的成员。" : candLoading ? "正在计算…" : "没有符合条件的成员,请先在成员与负责范围中配置后重试。"}</FieldHint></span>
             <select value={memberId} onChange={(event) => setMemberId(event.target.value)} disabled={candLoading}>
             <select value={memberId} onChange={(event) => setMemberId(event.target.value)} disabled={candLoading}>
@@ -202,7 +212,7 @@ export function QueueBoard({ teamId, teamName, showTeamColumn = false, canAutoDi
         {submit.busy && <p className="text-sm text-muted-foreground">提交中…</p>}
         {submit.busy && <p className="text-sm text-muted-foreground">提交中…</p>}
         <footer><Button variant="outline" type="button" disabled={submit.busy} onClick={() => setAction(null)}>取消</Button><Button type="button" disabled={submit.busy || candLoading || (action !== "auto" && !memberId)} onClick={confirm}><Check size={16} />确认分派</Button></footer>
         <footer><Button variant="outline" type="button" disabled={submit.busy} onClick={() => setAction(null)}>取消</Button><Button type="button" disabled={submit.busy || candLoading || (action !== "auto" && !memberId)} onClick={confirm}><Check size={16} />确认分派</Button></footer>
       </div>
       </div>
-    </OpsDrawer>}
+    </OpsDialog>}
     {notice && <OpsNotice key={notice} message={notice} onClose={() => setNotice("")} />}
     {notice && <OpsNotice key={notice} message={notice} onClose={() => setNotice("")} />}
   </>;
   </>;
 }
 }

+ 12 - 0
web-scaffold/src/styles/work-order-ledger.css

@@ -61,6 +61,18 @@
 .work-order-ledger-summary.work-order-queue-summary[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .work-order-ledger-summary.work-order-queue-summary[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .work-order-ledger-summary.work-order-queue-summary[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
 .work-order-ledger-summary.work-order-queue-summary[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
 .work-order-queue-filters .work-order-queue-auto { margin-inline-start: auto; }
 .work-order-queue-filters .work-order-queue-auto { margin-inline-start: auto; }
+.work-order-queue-dialog-context {
+  display: flex;
+  align-items: flex-start;
+  gap: 10px;
+  padding: 12px 14px;
+  border: 1px solid var(--border-subtle);
+  border-radius: var(--radius-control);
+  background: var(--surface-subtle);
+  overflow-wrap: anywhere;
+}
+.work-order-queue-dialog-context > svg { flex: none; margin-top: 2px; color: var(--primary); }
+.work-order-queue-dialog-context p { margin-top: 4px; color: var(--text-secondary); font-size: var(--type-support); line-height: 1.55; }
 .work-order-ledger .work-order-delivery-note { flex: none; }
 .work-order-ledger .work-order-delivery-note { flex: none; }
 .work-order-ledger .work-order-message-panel { flex: 1 1 auto; gap: 0; min-width: 0; padding: 0; }
 .work-order-ledger .work-order-message-panel { flex: 1 1 auto; gap: 0; min-width: 0; padding: 0; }
 .work-order-message-panel .work-order-message-scroll { flex: 1 1 240px; min-height: 240px; overflow-y: auto; }
 .work-order-message-panel .work-order-message-scroll { flex: 1 1 240px; min-height: 240px; overflow-y: auto; }