| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- /**
- * 待分派(册 5,「工单与任务」菜单入口)。
- *
- * 与 `/workspace/queue` 共用 [`QueueBoard`]:团队主看本团队并可一键自动平均分派;
- * 总运营/区域运营看权限范围内全部团队的待分派单(多一列「团队」),
- * 自动分派按团队执行 ⇒ 总运营侧按钮禁用并说明原因,⛔ 让他点一下再吃服务端 `team_id` 必填。
- *
- * 运维成员(`ops`/`worker`)不在 `pending_queue` 的角色集内(服务端 `guard::gate` 直拒),
- * 因此不给他们这个菜单,直接敲 URL 也落回我的待办。
- */
- import { Navigate } from "react-router";
- import { PageIntro } from "../components/PageIntro";
- import { Info } from "lucide-react";
- import { QueueBoard } from "./TeamQueuePage";
- import { useDemoIdentity } from "../lib/demo-session";
- import "../styles/operations.css";
- import "../styles/work-orders.css";
- const QUEUE_ROLES = ["admin", "regAdmin", "teamLead"];
- export function WorkOrderQueuePage() {
- const identity = useDemoIdentity();
- if (identity && !QUEUE_ROLES.includes(identity.role)) return <Navigate to="/work-orders/mine" replace />;
- const teamLead = identity?.role === "teamLead" && identity.maintenanceTeamId ? identity : null;
- return <section className="work-order-page work-order-queue-page page-fill">
- <header className="work-order-heading">
- <div>
- <p className="work-order-eyebrow"><span /> DISPATCH / 待分派</p>
- <h1>待分派</h1>
- <PageIntro>{teamLead
- ? `为 ${teamLead.name} 的待分派工单找合适的接单人,候选人按工单类型、负责范围和账号状态筛选。`
- : "在负责范围内逐张派单。需要自动平均分派时,请切到对应的团队主账号。"}</PageIntro>
- </div>
- </header>
- <QueueBoard
- teamId={teamLead?.maintenanceTeamId}
- teamName={teamLead?.name}
- showTeamColumn={!teamLead}
- canAutoDispatch={Boolean(teamLead)}
- />
- {!teamLead && <p className="work-order-block-note"><Info size={13} />自动平均分派以「团队」为作用域:服务端要求 `team_id` 且团队分派方式为自动平均。总部视角请到运维团队页切换分派方式,或在此逐张指定成员。</p>}
- </section>;
- }
|