Просмотр исходного кода

移除组织管理页面的客户加载说明

sy 1 день назад
Родитель
Сommit
ac9f4240cc

+ 3 - 11
web-scaffold/src/lib/organization-demo.ts

@@ -90,8 +90,6 @@ export type OrganizationStatus = {
   regionNameNote?: string;
   /** 运维团队负载列降级说明(后端 `load_pending` 原文) */
   loadPending?: string;
-  /** 客户集合条数口径提示 */
-  customerNote?: string;
 };
 
 const PAGE_SIZE = 200;
@@ -375,7 +373,6 @@ function currentDemand(): Set<OrgCollection> {
 async function fetchAll(need: ReadonlySet<OrgCollection>): Promise<void> {
   const partial: OrganizationStatus["partial"] = {};
   // 本轮未重取的集合,其降级说明沿用上一份(⛔ 把「这次没取」显示成「后端没这个口径」)。
-  let customerNote = need.has("enterprises") ? undefined : status.customerNote;
   let loadPending = need.has("maintenanceTeams") ? undefined : status.loadPending;
   let regionNameNote = need.has("regions") ? undefined : status.regionNameNote;
 
@@ -412,11 +409,7 @@ async function fetchAll(need: ReadonlySet<OrgCollection>): Promise<void> {
   }
 
   /** ⛔ 全量客户进内存。组织侧只保留空集合;指定客户/删除阻断另走搜索与计数。 */
-  let enterprises = snapshot.enterprises;
-  if (need.has("enterprises")) {
-    enterprises = [];
-    customerNote = "客户集合不再全量进内存(真实体量以万计);指定客户请搜索选用,删除阻断改用区域/主体计数。";
-  }
+  const enterprises = need.has("enterprises") ? [] : snapshot.enterprises;
   const customerIndex = new Map<string, number>();
 
   let operators = snapshot.operators;
@@ -457,7 +450,7 @@ async function fetchAll(need: ReadonlySet<OrgCollection>): Promise<void> {
   markLoaded(ready);
 
   snapshot = { regions, operators, partners, operationsTeams, maintenanceTeams, enterprises };
-  status = { loading: false, error: null, partial, regionNameNote, loadPending, customerNote };
+  status = { loading: false, error: null, partial, regionNameNote, loadPending };
   notify();
 }
 
@@ -468,8 +461,7 @@ async function fetchAll(need: ReadonlySet<OrgCollection>): Promise<void> {
  * 因此自动保持页面口径。⛔ 无条件拉全部:工单台账进入只应打 `ops_team/get_list`。
  * 在飞那一轮覆盖不全本次需求时,先等它完成再补取差额(⛔ 让后挂载的页面拿到缺集合的应答)。
  *
- * ⚠️ 客户集合**不再**全量拉取(真实体量以万计):`enterprises` 需求只清空并写
- * `customerNote`;指定客户改搜索选用,删除阻断改用区域/主体计数。
+ * 组织页通过搜索选择指定客户,通过区域或主体计数判断是否允许删除。
  */
 export function reloadOrganizationData(next?: readonly OrgCollection[], options?: { force?: boolean }): Promise<void> {
   const need = next ? new Set(next) : currentDemand();

+ 1 - 1
web-scaffold/src/pages/OrganizationPages.tsx

@@ -94,7 +94,7 @@ function refuseText(res: unknown): string {
 /** 取数门:整体失败原文+重试、逐集合失败原文、后端降级说明(⛔ 加载中 helper,其它页也不用)。 */
 function OrgFetchState({ status, collections }: { status: OrganizationStatus; collections?: (keyof OrganizationStatus["partial"])[] }) {
   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;
   return <>
     {status.error && <p className="org-form-error">组织档案读取失败:{status.error.message}<button className="org-inline-link" type="button" onClick={() => void reloadOrganizationData()}>重试</button></p>}