fix(ui): 補齊 Select 組件的 value 綁定解決表單保存報錯,並使用 parseFloat 剝離編輯狀態下的尾隨零
This commit is contained in:
parent
2395d792db
commit
06e52d58d6
@ -102,9 +102,9 @@ export function UpdateTransactionDialog({
|
||||
form.reset({
|
||||
assetId: transaction.assetId,
|
||||
txType: transaction.txType,
|
||||
quantity: transaction.quantity.toString(),
|
||||
price: transaction.price.toString(),
|
||||
fee: transaction.fee.toString(),
|
||||
quantity: parseFloat(transaction.quantity).toString(),
|
||||
price: parseFloat(transaction.price).toString(),
|
||||
fee: parseFloat(transaction.fee || 0).toString(),
|
||||
txCurrency: transaction.txCurrency,
|
||||
executedAt: transaction.executedAt
|
||||
? new Date(transaction.executedAt).toISOString().slice(0, 16)
|
||||
@ -150,7 +150,7 @@ export function UpdateTransactionDialog({
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>标的资产</FormLabel>
|
||||
<Select disabled>
|
||||
<Select disabled={true} onValueChange={field.onChange} value={field.value} defaultValue={field.value}>
|
||||
<FormControl>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="选择资产" />
|
||||
@ -174,7 +174,7 @@ export function UpdateTransactionDialog({
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>交易类型</FormLabel>
|
||||
<Select disabled>
|
||||
<Select disabled={true} onValueChange={field.onChange} value={field.value} defaultValue={field.value}>
|
||||
<FormControl>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="选择交易类型" />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user