RoutePlaceholder.tsx 1 KB
import { UCard, UEmpty } from '@uj/ui';
import { PageShell } from '@/components';

interface RoutePlaceholderProps {
  /** 菜单名,逐字来自 scripts/usedcar-menu-complete.sql 的 menu_name。 */
  title: string;
  /** 菜单节点登记的完整后台路由,逐字来自同一份 SQL 的 route。 */
  route: string;
}

/**
 * 页面占位:页面内容按要求留空,只显示当前路由。
 *
 * 路由值取各页面在 sys_menu 登记的 route 常量(由 SQL 反推),不读子应用的
 * window.location —— wujie 下页面由主壳经 props.page + bus 决定,子应用自身的
 * location 不是后台地址栏路径。哪条 ROUTES 命中,显示的就一定是那条路由。
 *
 * 布局走共享层 PageShell / @uj/ui,不直接引 antd、不写死颜色。
 */
export function RoutePlaceholder({ title, route }: RoutePlaceholderProps) {
  return (
    <PageShell title={title}>
      <UCard>
        <UEmpty description={`当前路由:${route}`} />
      </UCard>
    </PageShell>
  );
}