import{r as t,j as e}from"./app-eaa32a4a.js";import{I as a}from"./index-d0abb25c.js";import{c as s,e as o,i as n}from"./local-bd07797b.js";import{H as i}from"./auth-e5508dcf.js";import"./index-de07cc7b.js";import"./index-58480b55.js";import"./index-4abfb1b1.js";import"./formModel-91be7d5d.js";import"./Dialog-c56752ef.js";import"./index-f0b471ce.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};
