import{r as s,j as t}from"./app-eaa32a4a.js";import{C as e}from"./index-fae09989.js";import{C as a}from"./index-fbd6c2c0.js";import{n as i,g as r,i as l}from"./local-bd07797b.js";import{C as n}from"./index-a5b8701f.js";import{i as o}from"./dom-ce105537.js";import{a as u,t as c,b as h}from"./trade-8bf27581.js";import"./auth-e5508dcf.js";const p=["status"],m=["quantity"],d=["status","quantity"];class j 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.getFilterParams=(s="")=>{const{exchange_users_id:t,symbol:e,status:a,quantity:i}=this.state;let r={};t&&(r.exchange_users_id=t),e&&(r.symbol=e),a&&(r.status=a),i&&(r.quantity=i);let l=[];if(s){s===c?l=p:s===u?l=m:s===h&&(l=d);const t=Object.keys(r);l.forEach((s=>{-1!==t.findIndex((t=>t===s))&&delete r[s]}))}return r},this.state={user:"",status:"NEW",quantity:"",userSelect:{label:"用户",options:r()},SymbolOptions:[]}}onFilter(s){this.props.FilterChange&&this.props.FilterChange(s)}componentDidMount(){this.getSymb()}render(){const{userSelect:s}=this.state;return t.jsxs("div",{className:[l()?"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,{width:"150px",value:this.state.pairs,name:"pairs",options:this.state.SymbolOptions,filterable:!0,className:"trade-dialog-select",customClear:!0,clearable:!1,multiple:!1,autoWidth:!0,popupProps:{overlayClassName:"trade-dialog-select__overlay"},onChange:this.valueChange})]}),t.jsxs("div",{className:"custom-trade-input",style:{display:o(this.props.currentGroupButton===u)},children:[t.jsx("span",{className:"label",children:"状态"}),t.jsx(n,{name:"status",type:"text",onChange:this.valueChange,value:this.state.status})]}),t.jsxs("div",{className:"custom-trade-input",style:{display:o(this.props.currentGroupButton===c)},children:[t.jsx("span",{className:"label",children:"价值"}),t.jsx(n,{name:"quantity",type:"number",onChange:this.valueChange,value:this.state.quantity})]}),t.jsx(a,{onClick:this.onFilter.bind(this,this.getFilterParams(this.props.currentGroupButton)),children:"查询"}),t.jsx(a,{onClick:this.onFilter.bind(this,this.getFilterParams(this.props.currentGroupButton)),children:"刷新"})]}),this.props.children]})}}export{j as default};
