|
|
@@ -1,7 +1,8 @@
|
|
|
import { FilterSelect } from "../components/ui/filter-select";
|
|
|
import { FetchError } from "../components/fetchError";
|
|
|
-import { useEffect, useId, useMemo, useState, Fragment, type FormEvent } from "react";
|
|
|
-import { ArrowRight, Info, LockKeyhole, PencilLine, Plus, Search, Trash2, X } from "lucide-react";
|
|
|
+import { useEffect, useId, useLayoutEffect, useMemo, useRef, useState, Fragment, type FormEvent } from "react";
|
|
|
+import { createPortal } from "react-dom";
|
|
|
+import { CircleHelp, Info, LockKeyhole, PencilLine, Plus, Search, Trash2, X } from "lucide-react";
|
|
|
import { Button } from "../components/ui/button";
|
|
|
import { Input } from "../components/ui/input";
|
|
|
import { Tri } from "../components/triState";
|
|
|
@@ -11,9 +12,8 @@ import { COST_BY_COMBINATION, DERIVED_PLAN_EDITABLE, FIXED_PLAN_LOCKED_FIELDS, O
|
|
|
import { catalogCreate, catalogCustomerOptions, catalogDelete, catalogUpdate, lineExitSave, planCostItemList, planCostItemSave, rowsOf } from "../lib/api/bos";
|
|
|
import type { CatalogPlanRow, LineExitListResult, PlanCostItemRow } from "../lib/api/types";
|
|
|
import { ApiError } from "../lib/api/http";
|
|
|
-import { label, PLAN_KIND } from "../lib/api/labels";
|
|
|
import { useDemoIdentity } from "../lib/demo-session";
|
|
|
-import { bandwidthTextOfRow, categoryCode, categoryLabel, moneyCell, packageCategories, useCatalogPlans, useLineExits } from "../lib/package-catalog";
|
|
|
+import { bandwidthTextOfRow, categoryCode, categoryLabel, packageCategories, useCatalogPlans, useLineExits } from "../lib/package-catalog";
|
|
|
import { exitKey, splitExitInput } from "../domain/contract-items";
|
|
|
import { useLoad, type Load } from "../lib/useLoad";
|
|
|
import { slicePage, useLocalPage } from "../lib/list-paging";
|
|
|
@@ -47,11 +47,35 @@ const costRowOf = (draft: CostDraft): PlanCostItemRow => ({
|
|
|
remark: draft.remark.trim() || null,
|
|
|
});
|
|
|
|
|
|
-/** 整数格三态:字段缺失=取数失败,null=未配置,⛔ 显示 0。 */
|
|
|
-function intCell(value: number | null | undefined, unit: string) {
|
|
|
+/** 整数格三态:字段缺失=取数失败,null=未配置,⛔ 显示 0;不给单位时与原型一样只出数字。 */
|
|
|
+function intCell(value: number | null | undefined, unit?: string) {
|
|
|
if (value === undefined) return <Tri tone="fail" text={WORD_FETCH_FAILED} />;
|
|
|
if (value === null) return <Tri tone="missing" text={WORD_UNCONFIGURED} />;
|
|
|
- return <>{value}<small>{unit}</small></>;
|
|
|
+ return <>{value}{unit ? <small>{unit}</small> : null}</>;
|
|
|
+}
|
|
|
+
|
|
|
+/** 固定档金额:与原型 money 同式=千分位+两位小数(原型不带货币符号);三态词照旧。 */
|
|
|
+const LEDGER_MONEY = new Intl.NumberFormat("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
|
+function ledgerMoney(cents: number | null | undefined) {
|
|
|
+ if (cents === undefined) return <Tri tone="fail" text={WORD_FETCH_FAILED} />;
|
|
|
+ if (cents === null) return <Tri tone="missing" text={WORD_UNCONFIGURED} />;
|
|
|
+ return <>{LEDGER_MONEY.format(cents / 100)}</>;
|
|
|
+}
|
|
|
+
|
|
|
+/** 固定档总带宽:与原型同式——不承诺带宽/上下行 N M/下行 X M / 上行 Y M。 */
|
|
|
+function ledgerBandwidth(plan: CatalogPlanRow) {
|
|
|
+ if (plan.bandwidth_committed === null || plan.bandwidth_committed === undefined) return <Tri tone="missing" text={WORD_UNCONFIGURED} />;
|
|
|
+ if (!plan.bandwidth_committed) return <>不承诺带宽</>;
|
|
|
+ const up = plan.bandwidth_up_mbps;
|
|
|
+ const down = plan.bandwidth_down_mbps;
|
|
|
+ if (up === null || up === undefined || down === null || down === undefined) return <Tri tone="fail" text={WORD_FETCH_FAILED} />;
|
|
|
+ return <>{up === down ? `上下行 ${up}M` : `下行 ${down}M / 上行 ${up}M`}</>;
|
|
|
+}
|
|
|
+
|
|
|
+/** 固定档月成本:一档同时服务多个客户,取不到唯一组合 ⇒ 恒显「按组合」(14.4 固定档口径);调用失败才红字。 */
|
|
|
+function ledgerCostCell(plan: CatalogPlanRow) {
|
|
|
+ if (plan.plan_cost_state === "error") return <Tri tone="fail" text={WORD_FETCH_FAILED} />;
|
|
|
+ return <Tri tone="val" text={COST_BY_COMBINATION} title="金额随各客户的「省份 × 运营商」组合不同,不折中成一个数" />;
|
|
|
}
|
|
|
|
|
|
function formOf(plan: CatalogPlanRow | undefined, owner: string | null): EditorValues {
|
|
|
@@ -77,6 +101,65 @@ function CatalogInfo({ label, children }: { label: string; children: string }) {
|
|
|
</>;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 套餐说明:挂在名称右侧的问号图标上,不占一列。图标随行悬停/键盘聚焦显形,点击展开浮层显示说明。
|
|
|
+ * 浮层走 body 传送门+fixed,避免被台账滚动容器裁掉;**落在图标的左/右侧而非正下方**,
|
|
|
+ * 让指针停在图标上时不会压住浮层正文(正下方时箭头正对浮层首行)。
|
|
|
+ */
|
|
|
+function PlanDescNote({ name, desc }: { name: string; desc: string }) {
|
|
|
+ const id = useId();
|
|
|
+ const trigger = useRef<HTMLButtonElement>(null);
|
|
|
+ const popup = useRef<HTMLDivElement>(null);
|
|
|
+ const [open, setOpen] = useState(false);
|
|
|
+ const [position, setPosition] = useState({ top: 0, left: 0 });
|
|
|
+ useLayoutEffect(() => {
|
|
|
+ if (!open || !trigger.current || !popup.current) return;
|
|
|
+ const anchor = trigger.current.getBoundingClientRect();
|
|
|
+ const box = popup.current.getBoundingClientRect();
|
|
|
+ const gap = 10;
|
|
|
+ const clampTop = (top: number) => Math.max(8, Math.min(top, window.innerHeight - box.height - 8));
|
|
|
+ const rightRoom = window.innerWidth - anchor.right - gap - 8;
|
|
|
+ const leftRoom = anchor.left - gap - 8;
|
|
|
+ /** 优先右邻(与图标垂直居中对齐),右边放不下再翻到左边;两侧都放不下才落到下方,留 18px 让指针箭头够不到正文。 */
|
|
|
+ if (rightRoom >= box.width) {
|
|
|
+ setPosition({ left: anchor.right + gap, top: clampTop(anchor.top + anchor.height / 2 - box.height / 2) });
|
|
|
+ } else if (leftRoom >= box.width) {
|
|
|
+ setPosition({ left: anchor.left - gap - box.width, top: clampTop(anchor.top + anchor.height / 2 - box.height / 2) });
|
|
|
+ } else {
|
|
|
+ setPosition({
|
|
|
+ left: Math.max(8, Math.min(anchor.left + anchor.width / 2, window.innerWidth - box.width - 8)),
|
|
|
+ top: clampTop(anchor.bottom + 18),
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, [open]);
|
|
|
+ useEffect(() => {
|
|
|
+ if (!open) return;
|
|
|
+ const close = () => setOpen(false);
|
|
|
+ /** 点到图标与浮层以外即收(滚动/缩放同样收,浮层不跟着错位)。 */
|
|
|
+ const outside = (event: PointerEvent) => {
|
|
|
+ if (!trigger.current?.contains(event.target as Node) && !popup.current?.contains(event.target as Node)) close();
|
|
|
+ };
|
|
|
+ const escape = (event: KeyboardEvent) => { if (event.key === "Escape") close(); };
|
|
|
+ document.addEventListener("pointerdown", outside);
|
|
|
+ document.addEventListener("keydown", escape);
|
|
|
+ window.addEventListener("scroll", close, true);
|
|
|
+ window.addEventListener("resize", close);
|
|
|
+ return () => {
|
|
|
+ document.removeEventListener("pointerdown", outside);
|
|
|
+ document.removeEventListener("keydown", escape);
|
|
|
+ window.removeEventListener("scroll", close, true);
|
|
|
+ window.removeEventListener("resize", close);
|
|
|
+ };
|
|
|
+ }, [open]);
|
|
|
+ return <>
|
|
|
+ <button ref={trigger} type="button" className="catalog-desc-trigger" aria-label={`查看「${name}」的套餐说明`} aria-expanded={open} aria-describedby={open ? id : undefined} title="查看套餐说明" onClick={() => setOpen((current) => !current)}><CircleHelp size={15} aria-hidden="true" /></button>
|
|
|
+ {open && createPortal(<div ref={popup} id={id} role="dialog" aria-label={`${name} · 套餐说明`} className="catalog-desc-popover" style={position}>
|
|
|
+ <strong>套餐说明</strong>
|
|
|
+ <p>{desc}</p>
|
|
|
+ </div>, document.body)}
|
|
|
+ </>;
|
|
|
+}
|
|
|
+
|
|
|
function PackageEditor({ state, onClose, onSaved }: {
|
|
|
state: EditorState; onClose: () => void; onSaved: (message: string, savedPlan: CatalogPlanRow | null) => void;
|
|
|
}) {
|
|
|
@@ -151,10 +234,12 @@ function PackageEditor({ state, onClose, onSaved }: {
|
|
|
: { bandwidth_committed: false };
|
|
|
try {
|
|
|
if (!original) {
|
|
|
+ /** 自定义档恒为「定制化」(2026-11-15):弹窗不再让选,载荷固定送 customized。 */
|
|
|
+ const categoryOf = owner === null ? categoryCode(values.category) : "customized";
|
|
|
await catalogCreate({
|
|
|
plan_kind: owner === null ? "fixed" : "custom",
|
|
|
plan_name: name,
|
|
|
- ...(categoryCode(values.category) ? { use_category: categoryCode(values.category) as string } : {}),
|
|
|
+ ...(categoryOf ? { use_category: categoryOf } : {}),
|
|
|
annual_price_cents: Math.round(annualPrice * 100),
|
|
|
sub_account_quota: quota,
|
|
|
...bandwidth,
|
|
|
@@ -192,7 +277,9 @@ function PackageEditor({ state, onClose, onSaved }: {
|
|
|
<form onSubmit={submit} className="catalog-editor-body">
|
|
|
{locked && <div className="catalog-locked-note"><LockKeyhole size={18} /><p>{derived ? DERIVED_PLAN_EDITABLE : <>已被 {original?.referred_count ?? "—"} 处引用,字段「{FIXED_PLAN_LOCKED_FIELDS.join("、")}」已锁定;调整价格或额度请新建档位,再升级订阅。</>}</p></div>}
|
|
|
<section><h3><span>01</span> 基本信息</h3><label>套餐名称 <em>*</em><input autoFocus required maxLength={60} value={values.name} onChange={(event) => field("name", event.target.value)} placeholder="输入套餐名称" /></label>
|
|
|
- <div className="catalog-editor-grid"><label>用途分类<select disabled={Boolean(original) || locked} value={values.category} onChange={(event) => field("category", event.target.value)}>{!values.category && <option value="">未配置</option>}{packageCategories.map((item) => <option key={item.name}>{item.name}</option>)}</select></label><label>订阅周期<input disabled value="按年" /></label></div>
|
|
|
+ <div className="catalog-editor-grid">{state.owner === null
|
|
|
+ ? <label>用途分类<select disabled={Boolean(original) || locked} value={values.category} onChange={(event) => field("category", event.target.value)}>{!values.category && <option value="">未配置</option>}{packageCategories.filter((item) => item.name !== "定制化" || item.name === values.category).map((item) => <option key={item.name}>{item.name}</option>)}</select></label>
|
|
|
+ : <label>用途分类<input disabled value="定制化" /></label>}<label>订阅周期<input disabled value="按年" /></label></div>
|
|
|
{state.owner !== null && <label>归属客户 <em>*</em>
|
|
|
<select disabled={locked || Boolean(original)} required value={values.owner} onChange={(event) => field("owner", event.target.value)}>
|
|
|
<option value="">{customerOptions.loading ? "载入中…" : customerOptions.error ? WORD_FETCH_FAILED : "选择客户"}</option>
|
|
|
@@ -244,54 +331,95 @@ function PackageEditor({ state, onClose, onSaved }: {
|
|
|
</dialog>;
|
|
|
}
|
|
|
|
|
|
-/** 台账列宽:序号/操作列固定,其余按阅读需求分配(同合同台账口径)。 */
|
|
|
-const PLAN_COLUMNS = [58, 250, 104, 122, 122, 108, 96, 168, 300, 84, 118] as const;
|
|
|
+/** 台账列宽:序号/操作列固定,其余按阅读需求分配(同合同台账口径)。
|
|
|
+ * 套餐说明已收进名称旁问号图标,不再单列;自定义档恒为「定制化」用途分类,该列只在固定档 Tab 出现(2026-11-15)。 */
|
|
|
+const PLAN_COLUMNS = [58, 250, 104, 122, 122, 108, 96, 168, 84, 118] as const;
|
|
|
+/** 自定义档少一列「用途分类」(恒为定制化,不再占格子)。 */
|
|
|
+const CUSTOM_PLAN_COLUMNS = [58, 250, 122, 122, 108, 96, 168, 84, 118] as const;
|
|
|
|
|
|
/**
|
|
|
- * 目录台账行:一行一档,列与原型「套餐目录」同序(序号/套餐/用途分类/年订阅价格/
|
|
|
- * 月结算标准/月成本/分账号额度/总带宽/套餐说明/订阅量/操作)。
|
|
|
+ * 自定义档台账行:与固定档同形的精简行(⛔ 档位编号/类型标签/单位后缀/货币符号)。
|
|
|
+ * 列=序号/套餐(含归属客户)/年订阅价格/月结算标准/月成本/分账号额度/总带宽/订阅量/操作——
|
|
|
+ * 用途分类恒为「定制化」,⛔ 再占一列;套餐说明收进名称右侧问号图标。
|
|
|
* 三态:字段缺失=取数失败,null=未配置,⛔ 用 0/「—」冒充。
|
|
|
*/
|
|
|
-function PlanTableRow({ plan, index, writable, readOnlyNote, onEdit, onDelete }: {
|
|
|
+function CustomPlanRow({ plan, index, writable, readOnlyNote, onEdit, onDelete }: {
|
|
|
plan: CatalogPlanRow; index: number; writable: boolean; readOnlyNote: string; onEdit: () => void; onDelete: () => void;
|
|
|
}) {
|
|
|
- const annual = moneyCell(plan.annual_price_cents);
|
|
|
- const settle = moneyCell(plan.monthly_settle_cents);
|
|
|
- const bandwidth = bandwidthTextOfRow(plan);
|
|
|
- const costTone = plan.plan_cost_state === "error" ? "fail" : plan.plan_cost_state === "unconfigured" || (plan.plan_cost_cents === null && plan.plan_cost_state !== "ok") ? "missing" : "val";
|
|
|
- const category = categoryLabel(plan.use_category);
|
|
|
return <tr>
|
|
|
- <td><span className="ops-mono">{String(index).padStart(2, "0")}</span></td>
|
|
|
+ <td>{index}</td>
|
|
|
<td>
|
|
|
- <strong title={plan.plan_name || undefined}>{plan.plan_name || <Tri tone="missing" text={WORD_UNCONFIGURED} />}</strong>
|
|
|
- <small className="catalog-plan-meta"><span className={plan.plan_kind === "custom" ? "catalog-plan-tag is-custom" : "catalog-plan-tag"}>{label(PLAN_KIND, plan.plan_kind) || <Tri tone="missing" text={WORD_UNCONFIGURED} />}</span>{plan.derived_from_contract_item_id ? <span className="catalog-plan-tag">合同条目派生</span> : null}<span className="catalog-plan-id">{plan.plan_id}</span></small>
|
|
|
- {plan.customer_id && <small className="catalog-plan-owner" title={plan.customer_name ?? undefined}>归属客户 · {plan.customer_name || WORD_UNCONFIGURED}</small>}
|
|
|
+ <span className="catalog-plan-name">
|
|
|
+ <strong title={plan.plan_name || undefined}>{plan.plan_name || <Tri tone="missing" text={WORD_UNCONFIGURED} />}</strong>
|
|
|
+ {plan.plan_desc ? <PlanDescNote name={plan.plan_name || plan.plan_id} desc={plan.plan_desc} /> : null}
|
|
|
+ {plan.derived_from_contract_item_id ? <span className="catalog-plan-tag">合同条目派生</span> : null}
|
|
|
+ </span>
|
|
|
+ <small className="catalog-plan-owner" title={plan.customer_name ?? undefined}>归属客户 · {plan.customer_name || WORD_UNCONFIGURED}</small>
|
|
|
</td>
|
|
|
- <td>{category ? <span className="catalog-category-pill">{category}</span> : <Tri tone="missing" text={WORD_UNCONFIGURED} title="后端未下发 use_category(派生档恒为 null)" />}</td>
|
|
|
- <td><span className="ops-money">{annual.tone === "val" ? annual.text : <Tri tone={annual.tone} text={annual.text} />}</span>{annual.tone === "val" && <small>/ 年</small>}</td>
|
|
|
- <td><span className="ops-money">{settle.tone === "val" ? settle.text : <Tri tone={settle.tone} text={settle.text} />}</span>{settle.tone === "val" && <small>/ 月</small>}</td>
|
|
|
- <td title={plan.plan_cost_cents === null || plan.plan_cost_cents === undefined ? undefined : `随附成本项合计 ¥${(plan.plan_cost_cents / 100).toFixed(2)}`}><Tri tone={costTone} text={costTone === "val" ? COST_BY_COMBINATION : costTone === "fail" ? WORD_FETCH_FAILED : WORD_UNCONFIGURED} /></td>
|
|
|
- <td>{intCell(plan.sub_account_quota, "个")}</td>
|
|
|
- <td><Tri tone={bandwidth.tone} text={bandwidth.text} /></td>
|
|
|
- <td className="catalog-plan-desc" title={plan.plan_desc || undefined}>{plan.plan_desc || <Tri tone="missing" text={WORD_UNCONFIGURED} />}</td>
|
|
|
- <td title="后端 referred_count:被合同条目/订阅引用数">{intCell(plan.referred_count, "份")}</td>
|
|
|
+ <td className="catalog-ledger-price">{ledgerMoney(plan.annual_price_cents)}</td>
|
|
|
+ <td>{ledgerMoney(plan.monthly_settle_cents)}</td>
|
|
|
+ <td>{ledgerCostCell(plan)}</td>
|
|
|
+ <td>{intCell(plan.sub_account_quota)}</td>
|
|
|
+ <td>{ledgerBandwidth(plan)}</td>
|
|
|
+ <td title="后端 referred_count:被合同条目/订阅引用数">{intCell(plan.referred_count)}</td>
|
|
|
<td>{plan.derived_from_contract_item_id
|
|
|
? (writable
|
|
|
- ? <div className="ops-inline-actions"><button type="button" className="is-danger" onClick={onDelete} title="派生自定义档是合同条目的只读投影:目录侧无编辑/改名入口,改数回合同条目改;未被订阅引用时可删除(条目下次保存会重新派生一条新档)"><Trash2 size={15} />删除</button></div>
|
|
|
+ ? <div className="catalog-row-actions"><button type="button" className="is-danger" aria-label="删除套餐" onClick={onDelete} title="派生自定义档是合同条目的只读投影:目录侧无编辑/改名入口,改数回合同条目改;未被订阅引用时可删除"><Trash2 size={15} /></button></div>
|
|
|
: <small className="catalog-readonly-note">合同条目派生 · 只读</small>)
|
|
|
: writable
|
|
|
- ? <div className="ops-inline-actions"><button type="button" onClick={onEdit}><PencilLine size={15} />编辑</button><button type="button" className="is-danger" onClick={onDelete} title="删除档位(引用拦截由服务端判定)"><Trash2 size={15} />删除</button></div>
|
|
|
+ ? <div className="catalog-row-actions"><button type="button" aria-label="编辑套餐" onClick={onEdit} title="编辑套餐"><PencilLine size={15} /></button><button type="button" className="is-danger" aria-label="删除套餐" onClick={onDelete} title="删除套餐(引用拦截由服务端判定)"><Trash2 size={15} /></button></div>
|
|
|
: <small className="catalog-readonly-note">{readOnlyNote}</small>}</td>
|
|
|
</tr>;
|
|
|
}
|
|
|
|
|
|
-/** 固定档按用途分类分组的一行表头(分组落在表体内,与原型同形)。 */
|
|
|
+/** 固定档按用途分类分组的一行表头(分组落在表体内,与原型同形):分类名+「订阅方式:X · 口径说明」。 */
|
|
|
function PlanGroupRow({ title, hint }: { title: string; hint?: string }) {
|
|
|
- return <tr className="catalog-group-row"><td colSpan={11}><strong>{title}</strong>{hint && <span>{hint}</span>}</td></tr>;
|
|
|
+ return <tr className="catalog-group-row"><td colSpan={10}><strong>{title}</strong>{hint && <span>{hint}</span>}</td></tr>;
|
|
|
}
|
|
|
|
|
|
+/** 原型 `pkgSubMode`:用途分类决定订阅方式(叠加增值可叠加、定制化单独约定、其余可升降配)。 */
|
|
|
+function subModeOf(category: string) {
|
|
|
+ if (category === "叠加增值") return "可叠加";
|
|
|
+ if (category === "定制化") return "单独约定";
|
|
|
+ return "可升降配";
|
|
|
+}
|
|
|
|
|
|
-/** 目录级线路出口配置:出口在这里维护,合同条目/IP 条目只做选择(2026-11-15 裁定)。 */
|
|
|
+/**
|
|
|
+ * 固定档台账行:与原型「套餐配置」同形——10 列只出值,⛔ 档位编号/类型标签/单位后缀/货币符号;
|
|
|
+ * 套餐说明收进名称右侧问号图标(`PlanDescNote`),不再单列。
|
|
|
+ * 三态词照 14.4(字段缺失=取数失败,null=未配置,⛔ 用 0 冒充),金额与带宽文字口径同原型。
|
|
|
+ */
|
|
|
+function FixedPlanRow({ plan, index, writable, readOnlyNote, onEdit, onDelete }: {
|
|
|
+ plan: CatalogPlanRow; index: number; writable: boolean; readOnlyNote: string; onEdit: () => void; onDelete: () => void;
|
|
|
+}) {
|
|
|
+ const category = categoryLabel(plan.use_category);
|
|
|
+ return <tr>
|
|
|
+ <td>{index}</td>
|
|
|
+ <td>
|
|
|
+ <span className="catalog-plan-name">
|
|
|
+ <strong>{plan.plan_name || <Tri tone="missing" text={WORD_UNCONFIGURED} />}</strong>
|
|
|
+ {plan.plan_desc ? <PlanDescNote name={plan.plan_name || plan.plan_id} desc={plan.plan_desc} /> : null}
|
|
|
+ {plan.derived_from_contract_item_id ? <span className="catalog-plan-tag">合同条目派生</span> : null}
|
|
|
+ </span>
|
|
|
+ </td>
|
|
|
+ <td>{category ? <span className="catalog-category-pill">{category}</span> : <span className="catalog-category-pill">未分类</span>}</td>
|
|
|
+ <td className="catalog-ledger-price">{ledgerMoney(plan.annual_price_cents)}</td>
|
|
|
+ <td>{ledgerMoney(plan.monthly_settle_cents)}</td>
|
|
|
+ <td>{ledgerCostCell(plan)}</td>
|
|
|
+ <td>{intCell(plan.sub_account_quota)}</td>
|
|
|
+ <td>{ledgerBandwidth(plan)}</td>
|
|
|
+ <td title="后端 referred_count:被合同条目/订阅引用数">{intCell(plan.referred_count)}</td>
|
|
|
+ <td>{plan.derived_from_contract_item_id
|
|
|
+ ? (writable
|
|
|
+ ? <div className="catalog-row-actions"><button type="button" className="is-danger" aria-label="删除套餐" onClick={onDelete} title="派生自定义档是合同条目的只读投影:目录侧无编辑/改名入口,改数回合同条目改;未被订阅引用时可删除"><Trash2 size={15} /></button></div>
|
|
|
+ : <small className="catalog-readonly-note">合同条目派生 · 只读</small>)
|
|
|
+ : writable
|
|
|
+ ? <div className="catalog-row-actions"><button type="button" aria-label="编辑套餐" onClick={onEdit} title="编辑套餐"><PencilLine size={15} /></button><button type="button" className="is-danger" aria-label="删除套餐" onClick={onDelete} title="删除套餐(引用拦截由服务端判定)"><Trash2 size={15} /></button></div>
|
|
|
+ : <small className="catalog-readonly-note">{readOnlyNote}</small>}</td>
|
|
|
+ </tr>;
|
|
|
+}
|
|
|
+
|
|
|
+/** 配置级线路出口:出口在这里维护,合同条目/IP 条目只做选择(2026-11-15 裁定)。 */
|
|
|
const CATALOG_EXIT_MAX = 200;
|
|
|
|
|
|
function LineExitPanel({ writable, exits, onNotice }: { writable: boolean; exits: Load<LineExitListResult>; onNotice: (message: string) => void }) {
|
|
|
@@ -299,11 +427,16 @@ function LineExitPanel({ writable, exits, onNotice }: { writable: boolean; exits
|
|
|
const [input, setInput] = useState("");
|
|
|
const [error, setError] = useState("");
|
|
|
const [saving, setSaving] = useState(false);
|
|
|
+ /** 删除二次确认:必须手打出口原文才放行(2026-11-15 业主口径:有引用的不许删、没引用的也要二次输入确认)。 */
|
|
|
+ const [confirm, setConfirm] = useState<{ index: number; name: string; typed: string } | null>(null);
|
|
|
useEffect(() => {
|
|
|
if (draft === null && exits.data) setDraft(exits.data.items.map((item) => item.exit_name));
|
|
|
}, [exits.data, draft]);
|
|
|
- const saved = (exits.data?.items ?? []).map((item) => item.exit_name);
|
|
|
+ const savedItems = exits.data?.items ?? [];
|
|
|
+ const saved = savedItems.map((item) => item.exit_name);
|
|
|
const rows = draft ?? saved;
|
|
|
+ /** 引用面按归一化键查(后端逐条带出 `ref_count`/`ref_summary`)。 */
|
|
|
+ const refOf = (name: string) => savedItems.find((item) => item.exit_key === exitKey(name));
|
|
|
const dirty = draft !== null && (draft.length !== saved.length || rows.some((name, index) => name !== saved[index]));
|
|
|
function add() {
|
|
|
if (!writable) return;
|
|
|
@@ -324,9 +457,23 @@ function LineExitPanel({ writable, exits, onNotice }: { writable: boolean; exits
|
|
|
setInput("");
|
|
|
setError(overflow ? `线路出口最多 ${CATALOG_EXIT_MAX} 条,已忽略 ${overflow} 条。` : duplicated ? `已跳过 ${duplicated} 条重复出口(空白、大小写不区分)。` : "");
|
|
|
}
|
|
|
- function remove(index: number) {
|
|
|
+ function askRemove(index: number) {
|
|
|
if (!writable) return;
|
|
|
- setDraft((current) => (current ?? saved).filter((_, i) => i !== index));
|
|
|
+ const name = rows[index];
|
|
|
+ if (!name) return;
|
|
|
+ /** 有引用的出口连确认框都不给:⛔ 让人打完字再吃 400(服务端仍是最终判据)。 */
|
|
|
+ if ((refOf(name)?.ref_count ?? 0) > 0) {
|
|
|
+ setError(`「${name}」仍被 ${refOf(name)?.ref_summary || "业务数据"}引用,不能从清单删除;请先到合同/订阅侧处理引用。`);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ setError("");
|
|
|
+ setConfirm({ index, name, typed: "" });
|
|
|
+ }
|
|
|
+ function confirmRemove() {
|
|
|
+ if (!confirm) return;
|
|
|
+ if (confirm.typed.trim() !== confirm.name.trim()) return;
|
|
|
+ setDraft((current) => (current ?? saved).filter((_, i) => i !== confirm.index));
|
|
|
+ setConfirm(null);
|
|
|
setError("");
|
|
|
}
|
|
|
async function save() {
|
|
|
@@ -358,13 +505,31 @@ function LineExitPanel({ writable, exits, onNotice }: { writable: boolean; exits
|
|
|
<div className="catalog-exits-list">
|
|
|
{exits.error ? <Tri tone="fail" text={WORD_FETCH_FAILED} title={exits.error.message} />
|
|
|
: exits.loading && draft === null ? <Tri tone="missing" text="正在载入…" />
|
|
|
- : rows.length ? rows.map((exit, index) => <span key={`${exitKey(exit)}-${index}`}>{exit}{writable && <button type="button" aria-label={`移除线路出口 ${exit}`} onClick={() => remove(index)}><X size={15} /></button>}</span>)
|
|
|
+ : rows.length ? rows.map((exit, index) => {
|
|
|
+ const refCount = refOf(exit)?.ref_count ?? 0;
|
|
|
+ return <span key={`${exitKey(exit)}-${index}`} className={refCount > 0 ? "is-referenced" : undefined}>
|
|
|
+ {exit}
|
|
|
+ {refCount > 0 && <small className="catalog-exits-ref" title={refOf(exit)?.ref_summary}>{`被 ${refCount} 处引用`}</small>}
|
|
|
+ {writable && (refCount > 0
|
|
|
+ ? <button type="button" className="is-locked" aria-label={`${exit} 已被引用,不能删除`} title={`${refOf(exit)?.ref_summary || "已被业务数据"}引用,不能删除;请先到合同/订阅侧处理引用`} disabled><LockKeyhole size={15} /></button>
|
|
|
+ : <button type="button" aria-label={`删除线路出口 ${exit}`} title="删除需二次输入确认" onClick={() => askRemove(index)}><X size={15} /></button>)}
|
|
|
+ </span>;
|
|
|
+ })
|
|
|
: <Tri tone="missing" text="尚未配置线路出口" />}
|
|
|
</div>
|
|
|
- <p className="catalog-exits-note">线路出口在这里维护一份清单,合同的服务构成条目与需分配 IP 条目<strong>只从这里选择</strong>,不再自由录入。已被合同、IP 备案、派生档或订阅引用的出口不可删除。工单竣工回填不读本清单,只认该订阅合同条目的核定出口。</p>
|
|
|
+ <p className="catalog-exits-note">线路出口在这里维护一份清单,合同的服务构成条目与需分配 IP 条目<strong>只从这里选择</strong>,不再自由录入。<strong>已被合同、IP 备案、派生档或订阅引用的出口不允许删除</strong>(删除入口置灰并标出引用份数);未被引用的出口删除时须<strong>手打出口名称二次确认</strong>。工单竣工回填不读本清单,只认该订阅合同条目的核定出口。</p>
|
|
|
{error && <p className="catalog-editor-error" role="alert">{error}</p>}
|
|
|
<small>{writable ? "数组顺序即合同页的选择顺序;保存为整段全量替换。" : "当前账号只读;线路出口由总运营/运营主账号维护。"}</small>
|
|
|
</div>
|
|
|
+ {confirm && <div className="catalog-confirm-backdrop"><div className="catalog-confirm" role="alertdialog" aria-modal="true" aria-labelledby="catalog-exit-confirm-title">
|
|
|
+ <span className="catalog-confirm-icon"><Trash2 size={20} /></span>
|
|
|
+ <h2 id="catalog-exit-confirm-title">删除线路出口?</h2>
|
|
|
+ <p>「{confirm.name}」将从出口清单移除(<strong>保存出口清单</strong>后生效)。请手打出口名称确认本次删除。</p>
|
|
|
+ <label className="catalog-confirm-input">确认出口名称
|
|
|
+ <input autoFocus value={confirm.typed} onChange={(event) => setConfirm((current) => current ? { ...current, typed: event.target.value } : current)} placeholder={confirm.name} onKeyDown={(event) => { if (event.key === "Enter" && confirm.typed.trim() === confirm.name.trim()) { event.preventDefault(); confirmRemove(); } }} />
|
|
|
+ </label>
|
|
|
+ <div><button type="button" className="catalog-button catalog-button-secondary" onClick={() => setConfirm(null)}>取消</button><button type="button" className="catalog-button catalog-button-danger" disabled={confirm.typed.trim() !== confirm.name.trim()} onClick={confirmRemove}>确认删除</button></div>
|
|
|
+ </div></div>}
|
|
|
</div>;
|
|
|
}
|
|
|
|
|
|
@@ -391,24 +556,32 @@ export function PackageManagementPage() {
|
|
|
const [notice, setNotice] = useState("");
|
|
|
const [failure, setFailure] = useState("");
|
|
|
const [deleting, setDeleting] = useState(false);
|
|
|
- /** 检索一次算清,两个 tab 各取自己那一半;计数同源(总则§6.3),⛔ 各算一次。 */
|
|
|
- const filtered = useMemo(() => rows.filter((plan) => (category === "all" || categoryLabel(plan.use_category) === category)
|
|
|
- && `${plan.plan_name} ${categoryLabel(plan.use_category) ?? ""} ${bandwidthTextOfRow(plan).text} ${plan.plan_desc ?? ""} ${plan.customer_name ?? ""}`.toLowerCase().includes(search.trim().toLowerCase())), [rows, category, search]);
|
|
|
+ /** 自定义档恒为「定制化」用途分类 ⇒ 该列与分类筛选只在固定档 Tab 出现(2026-11-15)。 */
|
|
|
+ const isCustomTab = tab === "custom";
|
|
|
+ const ledgerColSpan = isCustomTab ? 9 : 10;
|
|
|
+ /** 检索一次算清,两个 tab 各取自己那一半;计数同源(总则§6.3),⛔ 各算一次。
|
|
|
+ * 自定义档没有可选分类,进自定义 Tab 时分类筛选不参与过滤(否则会筛成空表)。 */
|
|
|
+ const activeCategory = isCustomTab ? "all" : category;
|
|
|
+ const filtered = useMemo(() => rows.filter((plan) => (activeCategory === "all" || categoryLabel(plan.use_category) === activeCategory)
|
|
|
+ && `${plan.plan_name} ${categoryLabel(plan.use_category) ?? ""} ${bandwidthTextOfRow(plan).text} ${plan.plan_desc ?? ""} ${plan.customer_name ?? ""}`.toLowerCase().includes(search.trim().toLowerCase())), [rows, activeCategory, search]);
|
|
|
const fixed = filtered.filter((plan) => plan.plan_kind !== "custom");
|
|
|
const custom = filtered.filter((plan) => plan.plan_kind === "custom");
|
|
|
const fixedCount = rows.filter((plan) => plan.plan_kind !== "custom").length;
|
|
|
const customCount = rows.length - fixedCount;
|
|
|
- const visible = tab === "custom" ? custom : fixed;
|
|
|
+ const visible = isCustomTab ? custom : fixed;
|
|
|
const paging = useLocalPage(visible.length);
|
|
|
const pageRows = slicePage(visible, paging.safePage);
|
|
|
- /** 固定套餐按用途分类分组,分组行落在表体内;后端不下发 use_category 的档位单列一组,⛔ 静默丢行。 */
|
|
|
+ /** 固定套餐按用途分类分组,分组行落在表体内;后端不下发 use_category 的档位单列一组,⛔ 静默丢行。
|
|
|
+ * 序号取「表内显示顺序」(分组后位置),⛔ 用后端数组下标——否则分组一排序就出现 7 在 6 前面。 */
|
|
|
const fixedGroups = useMemo(() => {
|
|
|
const nameOf = (plan: CatalogPlanRow) => categoryLabel(plan.use_category);
|
|
|
- const groups = packageCategories
|
|
|
- .map((item) => ({ name: item.name as string, hint: item.hint as string | undefined, plans: pageRows.filter((plan) => nameOf(plan) === item.name) }))
|
|
|
+ const known = packageCategories
|
|
|
+ .map((item) => ({ name: item.name as string, hint: `订阅方式:${subModeOf(item.name)} · ${item.hint}`, plans: pageRows.filter((plan) => nameOf(plan) === item.name) }))
|
|
|
.filter((group) => group.plans.length > 0);
|
|
|
const uncategorized = pageRows.filter((plan) => !packageCategories.some((item) => item.name === nameOf(plan)));
|
|
|
- return uncategorized.length ? [...groups, { name: WORD_UNCONFIGURED, hint: `用途分类:${WORD_NOT_PROVIDED}` as string | undefined, plans: uncategorized }] : groups;
|
|
|
+ const groups = uncategorized.length ? [...known, { name: WORD_UNCONFIGURED, hint: `用途分类:${WORD_NOT_PROVIDED}`, plans: uncategorized }] : known;
|
|
|
+ let position = 0;
|
|
|
+ return groups.map((group) => ({ name: group.name, hint: group.hint, entries: group.plans.map((plan) => ({ plan, position: position++ })) }));
|
|
|
}, [pageRows]);
|
|
|
const total = catalog.data?.total;
|
|
|
const truncated = (total ?? 0) > rows.length ? total : null;
|
|
|
@@ -466,26 +639,36 @@ export function PackageManagementPage() {
|
|
|
setDeleteBlocks(null);
|
|
|
setDeleteError("");
|
|
|
}
|
|
|
- const planRow = (plan: CatalogPlanRow, position: number) => <PlanTableRow
|
|
|
+ const planRow = (plan: CatalogPlanRow, position: number) => <CustomPlanRow
|
|
|
+ key={plan.plan_id}
|
|
|
+ plan={plan}
|
|
|
+ index={paging.safePage * paging.pageSize + position + 1}
|
|
|
+ writable={canWrite}
|
|
|
+ readOnlyNote="只读"
|
|
|
+ onEdit={() => setEditor({ plan, owner: plan.customer_id ?? "" })}
|
|
|
+ onDelete={() => { setDeleteError(""); setDeleteBlocks(null); setDeleteTarget(plan); }}
|
|
|
+ />;
|
|
|
+ /** 固定档:与原型同形的精简行(⛔ 档位编号/类型标签/单位后缀),分组由 fixedGroups 插在表体内。 */
|
|
|
+ const fixedRow = (plan: CatalogPlanRow, position: number) => <FixedPlanRow
|
|
|
key={plan.plan_id}
|
|
|
plan={plan}
|
|
|
index={paging.safePage * paging.pageSize + position + 1}
|
|
|
- writable={tab === "custom" ? canWrite : canWriteFixed}
|
|
|
- readOnlyNote={tab === "custom" ? "只读" : OPERATOR_ONLY_CONFIG}
|
|
|
- onEdit={() => setEditor({ plan, owner: tab === "custom" ? plan.customer_id ?? "" : null })}
|
|
|
+ writable={canWriteFixed}
|
|
|
+ readOnlyNote={OPERATOR_ONLY_CONFIG}
|
|
|
+ onEdit={() => setEditor({ plan, owner: null })}
|
|
|
onDelete={() => { setDeleteError(""); setDeleteBlocks(null); setDeleteTarget(plan); }}
|
|
|
/>;
|
|
|
const emptyMessage = catalog.error
|
|
|
- ? `套餐目录取数失败:${catalog.error.message}(失败关闭,⛔ 回退成演示档位)`
|
|
|
+ ? `套餐配置取数失败:${catalog.error.message}(失败关闭,⛔ 回退成演示档位)`
|
|
|
: catalog.loading && !catalog.data
|
|
|
? "正在从目录接口读取档位…"
|
|
|
: search || category !== "all"
|
|
|
? "没有符合筛选条件的套餐档,可重置筛选后再看。"
|
|
|
: tab === "custom" ? "目录里还没有自定义套餐档。" : "目录里还没有固定套餐档。";
|
|
|
return <section className="ops-page ops-page--packages package-catalog page-fill page-fill-window">
|
|
|
- <header className="catalog-page-head"><div><span className="catalog-eyebrow">PRODUCT CATALOG / 产品与订阅</span><h1>套餐目录</h1></div><div className="catalog-head-actions">{canWrite && <button type="button" className="catalog-button catalog-button-secondary" onClick={() => setEditor({ owner: "" })}><Plus size={17} />新增自定义套餐</button>}{canWriteFixed ? <button type="button" className="catalog-button catalog-button-primary" onClick={() => setEditor({ owner: null })}><Plus size={17} />新增固定套餐</button> : <span className="catalog-head-note">区域运营不能配置公共固定档</span>}</div></header>
|
|
|
+ <header className="catalog-page-head"><div><span className="catalog-eyebrow">PRODUCT CATALOG / 产品与订阅</span><h1>套餐配置</h1></div></header>
|
|
|
<div className="ops-list-shell list-shell-fill">
|
|
|
- <div className="ops-tabs" role="tablist" aria-label="套餐目录视图">
|
|
|
+ <div className="ops-tabs catalog-tabs" role="tablist" aria-label="套餐配置视图">
|
|
|
<button role="tab" aria-selected={tab === "fixed"} aria-controls="catalog-fixed-panel" id="catalog-fixed-tab" className={tab === "fixed" ? "active" : ""} onClick={() => switchTab("fixed")}>固定套餐 <span>{catalog.error ? "—" : fixedCount}</span></button>
|
|
|
<button role="tab" aria-selected={tab === "custom"} aria-controls="catalog-custom-panel" id="catalog-custom-tab" className={tab === "custom" ? "active" : ""} onClick={() => switchTab("custom")}>自定义套餐 <span>{catalog.error ? "—" : customCount}</span></button>
|
|
|
<button role="tab" aria-selected={tab === "exits"} aria-controls="catalog-exits-panel" id="catalog-exits-tab" className={tab === "exits" ? "active" : ""} onClick={() => switchTab("exits")}>线路出口 <span>{exits.error ? "—" : exits.data ? exits.data.items.length : "—"}</span></button>
|
|
|
@@ -494,28 +677,36 @@ export function PackageManagementPage() {
|
|
|
? <div id="catalog-exits-panel" role="tabpanel" aria-labelledby="catalog-exits-tab" className="catalog-exits-panel"><LineExitPanel writable={canWriteExits} exits={exits} onNotice={(message) => { setFailure(""); setNotice(message); }} /></div>
|
|
|
: <div id={tab === "custom" ? "catalog-custom-panel" : "catalog-fixed-panel"} role="tabpanel" aria-labelledby={tab === "custom" ? "catalog-custom-tab" : "catalog-fixed-tab"} className="catalog-tabpanel">
|
|
|
<div className="ops-toolbar">
|
|
|
- <label className="ops-search"><Search size={17} /><Input aria-label="搜索套餐" placeholder="搜索名称、分类、带宽、说明或归属客户" value={search} onChange={(event) => { setSearch(event.target.value); paging.resetPage(); }} />{search && <button type="button" aria-label="清空搜索" onClick={() => { setSearch(""); paging.resetPage(); }}><X size={15} /></button>}</label>
|
|
|
- <FilterSelect icon="type" aria-label="用途分类筛选" value={category} onChange={(event) => { setCategory(event.target.value); paging.resetPage(); }}><option value="all">全部用途分类</option>{packageCategories.map((item) => <option key={item.name}>{item.name}</option>)}</FilterSelect>
|
|
|
- {(search || category !== "all") && <Button variant="ghost" size="sm" onClick={resetFilters}>重置筛选</Button>}
|
|
|
+ <label className="ops-search"><Search size={17} /><Input aria-label="搜索套餐" placeholder={isCustomTab ? "搜索名称、带宽、说明或归属客户" : "搜索名称、分类、带宽、说明或归属客户"} value={search} onChange={(event) => { setSearch(event.target.value); paging.resetPage(); }} />{search && <button type="button" aria-label="清空搜索" onClick={() => { setSearch(""); paging.resetPage(); }}><X size={15} /></button>}</label>
|
|
|
+ {/* 自定义档恒为「定制化」,没有可选项 ⇒ 该 Tab 不出分类筛选(⛔ 给一个筛完必空的控件)。 */}
|
|
|
+ {!isCustomTab && <FilterSelect icon="type" aria-label="用途分类筛选" value={category} onChange={(event) => { setCategory(event.target.value); paging.resetPage(); }}><option value="all">全部用途分类</option>{packageCategories.map((item) => <option key={item.name}>{item.name}</option>)}</FilterSelect>}
|
|
|
+ {(search || (!isCustomTab && category !== "all")) && <Button variant="ghost" size="sm" onClick={resetFilters}>重置筛选</Button>}
|
|
|
<span className="catalog-ledger-note">{tab === "custom" ? "自定义套餐只属于一个客户,不进公共目录" : "固定套餐为公共档,所有客户可选"}{truncated ? `;目录共 ${truncated} 条,当前仅载入 ${rows.length} 条` : ""}</span>
|
|
|
+ {/* 新增入口跟着 Tab 走:固定档只有总运营能新建,自定义套餐由总运营/运营主账号建。 */}
|
|
|
+ {tab === "fixed"
|
|
|
+ ? (canWriteFixed
|
|
|
+ ? <button type="button" className="catalog-button catalog-button-primary catalog-toolbar-action" onClick={() => setEditor({ owner: null })}><Plus size={17} />新增固定套餐</button>
|
|
|
+ : <span className="catalog-head-note catalog-toolbar-action">区域运营不能配置公共固定档</span>)
|
|
|
+ : (canWrite
|
|
|
+ ? <button type="button" className="catalog-button catalog-button-primary catalog-toolbar-action" onClick={() => setEditor({ owner: "" })}><Plus size={17} />新增自定义套餐</button>
|
|
|
+ : <span className="catalog-head-note catalog-toolbar-action">本角色只读,不能新增自定义套餐</span>)}
|
|
|
</div>
|
|
|
<div ref={tableOverflow.ref} tabIndex={0} role="region" aria-label="套餐档位台账,可横向滚动查看字段" className={`measured-table-scroll ops-table-wrap catalog-table-wrap${tableOverflow.overflow ? " has-horizontal-overflow" : ""}${tableOverflow.canScrollLeft ? " can-scroll-left" : ""}${tableOverflow.canScrollRight ? " can-scroll-right" : ""}`}>
|
|
|
<table className="ops-table catalog-ledger">
|
|
|
- <OpsTableColumns widths={PLAN_COLUMNS} />
|
|
|
- <thead><tr><th>序号</th><th>套餐</th><th>用途分类</th><th>年订阅价格</th><th>月结算标准</th><th>月成本</th><th>分账号额度</th><th>总带宽</th><th>套餐说明</th><th>订阅量</th><th>操作</th></tr></thead>
|
|
|
+ <OpsTableColumns widths={isCustomTab ? CUSTOM_PLAN_COLUMNS : PLAN_COLUMNS} />
|
|
|
+ <thead><tr><th>序号</th><th>套餐</th>{!isCustomTab && <th>用途分类</th>}<th>年订阅价格</th><th>月结算标准</th><th>月成本</th><th>分账号额度</th><th>总带宽</th><th>订阅量</th><th>操作</th></tr></thead>
|
|
|
<tbody>
|
|
|
{tab === "fixed"
|
|
|
- ? fixedGroups.map((group) => <Fragment key={group.name}><PlanGroupRow title={group.name} hint={group.hint} />{group.plans.map((plan) => planRow(plan, pageRows.indexOf(plan)))}</Fragment>)
|
|
|
+ ? fixedGroups.map((group) => <Fragment key={group.name}><PlanGroupRow title={group.name} hint={group.hint} />{group.entries.map(({ plan, position }) => fixedRow(plan, position))}</Fragment>)
|
|
|
: pageRows.map((plan, index) => planRow(plan, index))}
|
|
|
- {(!catalog.error && visible.length === 0) && <OpsTableEmpty colSpan={11}>{emptyMessage}</OpsTableEmpty>}
|
|
|
- {catalog.error && <OpsTableEmpty colSpan={11}>{emptyMessage}</OpsTableEmpty>}
|
|
|
+ {(!catalog.error && visible.length === 0) && <OpsTableEmpty colSpan={ledgerColSpan}>{emptyMessage}</OpsTableEmpty>}
|
|
|
+ {catalog.error && <OpsTableEmpty colSpan={ledgerColSpan}>{emptyMessage}</OpsTableEmpty>}
|
|
|
</tbody>
|
|
|
</table>
|
|
|
</div>
|
|
|
<ListPager total={visible.length} page={paging.safePage} pageSize={paging.pageSize} onPageChange={paging.setPage} unit="档" />
|
|
|
</div>}
|
|
|
</div>
|
|
|
- <div className="catalog-policy"><LockKeyhole size={18} /><p><strong>订阅引用后的修改规则</strong>已有订阅的档位允许修改名称、说明和成本项,删除由服务端引用拦截判定。调整价格、额度或带宽时,应新建档位并在订阅中办理升级。</p><ArrowRight size={16} /></div>
|
|
|
{notice && <div className="catalog-toast" role="status"><span>{notice}</span><button aria-label="关闭提示" onClick={() => setNotice("")}><X size={16} /></button></div>}
|
|
|
{failure && <div className="catalog-toast" role="alert"><span>{failure}</span><button aria-label="关闭提示" onClick={() => setFailure("")}><X size={16} /></button></div>}
|
|
|
{editor && <PackageEditor key={editor.plan?.plan_id ?? `new-${editor.owner ?? "fixed"}`} state={editor} onClose={() => setEditor(null)} onSaved={saved} />}
|