import React from 'react'; import { Button, Popover, Tabs, Flex, Card, Form, InputNumber, Switch, Radio } from 'antd'; import Styles from './web.pc.module.less'; import OfflineConfig from '../../offlineAccount/config'; const PayChannelConfigDict = {}; export function registerPayChannelComponent(entity, component) { PayChannelConfigDict[entity] = component; } function PayConfig(props) { const { payConfig, update, t } = props; const withdrawLoss = payConfig?.withdrawLoss; const depositLoss = payConfig?.depositLoss; const updateDepositLoss = (data) => { update && update({ depositLoss: { ...depositLoss, ...data, }, withdrawLoss: withdrawLoss || { conservative: false, }, }); }; const updateWithdrawLoss = (data) => { update && update({ depositLoss: depositLoss || {}, withdrawLoss: { conservative: !!(withdrawLoss?.conservative), ...withdrawLoss, ...data, }, }); }; return ( {t("help")} }>
{ const ratio = value; updateDepositLoss({ ratio: ratio || 0 }); }}/> { const highest = value; updateDepositLoss({ highest: highest || undefined }); return; }}/> { const lowest = value; updateDepositLoss({ lowest: lowest || undefined }); return; }}/>
{t("help")} }>
{ updateWithdrawLoss({ conservative }); }}/> { const ratio = value; updateWithdrawLoss({ ratio: ratio || 0 }); }}/> { const highest = value; updateWithdrawLoss({ highest: highest || undefined }); return; }}/> { const lowest = value; updateWithdrawLoss({ lowest: lowest || undefined }); return; }}/> updateWithdrawLoss({ trim: target.value, })}/>
); } export default function render(props) { const { system, oakFullpath, operation, oakDirty, serverUrl, oakExecutable, canUpdate } = props.data; const { t, update, clean, execute } = props.methods; if (system && oakFullpath) { return (
{t('system')}
), key: 'system', children: ( update({ payConfig }) : undefined} t={t}/> ), }, { label: (
{t('offlineAccount:name')}
), key: 'offlineAccount', children: (), }, ...Object.keys(PayChannelConfigDict).map((ele) => { const C = PayChannelConfigDict[ele]; return { // @oak-ignore label: (
{t(`${ele}:name`)}
), key: ele, children: }; }) ]}/> ); } return null; }