import{r as s,j as t}from"./app-a12cf07d.js";import{C as e}from"./index-49740479.js";import{C as a}from"./index-34595b79.js";import{h as i,G as r,t as l,i as n}from"./local-6367da78.js";import{C as o}from"./index-0a85991c.js";import{i as u}from"./dom-ce105537.js";import{S as h,a as c,t as p,b as m}from"./trade-8bf27581.js";import"./auth-d668f6b9.js";const d=["status"],y=["quantity"],x=["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(!0,r);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),this.state[h.user_id]&&(r[h.user_id]=this.state[h.user_id]);let l=[];if(s){s===p?l=d:s===c?l=y:s===m&&(l=x);const t=Object.keys(r);l.forEach((s=>{-1!==t.findIndex((t=>t===s))&&delete r[s]}))}return r},this.state={[h.user_id]:"",status:"NEW",quantity:"",symbol:"",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:[n()?"custom-trade-select-box__mobile":""].join(" "),children:[t.jsxs("div",{style:{display:u("4"!==this.props.currentGroupButton)},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:[h.user_id],value:this.state[h.user_id],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.symbol,name:"symbol",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:u(this.props.currentGroupButton===c)},children:[t.jsx("span",{className:"label",children:"状态"}),t.jsx(o,{name:"status",type:"text",onChange:this.valueChange,value:this.state.status})]}),t.jsxs("div",{className:"custom-trade-input",style:{display:u(this.props.currentGroupButton===p)},children:[t.jsx("span",{className:"label",children:"价值"}),t.jsx(o,{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};
