Browse Source

注释平仓

master
yyy 10 months ago
parent
commit
ff381b810c
  1. 72
      src/package/SimpleTrade/pages/client/mt4order/index.tsx

72
src/package/SimpleTrade/pages/client/mt4order/index.tsx

@ -55,42 +55,42 @@ const MT4Order: FC = () => {
<div>{statusText[`${status}`] || ''}</div>
)
},
{
title: '操作',
dataIndex: 'operations',
align: 'center',
key: Date.now(),
render: (text, record) => (
<div>
{record.account_forex_type === 1 && record.handle_status === 4 && (
<Button type='primary' size='small' onClick={() => {
setVisible(true)
setCurrentItem(record)
}}></Button>
)}
</div>
)
}
// {
// title: '操作',
// dataIndex: 'operations',
// align: 'center',
// key: Date.now(),
// render: (text, record) => (
// <div>
// {record.account_forex_type === 1 && record.handle_status === 4 && (
// <Button type='primary' size='small' onClick={() => {
// setVisible(true)
// setCurrentItem(record)
// }}>平仓</Button>
// )}
// </div>
// )
// }
], [])
const closePosition = async () => {
let params = {
login: currentItem.login,
ticket: `${currentItem.order}`,
volume: currentItem.volume
}
setVisible(false)
const res: any = await clientApi.close_order(params)
if (res.code === 0) {
notification.success({
message: '平仓成功'
})
setCurrentItem({})
setTimeout(() => {
tableRefs.current?.update()
}, 1000)
}
}
// const closePosition = async () => {
// let params = {
// login: currentItem.login,
// ticket: `${currentItem.order}`,
// volume: currentItem.volume
// }
// setVisible(false)
// const res: any = await clientApi.close_order(params)
// if (res.code === 0) {
// notification.success({
// message: '平仓成功'
// })
// setCurrentItem({})
// setTimeout(() => {
// tableRefs.current?.update()
// }, 1000)
// }
// }
return (
<div>
@ -100,9 +100,9 @@ const MT4Order: FC = () => {
columns={column}
rowKey="order"
/>
<Modal visible={visible} onCancel={() => setVisible(false)} title='提示' onOk={closePosition}>
{/* <Modal visible={visible} onCancel={() => setVisible(false)} title='' onOk={closePosition}>
<div></div>
</Modal>
</Modal> */}
</div>
)
}

Loading…
Cancel
Save