|
@@ -27,11 +27,11 @@ import "../styles/packages.css";
|
|
|
type CatalogTab = "fixed" | "custom" | "exits";
|
|
type CatalogTab = "fixed" | "custom" | "exits";
|
|
|
|
|
|
|
|
|
|
|
|
|
-/** 整数格三态:字段缺失=取数失败,null=未配置,⛔ 显示 0;不给单位时与原型一样只出数字。 */
|
|
|
|
|
-function intCell(value: number | null | undefined, unit?: string) {
|
|
|
|
|
|
|
+/** 计数列显示数量和单位,保留缺失与取数失败的提示。 */
|
|
|
|
|
+function intCell(value: number | null | undefined, unit: "个" | "份") {
|
|
|
if (value === undefined) return <Tri tone="fail" text={WORD_FETCH_FAILED} />;
|
|
if (value === undefined) return <Tri tone="fail" text={WORD_FETCH_FAILED} />;
|
|
|
if (value === null) return <Tri tone="missing" text={WORD_UNCONFIGURED} />;
|
|
if (value === null) return <Tri tone="missing" text={WORD_UNCONFIGURED} />;
|
|
|
- return <><span className="table-number">{value}</span>{unit && <span className="catalog-value-unit">/{unit}</span>}</>;
|
|
|
|
|
|
|
+ return <><span className="table-number catalog-count-value">{value}</span><span className="catalog-value-unit">/{unit}</span></>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/** 价格按年或按月标明单位,成本金额沿用千分位和两位小数。 */
|
|
/** 价格按年或按月标明单位,成本金额沿用千分位和两位小数。 */
|
|
@@ -135,9 +135,10 @@ function PlanDescNote({ name, desc }: { name: string; desc: string }) {
|
|
|
|
|
|
|
|
/** 台账列宽:序号/操作列固定,其余按阅读需求分配(同合同台账口径)。
|
|
/** 台账列宽:序号/操作列固定,其余按阅读需求分配(同合同台账口径)。
|
|
|
* 套餐说明已收进名称旁问号图标,不再单列;用途分类改由表体内分组行承载,两 Tab 同列(2026-11-15)。 */
|
|
* 套餐说明已收进名称旁问号图标,不再单列;用途分类改由表体内分组行承载,两 Tab 同列(2026-11-15)。 */
|
|
|
-const PLAN_COLUMNS = [58, 246, 132, 124, 96, 86, 150, 78, 100] as const;
|
|
|
|
|
|
|
+const PLAN_ACTIONS_WIDTH = 164;
|
|
|
|
|
+const PLAN_COLUMNS = [58, 246, 132, 124, 96, 86, 150, 78, PLAN_ACTIONS_WIDTH] as const;
|
|
|
/** 自定义档台账多两列:建档人/建档团队(固定档不加)。 */
|
|
/** 自定义档台账多两列:建档人/建档团队(固定档不加)。 */
|
|
|
-const CUSTOM_PLAN_COLUMNS = [...PLAN_COLUMNS.slice(0, -1), 106, 112, 100] as const;
|
|
|
|
|
|
|
+const CUSTOM_PLAN_COLUMNS = [...PLAN_COLUMNS.slice(0, -1), 106, 112, PLAN_ACTIONS_WIDTH] as const;
|
|
|
|
|
|
|
|
/** 小屏将同一行的数据排成卡片,使用独立的可见字段名。 */
|
|
/** 小屏将同一行的数据排成卡片,使用独立的可见字段名。 */
|
|
|
function CatalogField({ label, children, title }: {
|
|
function CatalogField({ label, children, title }: {
|
|
@@ -169,16 +170,16 @@ function PlanRow({ plan, index, custom, writable, readOnlyNote, onEdit, onDelete
|
|
|
<CatalogField label="月成本">{ledgerCostCell(plan)}</CatalogField>
|
|
<CatalogField label="月成本">{ledgerCostCell(plan)}</CatalogField>
|
|
|
<CatalogField label="分账号额度">{intCell(plan.sub_account_quota, "个")}</CatalogField>
|
|
<CatalogField label="分账号额度">{intCell(plan.sub_account_quota, "个")}</CatalogField>
|
|
|
<CatalogField label="总带宽">{ledgerBandwidth(plan)}</CatalogField>
|
|
<CatalogField label="总带宽">{ledgerBandwidth(plan)}</CatalogField>
|
|
|
- <CatalogField label="订阅量" title="被合同条目或订阅引用的数量">{intCell(plan.referred_count)}</CatalogField>
|
|
|
|
|
|
|
+ <CatalogField label="订阅量" title="被合同条目或订阅引用的数量">{intCell(plan.referred_count, "份")}</CatalogField>
|
|
|
{custom && <>
|
|
{custom && <>
|
|
|
<CatalogField label="建档人" title={plan.created_by ?? undefined}>{plan.created_by_name || <Tri tone="missing" text={WORD_UNCONFIGURED} />}</CatalogField>
|
|
<CatalogField label="建档人" title={plan.created_by ?? undefined}>{plan.created_by_name || <Tri tone="missing" text={WORD_UNCONFIGURED} />}</CatalogField>
|
|
|
<CatalogField label="建档团队" title={plan.created_team_id ?? undefined}>{plan.created_team_name || <Tri tone="missing" text={WORD_UNCONFIGURED} />}</CatalogField>
|
|
<CatalogField label="建档团队" title={plan.created_team_id ?? undefined}>{plan.created_team_name || <Tri tone="missing" text={WORD_UNCONFIGURED} />}</CatalogField>
|
|
|
</>}
|
|
</>}
|
|
|
<td role="cell" className="catalog-actions-cell">
|
|
<td role="cell" className="catalog-actions-cell">
|
|
|
{writable ? (
|
|
{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 className="ops-inline-actions catalog-row-actions">
|
|
|
|
|
+ <button type="button" aria-label="编辑套餐" onClick={onEdit}><PencilLine size={15} aria-hidden="true" />编辑</button>
|
|
|
|
|
+ <button type="button" className="is-danger" aria-label="删除套餐" onClick={onDelete} title="删除套餐(引用拦截由服务端判定)"><Trash2 size={15} aria-hidden="true" />删除</button>
|
|
|
</div>
|
|
</div>
|
|
|
) : <span className="catalog-readonly-note" title={readOnlyNote}>只读</span>}
|
|
) : <span className="catalog-readonly-note" title={readOnlyNote}>只读</span>}
|
|
|
</td>
|
|
</td>
|