fix:开发完毕

This commit is contained in:
彭帅
2026-05-28 17:25:32 +08:00
parent 50879a71da
commit c5d4d7a7e1
63 changed files with 4960 additions and 851 deletions

View File

@@ -1,5 +1,6 @@
"use client";
import Link from "next/link";
import { useCallback, useMemo, useState } from "react";
import { GitFork } from "lucide-react";
import { BrapiEntityPage, type BrapiFormField } from "@/components/brapi/BrapiEntityPage";
@@ -123,12 +124,43 @@ export function CrossEntityTab() {
icon={GitFork}
iconBg="bg-gradient-to-br from-emerald-500 to-green-600"
title="计划杂交"
description="cross_entity(planned=true):录入杂交计划亲本请在「杂交亲本」Tab 维护"
description="cross_entity(planned=true):录入杂交计划亲本与详情页 Parents Tab 维护"
addLabel="新增计划杂交"
useEnhancedDialog
columns={[
{ key: "plannedCrossDbId", label: "Cross ID" },
{ key: "name", label: "名称" },
{
key: "plannedCrossDbId",
label: "Cross ID",
render: (value, row) => {
const id = String(row.id ?? row.plannedCrossDbId ?? value ?? "");
if (!id) return "—";
return (
<Link
href={`/germplasm/cross-pedigree/planned-crosses/${encodeURIComponent(id)}`}
className="font-medium text-emerald-600 hover:underline dark:text-emerald-400"
>
{id}
</Link>
);
},
},
{
key: "name",
label: "名称",
render: (value, row) => {
const id = String(row.id ?? row.plannedCrossDbId ?? "");
const name = String(value ?? "—");
if (!id) return name;
return (
<Link
href={`/germplasm/cross-pedigree/planned-crosses/${encodeURIComponent(id)}`}
className="font-medium text-emerald-600 hover:underline dark:text-emerald-400"
>
{name}
</Link>
);
},
},
{ key: "crossing_project_name", label: "杂交项目" },
{ key: "cross_type", label: "类型", render: crossTypeLabel },
{ key: "status", label: "状态", render: plannedStatusLabel },
@@ -156,12 +188,43 @@ export function CrossEntityTab() {
icon={GitFork}
iconBg="bg-gradient-to-br from-green-600 to-emerald-700"
title="实际杂交"
description="cross_entity(planned=false):完成实际杂交后可关联来源计划杂交亲本请在「杂交亲本」Tab 维护"
description="cross_entity(planned=false):完成实际杂交后可关联来源计划杂交并继承亲本;详情页维护 Parents 与授粉事件"
addLabel="新增实际杂交"
useEnhancedDialog
columns={[
{ key: "crossDbId", label: "Cross ID" },
{ key: "name", label: "名称" },
{
key: "crossDbId",
label: "Cross ID",
render: (value, row) => {
const id = String(row.id ?? row.crossDbId ?? value ?? "");
if (!id) return "—";
return (
<Link
href={`/germplasm/cross-pedigree/crosses/${encodeURIComponent(id)}`}
className="font-medium text-green-600 hover:underline dark:text-green-400"
>
{id}
</Link>
);
},
},
{
key: "name",
label: "名称",
render: (value, row) => {
const id = String(row.id ?? row.crossDbId ?? "");
const name = String(value ?? "—");
if (!id) return name;
return (
<Link
href={`/germplasm/cross-pedigree/crosses/${encodeURIComponent(id)}`}
className="font-medium text-green-600 hover:underline dark:text-green-400"
>
{name}
</Link>
);
},
},
{ key: "crossing_project_name", label: "杂交项目" },
{ key: "plannedCrossName", label: "来源计划杂交" },
{ key: "cross_type", label: "类型", render: crossTypeLabel },