Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
anonymous committed Mar 23, 2024
1 parent 8ed9794 commit 6743102
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "moneynote-pc",
"version": "1.0.85",
"version": "1.0.86",
"private": true,
"scripts": {
"analyze": "cross-env ANALYZE=1 max build",
Expand Down
26 changes: 19 additions & 7 deletions src/pages/BalanceFlow/ActionForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,12 @@ export default ({ initType = 'EXPENSE' }) => {
categories: newValues.categories
});
}

function rateClickHandler2() {
const amount = formRef.current?.getFieldValue('amount');
formRef.current?.setFieldsValue({
convertedAmount: (currencyRate * Number(amount)).toFixed(2)
});
}

const successHandler = () => {
actionRef.current?.reload();
Expand Down Expand Up @@ -298,11 +303,18 @@ export default ({ initType = 'EXPENSE' }) => {
rules={requiredRules()}
/>
{currencyConvert.needConvert && (
<ProFormText
name="convertedAmount"
label={convertCurrencyMsg}
rules={requiredRules()}
/>
<Space.Compact>
<Form.Item
name='convertedAmount'
label={convertCurrencyMsg}
rules={requiredRules()}
>
<Input />
</Form.Item>
<Tooltip title={currencyTooltipMsg}>
<Button onClick={() => rateClickHandler2()} loading={currencyRateLoading} size="small" type="primary" icon={<CalculatorOutlined /> } />
</Tooltip>
</Space.Compact>
)}
</>
)}
Expand Down Expand Up @@ -343,7 +355,7 @@ export default ({ initType = 'EXPENSE' }) => {
rules={requiredRules()}
labelCol={{ span: 10 }}
>
<Input />
<Input />
</Form.Item>
<Tooltip title={currencyTooltipMsg}>
<Button onClick={() => rateClickHandler(field)} loading={currencyRateLoading} size="small" type="primary" icon={<CalculatorOutlined /> } />
Expand Down

0 comments on commit 6743102

Please sign in to comment.