ASSET1 统一电子资产与固定资产台账

这个提交包含在:
2026-05-22 22:04:41 +08:00
父节点 c2a3c7a84b
当前提交 9090046a97
共修改 18 个文件,包含 1457 行新增和 199 行删除
+33
查看文件
@@ -1,6 +1,8 @@
import { apiRequestData } from "./http";
export type AssetStatus = "in_stock" | "in_use" | "under_repair" | "retired" | "archived";
export type AssetType = "fixed_asset" | "electronic_document" | "electronic_system" | "code_repository" | "backup_media";
export type AssetSensitivityLevel = "public_candidate" | "internal" | "confidential" | "strictly_confidential";
export type AssetCategoryItem = {
id: string;
@@ -33,6 +35,8 @@ export type AssetItem = {
id: string;
assetNo: string;
name: string;
assetType: AssetType;
sensitivityLevel: AssetSensitivityLevel;
categoryId: string;
legalEntityId: string;
costCenterId: string;
@@ -41,6 +45,17 @@ export type AssetItem = {
location: string | null;
status: AssetStatus;
assigneeEmployeeId: string | null;
ownerEmployeeId: string | null;
keeperEmployeeId: string | null;
archiveLocation: string | null;
externalRef: string | null;
sourceHash: string | null;
verificationNo: string | null;
confidentialityNote: string | null;
metadata: Record<string, unknown> | null;
sensitiveFieldsRedacted?: boolean;
lastVerifiedAt: string | null;
expiresAt: string | null;
activatedAt: string | null;
retiredAt: string | null;
createdAt: string | null;
@@ -82,6 +97,8 @@ export type AssetItem = {
name: string;
} | null;
} | null;
owner: AssetAssigneeOption | null;
keeper: AssetAssigneeOption | null;
permissions: {
canEdit: boolean;
};
@@ -99,8 +116,12 @@ export type AssetListResponse = {
export type AssetListQuery = {
status?: AssetStatus;
assetType?: AssetType;
sensitivityLevel?: AssetSensitivityLevel;
categoryId?: string;
assigneeId?: string;
ownerId?: string;
keeperId?: string;
legalEntityId?: string;
costCenterId?: string;
q?: string;
@@ -109,6 +130,8 @@ export type AssetListQuery = {
export type CreateAssetPayload = {
name: string;
assetType?: AssetType;
sensitivityLevel?: AssetSensitivityLevel;
categoryId: string;
legalEntityId: string;
costCenterId: string;
@@ -117,6 +140,16 @@ export type CreateAssetPayload = {
location?: string | null;
status?: AssetStatus;
assigneeEmployeeId?: string | null;
ownerEmployeeId?: string | null;
keeperEmployeeId?: string | null;
archiveLocation?: string | null;
externalRef?: string | null;
sourceHash?: string | null;
verificationNo?: string | null;
confidentialityNote?: string | null;
metadata?: Record<string, unknown> | null;
lastVerifiedAt?: string | null;
expiresAt?: string | null;
activatedAt?: string | null;
retiredAt?: string | null;
};
+270 -4
查看文件
@@ -20,7 +20,9 @@ import {
type AssetCategoryItem,
type AssetErpStage,
type AssetErpTrack,
type AssetSensitivityLevel,
type AssetStatus,
type AssetType,
} from "../api/assets";
import { fetchPurchaseRequests } from "../api/purchaseRequests";
import { fetchCostCenters, fetchDocumentCategories, fetchLegalEntities } from "../api/masterData";
@@ -58,6 +60,8 @@ function initialCategoryForm() {
function initialAssetForm() {
return {
name: "",
assetType: "fixed_asset" as AssetType,
sensitivityLevel: "internal" as AssetSensitivityLevel,
categoryId: "",
legalEntityId: "",
costCenterId: "",
@@ -66,6 +70,16 @@ function initialAssetForm() {
location: "",
status: "in_stock" as AssetStatus,
assigneeEmployeeId: "",
ownerEmployeeId: "",
keeperEmployeeId: "",
archiveLocation: "",
externalRef: "",
sourceHash: "",
verificationNo: "",
confidentialityNote: "",
metadataText: "",
lastVerifiedAt: "",
expiresAt: "",
activatedAt: "",
retiredAt: "",
};
@@ -82,6 +96,75 @@ function assetStatusOptions(): Array<{ value: AssetStatus | ""; label: string }>
];
}
function assetTypeOptions(): Array<{ value: AssetType | ""; label: string }> {
return [
{ value: "", label: "全部资产类型" },
{ value: "fixed_asset", label: "固定资产 FA" },
{ value: "electronic_document", label: "电子资料 EA-DOC" },
{ value: "electronic_system", label: "电子系统 EA-SYS" },
{ value: "code_repository", label: "代码仓库 EA-REPO" },
{ value: "backup_media", label: "备份介质 EA-BKP" },
];
}
function assetTypeLabel(value: AssetType | string | null | undefined) {
return assetTypeOptions().find((item) => item.value === value)?.label ?? "未知类型";
}
function sensitivityOptions(): Array<{ value: AssetSensitivityLevel | ""; label: string }> {
return [
{ value: "", label: "全部敏感级别" },
{ value: "public_candidate", label: "可公开候选" },
{ value: "internal", label: "内部资料" },
{ value: "confidential", label: "商业秘密/机密" },
{ value: "strictly_confidential", label: "严格保密" },
];
}
function sensitivityLabel(value: AssetSensitivityLevel | string | null | undefined) {
return sensitivityOptions().find((item) => item.value === value)?.label ?? "未分级";
}
function typeHint(assetType: AssetType) {
switch (assetType) {
case "electronic_document":
return "电子资料只登记摘要、hash、敏感级别和归档位置;S3/S4 原文和完整路径不上传公网 OA。";
case "electronic_system":
return "电子系统登记负责人、入口、到期和备份策略;账号密码、token、Secret 不进 OA。";
case "code_repository":
return "代码仓库继续由 Git 管理,OA 只登记仓库元数据、负责人和备份策略。";
case "backup_media":
return "备份介质记录保管人、加密状态、备份范围和最近恢复验证时间。";
default:
return "固定资产支持领用、归还、调拨、盘点和移动扫码。";
}
}
function unsafeAssetTextReason(value: string) {
if (!value.trim()) {
return "";
}
if (/(?:token|secret|password|passwd|pwd|api[_-]?key|access[_-]?key|private[_-]?key|encodingaeskey)\s*[:=]/i.test(value)) {
return "不要填写 token、Secret、密码或密钥";
}
if (/\b[A-Z0-9_]*(?:SECRET|TOKEN|PASSWORD|PRIVATE_KEY|ENCODINGAESKEY)[A-Z0-9_]*\b/.test(value)) {
return "不要填写密钥类环境变量名或配置片段";
}
if (/(?:密码|密钥|私钥|令牌)\s*[::=]/.test(value) || /\bBearer\s+[A-Za-z0-9._-]{10,}/i.test(value)) {
return "不要填写密码、密钥、令牌或授权头";
}
if (/-----BEGIN [A-Z ]*PRIVATE KEY-----/i.test(value)) {
return "不要填写证书私钥或密钥正文";
}
if (/(^|[\s"'((,,;;])(?:\/(?:home|root|Users|var|etc|mnt|Volumes|app)\/|[A-Za-z]:[\\/]|\\\\)/i.test(value)) {
return "不要填写本机或服务器完整路径";
}
if (/(原始\s*(?:payload|xml|报文|正文|表单)|raw\s*(?:payload|xml|body|form))/i.test(value)) {
return "不要填写原始 payload、XML、表单或正文";
}
return "";
}
function formatAssetErpReason(reason: string | null) {
switch (reason) {
case "erp_sync_disabled":
@@ -129,10 +212,13 @@ export function AssetRegistryPage() {
const [editingCategoryId, setEditingCategoryId] = useState("");
const [statusFilter, setStatusFilter] = useState<AssetStatus | "">("");
const [assetTypeFilter, setAssetTypeFilter] = useState<AssetType | "">("");
const [sensitivityFilter, setSensitivityFilter] = useState<AssetSensitivityLevel | "">("");
const [categoryFilter, setCategoryFilter] = useState("");
const [legalEntityFilter, setLegalEntityFilter] = useState("");
const [costCenterFilter, setCostCenterFilter] = useState("");
const [assigneeFilter, setAssigneeFilter] = useState("");
const [assetSearch, setAssetSearch] = useState("");
const [mine, setMine] = useState(!canViewAll);
const [selectedAssetId, setSelectedAssetId] = useState(searchParams.get("id") ?? "");
@@ -150,14 +236,17 @@ export function AssetRegistryPage() {
});
const assetsQuery = useQuery({
queryKey: ["assets", "list", statusFilter, categoryFilter, legalEntityFilter, costCenterFilter, assigneeFilter, mine, canViewAll],
queryKey: ["assets", "list", statusFilter, assetTypeFilter, sensitivityFilter, categoryFilter, legalEntityFilter, costCenterFilter, assigneeFilter, assetSearch, mine, canViewAll],
queryFn: () =>
fetchAssets({
status: statusFilter || undefined,
assetType: assetTypeFilter || undefined,
sensitivityLevel: sensitivityFilter || undefined,
categoryId: categoryFilter || undefined,
legalEntityId: legalEntityFilter || undefined,
costCenterId: costCenterFilter || undefined,
assigneeId: assigneeFilter || undefined,
q: assetSearch.trim() || undefined,
mine: canViewAll ? mine : true,
}),
});
@@ -259,6 +348,8 @@ export function AssetRegistryPage() {
const asset = assetDetailQuery.data.asset;
setAssetForm({
name: asset.name,
assetType: asset.assetType,
sensitivityLevel: asset.sensitivityLevel,
categoryId: asset.categoryId,
legalEntityId: asset.legalEntityId,
costCenterId: asset.costCenterId,
@@ -267,6 +358,16 @@ export function AssetRegistryPage() {
location: asset.location ?? "",
status: asset.status,
assigneeEmployeeId: asset.assigneeEmployeeId ?? "",
ownerEmployeeId: asset.ownerEmployeeId ?? "",
keeperEmployeeId: asset.keeperEmployeeId ?? "",
archiveLocation: asset.archiveLocation ?? "",
externalRef: asset.externalRef ?? "",
sourceHash: asset.sourceHash ?? "",
verificationNo: asset.verificationNo ?? "",
confidentialityNote: asset.confidentialityNote ?? "",
metadataText: asset.metadata ? JSON.stringify(asset.metadata, null, 2) : "",
lastVerifiedAt: asset.lastVerifiedAt ?? "",
expiresAt: asset.expiresAt ?? "",
activatedAt: asset.activatedAt ?? "",
retiredAt: asset.retiredAt ?? "",
});
@@ -319,9 +420,23 @@ export function AssetRegistryPage() {
setAssetFormError("");
}
function parseAssetMetadata() {
const text = assetForm.metadataText.trim();
if (!text) {
return null;
}
const parsed = JSON.parse(text) as unknown;
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
throw new Error("扩展元数据必须是 JSON 对象");
}
return parsed as Record<string, unknown>;
}
function buildCreateAssetPayload() {
return {
name: assetForm.name.trim(),
assetType: assetForm.assetType,
sensitivityLevel: assetForm.sensitivityLevel,
categoryId: assetForm.categoryId,
legalEntityId: assetForm.legalEntityId,
costCenterId: assetForm.costCenterId,
@@ -330,6 +445,16 @@ export function AssetRegistryPage() {
location: assetForm.location.trim() || null,
status: assetForm.status,
assigneeEmployeeId: assetForm.assigneeEmployeeId || null,
ownerEmployeeId: assetForm.ownerEmployeeId || null,
keeperEmployeeId: assetForm.keeperEmployeeId || null,
archiveLocation: assetForm.archiveLocation.trim() || null,
externalRef: assetForm.externalRef.trim() || null,
sourceHash: assetForm.sourceHash.trim() || null,
verificationNo: assetForm.verificationNo.trim() || null,
confidentialityNote: assetForm.confidentialityNote.trim() || null,
metadata: parseAssetMetadata(),
lastVerifiedAt: assetForm.lastVerifiedAt || null,
expiresAt: assetForm.expiresAt || null,
activatedAt: assetForm.activatedAt || null,
retiredAt: assetForm.retiredAt || null,
};
@@ -338,12 +463,23 @@ export function AssetRegistryPage() {
function buildPatchAssetPayload() {
return {
name: assetForm.name.trim(),
sensitivityLevel: assetForm.sensitivityLevel,
categoryId: assetForm.categoryId,
legalEntityId: assetForm.legalEntityId,
costCenterId: assetForm.costCenterId,
serialNo: assetForm.serialNo.trim() || null,
location: assetForm.location.trim() || null,
status: assetForm.status,
ownerEmployeeId: assetForm.ownerEmployeeId || null,
keeperEmployeeId: assetForm.keeperEmployeeId || null,
archiveLocation: assetForm.archiveLocation.trim() || null,
externalRef: assetForm.externalRef.trim() || null,
sourceHash: assetForm.sourceHash.trim() || null,
verificationNo: assetForm.verificationNo.trim() || null,
confidentialityNote: assetForm.confidentialityNote.trim() || null,
metadata: parseAssetMetadata(),
lastVerifiedAt: assetForm.lastVerifiedAt || null,
expiresAt: assetForm.expiresAt || null,
activatedAt: assetForm.activatedAt || null,
retiredAt: assetForm.retiredAt || null,
};
@@ -362,6 +498,28 @@ export function AssetRegistryPage() {
if (!assetForm.costCenterId) {
throw new Error("请选择成本中心");
}
if (assetForm.verificationNo.trim() && !/^VER-\d{5,}$/.test(assetForm.verificationNo.trim())) {
throw new Error("历史验证编号格式应为 VER-NNNNN");
}
if (assetForm.sourceHash.trim() && !/^[A-Za-z0-9:_-]+$/.test(assetForm.sourceHash.trim())) {
throw new Error("文件 hash / 校验摘要只能包含字母、数字、冒号、下划线和短横线");
}
if (["electronic_document", "electronic_system", "code_repository", "backup_media"].includes(assetForm.assetType) && !assetForm.ownerEmployeeId) {
throw new Error("电子资产请指定负责人");
}
const textFields = [
["资产名称", assetForm.name],
["归档位置/备份位置", assetForm.archiveLocation],
["外部引用/仓库地址", assetForm.externalRef],
["保密/回收要求", assetForm.confidentialityNote],
["扩展元数据 JSON", assetForm.metadataText],
] as const;
for (const [label, value] of textFields) {
const reason = unsafeAssetTextReason(value);
if (reason) {
throw new Error(`${label}:${reason}`);
}
}
}
const saveCategoryMutation = useMutation({
@@ -699,6 +857,11 @@ export function AssetRegistryPage() {
<div className="space-y-6">
<FilterBar className="space-y-4">
<div className="grid gap-3 md:grid-cols-3 xl:grid-cols-6">
<Input
placeholder="搜索编号/名称/hash/VER"
value={assetSearch}
onChange={(event) => setAssetSearch(event.target.value)}
/>
<select className="select-std" value={statusFilter} onChange={(event) => setStatusFilter(event.target.value as AssetStatus | "") }>
{assetStatusOptions().map((item) => (
<option key={item.value || "all"} value={item.value}>
@@ -706,6 +869,20 @@ export function AssetRegistryPage() {
</option>
))}
</select>
<select className="select-std" value={assetTypeFilter} onChange={(event) => setAssetTypeFilter(event.target.value as AssetType | "") }>
{assetTypeOptions().map((item) => (
<option key={item.value || "all"} value={item.value}>
{item.label}
</option>
))}
</select>
<select className="select-std" value={sensitivityFilter} onChange={(event) => setSensitivityFilter(event.target.value as AssetSensitivityLevel | "") }>
{sensitivityOptions().map((item) => (
<option key={item.value || "all"} value={item.value}>
{item.label}
</option>
))}
</select>
<select className="select-std" value={categoryFilter} onChange={(event) => setCategoryFilter(event.target.value)}>
<option value="">全部分类</option>
{(categoriesQuery.data?.items ?? []).map((item) => (
@@ -785,6 +962,10 @@ export function AssetRegistryPage() {
<div className="text-zinc-400">分类</div>
<div className="mt-0.5 truncate text-zinc-700">{item.category?.name ?? "-"}</div>
</div>
<div>
<div className="text-zinc-400">类型</div>
<div className="mt-0.5 truncate text-zinc-700">{assetTypeLabel(item.assetType)}</div>
</div>
<div>
<div className="text-zinc-400">归属人</div>
<div className="mt-0.5 truncate text-zinc-700">{item.assignee?.name ?? "-"}</div>
@@ -801,9 +982,11 @@ export function AssetRegistryPage() {
<TableHeader>
<tr>
<TableHead>资产</TableHead>
<TableHead>类型</TableHead>
<TableHead>分类</TableHead>
<TableHead>敏感级别</TableHead>
<TableHead>状态</TableHead>
<TableHead>归属人</TableHead>
<TableHead>负责人</TableHead>
</tr>
</TableHeader>
<TableBody>
@@ -816,14 +999,16 @@ export function AssetRegistryPage() {
<div className="font-medium text-zinc-900">{item.assetNo}</div>
<div className="text-xs text-zinc-500">{item.name}</div>
</TableCell>
<TableCell>{assetTypeLabel(item.assetType)}</TableCell>
<TableCell>{item.category?.name ?? "-"}</TableCell>
<TableCell>{sensitivityLabel(item.sensitivityLevel)}</TableCell>
<TableCell><StatusBadge status={item.status} /></TableCell>
<TableCell>{item.assignee?.name ?? "-"}</TableCell>
<TableCell>{item.owner?.name ?? item.assignee?.name ?? "-"}</TableCell>
</TableRow>
))
) : (
<TableRow>
<TableCell colSpan={4} className="py-4 text-zinc-500">
<TableCell colSpan={6} className="py-4 text-zinc-500">
暂无资产卡片
</TableCell>
</TableRow>
@@ -857,6 +1042,12 @@ export function AssetRegistryPage() {
{!isCreatingAsset && currentAsset ? <StatusBadge status={currentAsset.status} /> : null}
</div>
{!isCreatingAsset && currentAsset?.sensitiveFieldsRedacted ? (
<p className="rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-700">
当前资产包含敏感字段,你可查看摘要;归档位置、外部引用、hash 和扩展元数据仅管理员或相关责任人可见。
</p>
) : null}
{assetFormError ? (
<p className="rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-600">{assetFormError}</p>
) : null}
@@ -866,6 +1057,17 @@ export function AssetRegistryPage() {
<label className="text-sm font-medium text-zinc-700">资产名称</label>
<Input data-testid="asset-name" value={assetForm.name} disabled={!canEditCurrent} onChange={(event) => setAssetForm((current) => ({ ...current, name: event.target.value }))} />
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-zinc-700">资产类型</label>
<select data-testid="asset-type" className="select-std" value={assetForm.assetType} disabled={!canEditCurrent || !isCreatingAsset} onChange={(event) => setAssetForm((current) => ({ ...current, assetType: event.target.value as AssetType }))}>
{assetTypeOptions().filter((item) => item.value).map((item) => (
<option key={item.value} value={item.value}>
{item.label}
</option>
))}
</select>
<p className="text-xs text-zinc-500">{typeHint(assetForm.assetType)}</p>
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-zinc-700">资产状态</label>
<select data-testid="asset-status" className="select-std" value={assetForm.status} disabled={!canEditCurrent} onChange={(event) => setAssetForm((current) => ({ ...current, status: event.target.value as AssetStatus }))}>
@@ -876,6 +1078,16 @@ export function AssetRegistryPage() {
))}
</select>
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-zinc-700">敏感级别</label>
<select data-testid="asset-sensitivity" className="select-std" value={assetForm.sensitivityLevel} disabled={!canEditCurrent} onChange={(event) => setAssetForm((current) => ({ ...current, sensitivityLevel: event.target.value as AssetSensitivityLevel }))}>
{sensitivityOptions().filter((item) => item.value).map((item) => (
<option key={item.value} value={item.value}>
{item.label}
</option>
))}
</select>
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-zinc-700">资产分类</label>
<select data-testid="asset-category" className="select-std" value={assetForm.categoryId} disabled={!canEditCurrent} onChange={(event) => setAssetForm((current) => ({ ...current, categoryId: event.target.value }))}>
@@ -929,6 +1141,28 @@ export function AssetRegistryPage() {
))}
</select>
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-zinc-700">负责人</label>
<select data-testid="asset-owner" className="select-std" value={assetForm.ownerEmployeeId} disabled={!canManage} onChange={(event) => setAssetForm((current) => ({ ...current, ownerEmployeeId: event.target.value }))}>
<option value="">未指定</option>
{(assigneesQuery.data?.items ?? []).map((item) => (
<option key={item.id} value={item.id}>
{item.name} ({item.employeeNo})
</option>
))}
</select>
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-zinc-700">保管人/管理员</label>
<select data-testid="asset-keeper" className="select-std" value={assetForm.keeperEmployeeId} disabled={!canManage} onChange={(event) => setAssetForm((current) => ({ ...current, keeperEmployeeId: event.target.value }))}>
<option value="">未指定</option>
{(assigneesQuery.data?.items ?? []).map((item) => (
<option key={item.id} value={item.id}>
{item.name} ({item.employeeNo})
</option>
))}
</select>
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-zinc-700">采购来源</label>
<select className="select-std" value={assetForm.purchaseRequestId} disabled={!canEditCurrent || !canReadProcurementSources || !isCreatingAsset} onChange={(event) => setAssetForm((current) => ({ ...current, purchaseRequestId: event.target.value }))}>
@@ -948,6 +1182,30 @@ export function AssetRegistryPage() {
<label className="text-sm font-medium text-zinc-700">存放位置</label>
<Input data-testid="asset-location" value={assetForm.location} disabled={!canEditCurrent} onChange={(event) => setAssetForm((current) => ({ ...current, location: event.target.value }))} />
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-zinc-700">归档位置/备份位置</label>
<Input data-testid="asset-archive-location" placeholder="填归档位置摘要或离线档案号,不填 /home 或盘符完整路径" value={assetForm.archiveLocation} disabled={!canEditCurrent} onChange={(event) => setAssetForm((current) => ({ ...current, archiveLocation: event.target.value }))} />
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-zinc-700">外部引用/仓库地址</label>
<Input data-testid="asset-external-ref" placeholder="填系统入口或仓库主页,不填带 token 的链接或完整配置" value={assetForm.externalRef} disabled={!canEditCurrent} onChange={(event) => setAssetForm((current) => ({ ...current, externalRef: event.target.value }))} />
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-zinc-700">文件 hash / 校验摘要</label>
<Input data-testid="asset-source-hash" value={assetForm.sourceHash} disabled={!canEditCurrent} onChange={(event) => setAssetForm((current) => ({ ...current, sourceHash: event.target.value }))} />
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-zinc-700">历史验证编号</label>
<Input data-testid="asset-verification-no" placeholder="VER-00001" value={assetForm.verificationNo} disabled={!canEditCurrent} onChange={(event) => setAssetForm((current) => ({ ...current, verificationNo: event.target.value }))} />
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-zinc-700">最近盘点/恢复验证日期</label>
<Input type="date" value={assetForm.lastVerifiedAt} disabled={!canEditCurrent} onChange={(event) => setAssetForm((current) => ({ ...current, lastVerifiedAt: event.target.value }))} />
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-zinc-700">到期/续费日期</label>
<Input type="date" value={assetForm.expiresAt} disabled={!canEditCurrent} onChange={(event) => setAssetForm((current) => ({ ...current, expiresAt: event.target.value }))} />
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-zinc-700">启用日期</label>
<Input type="date" value={assetForm.activatedAt} disabled={!canEditCurrent} onChange={(event) => setAssetForm((current) => ({ ...current, activatedAt: event.target.value }))} />
@@ -956,6 +1214,14 @@ export function AssetRegistryPage() {
<label className="text-sm font-medium text-zinc-700">退役日期</label>
<Input type="date" value={assetForm.retiredAt} disabled={!canEditCurrent} onChange={(event) => setAssetForm((current) => ({ ...current, retiredAt: event.target.value }))} />
</div>
<div className="space-y-2 md:col-span-2">
<label className="text-sm font-medium text-zinc-700">保密/回收要求</label>
<textarea className="textarea-std min-h-20" placeholder="写回收要求、保管要求或脱敏说明,不写密码、密钥、原文片段" value={assetForm.confidentialityNote} disabled={!canEditCurrent} onChange={(event) => setAssetForm((current) => ({ ...current, confidentialityNote: event.target.value }))} />
</div>
<div className="space-y-2 md:col-span-2">
<label className="text-sm font-medium text-zinc-700">扩展元数据 JSON</label>
<textarea className="textarea-std min-h-24 font-mono text-xs" placeholder='例如 {"backupPolicy":"monthly"};不要粘贴 .env、源码配置、原始 payload 或密钥' value={assetForm.metadataText} disabled={!canEditCurrent} onChange={(event) => setAssetForm((current) => ({ ...current, metadataText: event.target.value }))} />
</div>
</div>