feat(chart): hide qizheng from the chart page; backend endpoint kept (T1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
5dc977ef2c
commit
af27709de4
@@ -17,7 +17,6 @@ import { chartLayerFailureCopy } from "@/lib/chart-view-failure";
|
||||
import { ChartPageSkeleton } from "./chart-page-skeleton";
|
||||
import { ChartBasicsTab } from "./chart-basics-tab";
|
||||
import { ChartDashaTab } from "./chart-dasha-tab";
|
||||
import { ChartQizhengTab } from "./chart-qizheng-tab";
|
||||
import { ChartVedicTab } from "./chart-vedic-tab";
|
||||
import { ChartWesternTab } from "./chart-western-tab";
|
||||
|
||||
@@ -70,7 +69,6 @@ export function ChartPageView({
|
||||
setTab(id);
|
||||
if (id === "dasha") onNeedLayer?.("chara");
|
||||
if (id === "western") onNeedLayer?.("western");
|
||||
if (id === "qizheng") onNeedLayer?.("qizheng");
|
||||
}
|
||||
|
||||
function selectVarga(id: string) {
|
||||
@@ -136,15 +134,6 @@ export function ChartPageView({
|
||||
<ChartWesternTab view={view} />
|
||||
)
|
||||
) : null}
|
||||
{tab === "qizheng" ? (
|
||||
pendingLayers?.has("qizheng") ? (
|
||||
<WaitingNote copy={CHART_VIEW_COPY.waitingLayer} />
|
||||
) : layerFailures?.has("qizheng") ? (
|
||||
<WaitingNote copy={chartLayerFailureCopy(layerFailures.get("qizheng")!)} />
|
||||
) : (
|
||||
<ChartQizhengTab view={view} />
|
||||
)
|
||||
) : null}
|
||||
</>}
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
import type { ChartViewOk } from "@/lib/chart-view-contract";
|
||||
import { COORDINATE_BOUNDARY, QIZHENG_RULES } from "@/lib/chart-view-labels";
|
||||
import { QizhengPalaceGrid } from "./qizheng-palace-grid";
|
||||
|
||||
function Rules() {
|
||||
return (
|
||||
<ul className="chart-page-qizheng-rules">
|
||||
{QIZHENG_RULES.map((rule) => <li key={rule}>{rule}</li>)}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
export function ChartQizhengTab({ view }: { view: ChartViewOk }) {
|
||||
const qizheng = view.qizheng;
|
||||
if (qizheng.status === "unavailable") {
|
||||
return (
|
||||
<div className="chart-page-unavailable">
|
||||
<p className="chart-page-boundary">{COORDINATE_BOUNDARY.qizheng}</p>
|
||||
<p>{qizheng.copy}</p>
|
||||
<Rules />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className="chart-page-qizheng">
|
||||
<p className="chart-page-boundary">{qizheng.boundary}</p>
|
||||
<p className="chart-page-note">计都派别:{qizheng.ketuMode} · 坐标系 {qizheng.coordinateSystem}</p>
|
||||
<Rules />
|
||||
<QizhengPalaceGrid qizheng={qizheng} />
|
||||
<div className="chart-page-planet-table-wrap">
|
||||
<table className="chart-page-planet-table">
|
||||
<caption>十一曜宿度</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">曜</th>
|
||||
<th scope="col">宿</th>
|
||||
<th scope="col">宿度</th>
|
||||
<th scope="col">宫</th>
|
||||
<th scope="col">庙旺</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{qizheng.bodies.map((body) => (
|
||||
<tr key={body.name}>
|
||||
<th scope="row">{body.name}</th>
|
||||
<td>{body.mansion}</td>
|
||||
<td>{body.mansionDegree.toFixed(2)}</td>
|
||||
<td>{body.palace}</td>
|
||||
<td>{body.dignityClosed ? body.dignity : `${body.dignity}(未闭合)`}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
import type { ChartViewQizhengOk } from "@/lib/chart-view-contract";
|
||||
import { QIZHENG_BRANCH_GRID } from "@/lib/chart-view-labels";
|
||||
|
||||
export function QizhengPalaceGrid({ qizheng }: { qizheng: ChartViewQizhengOk }) {
|
||||
const byBranch = new Map(qizheng.palaces.map((palace) => [palace.branch, palace]));
|
||||
return (
|
||||
<div className="chart-page-qizheng-grid" role="img" aria-label="七政四余地支十二宫">
|
||||
{QIZHENG_BRANCH_GRID.flatMap((row, rowIndex) => row.map((branch, columnIndex) => {
|
||||
if (!branch) {
|
||||
return <div key={`empty-${rowIndex}-${columnIndex}`} className="chart-page-qizheng-hole" />;
|
||||
}
|
||||
const palace = byBranch.get(branch);
|
||||
return (
|
||||
<article key={branch} className="chart-page-qizheng-cell">
|
||||
<strong>{branch}</strong>
|
||||
<span>{palace?.lifePalace ?? "—"}</span>
|
||||
<small>{palace?.mansions.length ? palace.mansions.join(" ") : "所辖宿未返回"}</small>
|
||||
<p>{palace?.occupants.length ? palace.occupants.join(" ") : "空"}</p>
|
||||
</article>
|
||||
);
|
||||
}))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user