|
@@ -2,21 +2,21 @@ import { MultiTreeSelect } from "../components/ui/multi-tree-select";
|
|
|
import { PageIntro } from "../components/PageIntro";
|
|
import { PageIntro } from "../components/PageIntro";
|
|
|
import { TeamTicketTypes } from "../components/TeamTicketTypes";
|
|
import { TeamTicketTypes } from "../components/TeamTicketTypes";
|
|
|
import { ListPager } from "../components/ListPager";
|
|
import { ListPager } from "../components/ListPager";
|
|
|
-import { OpsNotice, OpsResponsiveActions, OpsTableColumns } from "../components/OperationsKit";
|
|
|
|
|
|
|
+import { OpsDialog, OpsNotice, OpsResponsiveActions, OpsStatus, OpsTag, OpsTableColumns } from "../components/OperationsKit";
|
|
|
import { compareNum, compareText, nextSort, slicePage, useLocalPage, type SortDir } from "../lib/list-paging";
|
|
import { compareNum, compareText, nextSort, slicePage, useLocalPage, type SortDir } from "../lib/list-paging";
|
|
|
import { downloadCsv } from "../lib/csv-download";
|
|
import { downloadCsv } from "../lib/csv-download";
|
|
|
import { useHorizontalOverflow } from "../lib/use-horizontal-overflow";
|
|
import { useHorizontalOverflow } from "../lib/use-horizontal-overflow";
|
|
|
import { FilterIcon, FilterSelect } from "../components/ui/filter-select";
|
|
import { FilterIcon, FilterSelect } from "../components/ui/filter-select";
|
|
|
import { useLayoutEffect, useEffect, useMemo, useRef, useState, type CSSProperties, type FormEvent, type ReactNode } from "react";
|
|
import { useLayoutEffect, useEffect, useMemo, useRef, useState, type CSSProperties, type FormEvent, type ReactNode } from "react";
|
|
|
import { createPortal } from "react-dom";
|
|
import { createPortal } from "react-dom";
|
|
|
-import { ArrowLeft, ArrowRight, ChevronDown, ChevronRight, Download, Info, MapPinned, PencilLine, Plus, Search, Trash2, UserRound, Users, Wrench, X } from "lucide-react";
|
|
|
|
|
|
|
+import { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, ArrowUpDown, Building2, ChevronDown, ChevronRight, Download, Info, MapPinned, PencilLine, Plus, Search, Trash2, UserRound, Users, Wrench, X } from "lucide-react";
|
|
|
import { Link, useParams, useSearchParams } from "react-router";
|
|
import { Link, useParams, useSearchParams } from "react-router";
|
|
|
import { Button as FilterResetButton } from "../components/ui/button";
|
|
import { Button as FilterResetButton } from "../components/ui/button";
|
|
|
import { TreeSelect } from "../components/ui/tree-select";
|
|
import { TreeSelect } from "../components/ui/tree-select";
|
|
|
import { regionLevelText, regionParentInTree, regionTreeNodes } from "../lib/region-tree";
|
|
import { regionLevelText, regionParentInTree, regionTreeNodes } from "../lib/region-tree";
|
|
|
import { markPeerOccupiedTreeNodes, peerOccupiedRegionIds, regionAncestorChain } from "../lib/region-ownership";
|
|
import { markPeerOccupiedTreeNodes, peerOccupiedRegionIds, regionAncestorChain } from "../lib/region-ownership";
|
|
|
import { OrganizationAccountDialog, type AccountTarget } from "../components/OrganizationAccountDialog";
|
|
import { OrganizationAccountDialog, type AccountTarget } from "../components/OrganizationAccountDialog";
|
|
|
-import { OrganizationAccountInline } from "../components/OrganizationAccountInline";
|
|
|
|
|
|
|
+import { PartnerCustomerPicker } from "../components/PartnerCustomerPicker";
|
|
|
import { OrganizationAccountStatus } from "../components/OrganizationAccountStatus";
|
|
import { OrganizationAccountStatus } from "../components/OrganizationAccountStatus";
|
|
|
import { MaintenanceAccounts, OperationsAccounts } from "../components/OrganizationTeamAccounts";
|
|
import { MaintenanceAccounts, OperationsAccounts } from "../components/OrganizationTeamAccounts";
|
|
|
import {
|
|
import {
|
|
@@ -29,8 +29,11 @@ import * as bos from "../lib/api/bos";
|
|
|
import { MAINTENANCE_TICKET_TYPES, typeLabel } from "../lib/api/ticket";
|
|
import { MAINTENANCE_TICKET_TYPES, typeLabel } from "../lib/api/ticket";
|
|
|
import { useDemoIdentity } from "../lib/demo-session";
|
|
import { useDemoIdentity } from "../lib/demo-session";
|
|
|
import { useSession } from "../auth/session";
|
|
import { useSession } from "../auth/session";
|
|
|
-import { Tri } from "../components/triState";
|
|
|
|
|
|
|
+import { TableValueText, Tri } from "../components/triState";
|
|
|
|
|
+import { SHARE_TERMS_INCOMPLETE, shareRuleParts } from "../lib/settle-text";
|
|
|
|
|
+import "../styles/operations.css";
|
|
|
import "../styles/organization.css";
|
|
import "../styles/organization.css";
|
|
|
|
|
+import "../styles/record-detail.css";
|
|
|
|
|
|
|
|
type EditorKind = "region" | "operator" | "partner" | "operations" | "maintenance";
|
|
type EditorKind = "region" | "operator" | "partner" | "operations" | "maintenance";
|
|
|
/** 后端 `operator.brand` 只接受这三值(`OPERATOR_BRANDS`,非法值 `30001`),故表单用下拉而非自由文本。 */
|
|
/** 后端 `operator.brand` 只接受这三值(`OPERATOR_BRANDS`,非法值 `30001`),故表单用下拉而非自由文本。 */
|
|
@@ -43,7 +46,8 @@ const freshScope = (): Scope => ({ regions: [], enterprises: [] });
|
|
|
const sameScope = (current: Scope | undefined, next: Scope) => Boolean(current)
|
|
const sameScope = (current: Scope | undefined, next: Scope) => Boolean(current)
|
|
|
&& current!.regions.length === next.regions.length && next.regions.every((id) => current!.regions.includes(id))
|
|
&& current!.regions.length === next.regions.length && next.regions.every((id) => current!.regions.includes(id))
|
|
|
&& current!.enterprises.length === next.enterprises.length && next.enterprises.every((index) => current!.enterprises.includes(index));
|
|
&& current!.enterprises.length === next.enterprises.length && next.enterprises.every((index) => current!.enterprises.includes(index));
|
|
|
-const shareText = (item: ShareFields) => item.shareMode === "按比例" ? `${(item.shareValue * 100).toLocaleString("zh-CN", { maximumFractionDigits: 2 })}%` : item.shareMode === "按每账号" ? `¥${item.shareValue} / 账号` : `¥${item.shareValue} / 月`;
|
|
|
|
|
|
|
+/** 分成规则取值:与分成管理列表同一口径(settle-text `shareRuleParts`,金额补两位小数、不加千分位;⛔ 本页另拼)。 */
|
|
|
|
|
+const shareText = (item: ShareFields) => shareRuleParts(settleKeyOf(item.shareMode), item.shareValue)?.value ?? SHARE_TERMS_INCOMPLETE;
|
|
|
const operationsRegionLabel = (data: OrganizationData, id: string) => regionPath(data, id).split(" / ").filter((part, index, parts) => part !== parts[index - 1]).join(" / ");
|
|
const operationsRegionLabel = (data: OrganizationData, id: string) => regionPath(data, id).split(" / ").filter((part, index, parts) => part !== parts[index - 1]).join(" / ");
|
|
|
/** 工单类型选项:**值=后端类型码**(`ops::domain::TYPES`,落库与传输一律用码),标签=同源中文名。
|
|
/** 工单类型选项:**值=后端类型码**(`ops::domain::TYPES`,落库与传输一律用码),标签=同源中文名。
|
|
|
*
|
|
*
|
|
@@ -56,8 +60,8 @@ const maintenanceTicketCodes = maintenanceTicketOptions.map((option) => option.v
|
|
|
/** 团队档案上的类型码集合;缺省=全部类型(⛔ 用中文标签当值,后端会按非法码拒绝)。 */
|
|
/** 团队档案上的类型码集合;缺省=全部类型(⛔ 用中文标签当值,后端会按非法码拒绝)。 */
|
|
|
const teamTicketTypes = (team: MaintenanceTeam) => team.ticketTypes?.length ? team.ticketTypes : maintenanceTicketCodes;
|
|
const teamTicketTypes = (team: MaintenanceTeam) => team.ticketTypes?.length ? team.ticketTypes : maintenanceTicketCodes;
|
|
|
|
|
|
|
|
-function PageHead({ eyebrow, title, description, action }: { eyebrow: string; title: string; description: string; action?: ReactNode }) {
|
|
|
|
|
- return <div className="org-page-head"><div><p className="org-eyebrow">{eyebrow}</p><h1>{title}</h1><PageIntro>{description}</PageIntro></div>{action}</div>;
|
|
|
|
|
|
|
+function PageHead({ eyebrow, title, description, action }: { eyebrow: string; title: string; description?: string; action?: ReactNode }) {
|
|
|
|
|
+ return <div className="org-page-head"><div><p className="org-eyebrow">{eyebrow}</p><h1>{title}</h1>{description && <PageIntro>{description}</PageIntro>}</div>{action}</div>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/** 账号列手机号展示:后端§5.4 已掩码则原样;偶发明文 11 位时再罩一层(⛔ 当拨号明文)。 */
|
|
/** 账号列手机号展示:后端§5.4 已掩码则原样;偶发明文 11 位时再罩一层(⛔ 当拨号明文)。 */
|
|
@@ -93,7 +97,7 @@ function refuseText(res: unknown): string {
|
|
|
/** 取数门:整体失败原文+重试、逐集合失败原文、后端降级说明(⛔ 加载中 helper,其它页也不用)。 */
|
|
/** 取数门:整体失败原文+重试、逐集合失败原文、后端降级说明(⛔ 加载中 helper,其它页也不用)。 */
|
|
|
function OrgFetchState({ status, collections }: { status: OrganizationStatus; collections?: (keyof OrganizationStatus["partial"])[] }) {
|
|
function OrgFetchState({ status, collections }: { status: OrganizationStatus; collections?: (keyof OrganizationStatus["partial"])[] }) {
|
|
|
const fails = (collections ?? []).map((key) => status.partial[key]).filter(Boolean) as string[];
|
|
const fails = (collections ?? []).map((key) => status.partial[key]).filter(Boolean) as string[];
|
|
|
- const notes = [status.regionNameNote, status.customerNote, status.loadPending].filter(Boolean) as string[];
|
|
|
|
|
|
|
+ const notes = [status.regionNameNote, status.loadPending].filter(Boolean) as string[];
|
|
|
if (!status.error && !fails.length && !notes.length) return null;
|
|
if (!status.error && !fails.length && !notes.length) return null;
|
|
|
return <>
|
|
return <>
|
|
|
{status.error && <p className="org-form-error">组织档案读取失败:{status.error.message}<button className="org-inline-link" type="button" onClick={() => void reloadOrganizationData()}>重试</button></p>}
|
|
{status.error && <p className="org-form-error">组织档案读取失败:{status.error.message}<button className="org-inline-link" type="button" onClick={() => void reloadOrganizationData()}>重试</button></p>}
|
|
@@ -106,7 +110,7 @@ function OrgFetchState({ status, collections }: { status: OrganizationStatus; co
|
|
|
function Count({ v, note }: { v: number | null | undefined; note?: string }) {
|
|
function Count({ v, note }: { v: number | null | undefined; note?: string }) {
|
|
|
if (v === undefined) return <Tri tone="missing" text={FIELD_UNAVAILABLE} title="后端接口未返回该字段" />;
|
|
if (v === undefined) return <Tri tone="missing" text={FIELD_UNAVAILABLE} title="后端接口未返回该字段" />;
|
|
|
if (v === null) return <Tri tone="missing" text="—" title={note || "后端回空(无计数/未覆盖),不是接口未实现"} />;
|
|
if (v === null) return <Tri tone="missing" text="—" title={note || "后端回空(无计数/未覆盖),不是接口未实现"} />;
|
|
|
- return <>{v}{note ? <span className="muted"> {note}</span> : null}</>;
|
|
|
|
|
|
|
+ return <><span className="table-number">{v}</span>{note ? <span className="muted"> {note}</span> : null}</>;
|
|
|
}
|
|
}
|
|
|
/** 计数文案:缺省/空值带 title,供字符串插值;需要悬停语义时优先用 `Count`。 */
|
|
/** 计数文案:缺省/空值带 title,供字符串插值;需要悬停语义时优先用 `Count`。 */
|
|
|
const countText = (v?: number | null) => v === undefined ? FIELD_UNAVAILABLE : v === null ? "—" : String(v);
|
|
const countText = (v?: number | null) => v === undefined ? FIELD_UNAVAILABLE : v === null ? "—" : String(v);
|
|
@@ -176,13 +180,9 @@ function OrgEditor({ editor, onClose, onSaved }: { editor: Editor; onClose: () =
|
|
|
return editor.parent ?? data.regions[0]?.id ?? "";
|
|
return editor.parent ?? data.regions[0]?.id ?? "";
|
|
|
});
|
|
});
|
|
|
const [username, setUsername] = useState("");
|
|
const [username, setUsername] = useState("");
|
|
|
- // 编辑回填:列表手机号已脱敏(`139****0002`)⇒ 留空表示「不改」;⛔ 把脱敏串当写入值上行。
|
|
|
|
|
const [mobile, setMobile] = useState(() => {
|
|
const [mobile, setMobile] = useState(() => {
|
|
|
- if (!(existing && "phone" in existing) || editor.id === undefined) {
|
|
|
|
|
- return existing && "phone" in existing ? ((existing as { phone?: string }).phone ?? "") : "";
|
|
|
|
|
- }
|
|
|
|
|
- const raw = ((existing as { phone?: string }).phone ?? "").trim();
|
|
|
|
|
- return raw.includes("*") ? "" : raw;
|
|
|
|
|
|
|
+ const phone = editor.kind === "partner" ? (existing as Partner | undefined)?.phone ?? "" : "";
|
|
|
|
|
+ return /^\d{11}$/.test(phone) ? phone : "";
|
|
|
});
|
|
});
|
|
|
const [busy, setBusy] = useState(false);
|
|
const [busy, setBusy] = useState(false);
|
|
|
const [confirmDispatch, setConfirmDispatch] = useState(false);
|
|
const [confirmDispatch, setConfirmDispatch] = useState(false);
|
|
@@ -213,27 +213,6 @@ function OrgEditor({ editor, onClose, onSaved }: { editor: Editor; onClose: () =
|
|
|
const [scope, setScope] = useState<Scope>("scope" in (existing ?? {}) ? structuredClone((existing as { scope: Scope }).scope) : editor.parent && editor.kind !== "region" ? { regions: [editor.parent], enterprises: [] } : freshScope());
|
|
const [scope, setScope] = useState<Scope>("scope" in (existing ?? {}) ? structuredClone((existing as { scope: Scope }).scope) : editor.parent && editor.kind !== "region" ? { regions: [editor.parent], enterprises: [] } : freshScope());
|
|
|
/** 合伙人「指定客户」:存客户主体号(⛔ 全量 enterprises 下标)。 */
|
|
/** 合伙人「指定客户」:存客户主体号(⛔ 全量 enterprises 下标)。 */
|
|
|
const [pickedCustomerIds, setPickedCustomerIds] = useState<string[]>(() => (existing as Partner | undefined)?.scopeCustomerIds ?? []);
|
|
const [pickedCustomerIds, setPickedCustomerIds] = useState<string[]>(() => (existing as Partner | undefined)?.scopeCustomerIds ?? []);
|
|
|
- const [customerSearch, setCustomerSearch] = useState("");
|
|
|
|
|
- const [customerHits, setCustomerHits] = useState<{ id: string; name: string }[]>([]);
|
|
|
|
|
- const [customerSearchBusy, setCustomerSearchBusy] = useState(false);
|
|
|
|
|
- useEffect(() => {
|
|
|
|
|
- if (editor.kind !== "partner") return;
|
|
|
|
|
- let alive = true;
|
|
|
|
|
- const handle = window.setTimeout(() => {
|
|
|
|
|
- setCustomerSearchBusy(true);
|
|
|
|
|
- void bos.customerGetList({ page: 0, page_size: 20, keyword: customerSearch.trim() || undefined })
|
|
|
|
|
- .then((res) => {
|
|
|
|
|
- if (!alive) return;
|
|
|
|
|
- setCustomerHits((res.items ?? []).map((row) => ({
|
|
|
|
|
- id: row.customer_id,
|
|
|
|
|
- name: row.customer_name || row.customer_id,
|
|
|
|
|
- })));
|
|
|
|
|
- })
|
|
|
|
|
- .catch(() => { if (alive) setCustomerHits([]); })
|
|
|
|
|
- .finally(() => { if (alive) setCustomerSearchBusy(false); });
|
|
|
|
|
- }, 280);
|
|
|
|
|
- return () => { alive = false; window.clearTimeout(handle); };
|
|
|
|
|
- }, [editor.kind, customerSearch]);
|
|
|
|
|
/** 负责范围旁嵌套「新建区域」:挂靠上级(空=平台树根=建省)。 */
|
|
/** 负责范围旁嵌套「新建区域」:挂靠上级(空=平台树根=建省)。 */
|
|
|
const [regionCreateParent, setRegionCreateParent] = useState("");
|
|
const [regionCreateParent, setRegionCreateParent] = useState("");
|
|
|
const [regionModal, setRegionModal] = useState<RegionModal | null>(null);
|
|
const [regionModal, setRegionModal] = useState<RegionModal | null>(null);
|
|
@@ -306,12 +285,9 @@ function OrgEditor({ editor, onClose, onSaved }: { editor: Editor; onClose: () =
|
|
|
else await bos.operatorCreate({ name: trimmed, brand, region_node_id: region, is_province_node: true, settle_mode: settleMode, settle_value: settleValue, recon_day: reconDay ? Number(reconDay) : null, pay_cycle: payCycle || null });
|
|
else await bos.operatorCreate({ name: trimmed, brand, region_node_id: region, is_province_node: true, settle_mode: settleMode, settle_value: settleValue, recon_day: reconDay ? Number(reconDay) : null, pay_cycle: payCycle || null });
|
|
|
} else if (editor.kind === "partner") {
|
|
} else if (editor.kind === "partner") {
|
|
|
if (editor.id) {
|
|
if (editor.id) {
|
|
|
- // 脱敏串/非法手机号一律不携带 mobile(留空=不改);合法 11 位才上行。
|
|
|
|
|
const nextMobile = mobile.trim();
|
|
const nextMobile = mobile.trim();
|
|
|
- const mobilePayload = !nextMobile ? undefined
|
|
|
|
|
- : /^1[3-9]\d{9}$/.test(nextMobile) ? nextMobile
|
|
|
|
|
- : (() => { throw new Error("请输入 11 位中国大陆手机号,或留空表示不改"); })();
|
|
|
|
|
- await bos.partnerUpdate({ partner_id: editor.id, name: trimmed, duty_desc: title.trim(), region_node_id: region, ...(mobilePayload !== undefined ? { mobile: mobilePayload } : {}), settle_mode: settleMode, settle_value: settleValue });
|
|
|
|
|
|
|
+ if (nextMobile && !/^1[3-9]\d{9}$/.test(nextMobile)) throw new Error("请输入 11 位中国大陆手机号,或留空表示不改");
|
|
|
|
|
+ await bos.partnerUpdate({ partner_id: editor.id, name: trimmed, duty_desc: title.trim(), region_node_id: region, ...(nextMobile ? { mobile: nextMobile } : {}), settle_mode: settleMode, settle_value: settleValue });
|
|
|
// 负责范围并入本弹窗:区域用 scope;指定客户用主体号清单(⛔ 全量 enterprises 下标)。
|
|
// 负责范围并入本弹窗:区域用 scope;指定客户用主体号清单(⛔ 全量 enterprises 下标)。
|
|
|
const prevCustomerIds = (existing as Partner | undefined)?.scopeCustomerIds ?? [];
|
|
const prevCustomerIds = (existing as Partner | undefined)?.scopeCustomerIds ?? [];
|
|
|
const customersChanged = prevCustomerIds.length !== customerIds.length
|
|
const customersChanged = prevCustomerIds.length !== customerIds.length
|
|
@@ -425,15 +401,17 @@ function OrgEditor({ editor, onClose, onSaved }: { editor: Editor; onClose: () =
|
|
|
const regionParentRaw = editor.parent ?? (existing as Region | undefined)?.parent;
|
|
const regionParentRaw = editor.parent ?? (existing as Region | undefined)?.parent;
|
|
|
const regionParent = regionParentRaw && regionParentRaw !== V_ROOT ? regionParentRaw : null;
|
|
const regionParent = regionParentRaw && regionParentRaw !== V_ROOT ? regionParentRaw : null;
|
|
|
const editorTitle = editor.kind === "region" ? editor.id ? "重命名区域" : `新建${regionLevelTitle}` : `${editor.id ? "编辑" : "新建"}${kindTitle}`;
|
|
const editorTitle = editor.kind === "region" ? editor.id ? "重命名区域" : `新建${regionLevelTitle}` : `${editor.id ? "编辑" : "新建"}${kindTitle}`;
|
|
|
|
|
+ const centeredEditor = editor.kind !== "region";
|
|
|
|
|
+ const editorBackdrop = centeredEditor ? "org-centered-backdrop" : "org-editor-modal-backdrop";
|
|
|
if (createdInfo) {
|
|
if (createdInfo) {
|
|
|
- return <div className="org-dialog-backdrop org-editor-modal-backdrop" role="presentation" onMouseDown={onClose}><section aria-label={`${createdInfo.title}回执`} aria-modal="true" className="org-dialog org-editor-modal" onMouseDown={(e) => e.stopPropagation()} role="dialog">
|
|
|
|
|
|
|
+ return <div className={`org-dialog-backdrop ${editorBackdrop}`} role="presentation" onMouseDown={onClose}><section aria-label={`${createdInfo.title}回执`} aria-modal="true" className="org-dialog org-editor-modal" onMouseDown={(e) => e.stopPropagation()} role="dialog">
|
|
|
<header><div><span className="org-eyebrow">ORGANIZATION / CREATED</span><h2>{createdInfo.title}</h2></div><button aria-label="关闭" className="org-icon-button" onClick={onClose} type="button"><X size={18} /></button></header>
|
|
<header><div><span className="org-eyebrow">ORGANIZATION / CREATED</span><h2>{createdInfo.title}</h2></div><button aria-label="关闭" className="org-icon-button" onClick={onClose} type="button"><X size={18} /></button></header>
|
|
|
<div className="org-dialog-content"><p className="org-account-notice" role="status">档案与登录账号已开通</p><div className="org-account-secret"><span>名称</span><strong>{createdInfo.label}</strong><span>登录名</span><strong>{createdInfo.username || "—"}</strong>{createdInfo.password ? <><span>一次性凭据</span><strong>{createdInfo.password}</strong><small>由开通回执一次性下发(初始密码/激活码),关闭后无法再次查询,请立即转交本人。</small></> : <small>后端未回传一次性凭据(`credential_viewable=false` 或不含 `initial_password`),请通过账号设置重置激活码。</small>}</div></div>
|
|
<div className="org-dialog-content"><p className="org-account-notice" role="status">档案与登录账号已开通</p><div className="org-account-secret"><span>名称</span><strong>{createdInfo.label}</strong><span>登录名</span><strong>{createdInfo.username || "—"}</strong>{createdInfo.password ? <><span>一次性凭据</span><strong>{createdInfo.password}</strong><small>由开通回执一次性下发(初始密码/激活码),关闭后无法再次查询,请立即转交本人。</small></> : <small>后端未回传一次性凭据(`credential_viewable=false` 或不含 `initial_password`),请通过账号设置重置激活码。</small>}</div></div>
|
|
|
<footer><button className="org-button" onClick={onClose} type="button">完成</button></footer>
|
|
<footer><button className="org-button" onClick={onClose} type="button">完成</button></footer>
|
|
|
</section></div>;
|
|
</section></div>;
|
|
|
}
|
|
}
|
|
|
if (confirmDispatch) {
|
|
if (confirmDispatch) {
|
|
|
- return <div className="org-dialog-backdrop org-editor-modal-backdrop" role="presentation" onMouseDown={() => setConfirmDispatch(false)}><section aria-label="确认切换分派方式" aria-modal="true" className="org-dialog org-editor-modal" onMouseDown={(e) => e.stopPropagation()} role="dialog">
|
|
|
|
|
|
|
+ return <div className={`org-dialog-backdrop ${editorBackdrop}`} role="presentation" onMouseDown={() => setConfirmDispatch(false)}><section aria-label="确认切换分派方式" aria-modal="true" className="org-dialog org-editor-modal" onMouseDown={(e) => e.stopPropagation()} role="dialog">
|
|
|
<header><div><span className="org-eyebrow">DISPATCH MODE</span><h2>确认切换分派方式</h2></div><button aria-label="关闭" className="org-icon-button" onClick={() => setConfirmDispatch(false)} type="button"><X size={18} /></button></header>
|
|
<header><div><span className="org-eyebrow">DISPATCH MODE</span><h2>确认切换分派方式</h2></div><button aria-label="关闭" className="org-icon-button" onClick={() => setConfirmDispatch(false)} type="button"><X size={18} /></button></header>
|
|
|
<div className="org-dialog-content">
|
|
<div className="org-dialog-content">
|
|
|
<p className="org-account-notice" role="status">分派方式影响该团队后续工单派发。将从「{(existing as MaintenanceTeam | undefined)?.mode}」改为「{mode}」。</p>
|
|
<p className="org-account-notice" role="status">分派方式影响该团队后续工单派发。将从「{(existing as MaintenanceTeam | undefined)?.mode}」改为「{mode}」。</p>
|
|
@@ -446,7 +424,7 @@ function OrgEditor({ editor, onClose, onSaved }: { editor: Editor; onClose: () =
|
|
|
</footer>
|
|
</footer>
|
|
|
</section></div>;
|
|
</section></div>;
|
|
|
}
|
|
}
|
|
|
- return <div className="org-dialog-backdrop org-editor-modal-backdrop" role="presentation" onMouseDown={onClose}><section aria-label={editorTitle} aria-describedby={hasScope ? "org-editor-scope-description" : undefined} aria-modal="true" className={`org-dialog org-editor-modal${editor.kind === "region" ? " org-region-editor-modal" : ""}`} onMouseDown={(e) => e.stopPropagation()} role="dialog">
|
|
|
|
|
|
|
+ return <div className={`org-dialog-backdrop ${editorBackdrop}`} role="presentation" onMouseDown={onClose}><section aria-label={editorTitle} aria-describedby={hasScope ? "org-editor-scope-description" : undefined} aria-modal="true" className={`org-dialog org-editor-modal${editor.kind === "region" ? " org-region-editor-modal" : ""}`} onMouseDown={(e) => e.stopPropagation()} role="dialog">
|
|
|
<header>
|
|
<header>
|
|
|
<div>
|
|
<div>
|
|
|
<span className="org-eyebrow">ORGANIZATION RECORD</span>
|
|
<span className="org-eyebrow">ORGANIZATION RECORD</span>
|
|
@@ -455,7 +433,7 @@ function OrgEditor({ editor, onClose, onSaved }: { editor: Editor; onClose: () =
|
|
|
</div>
|
|
</div>
|
|
|
<button aria-label="关闭" className="org-icon-button" onClick={onClose} type="button"><X size={18} /></button>
|
|
<button aria-label="关闭" className="org-icon-button" onClick={onClose} type="button"><X size={18} /></button>
|
|
|
</header>
|
|
</header>
|
|
|
- <form noValidate onSubmit={submit}><div className={`org-dialog-content${editor.kind === "maintenance" ? " org-editor-form-grid" : ""}`}>
|
|
|
|
|
|
|
+ <form noValidate onSubmit={submit}><div className={`org-dialog-content${editor.kind === "maintenance" || editor.kind === "partner" ? " org-editor-form-grid" : ""}`}>
|
|
|
<label className="org-field"><span>{editor.kind === "region" ? `${regionLevelTitle}名称` : "名称"} <em>*</em></span><input autoFocus maxLength={60} onChange={(e) => setName(e.target.value)} value={name} /></label>
|
|
<label className="org-field"><span>{editor.kind === "region" ? `${regionLevelTitle}名称` : "名称"} <em>*</em></span><input autoFocus maxLength={60} onChange={(e) => setName(e.target.value)} value={name} /></label>
|
|
|
{editor.kind === "region" && !editor.id && <label className="org-field"><span>区域层级 <em>*</em></span><select className="org-select" onChange={(e) => setRegionLevelSel(e.target.value)} value={regionLevelSel}><option value="">请选择层级</option>{levelNames.map((item) => <option key={item} value={item}>{item}</option>)}</select></label>}
|
|
{editor.kind === "region" && !editor.id && <label className="org-field"><span>区域层级 <em>*</em></span><select className="org-select" onChange={(e) => setRegionLevelSel(e.target.value)} value={regionLevelSel}><option value="">请选择层级</option>{levelNames.map((item) => <option key={item} value={item}>{item}</option>)}</select></label>}
|
|
|
{editor.kind === "region" && <div className="org-region-editor-context"><span>{regionParent ? "所属上级区域" : "区域层级"}</span><strong>{regionParent ? regionPath(data, regionParent) : "省级 · 挂在平台树根下"}</strong><p>{editor.id ? "调整区域名称,所属层级与挂载关系保持不变。" : "层级由业务侧自持,请在上方点名(跨级挂靠是常态,系统不按上级推导)。"}</p></div>}
|
|
{editor.kind === "region" && <div className="org-region-editor-context"><span>{regionParent ? "所属上级区域" : "区域层级"}</span><strong>{regionParent ? regionPath(data, regionParent) : "省级 · 挂在平台树根下"}</strong><p>{editor.id ? "调整区域名称,所属层级与挂载关系保持不变。" : "层级由业务侧自持,请在上方点名(跨级挂靠是常态,系统不按上级推导)。"}</p></div>}
|
|
@@ -468,33 +446,14 @@ function OrgEditor({ editor, onClose, onSaved }: { editor: Editor; onClose: () =
|
|
|
{editor.kind === "operations" && <p className="org-helper">运营团队分成的口径与取值由结算域维护,后端未在团队档案上开放修改入参。</p>}
|
|
{editor.kind === "operations" && <p className="org-helper">运营团队分成的口径与取值由结算域维护,后端未在团队档案上开放修改入参。</p>}
|
|
|
{editor.kind === "operations" && <label className="org-field"><span>团队说明</span><textarea onChange={(e) => setDesc(e.target.value)} rows={3} value={desc} /></label>}
|
|
{editor.kind === "operations" && <label className="org-field"><span>团队说明</span><textarea onChange={(e) => setDesc(e.target.value)} rows={3} value={desc} /></label>}
|
|
|
{editor.kind === "operator" && <label className="org-field"><span>付款周期</span><select className="org-select" onChange={(e) => setPayCycle(e.target.value)} value={payCycle}><option value="">未配置</option>{payCycleOptions.map((value) => <option key={value} value={value}>{value}</option>)}</select></label>}
|
|
{editor.kind === "operator" && <label className="org-field"><span>付款周期</span><select className="org-select" onChange={(e) => setPayCycle(e.target.value)} value={payCycle}><option value="">未配置</option>{payCycleOptions.map((value) => <option key={value} value={value}>{value}</option>)}</select></label>}
|
|
|
- {editor.kind === "partner" && <label className="org-field"><span>渠道说明</span><input onChange={(e) => setTitle(e.target.value)} value={title} /></label>}
|
|
|
|
|
- {editor.kind === "partner" && !editor.id && <><label className="org-field"><span>登录名 <em>*</em></span><input autoComplete="off" maxLength={64} onChange={(e) => setUsername(e.target.value)} value={username} /></label><label className="org-field"><span>手机号</span><input autoComplete="off" maxLength={20} onChange={(e) => setMobile(e.target.value)} value={mobile} /></label><p className="org-helper">后端创建合伙人时会同步创建其登录账号,登录名为必填;账号密码由后端以激活码下发。</p></>}
|
|
|
|
|
- {editor.kind === "partner" && editor.id && <label className="org-field"><span>手机号 <small>留空则不改(不上传该字段)</small></span><input autoComplete="off" inputMode="tel" maxLength={11} onChange={(e) => setMobile(e.target.value)} placeholder="列表为脱敏值,请重新输入完整手机号;清空号码请联系总运营" value={mobile} /></label>}
|
|
|
|
|
- {/* 合伙人账号并入「编辑合伙人」(2026-11-16 业主指示),沿用档案字段风格;手机号仍由上方档案字段维护。 */}
|
|
|
|
|
- {editor.kind === "partner" && editor.id && existing && <OrganizationAccountInline account={existing as Partner} mobile={mobile} provision={{ role_code: "partner", subject_type: "partner", subject_id: editor.id }} />}
|
|
|
|
|
- {editor.kind === "partner" && <p className="org-helper">通知地址:后端合伙人档案未下发该字段,本页不提供录入。</p>}
|
|
|
|
|
|
|
+ {editor.kind === "partner" && <label className={editor.id ? "org-field" : "org-field org-editor-wide"}><span>渠道说明</span><input onChange={(e) => setTitle(e.target.value)} value={title} /></label>}
|
|
|
|
|
+ {editor.kind === "partner" && !editor.id && <><label className="org-field"><span>登录名 <em>*</em></span><input autoComplete="off" maxLength={64} onChange={(e) => setUsername(e.target.value)} value={username} /></label><label className="org-field"><span>手机号</span><input autoComplete="off" maxLength={20} onChange={(e) => setMobile(e.target.value)} value={mobile} /></label></>}
|
|
|
|
|
+ {editor.kind === "partner" && editor.id && <label className="org-field"><span>手机号 <small>留空则不改</small></span><input autoComplete="off" inputMode="tel" maxLength={11} onChange={(e) => setMobile(e.target.value)} placeholder="输入完整手机号" value={mobile} /></label>}
|
|
|
{editor.kind === "maintenance" && <><label className="org-field org-maintenance-mode-field"><span>分派方式</span><select className="org-select" onChange={(e) => setMode(e.target.value as MaintenanceTeam["mode"])} value={mode}><option>手工</option><option>自动平均</option></select></label><div className="org-field org-ticket-types-field"><span>可分配工单类型 <em>*</em></span><MultiTreeSelect nodes={maintenanceTicketOptions} values={ticketTypes} onChange={setTicketTypes} label="可分配工单类型" placeholder="选择工单类型,可多选" searchPlaceholder="搜索工单类型" /></div></>}
|
|
{editor.kind === "maintenance" && <><label className="org-field org-maintenance-mode-field"><span>分派方式</span><select className="org-select" onChange={(e) => setMode(e.target.value as MaintenanceTeam["mode"])} value={mode}><option>手工</option><option>自动平均</option></select></label><div className="org-field org-ticket-types-field"><span>可分配工单类型 <em>*</em></span><MultiTreeSelect nodes={maintenanceTicketOptions} values={ticketTypes} onChange={setTicketTypes} label="可分配工单类型" placeholder="选择工单类型,可多选" searchPlaceholder="搜索工单类型" /></div></>}
|
|
|
{/* 「指定客户」2026-11-16 起运维团队侧**暂时隐去**(业主指示):保存时透传档案原值,⛔ 表单未展示却改写。 */}
|
|
{/* 「指定客户」2026-11-16 起运维团队侧**暂时隐去**(业主指示):保存时透传档案原值,⛔ 表单未展示却改写。 */}
|
|
|
{hasScope && <fieldset className="org-scope-editor org-scope-dropdowns"><legend>负责范围</legend>
|
|
{hasScope && <fieldset className="org-scope-editor org-scope-dropdowns"><legend>负责范围</legend>
|
|
|
<div className="org-field"><span>负责区域</span><MultiTreeSelect nodes={scopeRegionNodes} values={scope.regions} onChange={(regions) => setScope(current => ({ ...current, regions }))} label="负责区域" placeholder="选择负责区域,可多选" searchPlaceholder="搜索区域名称或路径" /></div>
|
|
<div className="org-field"><span>负责区域</span><MultiTreeSelect nodes={scopeRegionNodes} values={scope.regions} onChange={(regions) => setScope(current => ({ ...current, regions }))} label="负责区域" placeholder="选择负责区域,可多选" searchPlaceholder="搜索区域名称或路径" /></div>
|
|
|
- {editor.kind === "partner" && <div className="org-field"><span>指定客户</span>
|
|
|
|
|
- <div className="org-customer-picker">
|
|
|
|
|
- {pickedCustomerIds.length ? <div className="org-check-grid">{pickedCustomerIds.map((id) => {
|
|
|
|
|
- const hit = customerHits.find((item) => item.id === id);
|
|
|
|
|
- const label = hit?.name ?? id;
|
|
|
|
|
- return <label key={id}><input type="checkbox" checked onChange={() => setPickedCustomerIds((current) => current.filter((item) => item !== id))} />{label}<small>{id}</small></label>;
|
|
|
|
|
- })}</div> : <p className="org-helper">未指定客户;可按名称/主体号搜索后勾选(⛔ 全量客户清单)。</p>}
|
|
|
|
|
- <input aria-label="搜索客户" placeholder="搜索客户名称或主体号" value={customerSearch} onChange={(event) => setCustomerSearch(event.target.value)} />
|
|
|
|
|
- <div className="org-check-grid">{customerSearchBusy && !customerHits.length ? <p className="org-helper">搜索中…</p> : null}
|
|
|
|
|
- {customerHits.filter((item) => !pickedCustomerIds.includes(item.id)).slice(0, 20).map((item) => {
|
|
|
|
|
- const blocked = peerPickedCustomerIds.has(item.id);
|
|
|
|
|
- return <label key={item.id}><input type="checkbox" disabled={blocked} checked={false} onChange={() => { if (!blocked) setPickedCustomerIds((current) => [...current, item.id]); }} />{item.name}<small>{blocked ? "已被其他合伙人占用" : item.id}</small></label>;
|
|
|
|
|
- })}
|
|
|
|
|
- {!customerSearchBusy && customerSearch.trim() && !customerHits.length ? <p className="org-helper">无匹配客户</p> : null}
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>}
|
|
|
|
|
|
|
+ {editor.kind === "partner" && <PartnerCustomerPicker selectedIds={pickedCustomerIds} blockedIds={peerPickedCustomerIds} onChange={setPickedCustomerIds} disabled={busy} />}
|
|
|
{editor.kind === "operations" && (() => {
|
|
{editor.kind === "operations" && (() => {
|
|
|
const walk = (nodes: typeof scopeRegionNodes): boolean => nodes.every((n) => Boolean(n.disabled) && (!n.children?.length || walk(n.children)));
|
|
const walk = (nodes: typeof scopeRegionNodes): boolean => nodes.every((n) => Boolean(n.disabled) && (!n.children?.length || walk(n.children)));
|
|
|
const allOccupied = scopeRegionNodes.length > 0 && walk(scopeRegionNodes);
|
|
const allOccupied = scopeRegionNodes.length > 0 && walk(scopeRegionNodes);
|
|
@@ -535,7 +494,6 @@ function OrgEditor({ editor, onClose, onSaved }: { editor: Editor; onClose: () =
|
|
|
{regionCreateNote && <p className="org-account-notice" role="status">{regionCreateNote}</p>}
|
|
{regionCreateNote && <p className="org-account-notice" role="status">{regionCreateNote}</p>}
|
|
|
</div>
|
|
</div>
|
|
|
)}
|
|
)}
|
|
|
- {(editor.kind === "partner" || editor.kind === "maintenance") && <p className="org-helper">同类负责范围互斥:灰色节点已被同类其他主体占用;保存时后端以 KLT-T216 再拦一次。</p>}
|
|
|
|
|
{editor.kind === "maintenance" && <p className="org-helper">指定客户入口已暂时隐去;已有客户清单随档案保留,本弹窗只改负责区域。</p>}
|
|
{editor.kind === "maintenance" && <p className="org-helper">指定客户入口已暂时隐去;已有客户清单随档案保留,本弹窗只改负责区域。</p>}
|
|
|
</fieldset>}
|
|
</fieldset>}
|
|
|
{error && <p className="org-form-error" role="alert">{error}</p>}
|
|
{error && <p className="org-form-error" role="alert">{error}</p>}
|
|
@@ -734,17 +692,10 @@ function RegionNodeDialog({ data, modal, onClose, onSaved }: {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return <div className="org-dialog-backdrop org-editor-modal-backdrop" role="presentation" onMouseDown={onClose}>
|
|
|
|
|
- <section aria-label={title} aria-modal="true" className="org-dialog org-editor-modal org-region-editor-modal" onMouseDown={(e) => e.stopPropagation()} role="dialog">
|
|
|
|
|
- <header>
|
|
|
|
|
- <div>
|
|
|
|
|
- <span className="org-eyebrow">REGION / {modal.kind === "rename" ? "RENAME" : "CREATE"}</span>
|
|
|
|
|
- <h2>{title}</h2>
|
|
|
|
|
- </div>
|
|
|
|
|
- <button aria-label="关闭" className="org-icon-button" onClick={onClose} type="button"><X size={18} /></button>
|
|
|
|
|
- </header>
|
|
|
|
|
- <form onSubmit={submit}>
|
|
|
|
|
- <div className="org-dialog-content">
|
|
|
|
|
|
|
+ return (
|
|
|
|
|
+ <OpsDialog title={title} className="org-region-node-dialog" onClose={onClose}>
|
|
|
|
|
+ <form className="org-region-node-form" onSubmit={submit}>
|
|
|
|
|
+ <div className="org-region-node-fields">
|
|
|
{modal.kind === "create" && !isProvince && parent ? (
|
|
{modal.kind === "create" && !isProvince && parent ? (
|
|
|
<div className="org-region-editor-context">
|
|
<div className="org-region-editor-context">
|
|
|
<span>上级节点</span>
|
|
<span>上级节点</span>
|
|
@@ -766,8 +717,8 @@ function RegionNodeDialog({ data, modal, onClose, onSaved }: {
|
|
|
<button className="org-button" disabled={busy} type="submit">{busy ? "提交中…" : submitLabel}</button>
|
|
<button className="org-button" disabled={busy} type="submit">{busy ? "提交中…" : submitLabel}</button>
|
|
|
</footer>
|
|
</footer>
|
|
|
</form>
|
|
</form>
|
|
|
- </section>
|
|
|
|
|
- </div>;
|
|
|
|
|
|
|
+ </OpsDialog>
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
type RegionTreeMenuState = { id: string; anchor: HTMLElement } | null;
|
|
type RegionTreeMenuState = { id: string; anchor: HTMLElement } | null;
|
|
@@ -1062,22 +1013,28 @@ export function RegionManagementPage() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+function DirectorySortHeader({ label, direction, onSort }: { label: string; direction?: SortDir; onSort: () => void }) {
|
|
|
|
|
+ const SortIcon = direction === "asc" ? ArrowUp : direction === "desc" ? ArrowDown : ArrowUpDown;
|
|
|
|
|
+ return (
|
|
|
|
|
+ <th scope="col" aria-sort={direction === "asc" ? "ascending" : direction === "desc" ? "descending" : undefined}>
|
|
|
|
|
+ <button className="org-directory-sort" type="button" onClick={onSort}>
|
|
|
|
|
+ {label}<SortIcon size={13} aria-hidden="true" />
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </th>
|
|
|
|
|
+ );
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
export function OperatorManagementPage() {
|
|
export function OperatorManagementPage() {
|
|
|
// 名录不依赖客户全集;customer/get_list 曾把首开墙钟拖到 ~1s。
|
|
// 名录不依赖客户全集;customer/get_list 曾把首开墙钟拖到 ~1s。
|
|
|
// 删除校验/编辑弹窗才要 enterprises → 延后补取。
|
|
// 删除校验/编辑弹窗才要 enterprises → 延后补取。
|
|
|
const data = useOrganizationData(["regions", "operators"]);
|
|
const data = useOrganizationData(["regions", "operators"]);
|
|
|
useOrganizationDemand(["enterprises"]);
|
|
useOrganizationDemand(["enterprises"]);
|
|
|
const tableOverflow = useHorizontalOverflow();
|
|
const tableOverflow = useHorizontalOverflow();
|
|
|
- // 操作列空间够:账号+编辑+删除直接展开,⛔ 再收进「更多」。
|
|
|
|
|
- const expandedActions = true;
|
|
|
|
|
- const actionWidth = 168;
|
|
|
|
|
- const dayWidth = 148;
|
|
|
|
|
- const cycleWidth = 72;
|
|
|
|
|
- const customerWidth = 52;
|
|
|
|
|
- const accountWidth = 88;
|
|
|
|
|
- const fixed = dayWidth + cycleWidth + customerWidth + accountWidth + actionWidth;
|
|
|
|
|
- const flex = Math.max(280, (tableOverflow.width || 1200) - fixed);
|
|
|
|
|
- const columnWidths = [flex * .22, flex * .36, dayWidth, cycleWidth, flex * .42, customerWidth, accountWidth, actionWidth];
|
|
|
|
|
|
|
+ const minimumWidths = [112, 107, 107, 100, 100, 100, 100, 186];
|
|
|
|
|
+ const minimumTableWidth = minimumWidths.reduce((sum, width) => sum + width, 0);
|
|
|
|
|
+ const extraWidth = Math.max(0, tableOverflow.width - minimumTableWidth);
|
|
|
|
|
+ const extraShares = [.18, .17, .17, .11, .11, .11, .11, .04];
|
|
|
|
|
+ const columnWidths = minimumWidths.map((width, index) => width + extraWidth * extraShares[index]);
|
|
|
const [query, setQuery] = useState("");
|
|
const [query, setQuery] = useState("");
|
|
|
const regionIds = useMemo(() => new Set(data.regions.map((item) => item.id)), [data.regions]);
|
|
const regionIds = useMemo(() => new Set(data.regions.map((item) => item.id)), [data.regions]);
|
|
|
const [region, setRegion, invalidRegion] = useRegionQueryFilter(regionIds);
|
|
const [region, setRegion, invalidRegion] = useRegionQueryFilter(regionIds);
|
|
@@ -1125,7 +1082,9 @@ export function OperatorManagementPage() {
|
|
|
...rows.map((o) => [o.name, regionPath(data, o.region), reconcileDayText(o, defaultDay), o.payCycle || "未配置", o.sharePending ? "未配置" : `${shareText(o)} · ${o.shareMode}`, o.customerCount ?? "", o.account, o.login || ""]),
|
|
...rows.map((o) => [o.name, regionPath(data, o.region), reconcileDayText(o, defaultDay), o.payCycle || "未配置", o.sharePending ? "未配置" : `${shareText(o)} · ${o.shareMode}`, o.customerCount ?? "", o.account, o.login || ""]),
|
|
|
]);
|
|
]);
|
|
|
}
|
|
}
|
|
|
- const sortAria = (key: OpSort) => sortKey === key ? (sortDir === "asc" ? "ascending" : "descending") : "none";
|
|
|
|
|
|
|
+ function sortHeader(key: OpSort, label: string) {
|
|
|
|
|
+ return <DirectorySortHeader label={label} direction={sortKey === key ? sortDir : undefined} onSort={() => toggleSort(key)} />;
|
|
|
|
|
+ }
|
|
|
return <div className="org-page org-operator-page page-fill">
|
|
return <div className="org-page org-operator-page page-fill">
|
|
|
<PageHead eyebrow="组织与区域 / 02" title="运营商管理" description="按所属区域建立结算对手方档案,集中核对对账口径。" action={<Button onClick={() => setEditor({ kind: "operator" })}><Plus size={16} /> 新增运营商</Button>} />
|
|
<PageHead eyebrow="组织与区域 / 02" title="运营商管理" description="按所属区域建立结算对手方档案,集中核对对账口径。" action={<Button onClick={() => setEditor({ kind: "operator" })}><Plus size={16} /> 新增运营商</Button>} />
|
|
|
<OrgFetchState status={status} collections={["operators"]} />
|
|
<OrgFetchState status={status} collections={["operators"]} />
|
|
@@ -1143,18 +1102,34 @@ export function OperatorManagementPage() {
|
|
|
<FilterResetButton variant="ghost" size="sm" disabled={!rows.length} onClick={exportRows}><Download size={14} /> 导出 CSV</FilterResetButton>
|
|
<FilterResetButton variant="ghost" size="sm" disabled={!rows.length} onClick={exportRows}><Download size={14} /> 导出 CSV</FilterResetButton>
|
|
|
</div>
|
|
</div>
|
|
|
<div ref={tableOverflow.ref} tabIndex={0} role="region" aria-label="运营商列表,可横向滚动查看字段" className={`measured-table-scroll org-table-wrap org-operator-table-scroll${tableOverflow.overflow ? " has-horizontal-overflow" : ""}${tableOverflow.width >= 600 ? " can-pin-identity" : ""}${tableOverflow.canScrollLeft ? " can-scroll-left" : ""}${tableOverflow.canScrollRight ? " can-scroll-right" : ""}`}>
|
|
<div ref={tableOverflow.ref} tabIndex={0} role="region" aria-label="运营商列表,可横向滚动查看字段" className={`measured-table-scroll org-table-wrap org-operator-table-scroll${tableOverflow.overflow ? " has-horizontal-overflow" : ""}${tableOverflow.width >= 600 ? " can-pin-identity" : ""}${tableOverflow.canScrollLeft ? " can-scroll-left" : ""}${tableOverflow.canScrollRight ? " can-scroll-right" : ""}`}>
|
|
|
- <table className="org-table org-operator-ledger"><OpsTableColumns widths={columnWidths} />
|
|
|
|
|
- <thead><tr><th className="sortable" aria-sort={sortAria("name")} onClick={() => toggleSort("name")}>运营商</th><th className="sortable" aria-sort={sortAria("region")} onClick={() => toggleSort("region")}>所属区域</th><th>对账日</th><th>付款周期</th><th>分成规则</th><th className="sortable" aria-sort={sortAria("customers")} onClick={() => toggleSort("customers")}>客户</th><th>账号</th><th className="org-table-actions-heading">操作</th></tr></thead>
|
|
|
|
|
|
|
+ <table className="org-table org-operator-ledger" style={{ minWidth: minimumTableWidth }}>
|
|
|
|
|
+ <OpsTableColumns widths={columnWidths} />
|
|
|
|
|
+ <thead>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ {sortHeader("name", "运营商")}
|
|
|
|
|
+ {sortHeader("region", "所属区域")}
|
|
|
|
|
+ <th scope="col">对账日</th>
|
|
|
|
|
+ <th scope="col">付款周期</th>
|
|
|
|
|
+ <th scope="col">分成规则</th>
|
|
|
|
|
+ {sortHeader("customers", "客户数")}
|
|
|
|
|
+ <th scope="col">账号状态</th>
|
|
|
|
|
+ <th scope="col" className="org-table-actions-heading">操作</th>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
<tbody>{!status.partial.operators && pageRows.map((o) => {
|
|
<tbody>{!status.partial.operators && pageRows.map((o) => {
|
|
|
const shareLabel = o.sharePending ? "未配置" : `${shareText(o)} · ${o.shareMode}`;
|
|
const shareLabel = o.sharePending ? "未配置" : `${shareText(o)} · ${o.shareMode}`;
|
|
|
const accountOpened = o.account !== "未开通";
|
|
const accountOpened = o.account !== "未开通";
|
|
|
return <tr className={selected === o.id ? "selected" : ""} key={o.id} tabIndex={0} aria-label={`查看${regionPath(data, o.region)}${o.name}档案`} onKeyDown={(event) => { if (event.key === "Enter" && event.target === event.currentTarget) setSelected(o.id); }} onClick={() => setSelected(o.id)}>
|
|
return <tr className={selected === o.id ? "selected" : ""} key={o.id} tabIndex={0} aria-label={`查看${regionPath(data, o.region)}${o.name}档案`} onKeyDown={(event) => { if (event.key === "Enter" && event.target === event.currentTarget) setSelected(o.id); }} onClick={() => setSelected(o.id)}>
|
|
|
- <td><strong title={o.name}>{o.name}</strong></td>
|
|
|
|
|
|
|
+ <td className="org-directory-identity"><span className="org-directory-name table-cell-title" title={o.name}>{o.name}</span>{o.brand && <small>{o.brand}</small>}</td>
|
|
|
<td title={regionPath(data, o.region)}>{regionPath(data, o.region)}</td>
|
|
<td title={regionPath(data, o.region)}>{regionPath(data, o.region)}</td>
|
|
|
- <td><span title={reconcileDayTitle(o, defaultDay)}>{reconcileDayText(o, defaultDay)}</span></td>
|
|
|
|
|
- <td>{o.payCycle || "未配置"}</td>
|
|
|
|
|
- <td title={shareLabel}>{shareLabel}</td>
|
|
|
|
|
- <td className="org-number"><Count v={o.customerCount} /></td>
|
|
|
|
|
|
|
+ <td><span className="org-directory-value" title={reconcileDayTitle(o, defaultDay)}>{reconcileDayText(o, defaultDay)}</span></td>
|
|
|
|
|
+ <td title={o.payCycle || undefined}><TableValueText>{o.payCycle || "未配置"}</TableValueText></td>
|
|
|
|
|
+ <td title={shareLabel}>
|
|
|
|
|
+ {o.sharePending ? <TableValueText>{shareLabel}</TableValueText> : (
|
|
|
|
|
+ <><span className="org-directory-value org-directory-share-value">{shareText(o)}</span><small>{o.shareMode}</small></>
|
|
|
|
|
+ )}
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td className="org-directory-customer-count"><Count v={o.customerCount} />{typeof o.customerCount === "number" ? " 家" : null}</td>
|
|
|
<td>{/* 账号列只显示状态徽标;登录名/手机号挂 title,悬停可见。 */}
|
|
<td>{/* 账号列只显示状态徽标;登录名/手机号挂 title,悬停可见。 */}
|
|
|
<OrganizationAccountStatus
|
|
<OrganizationAccountStatus
|
|
|
status={o.account}
|
|
status={o.account}
|
|
@@ -1164,8 +1139,8 @@ export function OperatorManagementPage() {
|
|
|
/>
|
|
/>
|
|
|
</td>
|
|
</td>
|
|
|
<td className="org-table-actions-cell"><div className="org-table-actions is-icons">
|
|
<td className="org-table-actions-cell"><div className="org-table-actions is-icons">
|
|
|
- <button className="is-account" onClick={(event) => { event.stopPropagation(); setSelected(o.id); setAccountTarget({ kind: "operator", id: o.id }); }} type="button"><UserRound size={15} />账号</button>
|
|
|
|
|
- <OpsResponsiveActions expanded={expandedActions} items={[
|
|
|
|
|
|
|
+ <button className="is-account" aria-haspopup="dialog" onClick={(event) => { event.stopPropagation(); setSelected(o.id); setAccountTarget({ kind: "operator", id: o.id }); }} type="button"><UserRound size={15} />账号</button>
|
|
|
|
|
+ <OpsResponsiveActions expanded items={[
|
|
|
{ label: "编辑", icon: <PencilLine size={15} />, onSelect: () => { setSelected(o.id); setEditor({ kind: "operator", id: o.id }); } },
|
|
{ label: "编辑", icon: <PencilLine size={15} />, onSelect: () => { setSelected(o.id); setEditor({ kind: "operator", id: o.id }); } },
|
|
|
{ label: "删除", danger: true, icon: <Trash2 size={15} />, onSelect: () => { setSelected(o.id); setDeleteId(o.id); } },
|
|
{ label: "删除", danger: true, icon: <Trash2 size={15} />, onSelect: () => { setSelected(o.id); setDeleteId(o.id); } },
|
|
|
]} />
|
|
]} />
|
|
@@ -1189,13 +1164,11 @@ export function PartnerManagementPage() {
|
|
|
const data = useOrganizationData(["regions", "partners"]);
|
|
const data = useOrganizationData(["regions", "partners"]);
|
|
|
useOrganizationDemand(["enterprises"]);
|
|
useOrganizationDemand(["enterprises"]);
|
|
|
const tableOverflow = useHorizontalOverflow();
|
|
const tableOverflow = useHorizontalOverflow();
|
|
|
- // 2026-11-16 业主指示:合伙人操作列只有「编辑」「删除」两项,直接平铺,⛔ 收进「更多」菜单。
|
|
|
|
|
- const actionWidth = 180;
|
|
|
|
|
- const remaining = Math.max(0, (tableOverflow.width || 1200) - 180 - actionWidth);
|
|
|
|
|
- // 8 列:合伙人、所属区域、登录账号、分成方式、分成值、负责范围、覆盖客户、操作
|
|
|
|
|
- // 注意:Partner 表头只有一列「操作」,账号动作已并入「编辑合伙人」(2026-11-16),actionWidth 只承载右侧操作按钮组;
|
|
|
|
|
- // 不要像运营商/运营团队那样把数值列(客户数、账号状态)也给一个固定宽度——那些在这里已经被并入前面权重里了。
|
|
|
|
|
- const columnWidths = [.18, .20, .16, .14, .14, .24, .14].map((w) => remaining * w).concat([actionWidth]);
|
|
|
|
|
|
|
+ const minimumWidths = [122, 108, 110, 84, 96, 150, 88, 186];
|
|
|
|
|
+ const minimumTableWidth = minimumWidths.reduce((sum, width) => sum + width, 0);
|
|
|
|
|
+ const extraWidth = Math.max(0, tableOverflow.width - minimumTableWidth);
|
|
|
|
|
+ const extraShares = [.22, .18, .17, .07, .10, .26, 0, 0];
|
|
|
|
|
+ const columnWidths = minimumWidths.map((width, index) => width + extraWidth * extraShares[index]);
|
|
|
const [query, setQuery] = useState("");
|
|
const [query, setQuery] = useState("");
|
|
|
const regionIds = useMemo(() => new Set(data.regions.map((item) => item.id)), [data.regions]);
|
|
const regionIds = useMemo(() => new Set(data.regions.map((item) => item.id)), [data.regions]);
|
|
|
const [region, setRegion, invalidRegion] = useRegionQueryFilter(regionIds);
|
|
const [region, setRegion, invalidRegion] = useRegionQueryFilter(regionIds);
|
|
@@ -1204,6 +1177,7 @@ export function PartnerManagementPage() {
|
|
|
const saveNotice = useSaveNotice();
|
|
const saveNotice = useSaveNotice();
|
|
|
const [selected, setSelected] = useState<string | null>(data.partners[0]?.id ?? null);
|
|
const [selected, setSelected] = useState<string | null>(data.partners[0]?.id ?? null);
|
|
|
const [deleteId, setDeleteId] = useState<string | null>(null);
|
|
const [deleteId, setDeleteId] = useState<string | null>(null);
|
|
|
|
|
+ const [accountTarget, setAccountTarget] = useState<AccountTarget | null>(null);
|
|
|
const status = useOrganizationStatus();
|
|
const status = useOrganizationStatus();
|
|
|
const filtered = data.partners.filter((p) => (!region || descendants(data, region).includes(p.region)) && `${p.name} ${p.title} ${p.notify}`.toLowerCase().includes(query.trim().toLowerCase()));
|
|
const filtered = data.partners.filter((p) => (!region || descendants(data, region).includes(p.region)) && `${p.name} ${p.title} ${p.notify}`.toLowerCase().includes(query.trim().toLowerCase()));
|
|
|
type PtSort = "name" | "region" | "coverage";
|
|
type PtSort = "name" | "region" | "coverage";
|
|
@@ -1231,7 +1205,9 @@ export function PartnerManagementPage() {
|
|
|
...rows.map((p) => [p.name, p.title || "", regionPath(data, p.region), p.login || "", p.account, p.shareMode, p.sharePending ? "未配置" : shareText(p), scopeSummary(data, p.scope, p.scopeCustomerIds), p.coverageCustomers ?? ""]),
|
|
...rows.map((p) => [p.name, p.title || "", regionPath(data, p.region), p.login || "", p.account, p.shareMode, p.sharePending ? "未配置" : shareText(p), scopeSummary(data, p.scope, p.scopeCustomerIds), p.coverageCustomers ?? ""]),
|
|
|
]);
|
|
]);
|
|
|
}
|
|
}
|
|
|
- const sortAria = (key: PtSort) => sortKey === key ? (sortDir === "asc" ? "ascending" : "descending") : "none";
|
|
|
|
|
|
|
+ function sortHeader(key: PtSort, label: string) {
|
|
|
|
|
+ return <DirectorySortHeader label={label} direction={sortKey === key ? sortDir : undefined} onSort={() => toggleSort(key)} />;
|
|
|
|
|
+ }
|
|
|
return <div className="org-page org-partner-page page-fill"><PageHead eyebrow="组织与区域 / 03" title="合伙人管理" description="为渠道合伙人建档,明确客户覆盖范围和分成约定。" action={<Button onClick={() => setEditor({ kind: "partner" })}><Plus size={16} /> 新建合伙人</Button>} />
|
|
return <div className="org-page org-partner-page page-fill"><PageHead eyebrow="组织与区域 / 03" title="合伙人管理" description="为渠道合伙人建档,明确客户覆盖范围和分成约定。" action={<Button onClick={() => setEditor({ kind: "partner" })}><Plus size={16} /> 新建合伙人</Button>} />
|
|
|
<OrgFetchState status={status} collections={["partners"]} />
|
|
<OrgFetchState status={status} collections={["partners"]} />
|
|
|
<CollectionFailed status={status} collection="partners" title="合伙人" />
|
|
<CollectionFailed status={status} collection="partners" title="合伙人" />
|
|
@@ -1239,14 +1215,70 @@ export function PartnerManagementPage() {
|
|
|
<div className="org-ledger list-shell-fill"><section className="org-ledger-main list-shell-fill">
|
|
<div className="org-ledger list-shell-fill"><section className="org-ledger-main list-shell-fill">
|
|
|
<div className="org-filterbar"><SearchBox onChange={(value) => { setQuery(value); paging.resetPage(); }} placeholder="搜索合伙人名称、渠道说明或通知地址" value={query} /><RegionSelect all data={data} onChange={(value) => { setRegion(value); paging.resetPage(); }} value={region} />{(query || region) && <FilterResetButton variant="ghost" size="sm" onClick={() => { setQuery(""); setRegion(""); paging.resetPage(); }}>重置筛选</FilterResetButton>}<FilterResetButton variant="ghost" size="sm" disabled={!rows.length} onClick={exportRows}><Download size={14} /> 导出 CSV</FilterResetButton></div>
|
|
<div className="org-filterbar"><SearchBox onChange={(value) => { setQuery(value); paging.resetPage(); }} placeholder="搜索合伙人名称、渠道说明或通知地址" value={query} /><RegionSelect all data={data} onChange={(value) => { setRegion(value); paging.resetPage(); }} value={region} />{(query || region) && <FilterResetButton variant="ghost" size="sm" onClick={() => { setQuery(""); setRegion(""); paging.resetPage(); }}>重置筛选</FilterResetButton>}<FilterResetButton variant="ghost" size="sm" disabled={!rows.length} onClick={exportRows}><Download size={14} /> 导出 CSV</FilterResetButton></div>
|
|
|
<div ref={tableOverflow.ref} tabIndex={0} role="region" aria-label="合伙人名录,可横向滚动查看字段" className={`measured-table-scroll org-table-wrap org-partner-table-scroll${tableOverflow.overflow ? " has-horizontal-overflow" : ""}${tableOverflow.width >= 600 ? " can-pin-identity" : ""}${tableOverflow.canScrollLeft ? " can-scroll-left" : ""}${tableOverflow.canScrollRight ? " can-scroll-right" : ""}`}>
|
|
<div ref={tableOverflow.ref} tabIndex={0} role="region" aria-label="合伙人名录,可横向滚动查看字段" className={`measured-table-scroll org-table-wrap org-partner-table-scroll${tableOverflow.overflow ? " has-horizontal-overflow" : ""}${tableOverflow.width >= 600 ? " can-pin-identity" : ""}${tableOverflow.canScrollLeft ? " can-scroll-left" : ""}${tableOverflow.canScrollRight ? " can-scroll-right" : ""}`}>
|
|
|
- <table className="org-table org-partner-ledger"><OpsTableColumns widths={columnWidths} /><thead><tr><th className="sortable" aria-sort={sortAria("name")} onClick={() => toggleSort("name")}>合伙人</th><th className="sortable" aria-sort={sortAria("region")} onClick={() => toggleSort("region")}>所属区域</th><th>登录账号</th><th>分成方式</th><th>分成值</th><th>负责范围</th><th className="sortable" aria-sort={sortAria("coverage")} onClick={() => toggleSort("coverage")}>覆盖客户</th><th className="org-table-actions-heading">操作</th></tr></thead><tbody>{!status.partial.partners && pageRows.map((p) => <tr className={selected === p.id ? "selected" : ""} key={p.id} tabIndex={0} aria-label={`查看${regionPath(data, p.region)}${p.name}档案`} onKeyDown={(event) => { if (event.key === "Enter" && event.target === event.currentTarget) setSelected(p.id); }} onClick={() => setSelected(p.id)}><td><strong title={p.name}>{p.name}</strong><small>{p.title || "未填写渠道说明"}</small></td><td title={regionPath(data, p.region)}>{regionPath(data, p.region)}</td><td><OrganizationAccountStatus status={p.account} /><small>{p.login || "尚未设置登录名"}</small></td><td className="org-maintenance-share"><strong>{p.shareMode}</strong></td><td className="org-maintenance-share">{p.sharePending ? <Tri tone="missing" text="未配置" title="档案里分成方式/分成值为空=尚未配置,不是后端未下发" /> : <span className="org-number">{shareText(p)}</span>}</td><td className="org-maintenance-scope-cell" title={scopeSummary(data, p.scope, p.scopeCustomerIds)}>{scopeSummary(data, p.scope, p.scopeCustomerIds)}</td><td className="org-number"><Count v={p.coverageCustomers} /></td><td className="org-table-actions-cell"><div className="org-table-actions is-icons"><OpsResponsiveActions expanded items={[
|
|
|
|
|
- { label: "编辑合伙人", shortLabel: "编辑", icon: <PencilLine size={15} />, onSelect: () => { setSelected(p.id); setEditor({ kind: "partner", id: p.id }); } },
|
|
|
|
|
- { label: "删除合伙人", shortLabel: "删除", danger: true, icon: <Trash2 size={15} />, onSelect: () => { setSelected(p.id); setDeleteId(p.id); } },
|
|
|
|
|
- ]} /></div></td></tr>)}</tbody></table>{!rows.length && <Empty filtered={Boolean(query || region)} />}
|
|
|
|
|
|
|
+ <table className="org-table org-partner-ledger" style={{ minWidth: minimumTableWidth }}>
|
|
|
|
|
+ <OpsTableColumns widths={columnWidths} />
|
|
|
|
|
+ <thead>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ {sortHeader("name", "合伙人")}
|
|
|
|
|
+ {sortHeader("region", "所属区域")}
|
|
|
|
|
+ <th scope="col">登录账号</th>
|
|
|
|
|
+ <th scope="col">分成方式</th>
|
|
|
|
|
+ <th scope="col">分成值</th>
|
|
|
|
|
+ <th scope="col">负责范围</th>
|
|
|
|
|
+ {sortHeader("coverage", "覆盖客户")}
|
|
|
|
|
+ <th scope="col" className="org-table-actions-heading">操作</th>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <tbody>
|
|
|
|
|
+ {!status.partial.partners && pageRows.map((p) => {
|
|
|
|
|
+ const regionName = regionPath(data, p.region);
|
|
|
|
|
+ const scopeLabel = scopeSummary(data, p.scope, p.scopeCustomerIds);
|
|
|
|
|
+ return (
|
|
|
|
|
+ <tr
|
|
|
|
|
+ className={selected === p.id ? "selected" : ""}
|
|
|
|
|
+ key={p.id}
|
|
|
|
|
+ tabIndex={0}
|
|
|
|
|
+ aria-label={`查看${regionName}${p.name}档案`}
|
|
|
|
|
+ onKeyDown={(event) => { if (event.key === "Enter" && event.target === event.currentTarget) setSelected(p.id); }}
|
|
|
|
|
+ onClick={() => setSelected(p.id)}
|
|
|
|
|
+ >
|
|
|
|
|
+ <td className="org-directory-identity">
|
|
|
|
|
+ <span className="org-directory-name table-cell-title" title={p.name}>{p.name}</span>
|
|
|
|
|
+ <small title={p.title || undefined}>{p.title || "未填写渠道说明"}</small>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td title={regionName}>{regionName}</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <OrganizationAccountStatus status={p.account} />
|
|
|
|
|
+ <small title={p.login || undefined}>{p.login || "尚未设置登录名"}</small>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>{p.shareMode}</td>
|
|
|
|
|
+ <td title={p.sharePending ? undefined : shareText(p)}>
|
|
|
|
|
+ {p.sharePending ? (
|
|
|
|
|
+ <Tri tone="missing" text="未配置" title="档案里分成方式/分成值为空=尚未配置,不是后端未下发" />
|
|
|
|
|
+ ) : <span className="org-directory-value org-directory-share-value">{shareText(p)}</span>}
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td title={scopeLabel}><TableValueText>{scopeLabel}</TableValueText></td>
|
|
|
|
|
+ <td className="org-directory-customer-count"><Count v={p.coverageCustomers} /></td>
|
|
|
|
|
+ <td className="org-table-actions-cell">
|
|
|
|
|
+ <div className="org-table-actions is-icons">
|
|
|
|
|
+ <button className="is-account" aria-haspopup="dialog" onClick={(event) => { event.stopPropagation(); setSelected(p.id); setAccountTarget({ kind: "partner", id: p.id }); }} type="button"><UserRound size={15} />账号</button>
|
|
|
|
|
+ <OpsResponsiveActions expanded items={[
|
|
|
|
|
+ { label: "编辑合伙人", shortLabel: "编辑", icon: <PencilLine size={15} />, onSelect: () => { setSelected(p.id); setEditor({ kind: "partner", id: p.id }); } },
|
|
|
|
|
+ { label: "删除合伙人", shortLabel: "删除", danger: true, icon: <Trash2 size={15} />, onSelect: () => { setSelected(p.id); setDeleteId(p.id); } },
|
|
|
|
|
+ ]} />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ );
|
|
|
|
|
+ })}
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ {!rows.length && <Empty filtered={Boolean(query || region)} />}
|
|
|
</div>
|
|
</div>
|
|
|
<ListPager total={rows.length} page={paging.safePage} pageSize={paging.pageSize} onPageChange={paging.setPage} onPageSizeChange={paging.setPageSize} unit="位" className="org-list-pager" />
|
|
<ListPager total={rows.length} page={paging.safePage} pageSize={paging.pageSize} onPageChange={paging.setPage} onPageSizeChange={paging.setPageSize} unit="位" className="org-list-pager" />
|
|
|
</section></div>
|
|
</section></div>
|
|
|
{saveNotice.node}{editor && <OrgEditor key={editor.id ?? "new"} editor={editor} onClose={() => setEditor(null)} onSaved={saveNotice.show} />}
|
|
{saveNotice.node}{editor && <OrgEditor key={editor.id ?? "new"} editor={editor} onClose={() => setEditor(null)} onSaved={saveNotice.show} />}
|
|
|
|
|
+ {accountTarget && <OrganizationAccountDialog target={accountTarget} onClose={() => setAccountTarget(null)} />}
|
|
|
{deleteId && <DeleteDialog data={data} id={deleteId} kind="partner" name={data.partners.find((p) => p.id === deleteId)?.name ?? ""} onClose={() => setDeleteId(null)} onDeleted={() => setSelected(null)} />}
|
|
{deleteId && <DeleteDialog data={data} id={deleteId} kind="partner" name={data.partners.find((p) => p.id === deleteId)?.name ?? ""} onClose={() => setDeleteId(null)} onDeleted={() => setSelected(null)} />}
|
|
|
</div>;
|
|
</div>;
|
|
|
}
|
|
}
|
|
@@ -1306,7 +1338,7 @@ export function OperationsTeamManagementPage() {
|
|
|
<div className="org-maintenance-ledger-shell list-shell-fill">
|
|
<div className="org-maintenance-ledger-shell list-shell-fill">
|
|
|
<div className="ops-toolbar"><SearchBox onChange={(value) => { setQuery(value); paging.resetPage(); }} placeholder="搜索团队名称、说明或负责范围" value={query} /><RegionSelect all data={data} onChange={(value) => { setRegionFilter(value); paging.resetPage(); }} value={regionFilter} />{(query || regionFilter) && <FilterResetButton variant="ghost" size="sm" onClick={() => { setQuery(""); setRegionFilter(""); paging.resetPage(); }}>重置筛选</FilterResetButton>}<FilterResetButton variant="ghost" size="sm" disabled={!teams.length} onClick={exportRows}><Download size={14} /> 导出 CSV</FilterResetButton></div>
|
|
<div className="ops-toolbar"><SearchBox onChange={(value) => { setQuery(value); paging.resetPage(); }} placeholder="搜索团队名称、说明或负责范围" value={query} /><RegionSelect all data={data} onChange={(value) => { setRegionFilter(value); paging.resetPage(); }} value={regionFilter} />{(query || regionFilter) && <FilterResetButton variant="ghost" size="sm" onClick={() => { setQuery(""); setRegionFilter(""); paging.resetPage(); }}>重置筛选</FilterResetButton>}<FilterResetButton variant="ghost" size="sm" disabled={!teams.length} onClick={exportRows}><Download size={14} /> 导出 CSV</FilterResetButton></div>
|
|
|
<div ref={tableOverflow.ref} tabIndex={0} role="region" aria-label="运营团队台账,可横向滚动查看字段" className={`measured-table-scroll org-table-wrap org-team-table-scroll${tableOverflow.overflow ? " has-horizontal-overflow" : ""}${tableOverflow.canScrollLeft ? " can-scroll-left" : ""}${tableOverflow.canScrollRight ? " can-scroll-right" : ""}`}><table className="org-table org-operations-ledger-table org-team-ledger"><OpsTableColumns widths={columnWidths} /><thead><tr><th className="sortable" aria-sort={sortAria("name")} onClick={() => toggleSort("name")}>团队 / 说明</th><th className="sortable" aria-sort={sortAria("region")} onClick={() => toggleSort("region")}>所属区域</th><th>分成规则</th><th>负责范围</th><th className="sortable" aria-sort={sortAria("coverage")} onClick={() => toggleSort("coverage")}>覆盖客户</th><th className="sortable" aria-sort={sortAria("members")} onClick={() => toggleSort("members")}>成员账号</th><th className="org-table-actions-heading">操作</th></tr></thead><tbody>{pageTeams.map((team) => {
|
|
<div ref={tableOverflow.ref} tabIndex={0} role="region" aria-label="运营团队台账,可横向滚动查看字段" className={`measured-table-scroll org-table-wrap org-team-table-scroll${tableOverflow.overflow ? " has-horizontal-overflow" : ""}${tableOverflow.canScrollLeft ? " can-scroll-left" : ""}${tableOverflow.canScrollRight ? " can-scroll-right" : ""}`}><table className="org-table org-operations-ledger-table org-team-ledger"><OpsTableColumns widths={columnWidths} /><thead><tr><th className="sortable" aria-sort={sortAria("name")} onClick={() => toggleSort("name")}>团队 / 说明</th><th className="sortable" aria-sort={sortAria("region")} onClick={() => toggleSort("region")}>所属区域</th><th>分成规则</th><th>负责范围</th><th className="sortable" aria-sort={sortAria("coverage")} onClick={() => toggleSort("coverage")}>覆盖客户</th><th className="sortable" aria-sort={sortAria("members")} onClick={() => toggleSort("members")}>成员账号</th><th className="org-table-actions-heading">操作</th></tr></thead><tbody>{pageTeams.map((team) => {
|
|
|
- return <tr key={team.id}><td><div className="org-operations-team-name"><strong title={team.name}>{team.name}</strong>{team.hq && <span>总部内置</span>}</div><small title={team.desc || "尚未填写团队说明"}>{team.desc || "尚未填写团队说明"}</small></td><td>{team.hq ? "总部 · 不限区域" : operationsRegionLabel(data, team.region)}</td><td className="org-maintenance-share"><strong>{shareText(team)}</strong><small>{team.shareMode}</small></td><td className="org-maintenance-scope-cell" title={scopeSummary(data, team.scope)}>{scopeSummary(data, team.scope)}</td><td className="org-number"><Count v={team.coverageCustomers} /> 家</td><td>{team.members.length || (team.memberCount ?? 0) > 0 ? <span className="org-member-count" title={team.membersPending || undefined}><strong><Count v={team.memberCount} />{typeof team.memberCount === "number" ? " 个" : null}</strong>{team.membersPending ? <span aria-label={team.membersPending} className="org-member-count-hint" role="img" title={team.membersPending}><Info aria-hidden="true" size={13} /></span> : null}</span> : <OrganizationAccountStatus status="未开通" />}</td><td className="org-table-actions-cell"><div className="org-table-actions is-icons"><Link className="org-maintenance-account-link" to={`/organization/operations-teams/${encodeURIComponent(team.id)}/accounts`}><UserRound size={15} />账号</Link>{!teamReadOnly && <OpsResponsiveActions expanded={expandedActions} items={[
|
|
|
|
|
|
|
+ return <tr key={team.id}><td><div className="org-operations-team-name"><strong className="table-cell-title" title={team.name}>{team.name}</strong>{team.hq && <OpsTag tone="brand">总部内置</OpsTag>}</div><small title={team.desc || "尚未填写团队说明"}>{team.desc || "尚未填写团队说明"}</small></td><td>{team.hq ? "总部 · 不限区域" : operationsRegionLabel(data, team.region)}</td><td className="org-maintenance-share"><strong>{shareText(team)}</strong><small>{team.shareMode}</small></td><td className="org-maintenance-scope-cell" title={scopeSummary(data, team.scope)}><TableValueText>{scopeSummary(data, team.scope)}</TableValueText></td><td className="org-directory-customer-count"><Count v={team.coverageCustomers} />{typeof team.coverageCustomers === "number" ? " 家" : null}</td><td className="org-directory-customer-count">{team.members.length || (team.memberCount ?? 0) > 0 ? <span className="org-member-count" title={team.membersPending || undefined}><span><Count v={team.memberCount} />{typeof team.memberCount === "number" ? " 个" : null}</span>{team.membersPending ? <span aria-label={team.membersPending} className="org-member-count-hint" role="img" title={team.membersPending}><Info aria-hidden="true" size={13} /></span> : null}</span> : <OrganizationAccountStatus status="未开通" />}</td><td className="org-table-actions-cell"><div className="org-table-actions is-icons"><Link className="org-maintenance-account-link" to={`/organization/operations-teams/${encodeURIComponent(team.id)}/accounts`}><UserRound size={15} />账号</Link>{!teamReadOnly && <OpsResponsiveActions expanded={expandedActions} items={[
|
|
|
{ label: "编辑团队", shortLabel: "编辑", icon: <PencilLine size={15} />, onSelect: () => setEditor({ kind: "operations", id: team.id }) },
|
|
{ label: "编辑团队", shortLabel: "编辑", icon: <PencilLine size={15} />, onSelect: () => setEditor({ kind: "operations", id: team.id }) },
|
|
|
...(!team.hq ? [{ label: "删除团队", shortLabel: "删除", danger: true, icon: <Trash2 size={15} />, onSelect: () => setDeleteId(team.id) }] : []),
|
|
...(!team.hq ? [{ label: "删除团队", shortLabel: "删除", danger: true, icon: <Trash2 size={15} />, onSelect: () => setDeleteId(team.id) }] : []),
|
|
|
]} />}</div></td></tr>;
|
|
]} />}</div></td></tr>;
|
|
@@ -1318,16 +1350,68 @@ export function OperationsTeamManagementPage() {
|
|
|
</div>;
|
|
</div>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+function TeamAccountsSummary({ name, kind, icon, details, memberCount, coverage, scope, metric }: {
|
|
|
|
|
+ name: string;
|
|
|
|
|
+ kind: string;
|
|
|
|
|
+ icon: ReactNode;
|
|
|
|
|
+ details: ReactNode;
|
|
|
|
|
+ memberCount: number | null | undefined;
|
|
|
|
|
+ coverage: { label: string; count: number };
|
|
|
|
|
+ scope: string;
|
|
|
|
|
+ metric: { label: string; icon: ReactNode; value: string; description?: string };
|
|
|
|
|
+}) {
|
|
|
|
|
+ return <>
|
|
|
|
|
+ <header className="customer-record-masthead">
|
|
|
|
|
+ <div className="customer-hero-symbol" aria-hidden="true">{icon}</div>
|
|
|
|
|
+ <div className="customer-hero-copy">
|
|
|
|
|
+ <p className="customer-record-id">{kind}</p>
|
|
|
|
|
+ <h1 className="customer-record-title">{name} · 账号管理</h1>
|
|
|
|
|
+ <div className="customer-record-tags">{details}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </header>
|
|
|
|
|
+ <dl className="customer-record-metrics" aria-label="团队业务摘要">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <dt><Users size={16} aria-hidden="true" />成员账号</dt>
|
|
|
|
|
+ <dd>{memberCount == null ? <Count v={memberCount} /> : <><strong>{memberCount}</strong> <span className="org-team-metric-unit">个</span></>}</dd>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <dt><Building2 size={16} aria-hidden="true" />{coverage.label}</dt>
|
|
|
|
|
+ <dd><strong>{coverage.count}</strong> <span className="org-team-metric-unit">家</span></dd>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <dt><MapPinned size={16} aria-hidden="true" />团队负责范围</dt>
|
|
|
|
|
+ <dd className="org-team-metric-text">{scope}</dd>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <dt>{metric.icon}{metric.label}</dt>
|
|
|
|
|
+ <dd className="org-team-metric-text">{metric.value}{metric.description && <small>{metric.description}</small>}</dd>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </dl>
|
|
|
|
|
+ </>;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
export function OperationsTeamAccountsPage() {
|
|
export function OperationsTeamAccountsPage() {
|
|
|
const { id } = useParams();
|
|
const { id } = useParams();
|
|
|
const data = useOrganizationData(["regions", "operationsTeams", "enterprises"]);
|
|
const data = useOrganizationData(["regions", "operationsTeams", "enterprises"]);
|
|
|
const team = data.operationsTeams.find((item) => item.id === id);
|
|
const team = data.operationsTeams.find((item) => item.id === id);
|
|
|
if (!team) return <div className="org-page"><Link className="org-back-link" to="/organization/operations-teams"><ArrowLeft size={16} />返回运营团队</Link><Empty>团队不存在或已被删除</Empty></div>;
|
|
if (!team) return <div className="org-page"><Link className="org-back-link" to="/organization/operations-teams"><ArrowLeft size={16} />返回运营团队</Link><Empty>团队不存在或已被删除</Empty></div>;
|
|
|
const covered = scopeEnterpriseIndexes(data, team.scope);
|
|
const covered = scopeEnterpriseIndexes(data, team.scope);
|
|
|
- return <div className="org-page org-operations-accounts-page"><Link className="org-back-link" to="/organization/operations-teams"><ArrowLeft size={16} />返回运营团队</Link>
|
|
|
|
|
- <header className="org-maintenance-accounts-hero"><div className="org-team-accounts-title"><span className="org-team-accounts-icon"><Users size={25} /></span><div><span className="org-eyebrow">OPERATIONS / ACCOUNTS</span><h1>{team.name} · 账号管理</h1><PageIntro>为团队成员开通账号,明确各自的业务权限。</PageIntro><p>{team.hq ? "总部 · 不限区域" : operationsRegionLabel(data, team.region)} · {team.desc || "运营团队"}</p></div></div><span>{team.memberCount ?? team.members.length} 个成员账号</span></header>
|
|
|
|
|
- <div className="org-maintenance-accounts-context"><div><span>团队负责范围</span><strong>{scopeSummary(data, team.scope)}</strong></div><div><span>覆盖客户</span><strong>{covered.length} 家</strong></div><div><span>团队分成</span><strong>{team.shareMode} · {shareText(team)}</strong><small>{team.hq ? "总部内置团队" : "按团队档案执行"}</small></div></div>
|
|
|
|
|
- <section className="org-maintenance-accounts-body"><OperationsAccounts key={team.id} team={team} /></section>
|
|
|
|
|
|
|
+ return <div className="org-page org-team-accounts-page">
|
|
|
|
|
+ <Link className="org-back-link" to="/organization/operations-teams"><ArrowLeft size={16} />返回运营团队</Link>
|
|
|
|
|
+ <TeamAccountsSummary
|
|
|
|
|
+ name={team.name}
|
|
|
|
|
+ kind="OPERATIONS / ACCOUNTS"
|
|
|
|
|
+ icon={<Users size={26} />}
|
|
|
|
|
+ details={<>
|
|
|
|
|
+ <span className="customer-record-meta"><MapPinned size={14} aria-hidden="true" /><span>{team.hq ? "总部 · 不限区域" : operationsRegionLabel(data, team.region)}</span></span>
|
|
|
|
|
+ {team.desc && <span className="customer-record-meta">{team.desc}</span>}
|
|
|
|
|
+ </>}
|
|
|
|
|
+ memberCount={team.memberCount ?? (team.members.length || team.memberCount)}
|
|
|
|
|
+ coverage={{ label: "覆盖客户", count: covered.length }}
|
|
|
|
|
+ scope={scopeSummary(data, team.scope)}
|
|
|
|
|
+ metric={{ label: "团队分成", icon: <UserRound size={16} aria-hidden="true" />, value: `${team.shareMode} · ${shareText(team)}`, description: team.hq ? "总部内置团队" : "按团队档案执行" }}
|
|
|
|
|
+ />
|
|
|
|
|
+ <section className="org-team-accounts-list" aria-label="账号列表"><OperationsAccounts key={team.id} team={team} /></section>
|
|
|
</div>;
|
|
</div>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1406,7 +1490,7 @@ export function MaintenanceTeamLedgerPage() {
|
|
|
<div className="org-maintenance-ledger-shell list-shell-fill">
|
|
<div className="org-maintenance-ledger-shell list-shell-fill">
|
|
|
<div className="ops-toolbar"><SearchBox onChange={(value) => { setQuery(value); paging.resetPage(); }} placeholder="搜索团队名称、区域路径、说明或成员" value={query} /><RegionSelect all data={data} onChange={(value) => { setRegionFilter(value); paging.resetPage(); }} value={regionFilter} /><FilterSelect icon="assignment" aria-label="分派方式" onChange={(event) => { setModeFilter(event.target.value); paging.resetPage(); }} value={modeFilter}><option value="">全部分派方式</option><option value="手工">手工</option><option value="自动平均">自动平均</option></FilterSelect>{(query || regionFilter || modeFilter) && <FilterResetButton variant="ghost" size="sm" onClick={() => { setQuery(""); setRegionFilter(""); setModeFilter(""); paging.resetPage(); }}>重置筛选</FilterResetButton>}<FilterResetButton variant="ghost" size="sm" disabled={!teams.length} onClick={exportRows}><Download size={14} /> 导出 CSV</FilterResetButton></div>
|
|
<div className="ops-toolbar"><SearchBox onChange={(value) => { setQuery(value); paging.resetPage(); }} placeholder="搜索团队名称、区域路径、说明或成员" value={query} /><RegionSelect all data={data} onChange={(value) => { setRegionFilter(value); paging.resetPage(); }} value={regionFilter} /><FilterSelect icon="assignment" aria-label="分派方式" onChange={(event) => { setModeFilter(event.target.value); paging.resetPage(); }} value={modeFilter}><option value="">全部分派方式</option><option value="手工">手工</option><option value="自动平均">自动平均</option></FilterSelect>{(query || regionFilter || modeFilter) && <FilterResetButton variant="ghost" size="sm" onClick={() => { setQuery(""); setRegionFilter(""); setModeFilter(""); paging.resetPage(); }}>重置筛选</FilterResetButton>}<FilterResetButton variant="ghost" size="sm" disabled={!teams.length} onClick={exportRows}><Download size={14} /> 导出 CSV</FilterResetButton></div>
|
|
|
<div ref={tableRef} tabIndex={0} role="region" aria-label="运维团队台账,可横向滚动查看字段" className={`measured-table-scroll org-table-wrap org-team-table-scroll${tableOverflow.overflow ? " has-horizontal-overflow" : ""}${tableOverflow.canScrollLeft ? " can-scroll-left" : ""}${tableOverflow.canScrollRight ? " can-scroll-right" : ""}`}><table className="org-table org-maintenance-ledger-table org-team-ledger"><OpsTableColumns widths={columnWidths} /><thead><tr><th className="sortable" aria-sort={sortAria("name")} onClick={() => toggleSort("name")}>团队 / 分派</th><th className="sortable" aria-sort={sortAria("region")} onClick={() => toggleSort("region")}>所属区域</th><th className="org-maintenance-ticket-types"><span>可分配工单类型</span></th><th>分成规则</th><th>负责范围</th><th className="sortable" aria-sort={sortAria("coverage")} onClick={() => toggleSort("coverage")}>覆盖客户</th><th className="sortable" aria-sort={sortAria("open")} onClick={() => toggleSort("open")}>未完成</th><th>超期未完成</th><th className="sortable" aria-sort={sortAria("members")} onClick={() => toggleSort("members")}>成员账号</th><th className="org-table-actions-heading">操作</th></tr></thead><tbody>{pageTeams.map((team) => {
|
|
<div ref={tableRef} tabIndex={0} role="region" aria-label="运维团队台账,可横向滚动查看字段" className={`measured-table-scroll org-table-wrap org-team-table-scroll${tableOverflow.overflow ? " has-horizontal-overflow" : ""}${tableOverflow.canScrollLeft ? " can-scroll-left" : ""}${tableOverflow.canScrollRight ? " can-scroll-right" : ""}`}><table className="org-table org-maintenance-ledger-table org-team-ledger"><OpsTableColumns widths={columnWidths} /><thead><tr><th className="sortable" aria-sort={sortAria("name")} onClick={() => toggleSort("name")}>团队 / 分派</th><th className="sortable" aria-sort={sortAria("region")} onClick={() => toggleSort("region")}>所属区域</th><th className="org-maintenance-ticket-types"><span>可分配工单类型</span></th><th>分成规则</th><th>负责范围</th><th className="sortable" aria-sort={sortAria("coverage")} onClick={() => toggleSort("coverage")}>覆盖客户</th><th className="sortable" aria-sort={sortAria("open")} onClick={() => toggleSort("open")}>未完成</th><th>超期未完成</th><th className="sortable" aria-sort={sortAria("members")} onClick={() => toggleSort("members")}>成员账号</th><th className="org-table-actions-heading">操作</th></tr></thead><tbody>{pageTeams.map((team) => {
|
|
|
- return <tr key={team.id}><td><strong title={team.name}>{team.name}</strong><small>{team.mode}分派</small></td><td title={regionPath(data, team.region)}>{regionPath(data, team.region)}</td><td className="org-maintenance-ticket-types"><TeamTicketTypes types={teamTicketTypes(team)} /></td><td className="org-maintenance-share"><strong>{shareText(team)}</strong><small>{team.shareMode}</small></td><td className="org-maintenance-scope-cell" title={scopeSummary(data, team.scope)}>{scopeSummary(data, team.scope)}</td><td className="org-number"><Count v={team.coverageCustomers} /></td><td className="org-number"><Count v={team.openTickets} /></td><td>{team.overdueOpenTickets === undefined || team.overdueOpenTickets === null ? <Tri tone="missing" text={FIELD_UNAVAILABLE} title={team.loadPending} /> : team.overdueOpenTickets > 0 ? <span className="org-maintenance-overdue">超期 {team.overdueOpenTickets}</span> : <span className="org-maintenance-normal">正常</span>}</td><td><strong><Count v={team.memberCount} /></strong><small>{team.membersPending ?? `成员 ${team.members.length} 人`}</small></td><td className="org-table-actions-cell"><div className="org-table-actions is-icons"><Link className="org-maintenance-account-link" to={`/organization/maintenance-teams/${encodeURIComponent(team.id)}/accounts`}><UserRound size={15} />账号</Link><OpsResponsiveActions expanded={expandedActions} items={[
|
|
|
|
|
|
|
+ return <tr key={team.id}><td><strong className="table-cell-title" title={team.name}>{team.name}</strong><small>{team.mode}分派</small></td><td title={regionPath(data, team.region)}>{regionPath(data, team.region)}</td><td className="org-maintenance-ticket-types"><TeamTicketTypes types={teamTicketTypes(team)} /></td><td className="org-maintenance-share"><strong>{shareText(team)}</strong><small>{team.shareMode}</small></td><td className="org-maintenance-scope-cell" title={scopeSummary(data, team.scope)}><TableValueText>{scopeSummary(data, team.scope)}</TableValueText></td><td className="org-number"><Count v={team.coverageCustomers} /></td><td className="org-number"><Count v={team.openTickets} /></td><td>{team.overdueOpenTickets === undefined || team.overdueOpenTickets === null ? <Tri tone="missing" text={FIELD_UNAVAILABLE} title={team.loadPending} /> : team.overdueOpenTickets > 0 ? <OpsStatus tone="danger">超期 {team.overdueOpenTickets}</OpsStatus> : <OpsStatus tone="brand">正常</OpsStatus>}</td><td><strong><Count v={team.memberCount} /></strong><small>{team.membersPending ?? `成员 ${team.members.length} 人`}</small></td><td className="org-table-actions-cell"><div className="org-table-actions is-icons"><Link className="org-maintenance-account-link" to={`/organization/maintenance-teams/${encodeURIComponent(team.id)}/accounts`}><UserRound size={15} />账号</Link><OpsResponsiveActions expanded={expandedActions} items={[
|
|
|
// 负责范围已并入「编辑团队」弹窗(2026-11-16 业主指示),⛔ 再单列一条动作。
|
|
// 负责范围已并入「编辑团队」弹窗(2026-11-16 业主指示),⛔ 再单列一条动作。
|
|
|
{ label: "编辑团队", shortLabel: "编辑", icon: <PencilLine size={15} />, onSelect: () => setEditor({ kind: "maintenance", id: team.id }) },
|
|
{ label: "编辑团队", shortLabel: "编辑", icon: <PencilLine size={15} />, onSelect: () => setEditor({ kind: "maintenance", id: team.id }) },
|
|
|
{ label: "删除团队", shortLabel: "删除", danger: true, icon: <Trash2 size={15} />, onSelect: () => setDeleteId(team.id) },
|
|
{ label: "删除团队", shortLabel: "删除", danger: true, icon: <Trash2 size={15} />, onSelect: () => setDeleteId(team.id) },
|
|
@@ -1425,10 +1509,19 @@ export function MaintenanceTeamAccountsPage() {
|
|
|
const team = data.maintenanceTeams.find((item) => item.id === id);
|
|
const team = data.maintenanceTeams.find((item) => item.id === id);
|
|
|
if (!team) return <div className="org-page"><Link className="org-back-link" to="/organization/maintenance-teams"><ArrowLeft size={16} />返回运维团队</Link><Empty>团队不存在或已被删除</Empty></div>;
|
|
if (!team) return <div className="org-page"><Link className="org-back-link" to="/organization/maintenance-teams"><ArrowLeft size={16} />返回运维团队</Link><Empty>团队不存在或已被删除</Empty></div>;
|
|
|
const covered = scopeEnterpriseIndexes(data, team.scope).filter((index) => enterpriseTeamIds(data.enterprises[index]).includes(team.id));
|
|
const covered = scopeEnterpriseIndexes(data, team.scope).filter((index) => enterpriseTeamIds(data.enterprises[index]).includes(team.id));
|
|
|
- return <div className="org-page org-maintenance-accounts-page"><Link className="org-back-link" to="/organization/maintenance-teams"><ArrowLeft size={16} />返回运维团队</Link>
|
|
|
|
|
- <header className="org-maintenance-accounts-hero"><div className="org-team-accounts-title"><span className="org-team-accounts-icon"><Wrench size={25} /></span><div><span className="org-eyebrow">MAINTENANCE / ACCOUNTS</span><div className="org-team-accounts-heading"><h1>{team.name} · 账号管理</h1><span className="org-team-accounts-mode">{team.mode === "手工" ? "手工分配工单" : "自动平均分配工单"}</span></div><PageIntro>为运维成员开通账号,明确每个人可以接哪些工单。</PageIntro></div></div><span>{team.members.length} 名成员</span></header>
|
|
|
|
|
- <div className="org-maintenance-accounts-context"><div><span>团队负责范围</span><strong>{scopeSummary(data, team.scope)}</strong></div><div><span>归属且覆盖客户</span><strong>{covered.length} 家</strong></div><div><span>可分配工单</span><strong>{teamTicketTypes(team).map(typeLabel).join("、")}</strong></div></div>
|
|
|
|
|
- <section className="org-maintenance-accounts-body"><MaintenanceAccounts key={team.id} team={team} /></section>
|
|
|
|
|
|
|
+ return <div className="org-page org-team-accounts-page">
|
|
|
|
|
+ <Link className="org-back-link" to="/organization/maintenance-teams"><ArrowLeft size={16} />返回运维团队</Link>
|
|
|
|
|
+ <TeamAccountsSummary
|
|
|
|
|
+ name={team.name}
|
|
|
|
|
+ kind="MAINTENANCE / ACCOUNTS"
|
|
|
|
|
+ icon={<Wrench size={26} />}
|
|
|
|
|
+ details={<OpsTag tone="brand">{team.mode === "手工" ? "手工分配工单" : "自动平均分配工单"}</OpsTag>}
|
|
|
|
|
+ memberCount={team.memberCount ?? (team.members.length || team.memberCount)}
|
|
|
|
|
+ coverage={{ label: "归属且覆盖客户", count: covered.length }}
|
|
|
|
|
+ scope={scopeSummary(data, team.scope)}
|
|
|
|
|
+ metric={{ label: "可分配工单", icon: <Wrench size={16} aria-hidden="true" />, value: teamTicketTypes(team).map(typeLabel).join("、") || FIELD_UNAVAILABLE }}
|
|
|
|
|
+ />
|
|
|
|
|
+ <section className="org-team-accounts-list" aria-label="账号列表"><MaintenanceAccounts key={team.id} team={team} /></section>
|
|
|
</div>;
|
|
</div>;
|
|
|
}
|
|
}
|
|
|
|
|
|