Commit 0c14d99c by haojie

1

parent 076268a7
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
const n=n=>n.getBoundingClientRect(),e=(n,e="show")=>n?"":"none";export{n as g,e as i};
.t-tooltip .t-popup__content{display:inline-block;border:0;z-index:5600;margin-bottom:1px;max-width:480px;word-break:break-word;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:var(--td-radius-medium);color:var(--td-text-color-primary)}.t-tooltip--default .t-popup__content{color:var(--td-text-color-anti);background:var(--td-gray-color-13);-webkit-box-shadow:inset 0 .5px 0 var(--td-gray-color-9),inset .5px 0 0 var(--td-gray-color-9),inset 0 -.5px 0 var(--td-gray-color-9),inset -.5px 0 0 var(--td-gray-color-9);box-shadow:inset 0 .5px 0 var(--td-gray-color-9),inset .5px 0 0 var(--td-gray-color-9),inset 0 -.5px 0 var(--td-gray-color-9),inset -.5px 0 0 var(--td-gray-color-9)}.t-tooltip--default[data-popper-placement^=left] .t-popup__arrow:before{-webkit-box-shadow:inset -.5px 0 0 var(--td-gray-color-9),inset 0 .5px 0 var(--td-gray-color-9);box-shadow:inset -.5px 0 0 var(--td-gray-color-9),inset 0 .5px 0 var(--td-gray-color-9)}.t-tooltip--default[data-popper-placement^=right] .t-popup__arrow:before{-webkit-box-shadow:inset .5px 0 0 var(--td-gray-color-9),inset 0 -.5px 0 var(--td-gray-color-9);box-shadow:inset .5px 0 0 var(--td-gray-color-9),inset 0 -.5px 0 var(--td-gray-color-9)}.t-tooltip--default[data-popper-placement^=top] .t-popup__arrow:before{-webkit-box-shadow:inset 0 -.5px 0 var(--td-gray-color-9),inset -.5px 0 0 var(--td-gray-color-9);box-shadow:inset 0 -.5px 0 var(--td-gray-color-9),inset -.5px 0 0 var(--td-gray-color-9)}.t-tooltip--default[data-popper-placement^=bottom] .t-popup__arrow:before{-webkit-box-shadow:inset .5px 0 0 var(--td-gray-color-9),inset 0 .5px 0 var(--td-gray-color-9);box-shadow:inset .5px 0 0 var(--td-gray-color-9),inset 0 .5px 0 var(--td-gray-color-9)}.t-tooltip--primary .t-popup__content{color:var(--td-brand-color);background:var(--td-brand-color-light)}.t-tooltip--success .t-popup__content{color:var(--td-success-color);background:var(--td-success-color-light)}.t-tooltip--danger .t-popup__content{color:var(--td-error-color);background:var(--td-error-color-light)}.t-tooltip--warning .t-popup__content{color:var(--td-warning-color);background:var(--td-warning-color-light)}.t-tooltip .t-popup__arrow{background:inherit;height:auto}.t-tooltip .t-popup__arrow:before{background:inherit}.t-tooltip--noshadow .t-popup__content,.t-tooltip--noshadow[data-popper-placement] .t-popup__arrow:before{-webkit-box-shadow:none;box-shadow:none}
This source diff could not be displayed because it is too large. You can view the blob instead.
import{j as o}from"./app-31862dc0.js";import{Y as s}from"./auth-82dcf9fa.js";function n(n){const{onClick:t,className:c,icon:i}=n,r=i??"";return o.jsx(s,{onClick:()=>{t&&t()},icon:r,className:["custom-reset-t-button",c??""].join(" "),children:n.children})}export{n as C};
import{r as t,j as a}from"./app-31862dc0.js";import{I as e}from"./index-f16fae83.js";import{c as s,d as i,e as n,i as c}from"./local-cc653678.js";import"./index-cb06c7d1.js";import"./index-8e22b173.js";import"./auth-82dcf9fa.js";import"./index-313c704e.js";import"./formModel-cd1d5f2d.js";import"./Dialog-64469075.js";import"./index-82987c35.js";class o extends t.Component{constructor(t){super(t),this.state={list:[],loading:!1},this.columns=[{colKey:"ddd",title:"用户名",align:"center",cell:({rowIndex:t,row:a})=>a.exchange_users_id?s(a.exchange_users_id):"null"},{colKey:"exchange",title:"交易所",align:"center"},{colKey:"margin_balance",title:"保证金余额",align:"center"},{colKey:"available_balance",title:"可用余额",align:"center",cell:({rowIndex:t,row:e})=>a.jsx("span",{style:{color:"#12B981"},children:e.available_balance})}]}changeLoding(t){this.setState({loading:t})}async changeList(){try{this.changeLoding(!0);const t=await i();0==t.code&&this.setState({list:t.data.data}),this.changeLoding(!1)}catch(t){}}async componentDidMount(){await n(),this.changeList()}render(){return a.jsxs("div",{className:["contract-account-table",c()?"contract-account-table__mobile":""].join(" "),children:[a.jsx("div",{className:"contract-account-label",children:"合约账户"}),a.jsx("div",{className:"contract-account-table-box",children:a.jsx(e,{columns:this.columns,data:this.state.list,loading:this.state.loading})})]})}}export{o as default};
import{r as e,j as s}from"./app-31862dc0.js";import{f as a,C as t,a as i,g as r,b as l,i as o}from"./local-cc653678.js";import{C as d}from"./index-b10ec9de.js";import{C as n}from"./index-92ac49ec.js";import{C as m}from"./index-eb513bc7.js";import{C as c}from"./index-0a5d5188.js";import{S as h,a as p}from"./submit-4cb12a00.js";import{C as u}from"./trade-8bf27581.js";import{s as _,o as v}from"./auth-82dcf9fa.js";import{i as j}from"./dom-ce105537.js";import{D as x}from"./index-53c17267.js";import"./index-313c704e.js";import"./Dialog-64469075.js";const f="user_ids";class g extends e.Component{constructor(e){super(e),this.onReset=()=>{Object.keys(this.state).forEach((e=>{"string"==typeof this.state[e]?this.setState({[e]:""}):"number"==typeof this.state[e]?this.setState({[e]:0}):this.setState({[e]:[]})}))},this.onSubmit=async()=>{const e=[f,u.pairs,u.side,u.amount,u.position_side,u.order_type];if(!a(e,this.state))return void _("请填写必填项");if("LIMIT"===this.state[u.order_type]&&!this.state[u.limit_price])return void _("限价单价格必填");let s=null;try{s=v();0==(await t(this.state)).code&&(_("提交成功","success"),this.onClose()),s&&s.hide()}catch(i){s&&s.hide()}},this.onValueChange=(e,s)=>{s&&this.setState({[s]:e})},this.onClose=()=>{const{onClose:e}=this.props;e&&e()},this.getStrategy=async()=>{try{const e=await i();0==e.code&&(this.strategyOptions=e.data)}catch(e){}},this.state={[f]:[],[u.pairs]:"",[u.contract_strategy_id]:"",[u.side]:"",[u.position_side]:"",[u.order_type]:"",[u.amount]:null,[u.levers]:null,[u.stop_surplus]:null,[u.stop_loss]:null,[u.limit_price]:null},this.userOptions=r(!0,!1),this.strategyOptions=[],this.sideOptions=l("side",!1),this.positionSideOptions=l("position_side",!1),this.orderTypeOptions=l("order_type",!1)}componentDidMount(){this.getStrategy()}render(){const{visible:e}=this.props,a=this.state;return s.jsx(x,{visible:e,placement:"center",onClose:this.onClose,footer:!1,className:[o()?"trade-dialog__mobile":""].join(" "),children:s.jsxs("div",{className:"custom-trade-form",children:[s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"用户"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(d,{value:a[f],name:f,options:this.userOptions,className:"trade-dialog-select",clearable:!0,multiple:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"交易对"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(m,{value:a[u.pairs],name:u.pairs,align:"center",type:"text",onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label",children:"策略"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(d,{value:a[u.contract_strategy_id],name:u.contract_strategy_id,options:this.strategyOptions,className:"trade-dialog-select",clearable:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"方向"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(d,{value:a[u.side],name:u.side,options:this.sideOptions,className:"trade-dialog-select",clearable:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"买卖类型"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(d,{value:a[u.position_side],name:u.position_side,options:this.positionSideOptions,className:"trade-dialog-select",clearable:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"交易类型"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(d,{value:a[u.order_type],name:u.order_type,options:this.orderTypeOptions,className:"trade-dialog-select",clearable:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",style:{display:j("LIMIT"===a[u.order_type])},children:[s.jsx("div",{className:"trade-form-item__label required",children:"限价价格"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(m,{type:"number",value:a[u.limit_price],align:"center",name:u.limit_price,onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label",children:"杠杆"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(n,{value:a[u.levers],align:"center",name:u.levers,onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"买入金额"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(m,{value:a[u.amount],name:u.amount,align:"center",type:"number",onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label",children:"止盈"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(m,{value:a[u.stop_surplus],name:u.stop_surplus,align:"center",type:"number",suffixIcon:s.jsx("div",{className:"trade-form-input-suffix",children:"%"}),onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label",children:"止损"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(m,{value:a[u.stop_loss],name:u.stop_loss,align:"center",type:"number",suffixIcon:s.jsx("div",{className:"trade-form-input-suffix",children:"%"}),onChange:this.onValueChange})})]}),s.jsx("div",{className:"trade-form-item",children:s.jsx("div",{className:"trade-form-item__value",children:s.jsxs("div",{className:"trade-form-submit",children:[s.jsx(c,{icon:s.jsx(h,{}),onClick:this.onReset,children:"重置"}),s.jsx(c,{icon:s.jsx(p,{}),onClick:this.onSubmit,children:"提交"})]})})})]})})}}export{g as default};
.c-reset-input .t-is-focused{border-color:#c99400;box-shadow:none}.c-reset-input .t-is-focused .t-input__prefix-icon .t-icon{color:#c99400}.c-reset-input .t-is-focused:hover{border-color:#c99400;box-shadow:none}
import{r as e,j as s}from"./app-31862dc0.js";import{C as a}from"./index-82987c35.js";function n(n){const{checked:o}=n,[t,c]=e.useState(o??!1);return s.jsx(a,{className:"reset-t-checkbox",checked:t,onChange:e=>{c(e),n.onChange&&n.onChange(e)}})}export{n as C};
import{r as i,j as s,a as r}from"./app-31862dc0.js";import{L as t,C as o}from"./index-c95fdfd5.js";import e from"./index-1087ec89.js";import m from"./index-b66779e2.js";import"./local-cc653678.js";import"./auth-82dcf9fa.js";import"./index-f16fae83.js";import"./index-cb06c7d1.js";import"./index-8e22b173.js";import"./index-313c704e.js";import"./formModel-cd1d5f2d.js";import"./Dialog-64469075.js";import"./index-82987c35.js";import"./index-88b6973e.js";import"./index-0a5d5188.js";import"./trade-281a8bb7.js";import"./multipleUse-6d627ec3.js";import"./index-d93c9e50.js";import"./index-1c100007.js";import"./index-2e736737.js";import"./dom-ce105537.js";import"./trade-8bf27581.js";import"./index-7a17e3c1.js";import"./index-b10ec9de.js";import"./index-eb513bc7.js";import"./index-ad859412.js";import"./index-92ac49ec.js";import"./submit-4cb12a00.js";class p extends i.Component{constructor(i){super(i)}shouldComponentUpdate(i,s){return!0}render(){return s.jsxs(t,{children:[s.jsx(r,{title:this.props.info.title}),s.jsx(o,{children:s.jsxs("div",{className:"contract-trade-page",children:[s.jsx(e,{}),s.jsx(m,{})]})})]})}}export{p as default};
import{r as e,j as l}from"./app-31862dc0.js";import{j as s,c as a,i as t,l as i}from"./local-cc653678.js";import{P as c}from"./index-cb06c7d1.js";import{g as r,a as d,b as n,c as o}from"./trade-281a8bb7.js";import{o as h}from"./auth-82dcf9fa.js";import"./index-8e22b173.js";import"./index-313c704e.js";class m extends e.Component{constructor(e){super(e),this.pageChange=e=>{this.setState({pageNum:e}),this.getTableList()},this.state={list:[],pageNum:1,pageSize:10,total:0,isFirst:!0},this.columns=[{colKey:"ddd",title:"用户名"},{colKey:"d2",title:"交易所"},{colKey:"d3",title:"交易对"},{colKey:"d4",title:"交易类型",align:"center"},{colKey:"d5",title:"持仓方向",align:"center"},{colKey:"d6",title:"开仓价格",align:"center"},{colKey:"d7",title:"数量",align:"center"},{colKey:"d8",title:"成交数量USDT",align:"center"},{colKey:"d9",title:"状态",align:"center"},{colKey:"d10",title:"交易时间",align:"center"},{colKey:"d11",title:"更新时间",align:"center"},{colKey:"d12",title:"返回值",align:"center"}]}pcTable(){return""}mobileTable(){return l.jsxs("div",{className:"contract-real-table__mobile",children:[this.state.list.map(((e,t)=>{var i;return l.jsxs("div",{className:"table-row",children:[l.jsxs("div",{className:"table-row-line",children:[l.jsx("div",{className:"table-pairs",children:e.symbol}),l.jsx("div",{className:"table-time",children:e.trading_time})]}),l.jsxs("div",{className:"table-row-line",children:[l.jsxs("div",{className:["table-direction"].join(" "),style:{color:r(e.position_side)},children:[s("order_type",e.order_type),"/",d(e.position_side)]}),l.jsxs("div",{className:"table-time",children:[l.jsx("span",{children:"更新时间 "}),e.updated_at]})]}),l.jsxs("div",{className:"table-row-line",children:[l.jsxs("div",{className:"table-col-left",children:[l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"用户"}),l.jsx("div",{className:"table-col-value",children:a(e.exchange_users_id)})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"开仓价格"}),l.jsx("div",{className:"table-col-value",children:e.price})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"成交数量"}),l.jsx("div",{className:"table-col-value",children:parseFloat(e.quantity+"")})]})]}),l.jsxs("div",{className:"table-col-left",children:[l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"交易所"}),l.jsx("div",{className:"table-col-value",children:e.exchange})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"买卖方向"}),l.jsx("div",{className:"table-col-value",children:s("side",e.side)})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"状态"}),l.jsx("div",{className:["table-col-value"].join(" "),style:{color:n(null==(i=e.result)?void 0:i.code)},children:o(e.result)})]})]})]})]},t)})),l.jsx(c,{onChange:this.pageChange,pageNum:this.state.pageNum,pageSize:this.state.pageSize,total:this.state.total})]})}currentTable(){return l.jsx("div",{style:this.props.style??null,className:"c-table-height",children:t()?this.mobileTable():this.pcTable()})}shouldComponentUpdate(e,l,s){return e["v-if"]&&l.isFirst&&(this.setState({isFirst:!1}),this.getTableList()),!0}async getTableList(e){let l=null;try{l=h();let s={page:this.state.pageNum,limit:this.state.pageSize};e&&(s={...s,...e});const a=await i(s);0==a.code&&this.setState({list:a.data.data,total:a.data.total}),l&&l.hide()}catch(s){l&&l.hide()}}render(){return this.props["v-if"]?this.currentTable():l.jsx(l.Fragment,{})}}export{m as default};
.custom-trade-select-box{display:flex;flex-wrap:wrap;row-gap:6px;align-items:center;padding:0 12px;margin-left:-12px}.custom-trade-select-box>:not(:first-child){margin-left:12px}.custom-trade-select-box>*{margin-left:12px}.custom-trade-select-box .custom-trade-input{display:flex;align-items:center;font-size:12px;white-space:nowrap}.custom-trade-select-box .custom-trade-input .label{margin-right:10px}.custom-trade-select-box .custom-trade-input .t-input{height:24px}.custom-trade-select-box .custom-trade-input .t-input .t-input__inner{font-size:12px}.custom-trade-select-box .custom-trade-select{display:flex;align-items:center;white-space:nowrap;font-size:12px}.custom-trade-select-box .custom-trade-select .real-trade-select .t-input__wrap .t-input{font-size:12px;border:none}.custom-trade-select-box .custom-trade-select .real-trade-select .t-input__wrap .t-input--focused{box-shadow:none}.custom-trade-select-box__mobile{border-bottom:1px solid #EAECEF;padding-bottom:6px}
.t-checkbox-group{font:var(--td-font-body-medium);color:var(--td-text-color-primary);-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px}.t-checkbox{font:var(--td-font-body-medium);-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;cursor:pointer;color:var(--td-text-color-primary)}.t-checkbox+.t-checkbox{margin-left:inherit}.t-checkbox__former{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.t-checkbox__input{position:relative;display:inline-block;width:16px;height:16px;vertical-align:middle;border:1px solid var(--td-border-level-2-color);border-radius:var(--td-radius-default);background-color:var(--td-bg-color-container);-webkit-box-sizing:border-box;box-sizing:border-box}.t-checkbox__input:after{content:"";position:absolute;opacity:0;-webkit-box-sizing:border-box;box-sizing:border-box}.t-checkbox__label{display:inline-block;margin-left:8px;vertical-align:middle;font:var(--td-font-body-medium)}.t-checkbox:hover .t-checkbox__input{border-color:var(--td-brand-color);-webkit-transition:border-color .2s linear;transition:border-color .2s linear}.t-checkbox.t-is-checked .t-checkbox__input{border-color:var(--td-brand-color);background-color:var(--td-brand-color);-webkit-transition:background-color .2s cubic-bezier(.82,0,1,.9);transition:background-color .2s cubic-bezier(.82,0,1,.9)}.t-checkbox.t-is-checked .t-checkbox__input:after{opacity:1;top:6px;left:3px;width:5px;height:9px;border:2px solid var(--td-text-color-anti);border-radius:0 0 1px;border-top:0;border-left:0;-webkit-transform:rotate(45deg) scale(1) translate(-50%,-50%);transform:rotate(45deg) scale(1) translate(-50%,-50%);background:transparent}.t-checkbox.t-is-indeterminate .t-checkbox__input{border-color:var(--td-brand-color);background-color:var(--td-brand-color);-webkit-transition:background-color .2s cubic-bezier(.82,0,1,.9);transition:background-color .2s cubic-bezier(.82,0,1,.9)}.t-checkbox.t-is-indeterminate .t-checkbox__input:after{opacity:1;width:16px;height:4px;left:-1px;right:0;top:5px;border:unset;-webkit-transform:scale(.5);transform:scale(.5);background-color:var(--td-font-white-1)}.t-checkbox.t-is-disabled{cursor:not-allowed}.t-checkbox.t-is-disabled .t-checkbox__label{color:var(--td-text-color-disabled)}.t-checkbox.t-is-disabled .t-checkbox__input{background-color:var(--td-bg-color-component-disabled)}.t-checkbox.t-is-disabled:hover .t-checkbox__input,.t-checkbox.t-is-disabled.t-is-checked .t-checkbox__input{border-color:var(--td-border-level-2-color)}.t-checkbox.t-is-disabled.t-is-checked .t-checkbox__input:after{border-color:var(--td-text-color-disabled)}.t-checkbox.t-is-disabled.t-is-indeterminate .t-checkbox__input{border-color:var(--td-border-level-2-color)}.t-checkbox.t-is-disabled.t-is-indeterminate .t-checkbox__input:after{background-color:var(--td-text-color-disabled)}
import{r as e,j as s}from"./app-31862dc0.js";import{w as l,c as a,i as t,x as i}from"./local-cc653678.js";import{P as c}from"./index-cb06c7d1.js";import{C as d}from"./index-0a5d5188.js";import{d as r,e as n}from"./trade-281a8bb7.js";import{s as o,o as h}from"./auth-82dcf9fa.js";import{o as m}from"./multipleUse-6d627ec3.js";import{C as b}from"./index-1c100007.js";import"./index-8e22b173.js";import"./index-313c704e.js";import"./index-82987c35.js";class p extends e.Component{constructor(e){super(e),this.pageChange=e=>{this.setState({pageNum:e}),this.getTableList()},this.state={list:[{}],pageNum:1,pageSize:10,total:0,isFirst:!0},this.columns=[{colKey:"ddd",title:"用户名"},{colKey:"d2",title:"交易所"},{colKey:"d3",title:"交易对"},{colKey:"d4",title:"交易类型",align:"center"},{colKey:"d5",title:"持仓方向",align:"center"},{colKey:"d6",title:"开仓价格",align:"center"},{colKey:"d7",title:"数量",align:"center"},{colKey:"d8",title:"成交数量USDT",align:"center"},{colKey:"d9",title:"时间",align:"center"},{colKey:"d10",title:"操作",align:"center"}]}pcTable(){return""}mobileTable(){return s.jsxs("div",{className:"contract-real-table__mobile",children:[this.state.list.map(((e,t)=>s.jsxs("div",{className:"table-row",children:[s.jsxs("div",{className:"table-row-line",children:[s.jsx("div",{className:"table-pairs",children:e.symbol}),s.jsx("div",{className:"table-time",children:e.working_time})]}),s.jsxs("div",{className:"table-row-line",children:[s.jsxs("div",{className:["table-direction"].join(" "),style:{color:r(e.side)},children:[l("order_type",e.type),"/",n(e.side)]}),s.jsx(d,{onClick:this.tableContractRevoke.bind(this,e),children:"撤销"})]}),s.jsxs("div",{className:"table-row-line",children:[s.jsx(b,{checked:e.is_checked,onChange:s=>{e.is_checked=s}}),s.jsxs("div",{className:"table-col-left",children:[s.jsxs("div",{className:"table-col__line",children:[s.jsx("div",{className:"table-col-label",children:"用户"}),s.jsx("div",{className:"table-col-value",children:a(e.exchange_users_id)})]}),s.jsxs("div",{className:"table-col__line",children:[s.jsx("div",{className:"table-col-label",children:"开仓价格"}),s.jsx("div",{className:"table-col-value",children:e.price})]}),s.jsxs("div",{className:"table-col__line",children:[s.jsx("div",{className:"table-col-label",children:"订单id"}),s.jsx("div",{className:"table-col-value",children:e.order_id})]})]}),s.jsxs("div",{className:"table-col-left",children:[s.jsxs("div",{className:"table-col__line",children:[s.jsx("div",{className:"table-col-label",children:"交易所"}),s.jsx("div",{className:"table-col-value",children:e.exchange})]}),s.jsxs("div",{className:"table-col__line",children:[s.jsx("div",{className:"table-col-label",children:"数量"}),s.jsx("div",{className:"table-col-value",children:e.qty})]}),s.jsxs("div",{className:"table-col__line",children:[s.jsx("div",{className:"table-col-label",children:"状态"}),s.jsx("div",{className:["table-col-value","green"].join(" "),children:e.status})]})]})]})]},(new Date).valueOf()+t))),s.jsx(c,{onChange:this.pageChange,pageNum:this.state.pageNum,pageSize:this.state.pageSize,total:this.state.total})]})}async tableContractRevoke(e){let s={};if(e)s={ids:[e.id]};else{const e=this.state.list,l=[];if(e.forEach((e=>{e.is_checked&&l.push(e.id)})),!l.length)return void o("未选择行");s={ids:l}}await m(s)&&this.getTableList()}currentTable(){return s.jsx("div",{style:this.props.style??null,className:"c-table-height",children:t()?this.mobileTable():this.pcTable()})}async getTableList(e){let s=null;try{let l={page:this.state.pageNum,limit:this.state.pageSize};e&&(l={...l,...e}),s=h();const a=await i(l);0==a.code&&(a.data.data.forEach((e=>{e.is_checked=!1})),this.setState({list:JSON.parse(JSON.stringify(a.data.data)),total:a.data.total}),this.props.updateTotal&&this.props.updateTotal(a.data.total)),s&&s.hide()}catch(l){s&&s.hide()}}shouldComponentUpdate(e,s,l){return e["v-if"]&&s.isFirst&&(this.setState({isFirst:!1}),this.getTableList()),!0}render(){return this.props["v-if"]?this.currentTable():s.jsx(s.Fragment,{})}}export{p as default};
import{r as e,j as s}from"./app-31862dc0.js";import{f as t,S as a,s as i,E as r,q as o,r as l,g as d,t as m,p as n}from"./local-cc653678.js";import{C as c}from"./index-b10ec9de.js";import{C as h}from"./index-eb513bc7.js";import{C as p}from"./index-0a5d5188.js";import{S as u,a as _}from"./submit-4cb12a00.js";import{S as v}from"./trade-8bf27581.js";import{s as y,o as j}from"./auth-82dcf9fa.js";import{i as f}from"./dom-ce105537.js";const x="user_ids",g="symbols";class N extends e.Component{constructor(e){super(e),this.onReset=()=>{Object.keys(this.state).forEach((e=>{"string"==typeof this.state[e]?this.setState({[e]:""}):"number"==typeof this.state[e]?this.setState({[e]:0}):this.setState({[e]:[]})}))},this.onSubmit=async()=>{const e=[x,g,v.spot_strategy_id,v.direction,v.order_type];if(!t(e,this.state))return void y("请填写必填项");if("LIMIT"===this.state[v.order_type]&&!this.state[v.limit_price])return void y("限价单价格必填");let s=null;try{s=j();0==(await a(this.state)).code&&(y("提交成功","success"),i(r,this.state)),s&&s.hide()}catch(o){s&&s.hide()}},this.onValueChange=(e,s)=>{s&&this.setState({[s]:e})},this.getStrategy=async()=>{try{const e=await o();0==e.code&&(this.strategyOptions=e.data)}catch(e){}},this.SymbolList=async()=>{try{this.symbolOptions=await l()}catch(e){}},this.state=n(r)||{[x]:[],[g]:[],[v.direction]:"",[v.order_type]:"",[v.limit_price]:""},this.symbolOptions=[],this.strategyOptions=[],this.userOptions=d(!0,!1),this.positionSideOptions=m("direction",!1),this.orderTypeOptions=m("order_type",!1)}componentDidMount(){this.getStrategy(),this.SymbolList()}currentElement(){const e=this.state;return s.jsxs("div",{className:"custom-trade-form",style:this.props.style,children:[s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"用户"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(c,{value:e[x],name:x,options:this.userOptions,className:"trade-dialog-select",clearable:!0,multiple:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"交易对"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(c,{value:e[g],name:g,options:this.symbolOptions,filterable:!0,className:"trade-dialog-select",clearable:!0,multiple:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label",children:"策略"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(c,{value:e[v.spot_strategy_id],name:v.spot_strategy_id,options:this.strategyOptions,className:"trade-dialog-select",clearable:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"买卖类型"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(c,{value:e[v.direction],name:v.direction,options:this.positionSideOptions,className:"trade-dialog-select",clearable:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"交易类型"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(c,{value:e[v.order_type],name:v.order_type,options:this.orderTypeOptions,className:"trade-dialog-select",clearable:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",style:{display:f("LIMIT"===e[v.order_type])},children:[s.jsx("div",{className:"trade-form-item__label required",children:"限价价格"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(h,{type:"number",value:e[v.limit_price],align:"center",name:v.limit_price,onChange:this.onValueChange})})]}),s.jsx("div",{className:"trade-form-item",children:s.jsx("div",{className:"trade-form-item__value",children:s.jsxs("div",{className:"trade-form-submit",children:[s.jsx(p,{icon:s.jsx(u,{}),onClick:this.onReset,children:"重置"}),s.jsx(p,{icon:s.jsx(_,{}),onClick:this.onSubmit,children:"提交"})]})})})]})}render(){return this.props["v-if"]?this.currentElement():s.jsx(s.Fragment,{})}}export{N as default};
import{D as a}from"./Dialog-64469075.js";import"./app-31862dc0.js";import"./auth-82dcf9fa.js";var o=a;export{o as D};
import{r as e,j as l}from"./app-31862dc0.js";import{w as a,c as s,i as t,B as i}from"./local-cc653678.js";import{P as c}from"./index-cb06c7d1.js";import{d as r,f as d}from"./trade-281a8bb7.js";import{o as n}from"./auth-82dcf9fa.js";import{T as o}from"./trade-8bf27581.js";import"./index-8e22b173.js";import"./index-313c704e.js";class h extends e.Component{constructor(e){super(e),this.pageChange=e=>{this.setState({pageNum:e}),this.getTableList()},this.state={list:[],pageNum:1,pageSize:10,total:0,isFirst:!0},this.columns=[{colKey:"ddd",title:"用户名"},{colKey:"d2",title:"交易所"},{colKey:"d3",title:"交易对"},{colKey:"d4",title:"交易类型",align:"center"},{colKey:"d5",title:"持仓方向",align:"center"},{colKey:"d6",title:"开仓价格",align:"center"},{colKey:"d7",title:"数量",align:"center"},{colKey:"d8",title:"成交数量USDT",align:"center"},{colKey:"d9",title:"状态",align:"center"},{colKey:"d10",title:"交易时间",align:"center"},{colKey:"d11",title:"更新时间",align:"center"},{colKey:"d12",title:"返回值",align:"center"}]}pcTable(){return""}mobileTable(){return l.jsxs("div",{className:"contract-real-table__mobile",children:[this.state.list.map(((e,t)=>l.jsxs("div",{className:"table-row",children:[l.jsxs("div",{className:"table-row-line",children:[l.jsx("div",{className:"table-pairs",children:e.symbol}),l.jsx("div",{className:"table-time",children:e.created_at})]}),l.jsxs("div",{className:"table-row-line",children:[l.jsxs("div",{className:["table-direction"].join(" "),style:{color:r(e.direction)},children:[a("order_type",e.order_type),"/",o[e.direction]]}),l.jsxs("div",{className:"table-time",children:[l.jsx("span",{children:"更新时间 "}),e.updated_at]})]}),l.jsxs("div",{className:"table-row-line",children:[l.jsxs("div",{className:"table-col-left",children:[l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"用户"}),l.jsx("div",{className:"table-col-value",children:s(e.exchange_users_id)})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"开始价格"}),l.jsx("div",{className:"table-col-value",children:e.target_price})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"成交金额"}),l.jsx("div",{className:"table-col-value",children:parseFloat(e.quantity+"")})]})]}),l.jsxs("div",{className:"table-col-left",children:[l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"交易所"}),l.jsx("div",{className:"table-col-value",children:e.exchange})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"成交数量"}),l.jsx("div",{className:"table-col-value",children:e.quantity})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"状态"}),l.jsx("div",{className:["table-col-value"].join(" "),style:{color:d(e.status)},children:a("status",e.status)})]})]})]})]},t))),l.jsx(c,{onChange:this.pageChange,pageNum:this.state.pageNum,pageSize:this.state.pageSize,total:this.state.total})]})}currentTable(){return l.jsx("div",{style:this.props.style??null,className:"c-table-height",children:t()?this.mobileTable():this.pcTable()})}shouldComponentUpdate(e,l,a){return e["v-if"]&&l.isFirst&&(this.setState({isFirst:!1}),this.getTableList()),!0}async getTableList(e){let l=null;try{l=n();let a={page:this.state.pageNum,limit:this.state.pageSize};e&&(a={...a,...e});const s=await i(a);0==s.code&&this.setState({list:s.data.data,total:s.data.total}),l&&l.hide()}catch(a){l&&l.hide()}}render(){return this.props["v-if"]?this.currentTable():l.jsx(l.Fragment,{})}}export{h as default};
import{r as t,s as e,j as s}from"./app-31862dc0.js";import a from"./index-89ee82cf.js";import i from"./index-48cc8240.js";import r from"./index-545f3244.js";import{g as n,i as o}from"./dom-ce105537.js";import{t as l,a as u,b as h}from"./trade-8bf27581.js";import c from"./index-cfe9c682.js";import{v as p,i as d}from"./local-cc653678.js";import{C as m}from"./index-0a5d5188.js";import b from"./index-4e65099d.js";import"./index-cb06c7d1.js";import"./index-8e22b173.js";import"./auth-82dcf9fa.js";import"./index-313c704e.js";import"./trade-281a8bb7.js";import"./multipleUse-6d627ec3.js";import"./index-1c100007.js";import"./index-82987c35.js";import"./index-b10ec9de.js";import"./index-eb513bc7.js";import"./submit-4cb12a00.js";const g="contract-trade",j="start-trade";class x extends t.Component{constructor(t){super(t),this.changeTableStatus=t=>{const e=Object.keys(this.state.tableStatus);for(let s=0;s<e.length;s++){const a=e[s];if(a===t){this.state.tableStatus[a]||(this.state.tableStatus[a]=!0);break}}},this.changeGroupButton=t=>{this.changeTableStatus(t),this.setState({currentGroupButton:t})},this.getTableHeight=()=>{const t=document.getElementById(g);if(t){const e=n(t),s=document.documentElement.clientHeight-e.top;this.setState({minHeight:s+"px"})}},this.storeChange=()=>{e.dispatch({type:"count",data:1})},this.onCancelEntrust=()=>{this.currentConsignment.tableContractRevoke()},this.FilterChange=t=>{this.setState({filter:t}),this.getChildTableList(t)},this.getChildTableList=t=>{"1"===this.state.currentGroupButton?this.holdingPositionRef.getTableList(t):"2"===this.state.currentGroupButton?this.currentConsignment.getTableList(t):"3"===this.state.currentGroupButton&&this.historyTransaction.getTableList(t)},this.updateTotal=t=>{this.setState({currentEntrustNum:t})},this.state={minHeight:"",currentEntrustNum:0,currentGroupButton:"4",tableStatus:{[j]:!0,[l]:!1,[u]:!1,[h]:!1},filter:{}}}get ComputedGroupButtons(){return[{label:"开始交易",value:"4"},{label:"持有仓位",value:"1"},{label:`当前委托(${this.state.currentEntrustNum})`,value:"2"},{label:"历史成交",value:"3"}]}async componentDidMount(){this.getTableHeight(),await p()}getTableClass(){return["spread-out-table",d()?"spread-out-table__mobile":""].join(" ")}currentExtensionButtons(){switch(this.state.currentGroupButton){case l:return"";case u:return s.jsx("div",{className:"hold-position-extension",children:s.jsx(m,{onClick:this.onCancelEntrust,children:"多选撤销"})});case h:return""}}render(){return e.getState(),s.jsxs("div",{className:"contract-trade-table",id:this.props.id,style:this.props.style,children:[s.jsx("div",{className:"contract-trade-label",children:"现货交易"}),s.jsx("div",{className:"contract-trade-group",children:this.ComputedGroupButtons.map(((t,e)=>s.jsx("div",{className:t.value===this.state.currentGroupButton?"group-active":"",onClick:this.changeGroupButton.bind(this,t.value),children:t.label},t.value)))}),s.jsx(c,{FilterChange:this.FilterChange,tableType:this.state.currentGroupButton,children:this.currentExtensionButtons()}),s.jsxs("div",{className:["contract-trade-table-box",d()?"contract-trade-table__mobile":""].join(" "),id:g,style:{minHeight:this.state.minHeight},children:[s.jsx(b,{"v-if":this.state.tableStatus[j],className:this.getTableClass(),style:{display:o("4"===this.state.currentGroupButton)}}),s.jsx(a,{"v-if":this.state.tableStatus[l],className:this.getTableClass(),ref:t=>this.holdingPositionRef=t,style:{display:o(this.state.currentGroupButton===l)}}),s.jsx(i,{"v-if":this.state.tableStatus[u],className:this.getTableClass(),ref:t=>this.currentConsignment=t,style:{display:o(this.state.currentGroupButton===u)},updateTotal:this.updateTotal}),s.jsx(r,{"v-if":this.state.tableStatus[h],className:this.getTableClass(),ref:t=>this.historyTransaction=t,style:{display:o(this.state.currentGroupButton===h)}})]})]})}}export{x as default};
.custom-reset-t-button{background-color:#eff1f4!important;border-radius:1px!important;font-weight:600!important;font-size:12px!important;color:#1e2329!important;border:none;height:24px;--ripple-color: #C99400 !important}.custom-reset-t-button svg{padding-right:4px}
import{r as e,j as s}from"./app-31862dc0.js";import{C as t}from"./index-b10ec9de.js";import{C as a}from"./index-0a5d5188.js";import{g as i,b as l,i as n}from"./local-cc653678.js";import{C as o}from"./index-eb513bc7.js";import"./auth-82dcf9fa.js";class r extends e.Component{constructor(e){super(e),this.valueChange=(e,s)=>{this.setState({[s]:e})},this.state={user:"",pairs:"",direction:"",exchange:"",userSelect:{label:"用户",options:i()},directionSelect:{label:"方向",options:l("position_side")},exchangeSelect:{label:"交易所",options:l("exchange")}}}onFilter(e){this.props.FilterChange&&this.props.FilterChange(e)}render(){const{userSelect:e,exchange:i,directionSelect:l,exchangeSelect:r}=this.state;return s.jsxs("div",{className:[n()?"custom-trade-select-box__mobile":""].join(" "),children:[s.jsxs("div",{className:["custom-trade-select-box"].join(" "),children:[s.jsxs("div",{className:"custom-trade-select",children:[s.jsx("span",{className:"label",children:e.label}),s.jsx(t,{className:"real-trade-select",name:"user",value:this.state.user,options:e.options,onChange:this.valueChange})]}),s.jsxs("div",{className:"custom-trade-input",children:[s.jsx("span",{className:"label",children:"交易对"}),s.jsx(o,{name:"pairs",value:this.state.pairs,onChange:this.valueChange})]}),s.jsxs("div",{className:"custom-trade-select",children:[s.jsx("span",{className:"label",children:l.label}),s.jsx(t,{name:"direction",value:this.state.direction,className:"real-trade-select",options:l.options,onChange:this.valueChange})]}),s.jsxs("div",{className:"custom-trade-select",children:[s.jsx("span",{className:"label",children:r.label}),s.jsx(t,{name:"exchange",value:i,className:"real-trade-select",options:r.options,onChange:this.valueChange})]}),s.jsx(a,{onClick:this.onFilter.bind(this,{exchange_users_id:this.state.user,symbol:this.state.pairs,position_side:this.state.direction,exchange:this.state.exchange}),children:"查询"}),s.jsx(a,{onClick:this.onFilter.bind(this,{exchange_users_id:this.state.user,symbol:this.state.pairs,position_side:this.state.direction,exchange:this.state.exchange}),children:"刷新"})]}),this.props.children]})}}export{r as default};
.custom-trade-form{padding:12px 20px 20px 0}.custom-trade-form>:not(:first-child){margin-top:12px}.custom-trade-form .trade-form-item{display:flex;align-items:center}.custom-trade-form .trade-form-item .trade-form-item__label{text-align:right;width:70px;font-size:14px}.custom-trade-form .trade-form-item .required:before{content:"*";color:red;padding-right:2px}.custom-trade-form .trade-form-item .trade-form-item__value{flex:1;box-sizing:border-box;margin-left:12px}.custom-trade-form .trade-form-item .trade-form-item__value .trade-form-submit{float:right}.custom-trade-form .trade-form-item .trade-form-item__value .trade-form-submit>:nth-child(1){margin-right:12px}.custom-trade-form .trade-form-item .trade-form-item__value .trade-form-input-suffix{background:#EAECEF;width:32px;height:32px;display:flex;justify-content:center;align-items:center;margin-right:-8px}.custom-trade-form .trade-form-item .trade-form-item__value .trade-dialog-select .t-select .t-input__wrap{width:100%!important}.custom-trade-form .trade-form-item .trade-form-item__value .trade-dialog-select .t-select .t-input__wrap .t-input:hover{border-color:#c99400}.custom-trade-form .trade-form-item .trade-form-item__value .trade-dialog-select .t-select .t-input--focused{box-shadow:none;border-color:#c99400}.custom-trade-form .trade-form-item .trade-form-item__value .trade-dialog-select .t-select .t-fake-arrow--active{color:#c99400}.custom-trade-form .trade-form-item .trade-form-item__value .trade-dialog-select .t-select .t-input__prefix .t-tag{background-color:#c99400;color:#fff;font-weight:600;font-size:11px}.custom-trade-form .trade-form-item .trade-form-item__value .trade-dialog-select .t-select .t-input__prefix .t-tag .t-icon{color:#fff}.trade-dialog-select__overlay .t-select-option{color:#c99400}.trade-dialog-select__overlay .t-select-option .t-checkbox__input{border-color:#c99400!important}.trade-dialog-select__overlay .t-is-selected{background-color:#fff}.trade-dialog-select__overlay .t-is-selected .t-checkbox__input{background-color:#c99400;border-color:#c99400}.trade-dialog-select__overlay .t-is-selected .t-checkbox__input:hover,.trade-dialog-select__overlay .t-is-selected .t-checkbox__input:focus,.trade-dialog-select__overlay .t-is-selected .t-checkbox__input:active{background-color:#c99400;border-color:#c99400}.trade-dialog-select__overlay .t-is-selected .t-checkbox__label{color:#c99400}.trade-dialog-select__overlay .t-is-selected:hover{background-color:#fff}.trade-dialog-select__overlay .t-is-selected .t-is-checked{background-color:#fff;color:#fff}
import{aK as e,aL as t,h as r,P as n,u as c,f as a,e as o,p as l,aj as i,ag as s,Z as u,B as f}from"./auth-82dcf9fa.js";import{r as p,R as b}from"./app-31862dc0.js";var d=e,y=t;var h=function(e){return!0===e||!1===e||y(e)&&"[object Boolean]"==d(e)};function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e,t){for(var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e),c=0;c<t.length;c++){delete n[t[c]]}return n}var v=["allowUncheck","type","disabled","name","value","onChange","indeterminate","children","label","className","style","readonly","onClick"];function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var k=b.createContext(null),P=p.forwardRef((function(e,t){var i,s=p.useContext(k),u=s?s.inject(e):e,f=u.allowUncheck,d=void 0!==f&&f,y=u.type,O=u.disabled,g=u.name,P=u.value,w=u.onChange,E=u.indeterminate,C=u.children,A=u.label,D=u.className,x=u.style,N=u.readonly,S=u.onClick,_=n(u,v),T=c().classPrefix,z=a(u,"checked",w),L=o(z,2),M=L[0],B=L[1],G=l("".concat(T,"-").concat(y),D,(r(i={},"".concat(T,"-is-checked"),M),r(i,"".concat(T,"-is-disabled"),O),r(i,"".concat(T,"-is-indeterminate"),E),i)),I=b.createElement("input",{readOnly:N,type:"radio-button"===y?"radio":y,className:"".concat(T,"-").concat(y,"__former"),checked:M,disabled:O,name:g,tabIndex:-1,value:h(P)?Number(P):P,"data-value":"string"==typeof P?"'".concat(P,"'"):P,"data-allow-uncheck":d||void 0,onClick:function(e){e.stopPropagation(),("radio-button"===y||"radio"===y)&&d&&M&&B(!e.currentTarget.checked,{e:e})},onChange:function(e){return B(e.currentTarget.checked,{e:e})}}),R=!(!C&&!A);return b.createElement("label",j(j({ref:t,tabIndex:O?void 0:0,className:G,title:u.title,style:x},m(_,["checkAll","stopLabelTrigger"])),{},{onClick:function(e){null==S||S({e:e})}}),I,b.createElement("span",{className:"".concat(T,"-").concat(y,"__input")}),R&&b.createElement("span",{key:"label",className:"".concat(T,"-").concat(y,"__label"),onClick:function(e){u.stopLabelTrigger&&e.preventDefault()}},C||A))}));P.displayName="Check";var w={checkAll:!1,defaultChecked:!1,disabled:void 0,indeterminate:!1,readonly:!1},E={max:void 0,defaultValue:[]};function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var D=function(e){var t=c().classPrefix,r=s(e,E),n=r.onChange,i=r.disabled,d=r.className,y=r.style,h=r.children,O=r.max,m=r.options,v=void 0===m?[]:m,g=(Array.isArray(v)&&v.length>0?v:b.Children.map(h,(function(e){return e.props}))||[]).filter((function(e){return"object"!==u(e)||!e.checkAll})),j=[];g.forEach((function(e){var t=function(e){switch(u(e)){case"number":case"string":return e;case"object":return e.value;default:return}}(e);j.push(t)}));var P=a(e,"value",n),w=o(P,2),C=w[0],D=w[1],x=p.useState(O),N=o(x,2),_=N[0],T=N[1],z=p.useMemo((function(){return Array.isArray(C)?new Set([].concat(C)):new Set([])}),[C]),L=p.useMemo((function(){var e=Array.from(z);return 0!==e.length&&e.length!==g.length}),[z,g]),M=p.useMemo((function(){return Array.from(z).length===g.length}),[z,g]);p.useEffect((function(){f(O)&&(O<z.size||T(O))}),[O,z]);var B={inject:function(e){if(void 0!==e.checked)return e;var t=e.value;return A(A({},e),{},{checked:e.checkAll?M:z.has(t),indeterminate:e.checkAll?L:e.indeterminate,disabled:e.disabled||i||z.size>=_&&!z.has(t),onChange:function(r,n){var c=n.e;if("function"==typeof e.onChange&&e.onChange(r,{e:c}),e.checkAll)z.clear(),r&&j.forEach((function(e){z.add(e)}));else if(r){if(z.size>=_&&f(O))return;z.add(t)}else z.delete(t);D(Array.from(z),{e:c,current:e.checkAll?void 0:t,type:r?"check":"uncheck"})}})}},G=Array.isArray(v)&&0!==v.length;return b.createElement("div",{className:l("".concat(t,"-checkbox-group"),d),style:y},b.createElement(k.Provider,{value:B},G?v.map((function(e,t){switch(u(e)){case"string":var r=e;return b.createElement(S,{key:t,label:r,value:r},e);case"number":var n=e;return b.createElement(S,{key:t,label:n,value:n},e);case"object":var c=e;return c.checkAll?b.createElement(S,A(A({},c),{},{key:"checkAll_".concat(t),indeterminate:L})):b.createElement(S,A(A({},c),{},{key:t,disabled:c.disabled||i}));default:return null}})):h))};function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}D.displayName="CheckboxGroup";var N=i((function(e,t){return b.createElement(P,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({ref:t,type:"checkbox"},s(e,w)))}),{Group:D});N.displayName="Checkbox";var S=N;var _=S;export{_ as C,S as a,D as b,P as c,k as d,h as i};
import{r as i,j as s,a as r}from"./app-31862dc0.js";import{L as t,C as o}from"./index-c95fdfd5.js";import e from"./index-dfdd482a.js";import m from"./index-65223cfa.js";import"./local-cc653678.js";import"./auth-82dcf9fa.js";import"./index-f16fae83.js";import"./index-cb06c7d1.js";import"./index-8e22b173.js";import"./index-313c704e.js";import"./formModel-cd1d5f2d.js";import"./Dialog-64469075.js";import"./index-82987c35.js";import"./index-89ee82cf.js";import"./index-48cc8240.js";import"./index-0a5d5188.js";import"./trade-281a8bb7.js";import"./multipleUse-6d627ec3.js";import"./index-1c100007.js";import"./index-545f3244.js";import"./trade-8bf27581.js";import"./dom-ce105537.js";import"./index-cfe9c682.js";import"./index-b10ec9de.js";import"./index-eb513bc7.js";import"./index-4e65099d.js";import"./submit-4cb12a00.js";class p extends i.Component{constructor(i){super(i)}shouldComponentUpdate(i,s){return!0}render(){return s.jsxs(t,{children:[s.jsx(r,{title:this.props.info.title}),s.jsx(o,{children:s.jsxs("div",{className:"contract-trade-page",children:[s.jsx(e,{}),s.jsx(m,{})]})})]})}}export{p as default};
import{r as e,j as l}from"./app-31862dc0.js";import{c as s,i as a,m as t}from"./local-cc653678.js";import{C as i}from"./index-0a5d5188.js";import{P as c}from"./index-cb06c7d1.js";import{g as r,a as d,i as n}from"./trade-281a8bb7.js";import{C as o}from"./multipleUse-6d627ec3.js";import{o as m}from"./auth-82dcf9fa.js";import"./index-8e22b173.js";import"./index-313c704e.js";class h extends e.Component{constructor(e){super(e),this.pageChange=e=>{this.setState({pageNum:e}),this.getTableList()},this.state={list:[],pageNum:1,pageSize:10,total:0},this.columns=[{colKey:"ddd",title:"用户名",cell:({rowIndex:e,row:s})=>l.jsx("div",{children:s.d9})},{colKey:"d2",title:"交易所"},{colKey:"d3",title:"交易对"},{colKey:"d4",title:"持仓方向",align:"center"},{colKey:"d5",title:"策略",align:"center"},{colKey:"d6",title:"开仓价格",align:"center"},{colKey:"d7",title:"标记价格",align:"center"},{colKey:"d8",title:"未实现盈亏",align:"center"},{colKey:"d9",title:"操作",align:"center"}]}pcTable(){return""}mobileTable(){return l.jsxs("div",{className:"contract-real-table__mobile",children:[this.state.list.map(((e,a)=>l.jsxs("div",{className:"table-row",children:[l.jsxs("div",{className:"table-row-line",children:[l.jsxs("div",{className:"table-pairs",children:[e.symbol,l.jsxs("span",{children:[" x",e.leverage]})]}),l.jsx("div",{className:"table-time",children:e.created_at})]}),l.jsxs("div",{className:"table-row-line",children:[l.jsx("div",{className:"table-direction",style:{color:r(e.position_side)},children:d(e.position_side)}),l.jsx(i,{onClick:o.bind(this,{ids:[e.id]}),children:"平仓"})]}),l.jsxs("div",{className:"table-row-line",children:[l.jsxs("div",{className:"table-col-left",children:[l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"用户"}),l.jsx("div",{className:"table-col-value",children:s(e.exchange_users_id)})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"开仓价格"}),l.jsx("div",{className:"table-col-value",children:e.entry_price})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"策略"}),l.jsx("div",{className:"table-col-value",children:e.strategy})]})]}),l.jsxs("div",{className:"table-col-left",children:[l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"交易所"}),l.jsx("div",{className:"table-col-value",children:e.exchange})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"标记价格"}),l.jsx("div",{className:"table-col-value",children:e.market_price})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"盈亏"}),l.jsxs("div",{className:["table-col-value","green"].join(" "),children:[n(e.unrealized_profit)," USDT"]})]})]})]})]},a))),l.jsx(c,{onChange:this.pageChange,pageNum:this.state.pageNum,pageSize:this.state.pageSize,total:this.state.total})]})}currentTable(){return l.jsx("div",{style:this.props.style??null,className:"c-table-height",children:a()?this.mobileTable():this.pcTable()})}shouldComponentUpdate(e,l,s){return!0}async getTableList(e){let l=null;try{l=m();let s={page:this.state.pageNum,limit:this.state.pageSize};e&&(s={...s,...e});const a=await t(s);0==a.code&&this.setState({list:a.data.data,total:a.data.total}),l&&l.hide()}catch(s){l&&l.hide()}}componentDidMount(){this.getTableList()}render(){return this.props["v-if"]?this.currentTable():l.jsx(l.Fragment,{})}}export{h as default};
import{r as e,j as l}from"./app-31862dc0.js";import{c as a,i as t,D as s}from"./local-cc653678.js";import{P as i}from"./index-cb06c7d1.js";import{o as c}from"./auth-82dcf9fa.js";import"./index-8e22b173.js";import"./index-313c704e.js";class d extends e.Component{constructor(e){super(e),this.pageChange=e=>{this.setState({pageNum:e}),this.getTableList()},this.openTradeModal=e=>{this.setState({trade_dialog:!0})},this.state={list:[],pageNum:1,pageSize:10,total:0,trade_dialog:!1,strategy_dialog:!1},this.columns=[{colKey:"ddd",title:"用户名",cell:({rowIndex:e,row:a})=>l.jsx("div",{children:a.d9})},{colKey:"d2",title:"交易所"},{colKey:"d3",title:"交易对"},{colKey:"d4",title:"持仓方向",align:"center"},{colKey:"d5",title:"策略",align:"center"},{colKey:"d6",title:"开仓价格",align:"center"},{colKey:"d7",title:"标记价格",align:"center"},{colKey:"d8",title:"未实现盈亏",align:"center"},{colKey:"d9",title:"操作",align:"center"}]}pcTable(){return""}mobileTable(){return l.jsxs("div",{className:"contract-real-table__mobile",children:[this.state.list.map(((e,t)=>l.jsxs("div",{className:"table-row",children:[l.jsxs("div",{className:"table-row-line",children:[l.jsx("div",{className:"table-pairs",children:e.symbol}),l.jsx("div",{className:"table-btns"})]}),l.jsxs("div",{className:"table-row-line",children:[l.jsxs("div",{className:"table-col-left",children:[l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"用户"}),l.jsx("div",{className:"table-col-value",children:a(e.exchange_users_id)})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"BTC估值"}),l.jsx("div",{className:"table-col-value",children:e.btc_valuation})]})]}),l.jsxs("div",{className:"table-col-left",children:[l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"交易所"}),l.jsx("div",{className:"table-col-value",children:e.exchange})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"价值"}),l.jsx("div",{className:"table-col-value",children:e.quantity})]}),l.jsxs("div",{className:"table-col__line",children:[l.jsx("div",{className:"table-col-label",children:"更新"}),l.jsx("div",{className:["table-col-value"].join(" "),style:{fontSize:"12px"},children:e.updated_at})]})]})]})]},t))),l.jsx(i,{onChange:this.pageChange,pageNum:this.state.pageNum,pageSize:this.state.pageSize,total:this.state.total})]})}currentTable(){return l.jsx("div",{style:this.props.style??null,className:"c-table-height",children:t()?this.mobileTable():this.pcTable()})}shouldComponentUpdate(e,l,a){return!0}async getTableList(e){let l=null;try{l=c();let a={page:this.state.pageNum,limit:this.state.pageSize};e&&(a={...a,...e});const t=await s(a);0==t.code&&this.setState({list:t.data.data,total:t.data.total}),l&&l.hide()}catch(a){l&&l.hide()}}componentDidMount(){this.getTableList()}render(){return this.props["v-if"]?this.currentTable():l.jsx(l.Fragment,{})}}export{d as default};
import{r as e,j as t}from"./app-31862dc0.js";import{I as s}from"./index-313c704e.js";class n extends e.Component{constructor(e){super(e),this.onSet=e=>{this.setState({value:e})},this.onReduce=()=>{this.onSet(this.state.value-1),this.inputChange(this.state.value-1)},this.onAdd=()=>{this.onSet(this.state.value+1),this.inputChange(this.state.value+1)},this.inputChange=e=>{"number"==typeof e&&this.props.onChange&&this.props.onChange(e,this.name)},this.state={value:0},this.name=e.name??""}render(){const{align:e,addAndSubtract:n,onChange:a}=this.props,i=e??"left",h=n??!0;return t.jsxs("div",{className:["c-reset-input-number-box",h?"c-reset-input-number-add":""].join(" "),children:[h&&t.jsx("div",{className:"reduce",onClick:this.onReduce,children:"-"}),t.jsx(s,{className:"c-reset-input-number",align:i,onChange:this.inputChange,theme:"normal",defaultValue:1,value:this.props.value}),h&&t.jsx("div",{className:"add",onClick:this.onAdd,children:"+"})]})}}const a=n;export{a as C};
.contract-trade-table{flex:1;display:flex;flex-direction:column}.contract-trade-table .contract-trade-label{padding:24px 12px 6px;font-weight:600;font-size:16px;color:#000;border-bottom:1px solid #EAECEF}.contract-trade-table .contract-trade-table-box{padding:0 30px;flex:1}.contract-trade-table .contract-trade-table-box .spread-out-table{display:flex;flex-direction:column}.contract-trade-table .contract-trade-table-box .spread-out-table>:first-child{flex:1}.contract-trade-table .contract-trade-group{display:flex;align-items:center;height:37px;font-weight:600;font-size:14px}.contract-trade-table .contract-trade-group>*{cursor:pointer;transition:all .3s}.contract-trade-table .contract-trade-group>:nth-child(1){margin-left:12px}.contract-trade-table .contract-trade-group>:not(:nth-child(1)){margin-left:20px}.contract-trade-table .contract-trade-group .group-active{color:#c99400;transition:all .3s}.c-table-height{height:100%}.contract-trade-table__mobile{padding:6px 12px 0!important}.contract-trade-table__mobile .contract-real-table__mobile{min-height:100%;display:flex;flex-direction:column}.contract-trade-table__mobile .contract-real-table__mobile .table-row{padding-bottom:12px;border-bottom:1px solid #F0F0F0}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line{margin-top:6px;display:flex;justify-content:space-between;align-items:center}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-pairs{font-weight:400;font-size:16px;color:#222}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-pairs span{color:#c99400}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-time{font-weight:400;font-size:12px;color:#848e9c}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-direction{font-weight:400;font-size:14px}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-col-left{width:44%}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-col-left>:not(:first-child){margin-top:4px}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-col-left .table-col__line{display:flex;justify-content:space-between}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-col-left .table-col__line .table-col-label{font-weight:400;font-size:13px;color:#848e9c}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-col-left .table-col__line .table-col-value{font-weight:400;font-size:14px;color:#222}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-col-left .table-col__line .green{color:#0e9d6d}.contract-trade-table__mobile .contract-real-table__mobile .reset-t-pagination-box{margin-top:auto}.hold-position-extension{padding:0 12px;display:flex;justify-content:flex-end;margin-top:6px}.hold-position-extension>:first-child{margin-right:6px}.hold-position-extension>:only-child{margin-right:0}.hold-position-extension .custom-reset-t-button{color:#c99400!important}
.contract-trade-page{display:flex;flex-direction:column;height:100%}
import{r as e,j as s}from"./app-31862dc0.js";import{f as a,n as t,C as i,s as r,o as l,a as o,g as d,b as n,p as m}from"./local-cc653678.js";import{C as c}from"./index-b10ec9de.js";import{C as h}from"./index-92ac49ec.js";import{C as p}from"./index-eb513bc7.js";import{C as u}from"./index-0a5d5188.js";import{S as _,a as v}from"./submit-4cb12a00.js";import{C as j}from"./trade-8bf27581.js";import{s as x,o as f}from"./auth-82dcf9fa.js";import{i as g}from"./dom-ce105537.js";import"./index-313c704e.js";const N="user_ids";class y extends e.Component{constructor(e){super(e),this.onReset=()=>{Object.keys(this.state).forEach((e=>{"string"==typeof this.state[e]?this.setState({[e]:""}):"number"==typeof this.state[e]?this.setState({[e]:0}):this.setState({[e]:[]})}))},this.onSubmit=async()=>{const e=[N,j.pairs,j.side,j.amount,j.position_side,j.order_type];if(!a(e,this.state))return void x("请填写必填项");if("LIMIT"===this.state[j.order_type]&&!this.state[j.limit_price])return void x("限价单价格必填");const s=t(this.state);let o=null;try{o=f();0==(await i(s)).code&&(x("提交成功","success"),r(l,this.state)),o&&o.hide()}catch(d){o&&o.hide()}},this.onValueChange=(e,s)=>{s&&this.setState({[s]:e})},this.getStrategy=async()=>{try{const e=await o();0==e.code&&(this.strategyOptions=e.data)}catch(e){}},this.state=m(l)||{[N]:[],[j.pairs]:"",[j.contract_strategy_id]:"",[j.side]:"",[j.position_side]:"",[j.order_type]:"",[j.amount]:null,[j.levers]:null,[j.stop_surplus]:null,[j.stop_loss]:null,[j.limit_price]:null},this.userOptions=d(!0,!1),this.strategyOptions=[],this.sideOptions=n("side",!1),this.positionSideOptions=n("position_side",!1),this.orderTypeOptions=n("order_type",!1)}componentDidMount(){this.getStrategy()}currentElement(){const e=this.state;return s.jsxs("div",{className:"custom-trade-form",style:this.props.style,children:[s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"用户"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(c,{value:e[N],name:N,options:this.userOptions,className:"trade-dialog-select",clearable:!0,multiple:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"交易对"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(p,{value:e[j.pairs],name:j.pairs,align:"center",type:"text",onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label",children:"策略"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(c,{value:e[j.contract_strategy_id],name:j.contract_strategy_id,options:this.strategyOptions,className:"trade-dialog-select",clearable:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"方向"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(c,{value:e[j.side],name:j.side,options:this.sideOptions,className:"trade-dialog-select",clearable:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"买卖类型"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(c,{value:e[j.position_side],name:j.position_side,options:this.positionSideOptions,className:"trade-dialog-select",clearable:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"交易类型"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(c,{value:e[j.order_type],name:j.order_type,options:this.orderTypeOptions,className:"trade-dialog-select",clearable:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",style:{display:g("LIMIT"===e[j.order_type])},children:[s.jsx("div",{className:"trade-form-item__label required",children:"限价价格"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(p,{type:"number",value:e[j.limit_price],align:"center",name:j.limit_price,onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label",children:"杠杆"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(h,{value:e[j.levers],align:"center",name:j.levers,onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"买入金额"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(p,{value:e[j.amount],name:j.amount,align:"center",type:"number",onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label",children:"止盈"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(p,{value:e[j.stop_surplus],name:j.stop_surplus,align:"center",type:"number",suffixIcon:s.jsx("div",{className:"trade-form-input-suffix",children:"%"}),onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label",children:"止损"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(p,{value:e[j.stop_loss],name:j.stop_loss,align:"center",type:"number",suffixIcon:s.jsx("div",{className:"trade-form-input-suffix",children:"%"}),onChange:this.onValueChange})})]}),s.jsx("div",{className:"trade-form-item",children:s.jsx("div",{className:"trade-form-item__value",children:s.jsxs("div",{className:"trade-form-submit",children:[s.jsx(u,{icon:s.jsx(_,{}),onClick:this.onReset,children:"重置"}),s.jsx(u,{icon:s.jsx(v,{}),onClick:this.onSubmit,children:"提交"})]})})})]})}render(){return this.props["v-if"]?this.currentElement():s.jsx(s.Fragment,{})}}export{y as default};
import{j as a}from"./app-31862dc0.js";import{a6 as e}from"./auth-82dcf9fa.js";function o(o){const{options:p,className:t,clearable:l,multiple:s,filterable:n,autoWidth:r,popupProps:i,name:u,value:m}=o,c=r??!0,h=i??{},f=n??!1,b=u??"";return a.jsx(e,{className:t,value:m,clearable:l,filterable:f,autoWidth:c,popupProps:h,multiple:s,onChange:a=>{o.onChange&&o.onChange(a,b)},options:p})}export{o as C};
import{r as t,s,j as e}from"./app-31862dc0.js";import i from"./index-88b6973e.js";import a from"./index-d93c9e50.js";import r from"./index-2e736737.js";import{g as n,i as o}from"./dom-ce105537.js";import{t as l,a as u,b as h}from"./trade-8bf27581.js";import c from"./index-7a17e3c1.js";import{h as d,i as m}from"./local-cc653678.js";import{C as p}from"./index-0a5d5188.js";import{C as b}from"./multipleUse-6d627ec3.js";import g from"./index-ad859412.js";import"./index-cb06c7d1.js";import"./index-8e22b173.js";import"./auth-82dcf9fa.js";import"./index-313c704e.js";import"./trade-281a8bb7.js";import"./index-1c100007.js";import"./index-82987c35.js";import"./index-b10ec9de.js";import"./index-eb513bc7.js";import"./index-92ac49ec.js";import"./submit-4cb12a00.js";const j="contract-trade",x="start-trade";class C extends t.Component{constructor(t){super(t),this.changeTableStatus=t=>{const s=Object.keys(this.state.tableStatus);for(let e=0;e<s.length;e++){const i=s[e];if(i===t){this.state.tableStatus[i]||(this.state.tableStatus[i]=!0);break}}},this.changeGroupButton=t=>{this.changeTableStatus(t),this.setState({currentGroupButton:t})},this.getTableHeight=()=>{const t=document.getElementById(j);if(t){const s=n(t),e=document.documentElement.clientHeight-s.top;this.setState({minHeight:e+"px"})}},this.storeChange=()=>{s.dispatch({type:"count",data:1})},this.closeDialog=()=>{this.setState({dialog_visible:!1})},this.onCancelEntrust=()=>{this.currentConsignment.tableContractRevoke()},this.FilterChange=t=>{this.setState({filter:t}),this.getChildTableList(t)},this.getChildTableList=t=>{"1"===this.state.currentGroupButton?this.holdingPositionRef.getTableList(t):"2"===this.state.currentGroupButton?this.currentConsignment.getTableList(t):"3"===this.state.currentGroupButton&&this.historyTransaction.getTableList(t)},this.updateTotal=t=>{this.setState({currentEntrustNum:t})},this.state={dialog_visible:!1,minHeight:"",currentEntrustNum:0,currentGroupButton:"4",tableStatus:{[x]:!0,[l]:!1,[u]:!1,[h]:!1},filter:{}}}get ComputedGroupButtons(){return[{label:"开始交易",value:"4"},{label:"持有仓位",value:"1"},{label:`当前委托(${this.state.currentEntrustNum})`,value:"2"},{label:"历史成交",value:"3"}]}async componentDidMount(){this.getTableHeight(),await d()}onClosePosition(){b({ids:[]})}getTableClass(){return["spread-out-table",m()?"spread-out-table__mobile":""].join(" ")}currentExtensionButtons(){switch(this.state.currentGroupButton){case l:return e.jsx("div",{className:"hold-position-extension",children:e.jsx(p,{onClick:this.onClosePosition,children:"一键平仓"})});case u:return e.jsx("div",{className:"hold-position-extension",children:e.jsx(p,{onClick:this.onCancelEntrust,children:"多选撤销"})});case h:return""}}render(){return s.getState(),e.jsxs("div",{className:"contract-trade-table",id:this.props.id,style:this.props.style,children:[e.jsx("div",{className:"contract-trade-label",children:"合约交易"}),e.jsx("div",{className:"contract-trade-group",children:this.ComputedGroupButtons.map(((t,s)=>e.jsx("div",{className:t.value===this.state.currentGroupButton?"group-active":"",onClick:this.changeGroupButton.bind(this,t.value),children:t.label},t.value)))}),e.jsx(c,{FilterChange:this.FilterChange,children:this.currentExtensionButtons()}),e.jsxs("div",{className:["contract-trade-table-box",m()?"contract-trade-table__mobile":""].join(" "),id:j,style:{minHeight:this.state.minHeight},children:[e.jsx(g,{"v-if":this.state.tableStatus[x],className:this.getTableClass(),style:{display:o("4"===this.state.currentGroupButton)}}),e.jsx(i,{"v-if":this.state.tableStatus[l],className:this.getTableClass(),ref:t=>this.holdingPositionRef=t,style:{display:o(this.state.currentGroupButton===l)}}),e.jsx(a,{"v-if":this.state.tableStatus[u],className:this.getTableClass(),ref:t=>this.currentConsignment=t,style:{display:o(this.state.currentGroupButton===u)},updateTotal:this.updateTotal}),e.jsx(r,{"v-if":this.state.tableStatus[h],className:this.getTableClass(),ref:t=>this.historyTransaction=t,style:{display:o(this.state.currentGroupButton===h)}})]})]})}}export{C as default};
import{r as C,j as e,d as a}from"./app-31862dc0.js";import{u as t,i as l}from"./local-cc653678.js";const s=e=>C.createElement("svg",{width:71,height:43,viewBox:"0 0 71 43",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},C.createElement("path",{d:"M1.23541 32.0474H9.44886C9.90052 32.0474 10.2725 32.3091 10.5647 32.8324C10.6179 32.9945 10.6444 33.1194 10.6444 33.2071V33.502C10.6444 33.9217 10.3801 34.2738 9.85137 34.558C9.68133 34.6271 9.5206 34.6616 9.36916 34.6616H6.6433V41.3488C6.6433 41.8934 6.32315 42.2946 5.68287 42.5523L5.47165 42.5762H5.17675C4.75166 42.5762 4.39433 42.3145 4.10474 41.7911C4.03566 41.6184 4.00112 41.459 4.00112 41.3129V34.6616H1.34301C0.721318 34.6616 0.288261 34.3508 0.043837 33.7291C0.0146123 33.6016 0 33.5113 0 33.4581V33.2748C0 32.7408 0.313501 32.3463 0.940503 32.0912C1.04677 32.062 1.14508 32.0474 1.23541 32.0474ZM12.6131 32.0474H18.8858C19.7811 32.0474 20.6047 32.4685 21.3566 33.3107C21.8029 33.951 22.0261 34.5527 22.0261 35.116V35.5503C22.0261 36.4058 21.601 37.2082 20.7508 37.9574C20.2301 38.2895 19.8156 38.4834 19.5075 38.5392V38.5512C20.5941 39.5156 21.3088 40.1864 21.6515 40.5637C21.8029 40.8187 21.8786 41.0618 21.8786 41.293C21.8786 41.8456 21.5705 42.2587 20.9541 42.5324C20.8319 42.5616 20.7415 42.5762 20.6831 42.5762H20.3882C20.0455 42.5762 19.5925 42.2733 19.0292 41.6676C18.8353 41.5055 17.7248 40.4893 15.6976 38.6189H14.0239V41.3129C14.0239 41.8868 13.6931 42.2999 13.0315 42.5523C12.9598 42.5682 12.8987 42.5762 12.8482 42.5762H12.5533C12.1096 42.5762 11.7457 42.3065 11.4614 41.7672C11.4082 41.6264 11.3817 41.5015 11.3817 41.3926V33.2748C11.3817 32.7408 11.6952 32.3463 12.3222 32.0912C12.4285 32.062 12.5254 32.0474 12.6131 32.0474ZM19.3839 34.6616H14.0239V36.0286H19.3839V34.6616ZM27.9879 32.0474H28.2151C28.7597 32.0474 29.1981 32.4804 29.5302 33.3465C32.0409 38.2961 33.3334 40.8679 33.4078 41.0618V41.4604C33.4078 41.9067 33.1142 42.264 32.527 42.5324C32.3995 42.5616 32.2959 42.5762 32.2162 42.5762H32.0249C31.4776 42.5762 31.0353 42.1285 30.6978 41.2332C28.9709 37.8166 28.0942 36.0976 28.0676 36.0764C26.1361 39.9633 25.1159 41.9851 25.007 42.1418C24.7174 42.4314 24.4185 42.5762 24.1103 42.5762H23.927C23.4833 42.5762 23.1167 42.3065 22.8271 41.7672C22.7819 41.6105 22.7594 41.4856 22.7594 41.3926V41.2332C22.7594 41.0366 23.0091 40.4707 23.5086 39.5355L27.0474 32.5455C27.3264 32.2134 27.6399 32.0474 27.9879 32.0474ZM35.3764 32.0474H39.6127C40.8508 32.0474 42.0304 32.5375 43.1515 33.5179C43.821 34.2113 44.2541 34.8476 44.4507 35.4268C44.6739 36.0485 44.7855 36.5785 44.7855 37.0169V37.5828C44.7855 38.773 44.27 39.9261 43.2392 41.0419C42.4661 41.7274 41.7169 42.1697 40.9916 42.369C40.4576 42.5071 40.0311 42.5762 39.7123 42.5762H35.3167C34.8703 42.5762 34.505 42.3065 34.2207 41.7672C34.1676 41.6264 34.141 41.5015 34.141 41.3926V33.2748C34.141 32.7408 34.4545 32.3463 35.0815 32.0912C35.1878 32.062 35.2861 32.0474 35.3764 32.0474ZM38.9791 34.6616H36.7832V39.9619H39.1265C40.0378 39.9619 40.8361 39.6166 41.5216 38.9258C41.9361 38.4263 42.1433 37.9149 42.1433 37.3915V37.2082C42.1433 36.4244 41.7102 35.739 40.8441 35.1518C40.3021 34.825 39.6804 34.6616 38.9791 34.6616ZM46.79 32.0474H46.9893C47.4409 32.0474 47.8155 32.2971 48.1131 32.7966C48.1954 32.9586 48.2366 33.1526 48.2366 33.3784V41.3129C48.2366 41.8868 47.8992 42.2999 47.2244 42.5523C47.1473 42.5682 47.0836 42.5762 47.0331 42.5762H46.7342C46.2746 42.5762 45.9 42.3065 45.6104 41.7672C45.5519 41.6264 45.5227 41.5015 45.5227 41.3926V33.2748C45.5227 32.7408 45.8455 32.3463 46.4911 32.0912C46.5974 32.062 46.697 32.0474 46.79 32.0474ZM50.2053 32.0474H50.3966C50.7739 32.0474 51.1578 32.2679 51.5483 32.7089C54.0165 35.1372 55.8257 36.9066 56.9761 38.0172V33.4581C56.9761 32.8019 57.2763 32.3516 57.8768 32.1071C58.0096 32.0673 58.1305 32.0474 58.2394 32.0474H58.4228C58.8717 32.0474 59.2437 32.3091 59.5386 32.8324C59.5917 32.9945 59.6183 33.1194 59.6183 33.2071V41.4365C59.6183 41.8429 59.3659 42.1883 58.8611 42.4726C58.7203 42.5417 58.5888 42.5762 58.4666 42.5762H58.1717C57.7944 42.5762 57.3268 42.2508 56.7689 41.5998L51.6161 36.5626V41.3129C51.6161 41.8868 51.2853 42.2999 50.6238 42.5523C50.552 42.5682 50.4909 42.5762 50.4404 42.5762H50.1455C49.7018 42.5762 49.3379 42.3065 49.0536 41.7672C49.0005 41.6264 48.9739 41.5015 48.9739 41.3926V33.2748C48.9739 32.7408 49.2861 32.3463 49.9104 32.0912C50.0193 32.062 50.1176 32.0474 50.2053 32.0474ZM65.5961 32.0474H69.8004C70.2335 32.0474 70.6054 32.3024 70.9163 32.8125C70.9721 33.0012 71 33.1327 71 33.2071V33.502C71 33.9217 70.7356 34.2738 70.2069 34.558C70.0342 34.6271 69.8722 34.6616 69.7207 34.6616H66.1819C64.8615 34.6616 63.8824 35.193 63.2448 36.2557C63.0801 36.6064 62.9977 36.9664 62.9977 37.3357C62.9977 38.3718 63.6035 39.1715 64.815 39.7348C65.248 39.8862 65.6479 39.9619 66.0145 39.9619H68.3578V38.6389C68.3578 37.9454 68.6315 37.4832 69.1788 37.252C69.3196 37.1803 69.471 37.1444 69.6331 37.1444H69.7446C70.3159 37.1444 70.7263 37.4699 70.9761 38.1208C70.992 38.1925 71 38.2536 71 38.3041V41.4365C71 41.8429 70.7476 42.1883 70.2428 42.4726C70.102 42.5417 69.9705 42.5762 69.8483 42.5762H65.4646C64.3142 42.5762 63.1824 42.1139 62.0692 41.1894C61.4395 40.5464 61.0556 40.0416 60.9175 39.675C60.5402 38.9258 60.3516 38.2071 60.3516 37.519V37.1285C60.3516 35.8745 60.8763 34.6922 61.9257 33.5817C63.0495 32.5588 64.273 32.0474 65.5961 32.0474Z",fill:"#0A0A0A"}),C.createElement("path",{d:"M27.5235 18.7227L28.5343 16.7206C28.612 16.5647 28.6039 16.3805 28.5118 16.2327C28.4665 16.1603 28.4032 16.1005 28.328 16.0591C28.2528 16.0176 28.1682 15.9959 28.0821 15.9959H25.8968L31.6281 5.53001L36.7455 14.7367C36.8356 14.8967 37.0054 14.9958 37.1896 14.9958H39.4935C39.6736 14.9958 39.8393 14.9027 39.9294 14.7489C40.0215 14.595 40.0235 14.4068 39.9355 14.2529L32.066 0.238367C31.8879 -0.0794556 31.36 -0.0794556 31.182 0.238367L21.0637 18.255C20.9758 18.4109 20.9798 18.5992 21.0699 18.753C21.1599 18.9049 21.3257 19 21.5057 19H27.0713C27.2636 18.998 27.4375 18.8927 27.5235 18.7227Z",fill:"#0A0A0A"}),C.createElement("path",{d:"M49.9378 18.2577L39.9362 0.256866C39.8452 0.0950604 39.6571 0.00404513 39.4872 0C39.3011 0.00404513 39.1333 0.111241 39.0503 0.277092L36.5504 5.27688C36.4797 5.41644 36.4797 5.58229 36.5504 5.72387L37.5496 7.72418C37.7195 8.06398 38.2757 8.06398 38.4456 7.72418L39.5155 5.58229L45.1585 16.0005H34.4996C34.2245 16.0005 34 16.225 34 16.5001V18.5004C34 18.7755 34.2245 19 34.4996 19H49.5009C49.6789 19 49.8427 18.907 49.9317 18.7532C50.0207 18.6016 50.0227 18.4135 49.9378 18.2577Z",fill:"#0A0A0A"}),C.createElement("path",{d:"M43.438 20.5755C43.3946 20.4951 43.3312 20.4281 43.2544 20.3814C43.1777 20.3347 43.0902 20.31 43.0012 20.3098H40.4994C40.3194 20.3098 40.1536 20.4102 40.0646 20.5713C39.9756 20.7345 39.9776 20.9332 40.0706 21.0922L41.1163 22.8955H29.8674L34.9336 13.8456C35.0186 13.695 35.0246 13.5109 34.9478 13.356L33.9487 11.2871C33.9083 11.2033 33.8467 11.1325 33.7705 11.082C33.6943 11.0315 33.6063 11.0034 33.5159 11.0005C33.3298 10.9921 33.1579 11.0946 33.0669 11.262L29.0746 18.4877L25.0742 25.2113C25.0275 25.2896 25.0019 25.3794 25.0001 25.4714C24.9983 25.5634 25.0204 25.6542 25.0641 25.7343C25.1075 25.8147 25.1709 25.8817 25.2477 25.9284C25.3245 25.9751 25.4119 25.9998 25.5009 26H45.5009C45.6789 26 45.8427 25.9038 45.9317 25.7448C46.0207 25.5879 46.0227 25.3912 45.9378 25.2302L43.438 20.5755Z",fill:"#0A0A0A"}));function n({children:l}){const{pathname:n}=t(),[H,c]=C.useState(n),o=C=>H===C.path;return e.jsxs("main",{children:[e.jsxs("div",{className:"custom-layout-head",children:[e.jsxs("div",{className:"layout-head-left",children:[e.jsx(s,{}),[{label:"合约交易",path:"/"},{label:"现货交易",path:"/spot"}].map((C=>e.jsx(a,{href:C.path,className:["layout-chose-button",o(C)?"active":""].join(" "),children:C.label},C.path)))]}),e.jsx("div",{className:"layout-head-right"})]}),l]})}function H({children:C}){return e.jsx("div",{className:["custom-layout-content","narrow-scrollbar",l()?"custom-layout-content_mobile":""].join(" "),children:e.jsx("div",{className:"real-content",children:C})})}export{H as C,n as L};
import{r as e,j as t}from"./app-31862dc0.js";import{i as a}from"./local-cc653678.js";import{P as s}from"./index-8e22b173.js";class o extends e.Component{constructor(e){super(e),this.pageChange=({current:e,pageSize:t})=>{this.props.onChange(e)}}render(){const e=this.props;return t.jsx("div",{className:["reset-t-pagination-box",a()?"reset-t-pagination__mobile":""].join(" "),children:t.jsx(s,{foldedMaxPageBtn:2,maxPageBtn:3,className:["reset-t-pagination"].join(" "),defaultCurrent:e.pageNum,defaultPageSize:e.pageSize,pageSizeOptions:[],pageEllipsisMode:"mid",showFirstAndLastPageBtn:!1,showJumper:!1,showPageNumber:!0,showPreviousAndNextBtn:!0,size:"medium",theme:"default",total:e.total,totalContent:!0,onChange:this.pageChange})})}}export{o as P};
.custom-trade-select-box{display:flex;flex-wrap:wrap;row-gap:6px;align-items:center;padding:0 12px;margin-left:-12px}.custom-trade-select-box>:not(:first-child){margin-left:12px}.custom-trade-select-box>*{margin-left:12px}.custom-trade-select-box .custom-trade-input{display:flex;align-items:center;font-size:12px;white-space:nowrap}.custom-trade-select-box .custom-trade-input .label{margin-right:10px}.custom-trade-select-box .custom-trade-input .trade-dialog-select .t-select .t-input__wrap{width:100%!important}.custom-trade-select-box .custom-trade-input .trade-dialog-select .t-select .t-input__wrap .t-input:hover{border-color:#c99400}.custom-trade-select-box .custom-trade-input .trade-dialog-select .t-select .t-input--focused{box-shadow:none;border-color:#c99400}.custom-trade-select-box .custom-trade-input .trade-dialog-select .t-select .t-fake-arrow--active{color:#c99400}.custom-trade-select-box .custom-trade-input .trade-dialog-select .t-select .t-input__prefix .t-tag{background-color:#c99400;color:#fff;font-weight:600;font-size:11px}.custom-trade-select-box .custom-trade-input .trade-dialog-select .t-select .t-input__prefix .t-tag .t-icon{color:#fff}.custom-trade-select-box .custom-trade-input .t-input{height:24px}.custom-trade-select-box .custom-trade-input .t-input .t-input__inner{font-size:12px}.custom-trade-select-box .custom-trade-select{display:flex;align-items:center;white-space:nowrap;font-size:12px}.custom-trade-select-box .custom-trade-select .real-trade-select .t-input__wrap .t-input{font-size:12px;border:none}.custom-trade-select-box .custom-trade-select .real-trade-select .t-input__wrap .t-input--focused{box-shadow:none}.custom-trade-select-box__mobile{border-bottom:1px solid #EAECEF;padding-bottom:6px}
import{r as s,j as t}from"./app-31862dc0.js";import{C as e}from"./index-b10ec9de.js";import{C as a}from"./index-0a5d5188.js";import{r as i,g as l,i as o}from"./local-cc653678.js";import{C as r}from"./index-eb513bc7.js";import{i as n}from"./dom-ce105537.js";import"./auth-82dcf9fa.js";class h extends s.Component{constructor(s){super(s),this.valueChange=(s,t)=>{this.setState({[t]:s})},this.getSymb=async()=>{const s=await i();this.setState({SymbolOptions:s})},this.state={user:"",status:"",userSelect:{label:"用户",options:l()},SymbolOptions:[]}}onFilter(s){this.props.FilterChange&&this.props.FilterChange(s)}componentDidMount(){this.getSymb()}render(){const{userSelect:s}=this.state;return t.jsxs("div",{className:[o()?"custom-trade-select-box__mobile":""].join(" "),children:[t.jsxs("div",{className:["custom-trade-select-box"].join(" "),children:[t.jsxs("div",{className:"custom-trade-select",children:[t.jsx("span",{className:"label",children:s.label}),t.jsx(e,{className:"real-trade-select",name:"user",value:this.state.user,options:s.options,onChange:this.valueChange})]}),t.jsxs("div",{className:"custom-trade-input",children:[t.jsx("span",{className:"label",children:"交易对"}),t.jsx(e,{value:this.state.pairs,name:"pairs",options:this.state.SymbolOptions,filterable:!0,className:"trade-dialog-select",clearable:!0,multiple:!1,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.valueChange})]}),t.jsxs("div",{className:"custom-trade-input",style:{display:n("2"===this.props.tableType)},children:[t.jsx("span",{className:"label",children:"状态"}),t.jsx(r,{name:"status",type:"text",onChange:this.valueChange,value:this.state.status})]}),t.jsx(a,{onClick:this.onFilter.bind(this,{exchange_users_id:this.state.user,symbol:this.state.pairs,status:this.state.status}),children:"查询"}),t.jsx(a,{onClick:this.onFilter.bind(this,{exchange_users_id:this.state.user,symbol:this.state.pairs,status:this.state.status}),children:"刷新"})]}),this.props.children]})}}export{h as default};
.custom-layout-head{height:67px;border-bottom:1px solid #EAECEF;display:flex;justify-content:space-between;align-items:center;padding:0 20px}.custom-layout-head .layout-head-left{display:flex;align-items:center}.custom-layout-head .layout-head-left span{font-style:normal;font-weight:800;font-size:40px;color:#e6e6e6;line-height:48px;white-space:nowrap}.custom-layout-head .layout-head-left .layout-chose-button{margin-left:50px;font-style:normal;font-weight:600;font-size:14px;cursor:pointer;white-space:nowrap;transition:all .2s;color:#000}.custom-layout-head .layout-head-left .active{color:#c99400;transition:all .2s}.custom-layout-head .layout-head-right{display:flex;align-items:center}.custom-layout-head .layout-head-right .logout{background:#fd1753;border:none;margin-right:20px;--ripple-color: #fd6053 !important}.custom-layout-content{width:100%;height:calc(100vh - 64px);background:#FAFAFA;overflow-y:auto}.custom-layout-content .real-content{width:1500px;height:100%;background:white;margin:0 auto;border:1px solid #EAECEF;border-top:none;box-sizing:border-box}.custom-layout-content_mobile{overflow-x:hidden;background:white}.custom-layout-content_mobile .real-content{width:100vw;border:none}
import{r as e,j as s}from"./app-31862dc0.js";import{j as l,c as a,i as t,k as i}from"./local-cc653678.js";import{P as c}from"./index-cb06c7d1.js";import{C as d}from"./index-0a5d5188.js";import{g as r,a as n}from"./trade-281a8bb7.js";import{s as o,o as h}from"./auth-82dcf9fa.js";import{a as m}from"./multipleUse-6d627ec3.js";import{C as p}from"./index-1c100007.js";import"./index-8e22b173.js";import"./index-313c704e.js";import"./index-82987c35.js";class b extends e.Component{constructor(e){super(e),this.pageChange=e=>{this.setState({pageNum:e}),this.getTableList()},this.state={list:[{}],pageNum:1,pageSize:10,total:0,isFirst:!0},this.columns=[{colKey:"ddd",title:"用户名"},{colKey:"d2",title:"交易所"},{colKey:"d3",title:"交易对"},{colKey:"d4",title:"交易类型",align:"center"},{colKey:"d5",title:"持仓方向",align:"center"},{colKey:"d6",title:"开仓价格",align:"center"},{colKey:"d7",title:"数量",align:"center"},{colKey:"d8",title:"成交数量USDT",align:"center"},{colKey:"d9",title:"时间",align:"center"},{colKey:"d10",title:"操作",align:"center"}]}pcTable(){return""}mobileTable(){return s.jsxs("div",{className:"contract-real-table__mobile",children:[this.state.list.map(((e,t)=>s.jsxs("div",{className:"table-row",children:[s.jsxs("div",{className:"table-row-line",children:[s.jsx("div",{className:"table-pairs",children:e.symbol}),s.jsx("div",{className:"table-time",children:e.working_time})]}),s.jsxs("div",{className:"table-row-line",children:[s.jsxs("div",{className:["table-direction"].join(" "),style:{color:r(e.position_side)},children:[l("order_type",e.type),"/",n(e.position_side)]}),s.jsx(d,{onClick:this.tableContractRevoke.bind(this,e),children:"撤销"})]}),s.jsxs("div",{className:"table-row-line",children:[s.jsx(p,{checked:e.is_checked,onChange:s=>{e.is_checked=s}}),s.jsxs("div",{className:"table-col-left",children:[s.jsxs("div",{className:"table-col__line",children:[s.jsx("div",{className:"table-col-label",children:"用户"}),s.jsx("div",{className:"table-col-value",children:a(e.exchange_users_id)})]}),s.jsxs("div",{className:"table-col__line",children:[s.jsx("div",{className:"table-col-label",children:"开仓价格"}),s.jsx("div",{className:"table-col-value",children:e.price})]}),s.jsxs("div",{className:"table-col__line",children:[s.jsx("div",{className:"table-col-label",children:"交易方向"}),s.jsx("div",{className:"table-col-value",children:e.side})]})]}),s.jsxs("div",{className:"table-col-left",children:[s.jsxs("div",{className:"table-col__line",children:[s.jsx("div",{className:"table-col-label",children:"交易所"}),s.jsx("div",{className:"table-col-value",children:e.exchange})]}),s.jsxs("div",{className:"table-col__line",children:[s.jsx("div",{className:"table-col-label",children:"数量"}),s.jsx("div",{className:"table-col-value",children:e.qty})]}),s.jsxs("div",{className:"table-col__line",children:[s.jsx("div",{className:"table-col-label",children:"状态"}),s.jsx("div",{className:["table-col-value","green"].join(" "),children:e.status})]})]})]})]},(new Date).valueOf()+t))),s.jsx(c,{onChange:this.pageChange,pageNum:this.state.pageNum,pageSize:this.state.pageSize,total:this.state.total})]})}async tableContractRevoke(e){let s={};if(e)s={ids:[e.id]};else{const e=this.state.list,l=[];if(e.forEach((e=>{e.is_checked&&l.push(e.id)})),!l.length)return void o("未选择行");s={ids:l}}await m(s)&&this.getTableList()}currentTable(){return s.jsx("div",{style:this.props.style??null,className:"c-table-height",children:t()?this.mobileTable():this.pcTable()})}async getTableList(e){let s=null;try{let l={page:this.state.pageNum,limit:this.state.pageSize};e&&(l={...l,...e}),s=h();const a=await i(l);0==a.code&&(a.data.data.forEach((e=>{e.is_checked=!1})),this.setState({list:JSON.parse(JSON.stringify(a.data.data)),total:a.data.total}),this.props.updateTotal&&this.props.updateTotal(a.data.total)),s&&s.hide()}catch(l){s&&s.hide()}}shouldComponentUpdate(e,s,l){return e["v-if"]&&s.isFirst&&(this.setState({isFirst:!1}),this.getTableList()),!0}render(){return this.props["v-if"]?this.currentTable():s.jsx(s.Fragment,{})}}export{b as default};
.contract-trade-table{flex:1;display:flex;flex-direction:column}.contract-trade-table .contract-trade-label{padding:24px 12px 6px;font-weight:600;font-size:16px;color:#000;border-bottom:1px solid #EAECEF}.contract-trade-table .contract-trade-table-box{padding:0 30px;flex:1}.contract-trade-table .contract-trade-table-box .spread-out-table{display:flex;flex-direction:column}.contract-trade-table .contract-trade-table-box .spread-out-table>:first-child{flex:1}.contract-trade-table .contract-trade-group{display:flex;align-items:center;height:37px;font-weight:600;font-size:14px}.contract-trade-table .contract-trade-group>*{cursor:pointer;transition:all .3s}.contract-trade-table .contract-trade-group>:nth-child(1){margin-left:12px}.contract-trade-table .contract-trade-group>:not(:nth-child(1)){margin-left:20px}.contract-trade-table .contract-trade-group .group-active{color:#c99400;transition:all .3s}.c-table-height{height:100%}.contract-trade-table__mobile{padding:6px 12px 0!important}.contract-trade-table__mobile .contract-real-table__mobile{min-height:100%;display:flex;flex-direction:column}.contract-trade-table__mobile .contract-real-table__mobile .table-row{padding-bottom:12px;border-bottom:1px solid #F0F0F0}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line{margin-top:6px;display:flex;justify-content:space-between;align-items:center}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-btns>:not(:first-child){margin-left:12px}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-pairs{font-weight:400;font-size:16px;color:#222}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-pairs span{color:#c99400}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-time{font-weight:400;font-size:12px;color:#848e9c}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-direction{font-weight:400;font-size:14px}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-col-left{width:44%}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-col-left>:not(:first-child){margin-top:4px}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-col-left .table-col__line{display:flex;justify-content:space-between}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-col-left .table-col__line .table-col-label{font-weight:400;font-size:13px;color:#848e9c}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-col-left .table-col__line .table-col-value{font-weight:400;font-size:14px;color:#222}.contract-trade-table__mobile .contract-real-table__mobile .table-row .table-row-line .table-col-left .table-col__line .green{color:#0e9d6d}.contract-trade-table__mobile .contract-real-table__mobile .reset-t-pagination-box{margin-top:auto}.hold-position-extension{padding:0 12px;display:flex;justify-content:flex-end;margin-top:6px}.hold-position-extension>:first-child{margin-right:6px}.hold-position-extension>:only-child{margin-right:0}.hold-position-extension .custom-reset-t-button{color:#c99400!important}
.custom-trade-form{padding-right:20px}.custom-trade-form>:not(:first-child){margin-top:12px}.custom-trade-form .trade-form-item{display:flex;align-items:center}.custom-trade-form .trade-form-item .trade-form-item__label{text-align:right;width:70px}.custom-trade-form .trade-form-item .required:before{content:"*";color:red;padding-right:2px}.custom-trade-form .trade-form-item .trade-form-item__value{flex:1;box-sizing:border-box;margin-left:12px}.custom-trade-form .trade-form-item .trade-form-item__value .trade-form-submit{float:right}.custom-trade-form .trade-form-item .trade-form-item__value .trade-form-submit>:nth-child(1){margin-right:12px}.custom-trade-form .trade-form-item .trade-form-item__value .trade-form-input-suffix{background:#EAECEF;width:32px;height:32px;display:flex;justify-content:center;align-items:center;margin-right:-8px}.custom-trade-form .trade-form-item .trade-form-item__value .trade-dialog-select .t-select .t-input__wrap{width:100%!important}.custom-trade-form .trade-form-item .trade-form-item__value .trade-dialog-select .t-select .t-input__wrap .t-input:hover{border-color:#c99400}.custom-trade-form .trade-form-item .trade-form-item__value .trade-dialog-select .t-select .t-input--focused{box-shadow:none;border-color:#c99400}.custom-trade-form .trade-form-item .trade-form-item__value .trade-dialog-select .t-select .t-fake-arrow--active{color:#c99400}.custom-trade-form .trade-form-item .trade-form-item__value .trade-dialog-select .t-select .t-input__prefix .t-tag{background-color:#c99400;color:#fff;font-weight:600;font-size:11px}.custom-trade-form .trade-form-item .trade-form-item__value .trade-dialog-select .t-select .t-input__prefix .t-tag .t-icon{color:#fff}.trade-dialog-select__overlay .t-select-option{color:#c99400}.trade-dialog-select__overlay .t-select-option .t-checkbox__input{border-color:#c99400!important}.trade-dialog-select__overlay .t-is-selected{background-color:#fff}.trade-dialog-select__overlay .t-is-selected .t-checkbox__input{background-color:#c99400;border-color:#c99400}.trade-dialog-select__overlay .t-is-selected .t-checkbox__input:hover,.trade-dialog-select__overlay .t-is-selected .t-checkbox__input:focus,.trade-dialog-select__overlay .t-is-selected .t-checkbox__input:active{background-color:#c99400;border-color:#c99400}.trade-dialog-select__overlay .t-is-selected .t-checkbox__label{color:#c99400}.trade-dialog-select__overlay .t-is-selected:hover{background-color:#fff}.trade-dialog-select__overlay .t-is-selected .t-is-checked{background-color:#fff;color:#fff}
.reset-t-checkbox .t-checkbox__input{border-color:#c99400!important}.t-is-checked .t-checkbox__input{background-color:#c99400!important;border-color:#c99400!important}.t-is-checked:hover .t-checkbox__input{border-color:#c99400}
import{r as t,j as e}from"./app-31862dc0.js";import{I as a}from"./index-f16fae83.js";import{c as s,e as o,i as n}from"./local-cc653678.js";import{am as i}from"./auth-82dcf9fa.js";import"./index-cb06c7d1.js";import"./index-8e22b173.js";import"./index-313c704e.js";import"./formModel-cd1d5f2d.js";import"./Dialog-64469075.js";import"./index-82987c35.js";class c extends t.Component{constructor(t){super(t),this.state={list:[],loading:!1},this.columns=[{colKey:"ddd",title:"用户名",align:"center",cell:({rowIndex:t,row:e})=>e.id?s(e.id):"null"},{colKey:"exchange",title:"交易所",align:"center"},{colKey:"spot_asset",title:"现货资产",align:"center",cell:({rowIndex:t,row:a})=>e.jsx("span",{children:parseFloat(a.spot_asset+"").toFixed(4)})},{colKey:"contract_asset",title:"合约资产",align:"center",cell:({rowIndex:t,row:a})=>e.jsx("span",{children:parseFloat(a.contract_asset+"").toFixed(4)})},{colKey:"total",title:"总资产",align:"center",cell:({rowIndex:t,row:a})=>e.jsx("span",{children:(parseFloat(a.spot_asset+"")+parseFloat(a.contract_asset+"")).toFixed(4)})},{colKey:"principal",title:"本金",align:"center",cell:({rowIndex:t,row:a})=>e.jsx("span",{style:{color:"#C99400"},children:parseFloat(a.principal+"")})}]}changeLoding(t){this.setState({loading:t})}async changeList(){try{this.changeLoding(!0);const t=await i();0==t.code&&this.setState({list:t.data.data}),this.changeLoding(!1)}catch(t){}}async componentDidMount(){await o(),this.changeList()}render(){return e.jsxs("div",{className:["contract-account-table",n()?"contract-account-table__mobile":""].join(" "),children:[e.jsx("div",{className:"contract-account-label",children:"账号总览"}),e.jsx("div",{className:"contract-account-table-box",children:e.jsx(a,{columns:this.columns,data:this.state.list,loading:this.state.loading})})]})}}export{c as default};
import{r as e,j as s}from"./app-31862dc0.js";import{f as t,S as a,q as i,r,g as o,t as l,i as d}from"./local-cc653678.js";import{C as m}from"./index-b10ec9de.js";import{C as n}from"./index-eb513bc7.js";import{C as c}from"./index-0a5d5188.js";import{S as h,a as p}from"./submit-4cb12a00.js";import{S as u}from"./trade-8bf27581.js";import{s as _,o as v}from"./auth-82dcf9fa.js";import{i as j}from"./dom-ce105537.js";import{D as y}from"./index-53c17267.js";import"./Dialog-64469075.js";const f="user_ids",x="symbols";class g extends e.Component{constructor(e){super(e),this.onReset=()=>{Object.keys(this.state).forEach((e=>{"string"==typeof this.state[e]?this.setState({[e]:""}):"number"==typeof this.state[e]?this.setState({[e]:0}):this.setState({[e]:[]})}))},this.onSubmit=async()=>{const e=[f,x,u.spot_strategy_id,u.direction,u.order_type];if(!t(e,this.state))return void _("请填写必填项");if("LIMIT"===this.state[u.order_type]&&!this.state[u.limit_price])return void _("限价单价格必填");let s=null;try{s=v();0==(await a(this.state)).code&&(_("提交成功","success"),this.onClose()),s&&s.hide()}catch(i){s&&s.hide()}},this.onValueChange=(e,s)=>{s&&this.setState({[s]:e})},this.getStrategy=async()=>{try{const e=await i();0==e.code&&(this.strategyOptions=e.data)}catch(e){}},this.SymbolList=async()=>{try{this.symbolOptions=await r()}catch(e){}},this.onClose=()=>{const{onClose:e}=this.props;e&&e()},this.state={[f]:[],[x]:[],[u.direction]:"",[u.order_type]:"",[u.limit_price]:""},this.symbolOptions=[],this.strategyOptions=[],this.userOptions=o(!0,!1),this.positionSideOptions=l("direction",!1),this.orderTypeOptions=l("order_type",!1)}componentDidMount(){this.getStrategy(),this.SymbolList()}render(){const{visible:e}=this.props,t=this.state;return s.jsx(y,{visible:e,placement:"center",onClose:this.onClose,footer:!1,className:[d()?"trade-dialog__mobile":""].join(" "),children:s.jsxs("div",{className:"custom-trade-form",children:[s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"用户"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(m,{value:t[f],name:f,options:this.userOptions,className:"trade-dialog-select",clearable:!0,multiple:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"交易对"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(m,{value:t[x],name:x,options:this.symbolOptions,filterable:!0,className:"trade-dialog-select",clearable:!0,multiple:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label",children:"策略"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(m,{value:t[u.spot_strategy_id],name:u.spot_strategy_id,options:this.strategyOptions,className:"trade-dialog-select",clearable:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"买卖类型"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(m,{value:t[u.direction],name:u.direction,options:this.positionSideOptions,className:"trade-dialog-select",clearable:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",children:[s.jsx("div",{className:"trade-form-item__label required",children:"交易类型"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(m,{value:t[u.order_type],name:u.order_type,options:this.orderTypeOptions,className:"trade-dialog-select",clearable:!0,autoWidth:!1,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.onValueChange})})]}),s.jsxs("div",{className:"trade-form-item",style:{display:j("LIMIT"===t[u.order_type])},children:[s.jsx("div",{className:"trade-form-item__label required",children:"限价价格"}),s.jsx("div",{className:"trade-form-item__value",children:s.jsx(n,{type:"number",value:t[u.limit_price],align:"center",name:u.limit_price,onChange:this.onValueChange})})]}),s.jsx("div",{className:"trade-form-item",children:s.jsx("div",{className:"trade-form-item__value",children:s.jsxs("div",{className:"trade-form-submit",children:[s.jsx(c,{icon:s.jsx(h,{}),onClick:this.onReset,children:"重置"}),s.jsx(c,{icon:s.jsx(p,{}),onClick:this.onSubmit,children:"提交"})]})})})]})})}}export{g as default};
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment