cus-index.89de54a3.js 12 KB

12
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["cus-index"],{"23d6":function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"views",attrs:{id:"custom_index"}},[a("div",{staticClass:"chartSetting",class:{active:t.isChart}},[a("div",[a("i",{staticClass:"el-icon-close crm-cursor",on:{click:function(e){t.isChart=!1}}})]),a("div",{staticClass:"tit"},[a("span",{directives:[{name:"t",rawName:"v-t",value:"Custom.Index.ChartSet",expression:"'Custom.Index.ChartSet'"}]})]),a("el-form",{ref:"form",staticClass:"form",attrs:{model:t.ChartSet,"label-width":"0","label-position":"top"}},[a("el-form-item",{attrs:{label:t.$t("Label.ChartType")}},[a("el-select",{staticClass:"crm_select_icon_w",attrs:{placeholder:t.$t("placeholder.choose")},model:{value:t.ChartSet.type,callback:function(e){t.$set(t.ChartSet,"type",e)},expression:"ChartSet.type"}},[a("el-option",{attrs:{label:t.$t("Custom.Index.TradingVolumeStatistics"),value:4}}),a("el-option",{attrs:{label:t.$t("Custom.Index.DepositStatistical"),value:2}}),a("el-option",{attrs:{label:t.$t("Custom.Index.WithdrawalsStatistical"),value:3}}),a("el-option",{attrs:{label:t.$t("Custom.Index.ProfitLoss"),value:6}})],1)],1),a("el-form-item",{attrs:{label:t.$t("Label.PlatformType")}},[a("el-select",{staticClass:"crm_select_icon_w",attrs:{placeholder:t.$t("placeholder.choose")},model:{value:t.ChartSet.platform,callback:function(e){t.$set(t.ChartSet,"platform",e)},expression:"ChartSet.platform"}},[a("el-option",{attrs:{label:"MT4",value:"MT4"}}),a("el-option",{attrs:{label:"MT5",value:"MT5"}})],1)],1),a("el-form-item",{attrs:{label:t.$t("Label.TradingAccount")}},[a("el-select",{staticClass:"crm_select_icon_w",attrs:{placeholder:t.$t("placeholder.choose")},model:{value:t.ChartSet.login,callback:function(e){t.$set(t.ChartSet,"login",e)},expression:"ChartSet.login"}},t._l(t.dropDown,(function(t){return a("el-option",{key:t.login,attrs:{label:t.login,value:t.login}})})),1)],1),a("el-form-item",[a("el-button",{directives:[{name:"t",rawName:"v-t",value:"Btn.Confirm",expression:"'Btn.Confirm'"}],staticClass:"s-btn",attrs:{type:"primary"},on:{click:t.getChart}})],1)],1)],1),a("div",{staticClass:"chart-box crm-border-radius"},[a("div",{staticClass:"chart-title"},[a("div",{staticClass:"time",on:{click:t.toReload}},[a("i",{staticClass:"el-icon-refresh crm-cursor"}),a("span",{staticClass:"crm-cursor"},[t._v(" UTC+8 "+t._s(t.time))])]),a("div",{staticClass:"title"},[a("div",{staticClass:"name"},[4==t.ChartSet.type?a("span",{directives:[{name:"t",rawName:"v-t",value:"Custom.Index.TradingVolumeStatistics",expression:"'Custom.Index.TradingVolumeStatistics'"}]}):t._e(),2==t.ChartSet.type?a("span",{directives:[{name:"t",rawName:"v-t",value:"Custom.Index.DepositStatistical",expression:"'Custom.Index.DepositStatistical'"}]}):t._e(),3==t.ChartSet.type?a("span",{directives:[{name:"t",rawName:"v-t",value:"Custom.Index.WithdrawalsStatistical",expression:"'Custom.Index.WithdrawalsStatistical'"}]}):t._e(),6==t.ChartSet.type?a("span",{directives:[{name:"t",rawName:"v-t",value:"Custom.Index.ProfitLoss",expression:"'Custom.Index.ProfitLoss'"}]}):t._e()]),t.ChartSet.login?a("div",{staticClass:"account"},[a("span",{directives:[{name:"t",rawName:"v-t",value:"Custom.Index.TradingAccount",expression:"'Custom.Index.TradingAccount'"}]}),a("span",[t._v(" — ")]),a("span",[t._v(t._s(t.ChartSet.login))])]):t._e(),a("div",{staticClass:"date"},[a("el-date-picker",{attrs:{type:"daterange",size:"small","range-separator":"—","start-placeholder":t.$t("placeholder.Start"),"end-placeholder":t.$t("placeholder.End")},on:{input:t.getSearchDate},model:{value:t.isDate,callback:function(e){t.isDate=e},expression:"isDate"}})],1)]),a("div",{staticClass:"operation"},[a("i",{staticClass:"iconfont iconcanshu crm-cursor",on:{click:function(e){t.isChart=!0}}})])]),a("div",{attrs:{id:"myChart"}})]),a("div",{staticClass:"accounts"},[a("div",{staticClass:"account-top crm-title-box"},[a("span",{staticClass:"tit"},[a("span",{directives:[{name:"t",rawName:"v-t",value:"Custom.Index.AccountList",expression:"'Custom.Index.AccountList'"}]})]),a("span",{staticClass:"btn crm-cursor",on:{click:t.toNewAccount}},[a("i",{staticClass:"el-icon-plus"}),a("span",{directives:[{name:"t",rawName:"v-t",value:"Custom.Index.AddAccount",expression:"'Custom.Index.AddAccount'"}]})])]),a("div",{staticClass:"search"},[a("span",{staticClass:"crm-cursor",class:{active:"MT4"==t.platform},on:{click:function(e){return t.tableSearch("MT4")}}},[t._v("MT4")]),a("span",{staticClass:"crm-cursor",class:{active:"MT5"==t.platform},on:{click:function(e){return t.tableSearch("MT5")}}},[t._v("MT5")])]),a("div",{staticClass:"tab"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.pictLoading,expression:"pictLoading"}],staticClass:"crm_tab_header",staticStyle:{width:"100%"},attrs:{data:t.tableData,"element-loading-background":"rgba(43, 48, 67, 0.65)","element-loading-spinner":"el-icon-loading"}},[a("el-table-column",{attrs:{align:"center","header-align":"center",label:t.$t("Label.TradingAccount")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.login||"-"))]}}])}),a("el-table-column",{attrs:{align:"center",label:t.$t("Label.AccountType")},scopedSlots:t._u([{key:"default",fn:function(e){return[1==e.row.type?a("span",{directives:[{name:"t",rawName:"v-t",value:"AccountType.ClassicAccount",expression:"'AccountType.ClassicAccount'"}]}):t._e(),2==e.row.type?a("span",{directives:[{name:"t",rawName:"v-t",value:"AccountType.SeniorAccount",expression:"'AccountType.SeniorAccount'"}]}):t._e(),3==e.row.type?a("span",{directives:[{name:"t",rawName:"v-t",value:"AccountType.AgencyAccount",expression:"'AccountType.AgencyAccount'"}]}):t._e(),4==e.row.type?a("span",{directives:[{name:"t",rawName:"v-t",value:"AccountType.ProfessionalAccount",expression:"'AccountType.ProfessionalAccount'"}]}):t._e(),5==e.row.type?a("span",{directives:[{name:"t",rawName:"v-t",value:"AccountType.SpeedAccount",expression:"'AccountType.SpeedAccount'"}]}):t._e()]}}])}),a("el-table-column",{attrs:{align:"center",label:t.$t("Label.Leverage")},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.leverage?a("span",[t._v("1:")]):t._e(),t._v(t._s(e.row.leverage||"-"))]}}])}),a("el-table-column",{attrs:{align:"center",label:t.$t("Label.Equity")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("$"+t._s(e.row.equity||"0"))]}}])}),a("el-table-column",{attrs:{align:"center",label:t.$t("Label.Credit")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.credit||"0"))]}}])}),a("el-table-column",{attrs:{align:"center",label:t.$t("Label.Balance")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("$"+t._s(e.row.balance||"0"))]}}])}),a("el-table-column",{attrs:{align:"center",label:t.$t("Label.Action"),width:"220"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"tab-act-btn"},[a("span",{staticClass:"crm-font-btn",on:{click:function(a){return t.toDeposit(e.row)}}},[a("i",{staticClass:"el-icon-error"}),a("span",{directives:[{name:"t",rawName:"v-t",value:"Custom.Index.Deposit",expression:"'Custom.Index.Deposit'"}]})]),a("span",{staticClass:"crm-font-btn",on:{click:function(a){return t.toWithdraw(e.row)}}},[a("i",{staticClass:"el-icon-error"}),a("span",{directives:[{name:"t",rawName:"v-t",value:"Custom.Index.Withdrawals",expression:"'Custom.Index.Withdrawals'"}]})])]),a("div",{staticClass:"tab-act-btn"},[a("span",{staticClass:"crm-font-btn",on:{click:function(a){return t.toTransfer(e.row)}}},[a("i",{staticClass:"el-icon-error"}),a("span",{directives:[{name:"t",rawName:"v-t",value:"Custom.Index.Transfer",expression:"'Custom.Index.Transfer'"}]})]),a("span",{staticClass:"crm-font-btn",on:{click:function(a){return t.toSettings(e.row)}}},[a("i",{staticClass:"el-icon-error"}),a("span",{directives:[{name:"t",rawName:"v-t",value:"Custom.Index.Settings",expression:"'Custom.Index.Settings'"}]})])])]}}])})],1),t.pagerInfo.rowTotal?a("div",{staticClass:"crm_pagination"},[a("el-pagination",{staticClass:"page",attrs:{background:"",layout:"prev, pager, next","page-size":t.pagerInfo.row,total:t.pagerInfo.rowTotal},on:{"current-change":t.handleCurrentChange}})],1):t._e()],1)])])},i=[],n=a("eec4"),r=a.n(n),o=a("6df7"),c=a("f121"),l=a.n(c);let{Code:u}=l.a;var d={name:"Customer",components:{},inject:["reload"],data(){return{pictLoading:!1,platform:"MT4",ChartSet:{type:4,platform:"MT4",login:"",startDate:"",endDate:""},isChart:!1,isDate:"",dropDown:[],time:"",value:"",input:"",tableData:[],form:{},chartDates:[],chartTimes:[],pagerInfo:{row:10,current:1,pageTotal:0,rowTotal:10}}},computed:{},methods:{tableSearch(t){this.platform=t,this.getDateList()},getSearchDate(t){this.ChartSet.startDate=t[0],this.ChartSet.endDate=t[1],this.getChart()},getDateList:async function(){this.pictLoading=!0;let t=await o["a"].AccountList({platform:this.platform,page:{current:this.pagerInfo.current,row:this.pagerInfo.row}});t.code==u.StatusOK?(this.tableData=t.data,this.pictLoading=!1):(this.$pigeon.MessageError(t.msg),this.pictLoading=!1)},getAccountList:async function(){let t=await o["a"].CustomDropdown({platform:this.ChartSet.platform});t.code==u.StatusOK?this.dropDown=t.data:this.$pigeon.MessageError(t.msg)},getChart:async function(){this.chartDates=[],this.chartTimes=[];let t=await o["a"].getChartInfo({...this.ChartSet});t.code==u.StatusOK?(t.data.forEach(t=>{this.chartDates.push(t.amount),this.chartTimes.push(t.date.split(" ")[0])}),this.drawLine(),this.$pigeon.MessageOK(this.$i18n.t("Msg.SearchSuccess"))):this.$pigeon.MessageError(t.msg)},toNewAccount(){this.$router.push({path:"/customer/new"}).catch(t=>t),this.$store.commit("isActiveTab","0")},toSettings(t){this.$router.push({path:"/customer/settings",query:{login:t.login,platform:t.platform,type:t.type,currency:t.currency,leverage:t.leverage}}).catch(t=>t),this.$store.commit("isActiveTab","0")},toDeposit(){this.$router.push({path:"/customer/deposit"}).catch(t=>t),this.$store.commit("isActiveTab","2")},toWithdraw(){this.$router.push({path:"/customer/withdraw"}).catch(t=>t),this.$store.commit("isActiveTab","3")},toTransfer(){this.$router.push({path:"/customer/transfer"}).catch(t=>t),this.$store.commit("isActiveTab","4")},getDate(){let t=new Date,e=t.setDate(1),a=t.setMonth(t.getMonth()+1),s=new Date(e).getFullYear(),i=new Date(e).getMonth()+1,n=new Date(e).getDate(),r=new Date(a).getFullYear(),o=new Date(a).getMonth()+1,c=1;this.ChartSet.startDate=s+"-"+(i<10?"0"+i:i)+"-"+(n<10?"0"+n:n),this.ChartSet.endDate=r+"-"+(o<10?"0"+o:o)+"-"+(c<10?"0"+c:c);let l,u=new Date,d=u.getMonth()+1,p=u.getDate(),m=u.getHours(),h=u.getMinutes();d<10&&(d="0"+d),p<10&&(p="0"+p),m<10&&(m="0"+m),h<10&&(h="0"+h),l=" "+m+":"+h+" "+d+"/"+p,this.time=l},goTime(){this.getDate()},toReload(){this.reload()},drawLine(){let t=this.$echarts.init(document.getElementById("myChart")),e=this.chartTimes,a=this.chartDates,s={title:{text:"",subtext:"",left:"center"},tooltip:{trigger:"axis",axisPointer:{animation:!1}},axisPointer:{link:{xAxisIndex:"all"}},grid:[{left:50,right:50,bottom:50,height:"75%"}],xAxis:[{type:"category",boundaryGap:!1,axisLine:{onZero:!0},data:e}],yAxis:[{name:"",type:"value"}],series:[{name:"",type:"line",symbolSize:8,hoverAnimation:!1,data:a}]};t.setOption(s)},divInit(){const t=this,e=r()();e.listenTo(document.getElementById("myChart"),()=>{t.$nextTick(()=>{t.chart=t.$echarts.init(document.getElementById("myChart")),t.chart.resize()})})},handleSizeChange(t){this.pagerInfo.row=t,this.getDateList()},handleCurrentChange(t){this.pagerInfo.current=t,this.getDateList()}},mounted(){this.goTime(),this.getChart(),this.getDateList(),this.divInit(),this.getAccountList()},beforeDestroy:function(){this.getDate&&clearInterval(this.getDate)},watch:{"ChartSet.platform":function(){this.ChartSet.login="",this.getAccountList()}}},p=d,m=(a("d583"),a("cc4f"),a("2877")),h=Object(m["a"])(p,s,i,!1,null,"59d64b5e",null);e["default"]=h.exports},"8f9b":function(t,e,a){},cc4f:function(t,e,a){"use strict";var s=a("8f9b"),i=a.n(s);i.a},d583:function(t,e,a){"use strict";var s=a("ddf0"),i=a.n(s);i.a},ddf0:function(t,e,a){}}]);
  2. //# sourceMappingURL=cus-index.89de54a3.js.map