From 2395d792db543c1089f5f7a5f9f88b8b17204b60 Mon Sep 17 00:00:00 2001 From: kennethcheng Date: Wed, 29 Apr 2026 10:08:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E4=BF=AE=E5=A4=8D=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E4=B8=AD=20FormField=20=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E8=A2=AB=E7=A0=B4=E5=9D=8F=E5=AF=BC=E8=87=B4=E7=9A=84=E4=B8=8A?= =?UTF-8?q?=E4=B8=8B=E6=96=87=E8=B6=8A=E7=95=8C=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../update-transaction-dialog.tsx | 88 ++++++++++++------- 1 file changed, 54 insertions(+), 34 deletions(-) diff --git a/src/components/transactions/update-transaction-dialog.tsx b/src/components/transactions/update-transaction-dialog.tsx index 291778f..09c1fc6 100644 --- a/src/components/transactions/update-transaction-dialog.tsx +++ b/src/components/transactions/update-transaction-dialog.tsx @@ -47,6 +47,8 @@ interface Asset { } const updateTransactionSchema = z.object({ + assetId: z.string(), + txType: z.string(), quantity: z.string().regex(/^-?\d+(\.\d+)?$/, '数量必须是数字'), price: z.string().regex(/^-?\d+(\.\d+)?$/, '价格必须是数字'), fee: z.string().regex(/^-?\d+(\.\d+)?$/, '手续费必须是数字').default('0'), @@ -85,6 +87,8 @@ export function UpdateTransactionDialog({ const form = useForm({ resolver: zodResolver(updateTransactionSchema), defaultValues: { + assetId: '', + txType: '', quantity: '', price: '', fee: '0', @@ -96,6 +100,8 @@ export function UpdateTransactionDialog({ useEffect(() => { if (transaction && open) { form.reset({ + assetId: transaction.assetId, + txType: transaction.txType, quantity: transaction.quantity.toString(), price: transaction.price.toString(), fee: transaction.fee.toString(), @@ -138,40 +144,54 @@ export function UpdateTransactionDialog({
- - 标的资产 - - - - 交易类型 - - + ( + + 标的资产 + + + + )} + /> + ( + + 交易类型 + + + + )} + />