优化评查详情,新增信息提示框组件

This commit is contained in:
2025-04-23 20:48:32 +08:00
parent ee36ce2620
commit be99fdec79
15 changed files with 1399 additions and 757 deletions
+2 -1
View File
@@ -145,7 +145,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
// 表单处理
export async function action({ request }: ActionFunctionArgs) {
const formData = await request.formData();
// 提取表单数据
const id = formData.get("id") as string | null;
const name = formData.get("name") as string;
@@ -156,6 +156,7 @@ export async function action({ request }: ActionFunctionArgs) {
const parentId = groupType === "secondary" ? formData.get("parentId") as string : null;
// 表单验证
// action是处于服务端的表单提交方法,这里再次验证表单数据也是出于安全考虑,防止客户端验证被绕过从而提交非法数据
const errors: ActionData["errors"] = {};
if (!name || name.trim() === "") {