text: webpackJsonp([1],{"+B9X":function(t,e){},"4/hK":function(t,e){},"7Otq":function(t,e){t.exports="data:image/png;base64,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"},"7tVw":function(t,e){},C17c:function(t,e){},Cb2R:function(t,e){},DoUX:function(t,e){},GUiZ:function(t,e){},JgyK:function(t,e){},LxZp:function(t,e){},NHnr:function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=s("7+uW"),i={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{attrs:{id:"app"}},[e("router-view")],1)},staticRenderFns:[]};var n=s("VU/8")({name:"App"},i,!1,function(t){s("wx9h")},null,null).exports,o=s("/ocq"),r={name:"Login",data:function(){return{loginid:"",passwd:"",saveuser:!0,loading:!1}},methods:{doLogin:function(){var t=this,e=this,s=e.loginid,a=e.passwd;e.loading=!0,this.$api.login(s,a,function(a){if(a.result<0)e.$alert("用户登录出错："+a.message,"登录失败");else{var i=a.userinfo;localStorage.setItem("last_user",s),localStorage.setItem("save_user",e.saveuser?"true":"false"),t.$store.commit("loginok",{isLogined:!0,loginid:s,userinfo:i}),t.$socket.emit("connect",1),e.$router.push("/index")}e.loading=!1})}},mounted:function(){this.saveuser="true"==localStorage.getItem("save_user"),this.saveuser&&(this.loginid=localStorage.getItem("last_user"))}},l={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"loginBox"},[s("div",{staticClass:"login"},[s("div",{staticClass:"loginForm"},[s("el-row",[s("h2",[t._v("交易控制中心")])]),t._v(" "),s("el-row",[s("el-input",{attrs:{placeholder:"用户名"},model:{value:t.loginid,callback:function(e){t.loginid=e},expression:"loginid"}})],1),t._v(" "),s("el-row",[s("el-input",{attrs:{placeholder:"密码",type:"password"},model:{value:t.passwd,callback:function(e){t.passwd=e},expression:"passwd"}})],1),t._v(" "),s("el-row",[s("el-checkbox",{staticStyle:{float:"right"},model:{value:t.saveuser,callback:function(e){t.saveuser=e},expression:"saveuser"}},[t._v("保存用户名")])],1),t._v(" "),s("el-row",{staticStyle:{"margin-top":"30px"}},[s("el-button",{attrs:{type:"primary",plain:""},on:{click:function(e){return t.doLogin()}}},[t._v("登 录")])],1)],1)])])},staticRenderFns:[]};var c=s("VU/8")(r,l,!1,function(t){s("kk+i")},"data-v-02eab36d",null).exports,u=s("Dd8w"),d=s.n(u),p=s("NYxO"),f={name:"index",computed:d()({},Object(p.b)(["cache"]),{isAdmin:function(){var t=this.cache.userinfo;return!!t&&("admin"==t.role||"superman"==t.role)}}),components:{},data:function(){return{showDlgModPwd:!1,oldpwd:"",newpwd:"",confirmpwd:"",loading:!1,notifies:[],lastNotify:null,showNotifies:!1}},methods:{handleItemSel:function(t,e,s,a){},onLogout:function(t){var e=this;this.$confirm("确定要注销登录吗？","注销登录",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){e.$store.commit("logoutok"),e.$router.push("/login")}).catch(function(){})},onModPwd:function(t){this.showDlgModPwd=!0},doModPwd:function(){var t=this,e=this;""!=this.newpwd&&""!=this.oldpwd&&""!=this.confirmpwd?this.newpwd==this.confirmpwd?(this.loading=!0,this.$api.modpwd(this.oldpwd,this.newpwd,function(s){s.result<0?e.$notify.error("密码修改失败："+s.message,"修改密码"):(e.$notify.success("密码修改成功","修改密码"),t.showDlgModPwd=!1),setTimeout(function(){t.loading=!1},150)})):this.$alert("两次输入的新密码不一致"):this.$alert("密码不能为空")},handleNotify:function(t){this.notifies.push(t),this.notifies.length>100&&(this.notifies=this.notifies.slice(this.notifies.length-100)),this.lastNotify=t},onClickScroller:function(t){this.showNotifies=!this.showNotifies},getTitleStyle:function(t){return"成交回报"==t?"title-success":"title-warning"},getIconStyle:function(t){return"成交回报"==t?"el-icon-news":"el-icon-warning-outline"}},mounted:function(){this.cache.isLogined||this.$router.push("/login")}},m={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{height:"100%"},attrs:{id:"index"}},[a("el-container",{staticStyle:{height:"100%"}},[a("el-aside",{staticStyle:{"border-right":"2px solid #E4E7ED",height:"100%"},attrs:{width:"230px"}},[a("div",{staticStyle:{height:"100%",display:"flex","flex-direction":"column"}},[a("div",{staticStyle:{flex:"0",height:"44px !important","border-bottom":"1px solid #E4E7ED"}},[a("div",{staticStyle:{display:"flex","flex-direction":"row","margin-left":"12px"}},[a("div",{staticStyle:{flex:"0","margin-top":"6px","padding-right":"12px"}},[a("img",{attrs:{src:s("7Otq"),height:"28px",width:"28px"}})]),t._v(" "),a("div",{staticStyle:{flex:"1","margin-top":"4px",overflow:"hidden"}},[a("span",{staticStyle:{"font-size":"24px"}},[t._v("WT控制台")])])])]),t._v(" "),a("div",{staticStyle:{flex:"1"}},[a("div",{staticStyle:{display:"flex","flex-direction":"column",height:"100%"}},[a("div",{staticStyle:{flex:"1",display:"block","border-bottom":"1px solid #E4E7ED"}},[a("el-menu",{staticClass:"el-menu-vertical-demo",staticStyle:{height:"100%"},attrs:{"default-active":"1-1",router:""},on:{select:t.handleItemSel}},[a("el-submenu",{attrs:{index:"1"}},[a("template",{slot:"title"},[a("i",{staticClass:"el-icon-set-up"}),t._v(" "),a("span",[t._v("控制台")])]),t._v(" "),a("el-menu-item-group",[a("el-menu-item",{attrs:{index:"1-1",route:"/monitor"}},[a("i",{staticClass:"el-icon-view"}),t._v(" "),a("span",[t._v("监控中心")])]),t._v(" "),t.isAdmin?a("el-menu-item",{attrs:{index:"1-2",route:"/schedule"}},[a("i",{staticClass:"el-icon-time"}),t._v(" "),a("span",[t._v("调度中心")])]):t._e()],1)],2),t._v(" "),t.isAdmin?a("el-submenu",{attrs:{index:"2"}},[a("template",{slot:"title"},[a("i",{staticClass:"el-icon-box"}),t._v(" "),a("span",[t._v("自动实施")])]),t._v(" "),a("el-menu-item-group",[a("el-menu-item",{attrs:{index:"2-1",route:"/deploy"}},[a("i",{staticClass:"el-icon-thumb"}),t._v(" "),a("span",[t._v("策略部署")])]),t._v(" "),a("el-menu-item",{attrs:{index:"2-2",route:"/backtest"}},[a("i",{staticClass:"el-icon-data-line"}),t._v(" "),a("span",[t._v("在线回测")])])],1)],2):t._e(),t._v(" "),t.isAdmin?a("el-submenu",{attrs:{index:"3"}},[a("template",{slot:"title"},[a("i",{staticClass:"el-icon-setting"}),t._v(" "),a("span",[t._v("系统设置")])]),t._v(" "),a("el-menu-item-group",[a("el-menu-item",{attrs:{index:"3-1",route:"/admins"}},[a("i",{staticClass:"el-icon-user"}),t._v(" "),a("span",[t._v("用户管理")])])],1)],2):t._e()],1)],1),t._v(" "),a("div",{staticStyle:{flex:"0",margin:"8px","font-size":"14px",display:"flex","flex-direction":"row"}},[a("div",{staticStyle:{flex:"0 0","margin-right":"8px"}},[a("el-popover",{attrs:{placement:"top-start",width:"240",trigger:"hover"}},[a("div",[a("el-row",{staticStyle:{"font-size":"20px","padding-bottom":"4px"}},[a("i",{staticClass:"el-icon-user",staticStyle:{"padding-right":"4px"}}),a("strong",[t._v("用户信息")])]),t._v(" "),a("el-row",[a("el-col",{attrs:{span:8}},[t._v("账户：")]),t._v(" "),a("el-col",{attrs:{span:14}},[t._v(t._s(t.cache.loginid))])],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:8}},[t._v("姓名：")]),t._v(" "),a("el-col",{attrs:{span:14}},[t._v(t._s(t.cache.userinfo.name))])],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:8}},[t._v("用户类型：")]),t._v(" "),a("el-col",{attrs:{span:14}},[t._v(t._s(t.isAdmin?"管理员":"风控员"))])],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:8}},[t._v("登录时间：")]),t._v(" "),a("el-col",{attrs:{span:14}},[t._v(t._s(t.cache.userinfo.logintime))])],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:8}},[t._v("登录地址：")]),t._v(" "),a("el-col",{attrs:{span:14}},[t._v(t._s(t.cache.userinfo.loginip))])],1)],1),t._v(" "),a("span",{attrs:{slot:"reference"},slot:"reference"},[a("i",{staticClass:"el-icon-user userhead"})])])],1),t._v(" "),a("div",{staticStyle:{flex:"1 0"}},[a("el-row",[a("span",{staticClass:"user"},[t._v(t._s(t.cache.userinfo.name))])]),t._v(" "),a("el-row",[a("span",{staticClass:"user"},[t._v(t._s(t.cache.loginid))])])],1),t._v(" "),a("div",{staticStyle:{flex:"0 0"}},[a("div",[a("el-tooltip",{attrs:{placement:"top"}},[a("div",{attrs:{slot:"content"},slot:"content"},[t._v("修改密码")]),t._v(" "),a("i",{staticClass:"el-icon-setting button",on:{click:t.onModPwd}})])],1),t._v(" "),a("div",[a("el-tooltip",{attrs:{placement:"top"}},[a("div",{attrs:{slot:"content"},slot:"content"},[t._v("注销登录")]),t._v(" "),a("i",{staticClass:"el-icon-switch-button button",staticStyle:{color:"#F56C6C"},on:{click:t.onLogout}})])],1)])])])])])]),t._v(" "),a("el-container",[a("el-main",{staticStyle:{"border-bottom":"2px solid #E4E7ED"}},[a("keep-alive",[a("router-view",{ref:"main",on:{notify:t.handleNotify}})],1)],1),t._v(" "),a("el-footer",{staticClass:"statusbar"},[a("div",{staticStyle:{flex:"1",margin:"4px"}},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.lastNotify,expression:"lastNotify"}],staticClass:"scroller",on:{click:t.onClickScroller}},[a("marquee",[a("i",{class:t.getIconStyle(t.lastNotify?t.lastNotify.title:""),staticStyle:{"padding-right":"4px"}}),t._v(" "),a("span",{staticClass:"time"},[t._v(t._s(t.lastNotify?t.lastNotify.time.format("hh:mm:ss"):""))]),t._v(" "),a("span",{staticClass:"group"},[t._v(t._s(t.lastNotify?t.lastNotify.group:""))]),t._v(" "),a("span",{staticClass:"channel"},[t._v(t._s(t.lastNotify?t.lastNotify.channel:""))]),t._v(" "),a("span",{class:t.getTitleStyle(t.lastNotify?t.lastNotify.title:"")},[t._v(t._s(t.lastNotify?t.lastNotify.title:""))]),t._v(" "),a("span",{staticClass:"message"},[t._v(t._s(t.lastNotify?t.lastNotify.message:""))])])],1)]),t._v(" "),a("div",{staticStyle:{flex:"0","margin-top":"4px","min-width":"150px"}},[a("i",{staticClass:"el-icon-connection",staticStyle:{color:"green","padding-right":"8px"}}),a("a",[t._v("推送通道已连接")])])])],1)],1),t._v(" "),a("el-dialog",{attrs:{title:"修改密码",visible:t.showDlgModPwd,width:"360px"},on:{"update:visible":function(e){t.showDlgModPwd=e}}},[a("el-row",{staticStyle:{margin:"8px 0"}},[a("el-input",{attrs:{placeholder:"请输入旧密码","show-password":""},model:{value:t.oldpwd,callback:function(e){t.oldpwd=e},expression:"oldpwd"}})],1),t._v(" "),a("el-row",{staticStyle:{margin:"8px 0"}},[a("el-input",{attrs:{placeholder:"请输入新密码","show-password":""},model:{value:t.newpwd,callback:function(e){t.newpwd=e},expression:"newpwd"}})],1),t._v(" "),a("el-row",{staticStyle:{margin:"8px 0"}},[a("el-input",{attrs:{placeholder:"请确认新密码","show-password":""},model:{value:t.confirmpwd,callback:function(e){t.confirmpwd=e},expression:"confirmpwd"}})],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary",plain:""},on:{click:function(e){return t.doModPwd()}}},[t._v("确 定")])],1)],1),t._v(" "),a("el-dialog",{attrs:{title:"通知列表",visible:t.showNotifies,direction:"btt",width:"800px"},on:{"update:visible":function(e){t.showNotifies=e}}},[a("div",{staticStyle:{height:"400px","overflow-y":"scroll",border:"solid 1px #E4E7ED",padding:"4px"}},[a("el-table",{attrs:{data:t.notifies,stripe:"","show-header":!1}},[a("el-table-column",{scopedSlots:t._u([{key:"default",fn:function(e){return[a("i",{class:t.getIconStyle(e.row.title),staticStyle:{"padding-right":"4px"}}),t._v(" "),a("span",{staticClass:"time"},[t._v(t._s(e.row.time.format("hh:mm:ss")))]),t._v(" "),a("span",{staticClass:"group"},[t._v(t._s(e.row.group))]),t._v(" "),a("span",{staticClass:"channel"},[t._v(t._s(e.row.channel))]),t._v(" "),a("span",{class:t.getTitleStyle(e.row.title)},[t._v(t._s(e.row.title))]),t._v(" "),a("span",{staticClass:"message"},[t._v(t._s(e.row.message))])]}}])})],1)],1)])],1)},staticRenderFns:[]};var h=s("VU/8")(f,m,!1,function(t){s("pKwi")},"data-v-ce9460cc",null).exports,v=s("mvHQ"),g=s.n(v),b=s("bOdI"),y=s.n(b),w={name:"stradata",props:{groupid:{type:String,default:function(){return""}}},computed:d()({},Object(p.b)(["cache"]),{isAdmin:function(){var t=this.cache.userinfo;return!!t&&("admin"==t.role||"superman"==t.role)}}),components:{},watch:{groupid:function(t,e){var s=this;t=t||"",e=e||"",0!=t.length&&t!=e&&setTimeout(function(){s.$api.getStrategies(t,function(t){t.result<0?s.$notify.error("获取策略列表出错："+t.message):(s.strategies=t.strategies,"pos"!=s.selCat&&"all"==s.strafilter?s.strafilter=s.strategies[0]:"pos"==s.selCat&&(s.strafilter="all"),s.queryData())})},300)}},data:function(){var t;return t={selCat:"pos",strafilter:"all",strategies:[],loading:{trade:!1,signal:!1,round:!1,position:!1,fund:!1},capital:5e6,trades:[],positions:[],signals:[],rounds:[]},y()(t,"strategies",[]),y()(t,"funds",[]),y()(t,"nvChart",null),y()(t,"autoData",!1),y()(t,"dataInterval",0),y()(t,"refreshTime",(new Date).format("yyyy.MM.dd hh:mm:ss")),t},methods:{handleCheckAutoData:function(t){this.resetDataInterval()},resetDataInterval:function(){var t=this;this.autoData?(0!=this.dataInterval&&clearInterval(this.dataInterval),this.dataInterval=setInterval(function(){t.queryData()},3e4)):0!=this.dataInterval&&clearInterval(this.dataInterval)},getTrdSum:function(t){var e=t.columns,s=t.data,a=[];return e.forEach(function(t,e){if(e<3||e>5)a[e]="";else if(3!=e){if(4==e)a[e]=s.length+"笔";else if(5==e){var i=s.map(function(t){return Number(t.volume)});i.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=i.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0)+"手"}}else a[e]="总计"}),a},getSigSum:function(t){var e=t.columns,s=t.data,a=[];return e.forEach(function(t,e){e>1?a[e]="":0!=e?1==e&&(a[e]=s.length+"笔"):a[e]="总计"}),a},getPosSum:function(t){var e=t.columns,s=t.data,a=[];return e.forEach(function(t,e){if(0==e||1==e||2==e||3==e)if(0!=e){if(1==e)a[e]=s.length+"笔";else if(2==e){var i=s.map(function(t){return Number(t.qty)});i.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=i.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+Math.abs(e)},0)+"手"}else if(3==e){var n=s.map(function(t){return Number(t.profit)});n.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=n.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0).toFixed(1)}}else a[e]="总计";else a[e]=""}),a},getRndSum:function(t){var e=t.columns,s=t.data,a=[];return e.forEach(function(t,e){if(5==e||6==e||7==e||8==e)if(5!=e)if(6!=e){if(7==e){var i=s.map(function(t){return Number(t.qty)});i.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=i.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0)+"手"}else if(8==e){var n=s.map(function(t){return Number(t.profit)});n.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=n.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0).toFixed(1)}}else a[e]=s.length+"笔";else a[e]="总计";else a[e]=""}),a},handleCatChange:function(t,e){this.selCat!=t.name&&(this.selCat=t.name,"pos"!=this.selCat&&"all"==this.strafilter?this.strafilter=this.strategies[0]:"pos"==this.selCat&&(this.strafilter="all"),this.queryData())},onStraSwitch:function(){this.queryData()},formatAmount:function(t,e){return t[e.property].toFixed(2)},fmtPrice:function(t){for(var e=t.toFixed(4),s=0;s<e.length&&"0"==e[e.length-1-s];s++);"."==e[e.length-1-s]&&s++;var a=e.length-s;return e.substr(0,a)},fmtTime:function(t,e){if(e=e||!1){var s=t+"";return s.substr(2,2)+"."+s.substr(4,2)+"."+s.substr(6,2)+" "+s.substr(8,2)+":"+s.substr(10,2)+":"+s.substr(12,2)+","+s.substr(14,3)}var a=t+"";return a.substr(2,2)+"."+a.substr(4,2)+"."+a.substr(6,2)+" "+a.substr(8,2)+":"+a.substr(10,2)},fmtDate:function(t){var e=t+"";return e.substr(0,4)+"."+e.substr(4,2)+"."+e.substr(6,2)},fmtProfit:function(t){return t>0?"text-danger":t<0?"text-success":""},onClickPaintChart:function(){this.paintChart()},paintChart:function(){null==this.nvChart&&(this.nvChart=this.$echarts.init(document.getElementById("trend")));for(var t={title:{text:"净值走势"},tooltip:{trigger:"axis",axisPointer:{label:{backgroundColor:"#6a7985",formatter:function(t){var e=t.value+"";return e.substr(0,4)+"."+e.substr(4,2)+"."+e.substr(6,2)}}},formatter:function(t){if(0==t.length)return"收益曲线";var e=t[0].axisValueLabel;for(var s in t)"净值"==t[s].seriesName?e+="<br/>净值: "+t[s].value.toFixed(4):e+="<br/>"+t[s].seriesName+": "+t[s].value;return e}},grid:{top:42,left:"8",right:"8",bottom:"8",containLabel:!0},xAxis:{type:"category",data:[],boundaryGap:!1,axisLabel:{textStyle:{color:"#000"},formatter:function(t,e){return(t+="").substr(0,4)+"."+t.substr(4,2)+"."+t.substr(6,2)}},axisLine:{lineStyle:{color:"#000"}}},yAxis:[{type:"value",axisLabel:{textStyle:{color:"#000"},formatter:function(t,e){return t.toFixed(4)}},axisLine:{lineStyle:{color:"#000"}},scale:!0}],series:[{name:"净值",type:"line",smooth:!0,stack:"净值",areaStyle:{normal:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(102,156,214,0.5)"},{offset:1,color:"rgba(242,242,242,0.3)"}],globalCoord:!1}}},data:[],lineStyle:{normal:{color:"rgb(102,156,214)",width:2}},itemStyle:{normal:{color:"rgb(102,156,214)",borderWidth:1}}}]},e=[],s=[],a=parseInt(this.capital),i=this.funds.length-1;i>=0;i--){var n=this.funds[i];e.push(n.date);var o=a+n.dynbalance;s.push(o/a)}var r=Math.max.apply(null,s),l=Math.min.apply(null,s);if(r==l)r*=1.05,l*=.95;else{var c=r-l;r+=.05*c,l=Math.max(0,l-.05*c)}t.xAxis.data=e,t.series[0].data=s,t.yAxis[0].max=r,t.yAxis[0].min=l,this.nvChart.setOption(t)},queryData:function(t){var e=this;t=t||!1;var s=this,a=this.selCat,i=this.groupid||"",n=this.strafilter||"";0!=i.length?0!=n.length?"trd"==a?(s.loading.trade=!0,setTimeout(function(){e.$api.getTrades(i,n,function(a){a.result<0?e.$notify.error("查询成交出错："+a.message):(a.trades.forEach(function(t){var e="";"OPEN"==t.offset?e+="开":e+="平","LONG"==t.direction?e+="多":e+="空",t.action=e}),s.trades=a.trades,s.trades.reverse()),s.loading.trade=!1,s.refreshTime=(new Date).format("yyyy.MM.dd hh:mm:ss"),t&&s.resetDataInterval()})},300)):"sig"==a?(s.loading.signal=!0,setTimeout(function(){e.$api.getSignals(i,n,function(a){a.result<0?e.$notify.error("查询信号出错："+a.message):(s.signals=a.signals,s.signals.reverse()),s.loading.signal=!1,s.refreshTime=(new Date).format("yyyy.MM.dd hh:mm:ss"),t&&s.resetDataInterval()})},300)):"rnd"==a?(s.loading.round=!0,setTimeout(function(){e.$api.getRounds(i,n,function(a){a.result<0?e.$notify.error("查询回合出错："+a.message):(s.rounds=a.rounds,s.rounds.reverse()),s.loading.round=!1,s.refreshTime=(new Date).format("yyyy.MM.dd hh:mm:ss"),t&&s.resetDataInterval()})},300)):"pos"==a?(s.loading.position=!0,setTimeout(function(){e.$api.getPositions(i,n,function(a){a.result<0?e.$notify.error("查询持仓出错："+a.message):(a.positions.forEach(function(t){t.qty=t.volume*(t.long?1:-1)}),s.positions=a.positions),s.loading.position=!1,s.refreshTime=(new Date).format("yyyy.MM.dd hh:mm:ss"),t&&s.resetDataInterval()})},300)):"fnd"==a&&(s.loading.fund=!0,setTimeout(function(){e.$api.getFunds(i,n,function(a){a.result<0?e.$notify.error("查询绩效出错："+a.message):(s.funds=a.funds,s.funds.reverse(),s.paintChart()),s.loading.fund=!1,s.refreshTime=(new Date).format("yyyy.MM.dd hh:mm:ss"),t&&s.resetDataInterval()})},300)):this.$notify.error("策略ID不能为空"):this.$notify.error("组合ID不能为空")}},mounted:function(){window.onresize=function(){self.zooming||(self.zooming=!0,setTimeout(function(){self.myChart&&self.nvChart.resize(),self.zooming=!1},300))}}},x={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticStyle:{height:"100%",overflow:"auto"}},[s("el-container",{staticStyle:{height:"100%",overflow:"auto"}},[s("el-header",{staticStyle:{height:"40px","overflow-y":"hidden"}},[s("div",{staticStyle:{height:"100%",display:"flex","flex-direction":"row"}},[s("div",{staticStyle:{flex:"0",height:"100%"}},[s("el-tabs",{staticStyle:{height:"100%",margin:"0"},attrs:{value:t.selCat,"tab-position":"top"},on:{"tab-click":t.handleCatChange}},[s("el-tab-pane",{attrs:{label:"持仓明细",name:"pos"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"成交明细",name:"trd"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"信号明细",name:"sig"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"回合明细",name:"rnd"}}),t._v(" "),t.isAdmin?s("el-tab-pane",{attrs:{label:"每日绩效",name:"fnd"}}):t._e()],1)],1),t._v(" "),s("div",{staticStyle:{flex:"1","border-bottom":"2px solid #E4E7ED","margin-top":"4px"}},[s("div",{staticStyle:{float:"right"}},[s("el-row",[s("el-col",{attrs:{span:4}},[s("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"每隔30秒刷新一次",placement:"top"}},[s("el-checkbox",{staticStyle:{float:"right","margin-top":"6px"},on:{change:t.handleCheckAutoData},model:{value:t.autoData,callback:function(e){t.autoData=e},expression:"autoData"}},[t._v("自动刷新")])],1)],1),t._v(" "),s("el-col",{attrs:{offset:1,span:12}},[s("el-select",{attrs:{placeholder:"请选择",size:"mini"},on:{change:t.onStraSwitch},model:{value:t.strafilter,callback:function(e){t.strafilter=e},expression:"strafilter"}},[s("el-option",{directives:[{name:"show",rawName:"v-show",value:"pos"==t.selCat,expression:"selCat=='pos'"}],attrs:{label:"全部策略",value:"all"}},[s("i",{staticClass:"el-icon-collection"}),t._v(" "),s("span",[t._v("全部策略")])]),t._v(" "),t._l(t.strategies,function(e){return s("el-option",{key:e,attrs:{label:e,value:e}},[s("i",{staticClass:"el-icon-tickets"}),t._v(" "),s("span",[t._v(t._s(e))])])})],2)],1),t._v(" "),s("el-col",{attrs:{span:4}},[s("el-button",{attrs:{type:"primary",icon:"el-icon-refresh",size:"mini",plain:""},on:{click:function(e){return t.queryData()}}},[t._v("刷新")])],1)],1)],1)])])]),t._v(" "),s("el-main",{staticStyle:{overflow:"auto","border-bottom":"1px solid #E4E7ED"}},[s("div",{directives:[{name:"show",rawName:"v-show",value:"pos"==t.selCat,expression:"selCat=='pos'"},{name:"loading",rawName:"v-loading",value:t.loading.position,expression:"loading.position"}],staticStyle:{"max-height":"100%",overflow:"auto"}},[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"",data:t.positions,"summary-method":t.getPosSum,"show-summary":""}},[s("el-table-column",{attrs:{prop:"strategy",label:"策略",width:"140",sortable:""}}),t._v(" "),s("el-table-column",{attrs:{prop:"code",label:"品种",width:"120",sortable:""}}),t._v(" "),s("el-table-column",{attrs:{label:"数量",width:"64"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.qty>=0?"text-danger":"text-success"},[t._v(t._s(e.row.qty))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"浮盈",width:"100",sortable:""},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.profit>=0?"text-danger":"text-success"},[t._v(t._s(e.row.profit.toFixed(1)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"开仓时间",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtTime(e.row.opentime)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"开仓价格",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtPrice(e.row.price)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"最大浮盈",width:"120",sortable:""},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{staticClass:"text-danger"},[t._v(t._s(e.row.maxprofit.toFixed(1)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"最大浮亏",width:"120",sortable:""},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{staticClass:"text-success"},[t._v(t._s(e.row.maxloss.toFixed(1)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"opentag",label:"标记",sortable:""}})],1)],1),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:"trd"==t.selCat,expression:"selCat=='trd'"},{name:"loading",rawName:"v-loading",value:t.loading.trade,expression:"loading.trade"}],staticStyle:{"max-height":"100%",overflow:"auto"}},[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"",data:t.trades,"summary-method":t.getTrdSum,"show-summary":""}},[s("el-table-column",{attrs:{prop:"strategy",label:"策略",width:"140"}}),t._v(" "),s("el-table-column",{attrs:{prop:"code",label:"品种",width:"120",sortable:""}}),t._v(" "),s("el-table-column",{attrs:{label:"时间",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtTime(e.row.time)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"动作",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:"开多"==e.row.action||"平空"==e.row.action?"text-danger":"text-success"},[t._v(t._s(e.row.action))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"价格",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtPrice(e.row.price)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"volume",label:"数量",width:"80"}}),t._v(" "),s("el-table-column",{attrs:{prop:"tag",label:"标记",sortable:""}})],1)],1),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:"sig"==t.selCat,expression:"selCat=='sig'"},{name:"loading",rawName:"v-loading",value:t.loading.signal,expression:"loading.signal"}],staticStyle:{"max-height":"100%",overflow:"auto"}},[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"",data:t.signals,"summary-method":t.getSigSum,"show-summary":""}},[s("el-table-column",{attrs:{prop:"strategy",label:"策略",width:"140"}}),t._v(" "),s("el-table-column",{attrs:{prop:"code",label:"品种",width:"120",sortable:""}}),t._v(" "),s("el-table-column",{attrs:{prop:"target",label:"目标数量",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:t.fmtProfit(e.row.target)},[t._v(t._s(e.row.target))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"触发价格",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtPrice(e.row.sigprice)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"触发时间",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtTime(e.row.gentime,!0)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"tag",label:"标记",sortable:""}})],1)],1),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:"rnd"==t.selCat,expression:"selCat=='rnd'"},{name:"loading",rawName:"v-loading",value:t.loading.round,expression:"loading.round"}],staticStyle:{"max-height":"100%",overflow:"auto"}},[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"","summary-method":t.getRndSum,"show-summary":"",data:t.rounds}},[s("el-table-column",{attrs:{prop:"strategy",label:"策略",width:"140"}}),t._v(" "),s("el-table-column",{attrs:{prop:"code",label:"品种",width:"120",sortable:""}}),t._v(" "),s("el-table-column",{attrs:{label:"方向",width:"64"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:"LONG"==e.row.direct?"text-danger":"text-success"},[t._v(t._s("LONG"==e.row.direct?"多":"空"))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"开仓时间",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtTime(e.row.opentime)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"开仓价格",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtPrice(e.row.openprice)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"平仓时间",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtTime(e.row.closetime)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"平仓价格",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtPrice(e.row.closeprice)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"qty",label:"数量",width:"64"}}),t._v(" "),s("el-table-column",{attrs:{label:"盈亏",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.profit>=0?"text-danger":"text-success"},[t._v(t._s(e.row.profit.toFixed(1)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"entertag",label:"进场标记",width:"100"}}),t._v(" "),s("el-table-column",{attrs:{prop:"exittag",label:"出场标记",width:"100"}})],1)],1),t._v(" "),t.isAdmin?s("div",{directives:[{name:"show",rawName:"v-show",value:"fnd"==t.selCat,expression:"selCat=='fnd'"},{name:"loading",rawName:"v-loading",value:t.loading.fund,expression:"loading.fund"}],staticStyle:{height:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"1",width:"100%",overflow:"auto",height:"50%","border-bottom":"1px solid #E4E7ED"}},[s("div",{staticStyle:{"max-height":"100%"}},[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"",data:t.funds}},[s("el-table-column",{attrs:{prop:"strategy",label:"策略",width:"140"}}),t._v(" "),s("el-table-column",{attrs:{label:"日期",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtDate(e.row.date)))])]}}],null,!1,1157224088)}),t._v(" "),s("el-table-column",{attrs:{label:"平仓盈亏",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.closeprofit>=0?"text-danger":"text-success"},[t._v(t._s(e.row.closeprofit.toFixed(1)))])]}}],null,!1,298912261)}),t._v(" "),s("el-table-column",{attrs:{label:"浮动盈亏",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.dynprofit>=0?"text-danger":"text-success"},[t._v(t._s(e.row.dynprofit.toFixed(1)))])]}}],null,!1,103057029)}),t._v(" "),s("el-table-column",{attrs:{prop:"fee",label:"手续费",width:"120"}}),t._v(" "),s("el-table-column",{attrs:{prop:"dynbalance",label:"动态权益"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.dynbalance>=0?"text-danger":"text-success"},[t._v(t._s(e.row.dynbalance.toFixed(1)))])]}}],null,!1,1406323205)})],1)],1)]),t._v(" "),s("div",{staticStyle:{flex:"1",width:"100%",overflow:"auto",display:"flex","flex-direction":"column",margin:"4px"}},[s("div",{staticStyle:{height:"40px",display:"inline-block",flex:"0",margin:"4px"}},[s("el-row",[s("el-col",{staticStyle:{"margin-top":"2px"},attrs:{span:2}},[s("i",{staticClass:"el-icon-money"}),t._v(" "),s("a",[t._v("资金规模")])]),t._v(" "),s("el-col",{attrs:{span:3}},[s("el-input",{attrs:{placeholder:"请输入资金规模",size:"mini",type:"number",min:"1000000",step:"1000000"},model:{value:t.capital,callback:function(e){t.capital=e},expression:"capital"}})],1),t._v(" "),s("el-col",{staticStyle:{"margin-left":"2px"},attrs:{span:2}},[s("el-button",{attrs:{size:"mini",plain:"",type:"danger"},on:{click:t.onClickPaintChart}},[t._v("重新绘图")])],1)],1)],1),t._v(" "),s("div",{staticStyle:{flex:"1",width:"100%","border-top":"1px solid #E4E7ED"}},[s("div",{staticStyle:{width:"100%",height:"100%"},attrs:{id:"trend"}})])])]):t._e()]),t._v(" "),s("el-footer",{staticStyle:{height:"24px"}},[s("span",{staticStyle:{"font-size":"12px",color:"gray","line-height":"24px"}},[t._v("数据刷新时间: "+t._s(t.refreshTime))])])],1)],1)},staticRenderFns:[]};var _=s("VU/8")(w,x,!1,function(t){s("tvDO")},"data-v-d91c86fe",null).exports,k={name:"tradedata",props:{groupid:{type:String,default:function(){return""}}},components:{},watch:{groupid:function(t,e){var s=this;t=t||"",e=e||"",0!=t.length&&t!=e&&setTimeout(function(){s.$api.getChannels(t,function(t){if(t.result<0)s.$notify.error("拉取组合交易通道出错："+t.message);else{s.channels=t.channels;var e=s.showAllChannels(s.selCat);s.chnlfilter=e?"all":s.channels[0],setTimeout(function(){s.queryData()},300)}})},300)}},data:function(){return{selCat:"pos",chnlfilter:"all",channels:[],loading:{trade:!1,order:!1,position:!1,fund:!1},trades:[],orders:[],positions:[],funds:[],autoData:!1,dataInterval:0,refreshTime:(new Date).format("yyyy.MM.dd hh:mm:ss")}},methods:{showAllChannels:function(t){return"fnd"==t||"pos"==t},getPosSum:function(t){var e=t.columns,s=t.data,a=[];return e.forEach(function(t,e){if(0==e||1==e||2==e||3==e)if(0!=e){if(1==e)a[e]=s.length+"笔";else if(2==e){var i=s.map(function(t){return Number(t.long.newvol)}),n=s.map(function(t){return Number(t.long.prevol)});a[e]="昨"+n.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0)+"手 | 今"+i.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0)+"手"}else if(3==e){var o=s.map(function(t){return Number(t.short.newvol)}),r=s.map(function(t){return Number(t.short.prevol)});a[e]="昨"+r.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0)+"手 | 今"+o.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0)+"手"}}else a[e]="总计";else a[e]=""}),a},getTrdSum:function(t){var e=t.columns,s=t.data,a=[];return e.forEach(function(t,e){if(e<4||e>6)a[e]="";else if(4!=e){if(5==e)a[e]=s.length+"笔";else if(6==e){var i=s.map(function(t){return Number(t.volume)});i.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=i.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0)+"手"}}else a[e]="总计"}),a},getOrdSum:function(t){var e=t.columns,s=t.data,a=[];return e.forEach(function(t,e){if(e<4||e>7)a[e]="";else if(4!=e){if(5==e)a[e]=s.length+"笔";else if(6==e){var i=s.map(function(t){return Number(t.total)});i.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=i.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0)+"手"}else if(7==e){var n=s.map(function(t){return Number(t.traded)});n.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=n.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0)+"手"}}else a[e]="总计"}),a},getFndSum:function(t){var e=t.columns,s=t.data,a=[];return e.forEach(function(t,e){if(0!=e){if(1==e)a[e]=s.length+"条";else if(2==e){var i=s.map(function(t){return Number(t.prebalance)});i.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=i.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0).toFixed(2)}else if(3==e){var n=s.map(function(t){return Number(t.balance)});n.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=n.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0).toFixed(2)}else if(4==e){var o=s.map(function(t){return Number(t.closeprofit)});o.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=o.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0).toFixed(2)}else if(5==e){var r=s.map(function(t){return Number(t.dynprofit)});r.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=r.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0).toFixed(2)}else if(6==e){var l=s.map(function(t){return Number(t.margin)});l.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=l.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0).toFixed(2)}else if(7==e){var c=s.map(function(t){return Number(t.fee)});c.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=c.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0).toFixed(2)}else if(8==e){var u=s.map(function(t){return Number(t.available)});u.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=u.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0).toFixed(2)}else if(9==e){var d=s.map(function(t){return Number(t.moneyio)});d.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=d.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0).toFixed(2)}}else a[e]="总计"}),a},handleCheckAutoData:function(t){this.resetDataInterval()},resetDataInterval:function(){var t=this;this.autoData?(0!=this.dataInterval&&clearInterval(this.dataInterval),this.dataInterval=setInterval(function(){t.queryData()},3e4)):0!=this.dataInterval&&clearInterval(this.dataInterval)},getActClr:function(t){return"开多"==t||"平空"==t||"平今空"==t?"text-danger":"text-success"},handleCatChange:function(t,e){if(this.selCat!=t.name){this.selCat=t.name;var s=this.showAllChannels(this.selCat);s||"all"!=this.chnlfilter?s&&(this.chnlfilter="all"):this.chnlfilter=this.channels[0],this.queryData()}},onChnlSwitch:function(){this.queryData()},formatTime:function(t,e){var s=t[e.property],a=new Date;return a.setTime(s),a.format("yyyy/MM/dd hh:mm:ss")},fmtPrice:function(t,e){for(var s=t[e.property].toFixed(4),a=0;a<s.length&&"0"==s[s.length-1-a];a++);"."==s[s.length-1-a]&&a++;var i=s.length-a;return s.substr(0,i)},fmtAmount:function(t,e){return t[e.property].toFixed(2)},queryData:function(t){var e=this;t=t||!1;var s=this,a=this.selCat,i=this.groupid||"",n=this.chnlfilter||"";0!=i.length?0!=n.length?"trd"==a?(s.loading.trade=!0,setTimeout(function(){e.$api.getChnlTrades(i,n,function(a){a.result<0?e.$notify.error("查询成交出错："+a.message):(a.trades.forEach(function(t){var e;t.action="OL"==(e=t.action)?"开多":"OS"==e?"开空":"CL"==e?"平多":"CS"==e?"平空":e}),s.trades=a.trades,s.trades.reverse()),s.loading.trade=!1,s.refreshTime=(new Date).format("yyyy.MM.dd hh:mm:ss"),t&&s.resetDataInterval()})},300)):"ord"==a?(s.loading.order=!0,setTimeout(function(){e.$api.getChnlOrders(i,n,function(a){a.result<0?e.$notify.error("查询订单出错："+a.message):(a.orders.forEach(function(t){var e;t.action="OL"==(e=t.action)?"开多":"OS"==e?"开空":"CL"==e?"平多":"CS"==e?"平空":e}),s.orders=a.orders,s.orders.reverse()),s.loading.order=!1,s.refreshTime=(new Date).format("yyyy.MM.dd hh:mm:ss"),t&&s.resetDataInterval()})},300)):"pos"==a?(s.loading.position=!0,setTimeout(function(){e.$api.getChnlPositions(i,n,function(a){a.result<0?e.$notify.error("查询持仓出错："+a.message):s.positions=a.positions,s.loading.position=!1,s.refreshTime=(new Date).format("yyyy.MM.dd hh:mm:ss"),t&&s.resetDataInterval()})},300)):"fnd"==a&&(s.loading.fund=!0,setTimeout(function(){e.$api.getChnlFunds(i,n,function(a){if(a.result<0)e.$notify.error("查询资金出错："+a.message);else{var i=[];for(var n in a.funds){var o=a.funds[n];for(var r in o){var l=o[r];l.channel=n,l.currency=r,l.moneyio=l.deposit-l.withdraw,l.dynprofit=l.dynprofit||0,i.push(l)}}s.funds=i}s.loading.fund=!1,s.refreshTime=(new Date).format("yyyy.MM.dd hh:mm:ss"),t&&s.resetDataInterval()})},300)):this.$notify.error("通道ID不能为空"):this.$notify.error("组合ID不能为空")}}},C={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticStyle:{height:"100%"}},[s("el-container",{staticStyle:{height:"100%"}},[s("el-header",{staticStyle:{height:"40px","overflow-y":"hidden"}},[s("div",{staticStyle:{height:"100%",display:"flex","flex-direction":"row"}},[s("div",{staticStyle:{flex:"0",height:"100%"}},[s("el-tabs",{attrs:{value:t.selCat,"tab-position":"top"},on:{"tab-click":t.handleCatChange}},[s("el-tab-pane",{attrs:{label:"持仓明细",name:"pos"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"成交明细",name:"trd"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"订单明细",name:"ord"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"资金明细",name:"fnd"}})],1)],1),t._v(" "),s("div",{staticStyle:{flex:"1","border-bottom":"2px solid #E4E7ED","margin-top":"4px"}},[s("div",{staticStyle:{float:"right"}},[s("el-row",[s("el-col",{attrs:{span:4}},[s("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"每隔30秒刷新一次",placement:"top"}},[s("el-checkbox",{staticStyle:{float:"right","margin-top":"6px"},on:{change:t.handleCheckAutoData},model:{value:t.autoData,callback:function(e){t.autoData=e},expression:"autoData"}},[t._v("自动刷新")])],1)],1),t._v(" "),s("el-col",{attrs:{offset:1,span:12}},[s("el-select",{attrs:{placeholder:"请选择",size:"mini"},on:{change:t.onChnlSwitch},model:{value:t.chnlfilter,callback:function(e){t.chnlfilter=e},expression:"chnlfilter"}},[s("el-option",{directives:[{name:"show",rawName:"v-show",value:t.showAllChannels(t.selCat),expression:"showAllChannels(selCat)"}],attrs:{label:"全部通道",value:"all"}},[s("i",{staticClass:"el-icon-tickets"}),t._v(" "),s("span",[t._v("全部通道")])]),t._v(" "),t._l(t.channels,function(e){return s("el-option",{key:e,attrs:{label:e,value:e}},[s("i",{staticClass:"el-icon-tickets"}),t._v(" "),s("span",[t._v(t._s(e))])])})],2)],1),t._v(" "),s("el-col",{attrs:{span:4}},[s("el-button",{attrs:{type:"primary",icon:"el-icon-refresh",size:"mini",plain:""},on:{click:function(e){return t.queryData()}}},[t._v("刷新")])],1)],1)],1)])])]),t._v(" "),s("el-main",{staticStyle:{overflow:"auto","border-bottom":"1px solid #E4E7ED"}},[s("div",{directives:[{name:"show",rawName:"v-show",value:"pos"==t.selCat,expression:"selCat=='pos'"},{name:"loading",rawName:"v-loading",value:t.loading.position,expression:"loading.position"}],staticStyle:{"max-height":"100%",overflow:"auto"}},[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"",data:t.positions,"summary-method":t.getPosSum,"show-summary":""}},[s("el-table-column",{attrs:{prop:"channel",label:"通道",width:"120"}}),t._v(" "),s("el-table-column",{attrs:{prop:"code",label:"品种",width:"120",sortable:""}}),t._v(" "),s("el-table-column",{attrs:{prop:"long",label:"多头",width:"140"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("a",{staticClass:"text-danger"},[s("span",[t._v("昨"+t._s(e.row.long.prevol)+"["+t._s(e.row.long.preavail)+"]")]),t._v(" "),s("span",[t._v("|")]),t._v(" "),s("span",[t._v("今"+t._s(e.row.long.newvol)+"["+t._s(e.row.long.newavail)+"]")])])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"short",label:"空头",width:"140"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("a",{staticClass:"text-success"},[s("span",[t._v("昨"+t._s(e.row.short.prevol)+"["+t._s(e.row.short.preavail)+"]")]),t._v(" "),s("span",[t._v("|")]),t._v(" "),s("span",[t._v("今"+t._s(e.row.short.newvol)+"["+t._s(e.row.short.newavail)+"]")])])]}}])})],1)],1),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:"trd"==t.selCat,expression:"selCat=='trd'"},{name:"loading",rawName:"v-loading",value:t.loading.trade,expression:"loading.trade"}],staticStyle:{"max-height":"100%",overflow:"auto"}},[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"",data:t.trades,"summary-method":t.getTrdSum,"show-summary":""}},[s("el-table-column",{attrs:{prop:"channel",label:"通道",width:"120"}}),t._v(" "),s("el-table-column",{attrs:{prop:"code",label:"品种",width:"120",sortable:""}}),t._v(" "),s("el-table-column",{attrs:{prop:"time",label:"时间",width:"150",sortable:"",formatter:t.formatTime}}),t._v(" "),s("el-table-column",{attrs:{prop:"localid",label:"本地单号",width:"120"}}),t._v(" "),s("el-table-column",{attrs:{label:"动作",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:t.getActClr(e.row.action)},[t._v(t._s(e.row.action))])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"price",label:"价格",width:"80",formatter:t.fmtPrice}}),t._v(" "),s("el-table-column",{attrs:{prop:"volume",label:"数量",width:"80"}}),t._v(" "),s("el-table-column",{attrs:{prop:"tradeid",label:"成交单号",width:"100"}}),t._v(" "),s("el-table-column",{attrs:{prop:"orderid",label:"委托单号",width:"100"}})],1)],1),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:"ord"==t.selCat,expression:"selCat=='ord'"},{name:"loading",rawName:"v-loading",value:t.loading.order,expression:"loading.order"}],staticStyle:{"max-height":"100%",overflow:"auto"}},[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"",data:t.orders,"summary-method":t.getOrdSum,"show-summary":""}},[s("el-table-column",{attrs:{prop:"channel",label:"通道",width:"120"}}),t._v(" "),s("el-table-column",{attrs:{prop:"code",label:"品种",width:"120",sortable:""}}),t._v(" "),s("el-table-column",{attrs:{prop:"time",label:"委托时间",width:"150",sortable:"",formatter:t.formatTime}}),t._v(" "),s("el-table-column",{attrs:{prop:"localid",label:"本地单号",width:"120"}}),t._v(" "),s("el-table-column",{attrs:{label:"动作",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:t.getActClr(e.row.action)},[t._v(t._s(e.row.action))])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"price",label:"价格",width:"80",formatter:t.fmtPrice}}),t._v(" "),s("el-table-column",{attrs:{prop:"total",label:"数量",width:"80"}}),t._v(" "),s("el-table-column",{attrs:{prop:"traded",label:"成交",width:"80"}}),t._v(" "),s("el-table-column",{attrs:{prop:"orderid",label:"委托单号",width:"100"}}),t._v(" "),s("el-table-column",{attrs:{label:"撤销",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:"TRUE"==e.row.canceled?"text-danger":"text-info"},[t._v(t._s("TRUE"==e.row.canceled?"是":"否"))])]}}])})],1)],1),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:"fnd"==t.selCat,expression:"selCat=='fnd'"},{name:"loading",rawName:"v-loading",value:t.loading.fund,expression:"loading.fund"}],staticStyle:{"max-height":"100%",overflow:"auto"}},[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"",data:t.funds,"summary-method":t.getFndSum,"show-summary":""}},[s("el-table-column",{attrs:{prop:"channel",label:"通道",width:"120",sortable:""}}),t._v(" "),s("el-table-column",{attrs:{prop:"currency",label:"币种",width:"64"}}),t._v(" "),s("el-table-column",{attrs:{prop:"prebalance",label:"上日结存",width:"120",sortable:"",formatter:t.fmtAmount}}),t._v(" "),s("el-table-column",{attrs:{prop:"balance",label:"静态权益",width:"120",sortable:"",formatter:t.fmtAmount}}),t._v(" "),s("el-table-column",{attrs:{label:"平仓盈亏",width:"110",sortable:""},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.closeprofit>=0?"text-danger":"text-success"},[t._v(t._s(e.row.closeprofit.toFixed(2)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"浮动盈亏",width:"110",sortable:""},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.dynprofit>=0?"text-danger":"text-success"},[t._v(t._s(e.row.dynprofit.toFixed(2)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"margin",label:"保证金",width:"120",sortable:"",formatter:t.fmtAmount}}),t._v(" "),s("el-table-column",{attrs:{prop:"fee",label:"手续费",width:"100",sortable:"",formatter:t.fmtAmount}}),t._v(" "),s("el-table-column",{attrs:{prop:"available",label:"可用资金",width:"120",sortable:"",formatter:t.fmtAmount}}),t._v(" "),s("el-table-column",{attrs:{label:"出入金",width:"100",sortable:""},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.moneyio>=0?"text-danger":"text-success"},[t._v(t._s(e.row.moneyio.toFixed(2)))])]}}])})],1)],1)]),t._v(" "),s("el-footer",{staticStyle:{height:"24px"}},[s("span",{staticStyle:{"font-size":"12px",color:"gray","line-height":"24px"}},[t._v("数据刷新时间: "+t._s(t.refreshTime))])])],1)],1)},staticRenderFns:[]};var S=s("VU/8")(k,C,!1,function(t){s("n+8b")},"data-v-b10ba514",null).exports,N={name:"portdata",props:{groupid:{type:String,default:function(){return""}}},computed:d()({},Object(p.b)(["cache"]),{isAdmin:function(){var t=this.cache.userinfo;return!!t&&("admin"==t.role||"superman"==t.role)}}),components:{},watch:{groupid:function(t,e){var s=this;t=t||"",e=e||"",0!=t.length&&t!=e&&setTimeout(function(){s.queryData()},300)}},data:function(){return{selCat:"pos",loading:{risk:!1,performance:!1,position:!1,fund:!1},capital:5e6,performances:[],positions:[],filters:{},funds:[],nvChart:null,pieChart:null,autoData:!1,dataInterval:0,refreshTime:(new Date).format("yyyy.MM.dd hh:mm:ss")}},methods:{handleCheckAutoData:function(t){this.resetDataInterval()},resetDataInterval:function(){var t=this;this.autoData?(0!=this.dataInterval&&clearInterval(this.dataInterval),this.dataInterval=setInterval(function(){"pos"==t.selCat&&t.queryData()},3e4)):0!=this.dataInterval&&clearInterval(this.dataInterval)},getPosSum:function(t){var e=t.columns,s=t.data,a=[];return e.forEach(function(t,e){if(0==e||1==e||2==e||3==e)if(0!=e){if(1==e){var i=s.map(function(t){return Number(t.qty)});i.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=s.length+"笔 | "+i.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+Math.abs(e)},0)+"手"}else if(2==e){var n=s.map(function(t){return Number(t.profit)});n.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=n.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0).toFixed(1)}}else a[e]="总计";else a[e]=""}),a},handleCatChange:function(t,e){this.selCat!=t.name&&(this.selCat=t.name,this.queryData())},formatAmount:function(t,e){return t[e.property].toFixed(2)},fmtFundTime:function(t){var e=Math.floor(t/1e3)+"";return e.length<6&&(e="0"+e),e.substr(0,2)+":"+e.substr(2,2)},fmtFundDate:function(t){var e=t+"";return e.substr(2,2)+"."+e.substr(4,2)+"."+e.substr(6,2)},fmtPrice:function(t){for(var e=t.toFixed(4),s=0;s<e.length&&"0"==e[e.length-1-s];s++);"."==e[e.length-1-s]&&s++;var a=e.length-s;return e.substr(0,a)},fmtTime:function(t,e){if(e=e||!1){var s=t+"";return s.substr(2,2)+"."+s.substr(4,2)+"."+s.substr(6,2)+" "+s.substr(8,2)+":"+s.substr(10,2)+":"+s.substr(12,2)+","+s.substr(14,3)}var a=t+"";return a.substr(2,2)+"."+a.substr(4,2)+"."+a.substr(6,2)+" "+a.substr(8,2)+":"+a.substr(10,2)},fmtDate:function(t){var e=t+"";return e.substr(0,4)+"."+e.substr(4,2)+"."+e.substr(6,2)},fmtProfit:function(t){return t>0?"text-danger":t<0?"text-success":""},onClickResetCapital:function(){var t=parseInt(this.capital);this.funds.forEach(function(e){e.capital=t}),this.paintChart()},paintChart:function(){null==this.nvChart&&(this.nvChart=this.$echarts.init(document.getElementById("grptrend")));for(var t={title:{text:"净值走势"},tooltip:{trigger:"axis",axisPointer:{label:{backgroundColor:"#6a7985",formatter:function(t){var e=t.value+"";return e.substr(0,4)+"."+e.substr(4,2)+"."+e.substr(6,2)}}},formatter:function(t){if(0==t.length)return"收益曲线";var e=t[0].axisValueLabel;for(var s in t)"净值"==t[s].seriesName?e+="<br/>净值: "+t[s].value.toFixed(4):e+="<br/>"+t[s].seriesName+": "+t[s].value;return e}},grid:{top:42,left:"8",right:"8",bottom:"8",containLabel:!0},xAxis:{type:"category",data:[],boundaryGap:!1,axisLabel:{textStyle:{color:"#000"},formatter:function(t,e){return(t+="").substr(0,4)+"."+t.substr(4,2)+"."+t.substr(6,2)}},axisLine:{lineStyle:{color:"#000"}}},yAxis:[{type:"value",axisLabel:{textStyle:{color:"#000"},formatter:function(t,e){return t.toFixed(4)}},axisLine:{lineStyle:{color:"#000"}},scale:!0}],series:[{name:"净值",type:"line",smooth:!0,stack:"净值",areaStyle:{normal:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(102,156,214,0.5)"},{offset:1,color:"rgba(242,242,242,0.3)"}],globalCoord:!1}}},data:[],lineStyle:{normal:{color:"rgb(102,156,214)",width:2}},itemStyle:{normal:{color:"rgb(102,156,214)",borderWidth:1}}}]},e=[],s=[],a=parseInt(this.capital),i=this.funds.length-1;i>=0;i--){var n=this.funds[i];e.push(n.date);var o=a+n.dynbalance;s.push(o/a)}var r=Math.max.apply(null,s),l=Math.min.apply(null,s);if(r==l)r*=1.05,l*=.95;else{var c=r-l;r+=.05*c,l=Math.max(0,l-.05*c)}t.xAxis.data=e,t.series[0].data=s,t.yAxis[0].max=r,t.yAxis[0].min=l,this.nvChart.setOption(t)},paintPie:function(){if(this.isAdmin){null==this.pieChart&&(this.pieChart=this.$echarts.init(document.getElementById("pie")));var t=[];for(var e in this.performances){var s=this.performances[e],a=s.closeprofit+s.dynprofit;t.push({value:Math.abs(a),truevalue:a,name:e})}var i={title:{text:"组合绩效归因",subtext:"按品种",left:"center"},tooltip:{trigger:"item",formatter1:"{a} <br/>{b} : {c} ({d}%)",formatter:function(t){return t.name+": "+(t.data.truevalue/1e4).toFixed(2)+"万("+t.percent.toFixed(1)+"%)"}},legend:{orient:"horizontal",left:"center",top:"bottom"},series:[{name:"分品种绩效",type:"pie",radius:"50%",emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},data:t}]};this.pieChart.setOption(i)}},queryPerf:function(){var t=this,e=this.groupid||"";this.$api.getPortPerfs(e,function(e){e.result<0?t.$notify.error("查询绩效归因出错："+e.message,"查询失败"):(t.performances=e.performance,setTimeout(function(){t.paintPie()},300))})},checkAllFilters:function(t,e){for(var s in this.filters[t])this.filters[t][s]=e},onAddCodeFilter:function(){var t=this;t.$prompt("请输入品种代码，格式如CFFEX.IF","新增代码过滤器",{confirmButtonText:"确定",cancelButtonText:"取消"}).then(function(e){var s=e.value;if(void 0!=t.filters.code_filters[s])return t.$alert("该品种代码已存在"),!0;t.filters.code_filters[s]=!0,t.$forceUpdate()}).catch(function(){})},onDelCodeFilter:function(t){var e=this;this.$confirm("确定要删除该代码过滤器吗?","删除代码过滤器",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){delete e.filters.code_filters[t],e.$forceUpdate()}).catch(function(){})},onCommitFilters:function(){var t=this,e=this;this.$confirm("确定要提交最新的过滤器配置吗?","提交过滤器",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var s=t.groupid||"";e.$api.commitPortFilters(s,e.filters,function(e){e.result<0?t.$notify.error("提交过滤器出错："+e.message):t.$notify({message:"过滤器提交成功"})})}).catch(function(){})},queryData:function(t){var e=this;t=t||!1;var s=this,a=this.selCat,i=this.groupid||"";0!=i.length?"pos"==a?(s.loading.position=!0,setTimeout(function(){e.$api.getPortPositions(i,function(a){a.result<0?e.$notify.error("查询持仓出错："+a.message):(a.positions.forEach(function(t){t.qty=t.volume*(t.long?1:-1)}),s.positions=a.positions),s.loading.position=!1,s.refreshTime=(new Date).format("yyyy.MM.dd hh:mm:ss"),t&&s.resetDataInterval()}),e.queryPerf()},300)):"fnd"==a?(s.loading.fund=!0,setTimeout(function(){var a=parseInt(s.capital);e.$api.getPortFunds(i,function(i){i.result<0?e.$notify.error("查询绩效出错："+i.message):(i.funds.forEach(function(t){t.dynbalance=t.balance+t.dynprofit,t.capital=a}),s.funds=i.funds,s.funds.reverse(),s.paintChart()),s.loading.fund=!1,s.refreshTime=(new Date).format("yyyy.MM.dd hh:mm:ss"),t&&s.resetDataInterval()})},300)):"rsk"==a&&(s.loading.risk=!0,setTimeout(function(){parseInt(s.capital);e.$api.getPortFilters(i,function(a){a.result<0?e.$notify.error("查询过滤器出错："+a.message):(a.filters.strategy_filters=a.filters.strategy_filters||{},a.filters.code_filters=a.filters.code_filters||{},a.filters.channel_filters=a.filters.executer_filters||{},s.filters=a.filters),s.loading.risk=!1,s.refreshTime=(new Date).format("yyyy.MM.dd hh:mm:ss"),t&&s.resetDataInterval()})},300)):this.$notify.error("组合ID不能为空")}},mounted:function(){var t=this;window.onresize=function(){t.zooming||(t.zooming=!0,setTimeout(function(){t.myChart&&t.nvChart.resize(),t.pieChart&&t.pieChart.resize(),t.zooming=!1},300))},t.$nextTick(function(){t.$on("resize",function(){t.zooming||(t.zooming=!0,setTimeout(function(){t.myChart&&t.nvChart.resize(),t.pieChart&&t.pieChart.resize(),t.zooming=!1},150))})})}},A={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticStyle:{height:"100%",overflow:"auto"}},[s("el-container",{staticStyle:{height:"100%",overflow:"auto"}},[s("el-header",{staticStyle:{height:"40px","overflow-y":"hidden"}},[s("div",{staticStyle:{height:"100%",display:"flex","flex-direction":"row"}},[s("div",{staticStyle:{flex:"0",height:"100%"}},[s("el-tabs",{staticStyle:{height:"100%",margin:"0"},attrs:{value:t.selCat,"tab-position":"top"},on:{"tab-click":t.handleCatChange}},[s("el-tab-pane",{attrs:{label:"持仓数据",name:"pos"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"组合风控",name:"rsk"}}),t._v(" "),t.isAdmin?s("el-tab-pane",{attrs:{label:"每日绩效",name:"fnd"}}):t._e()],1)],1),t._v(" "),s("div",{staticStyle:{flex:"1","border-bottom":"2px solid #E4E7ED","margin-top":"4px"}},[s("div",{staticStyle:{float:"right"}},[s("el-row",[s("el-col",{attrs:{offset:7,span:4}},[s("el-tooltip",{directives:[{name:"show",rawName:"v-show",value:"pos"==t.selCat,expression:"selCat=='pos'"}],staticClass:"item",attrs:{effect:"dark",content:"每隔30秒刷新一次",placement:"top"}},[s("el-checkbox",{staticStyle:{float:"right","margin-top":"6px"},on:{change:t.handleCheckAutoData},model:{value:t.autoData,callback:function(e){t.autoData=e},expression:"autoData"}},[t._v("自动刷新")])],1)],1),t._v(" "),s("el-col",{attrs:{offset:1,span:4}},[s("el-button",{attrs:{type:"primary",icon:"el-icon-refresh",size:"mini",plain:""},on:{click:function(e){return t.queryData()}}},[t._v("刷新")])],1)],1)],1)])])]),t._v(" "),s("el-main",{staticStyle:{overflow:"auto","border-bottom":"1px solid #E4E7ED"}},[s("div",{directives:[{name:"show",rawName:"v-show",value:"pos"==t.selCat,expression:"selCat=='pos'"},{name:"loading",rawName:"v-loading",value:t.loading.position,expression:"loading.position"}],staticStyle:{height:"100%",display:"flex","flex-direction":"row"}},[s("div",{staticStyle:{flex:"1",height:"100%",overflow:"auto","border-right":"1px solid #E4E7ED",width:"100%"}},[s("div",[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"",data:t.positions,"summary-method":t.getPosSum,"show-summary":""}},[s("el-table-column",{attrs:{prop:"code",label:"品种",width:"120",sortable:""}}),t._v(" "),s("el-table-column",{attrs:{label:"数量",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.qty>=0?"text-danger":"text-success"},[t._v(t._s(e.row.qty))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"浮盈",width:"100",sortable:""},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.profit>=0?"text-danger":"text-success"},[t._v(t._s(e.row.profit.toFixed(1)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"开仓时间",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtTime(e.row.opentime)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"开仓价格",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtPrice(e.row.price)))])]}}])})],1)],1)]),t._v(" "),t.isAdmin?s("div",{staticStyle:{flex:"1",height:"100%",overflow:"auto",width:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"1",width:"100%",height:"100%"}},[s("div",{staticStyle:{width:"100%",height:"100%"},attrs:{id:"pie"}})])]):t._e()]),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:"rsk"==t.selCat,expression:"selCat=='rsk'"},{name:"loading",rawName:"v-loading",value:t.loading.risk,expression:"loading.risk"}],staticStyle:{height:"100%",overflow:"auto"}},[s("div",{staticStyle:{height:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"1",display:"flex","flex-direction":"row"}},[s("div",{staticClass:"filter-pane el-card is-always-shadow"},[s("div",{staticStyle:{height:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"0 1 44px",padding:"18px 20px","border-bottom":"1px solid #EBEEF5","box-sizing":"border-box"}},[s("span",{staticClass:"filter"},[t._v("策略过滤器")]),t._v(" "),s("el-button",{staticStyle:{float:"right","margin-left":"1px"},attrs:{type:"danger",size:"mini",plain:""},on:{click:function(e){return t.checkAllFilters("strategy_filters",!0)}}},[t._v("一键过滤")]),t._v(" "),s("el-button",{staticStyle:{float:"right","margin-right":"1px"},attrs:{type:"success",size:"mini",plain:""},on:{click:function(e){return t.checkAllFilters("strategy_filters",!1)}}},[t._v("一键通过")])],1),t._v(" "),s("div",{staticStyle:{flex:"1 0 0",overflow:"auto",padding:"20px"}},t._l(t.filters.strategy_filters,function(e,a){return s("el-row",{key:a,staticClass:"filter-row"},[s("el-col",{attrs:{span:12}},[s("i",{staticClass:"el-icon-cpu"}),s("span",{staticClass:"filter-strategy"},[t._v(t._s(a))])]),t._v(" "),s("el-col",{attrs:{span:12}},[s("el-switch",{attrs:{"active-text":"过滤","inactive-text":"通过","inactive-color":"#13ce66","active-color":"#ff4949"},model:{value:t.filters.strategy_filters[a],callback:function(e){t.$set(t.filters.strategy_filters,a,e)},expression:"filters['strategy_filters'][id]"}})],1)],1)}),1)])]),t._v(" "),s("div",{staticClass:"filter-pane el-card is-always-shadow"},[s("div",{staticStyle:{height:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"0 1 44px",padding:"18px 20px","border-bottom":"1px solid #EBEEF5","box-sizing":"border-box"}},[s("span",{staticClass:"filter"},[t._v("代码过滤器")]),t._v(" "),s("el-button",{staticStyle:{float:"right","margin-left":"1px"},attrs:{type:"danger",size:"mini",plain:""},on:{click:function(e){return t.checkAllFilters("code_filters",!0)}}},[t._v("一键过滤")]),t._v(" "),s("el-button",{staticStyle:{float:"right","margin-right":"1px"},attrs:{type:"success",size:"mini",plain:""},on:{click:function(e){return t.checkAllFilters("code_filters",!1)}}},[t._v("一键通过")])],1),t._v(" "),s("div",{staticStyle:{flex:"1 0 0",overflow:"auto",padding:"20px"}},[t._l(t.filters.code_filters,function(e,a){return s("el-row",{key:a,staticClass:"filter-row"},[s("el-col",{staticStyle:{"margin-top":"4px"},attrs:{span:10}},[s("i",{staticClass:"el-icon-collection"}),s("span",{staticClass:"filter-code"},[t._v(t._s(a))])]),t._v(" "),s("el-col",{staticStyle:{"margin-top":"4px"},attrs:{span:10}},[s("el-switch",{staticStyle:{float:"right"},attrs:{"active-text":"过滤","inactive-text":"通过","inactive-color":"#13ce66","active-color":"#ff4949"},model:{value:t.filters.code_filters[a],callback:function(e){t.$set(t.filters.code_filters,a,e)},expression:"filters['code_filters'][id]"}})],1),t._v(" "),s("el-col",{attrs:{span:4}},[s("el-tooltip",{attrs:{placement:"top"}},[s("div",{attrs:{slot:"content"},slot:"content"},[t._v("删除代码过滤器")]),t._v(" "),s("el-button",{staticStyle:{float:"right"},attrs:{size:"mini",circle:"",icon:"el-icon-delete"},on:{click:function(e){return t.onDelCodeFilter(a)}}})],1)],1)],1)}),t._v(" "),s("el-row",{staticClass:"filter-row"},[s("el-tooltip",{attrs:{placement:"top"}},[s("div",{attrs:{slot:"content"},slot:"content"},[t._v("添加代码过滤器")]),t._v(" "),s("el-button",{staticStyle:{width:"100%"},attrs:{type:"primary",plain:"",icon:"el-icon-plus"},on:{click:function(e){return t.onAddCodeFilter()}}})],1)],1)],2)])]),t._v(" "),s("div",{staticClass:"filter-pane el-card is-always-shadow"},[s("div",{staticStyle:{height:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"0 1 44px",padding:"18px 20px","border-bottom":"1px solid #EBEEF5","box-sizing":"border-box"}},[s("span",{staticClass:"filter"},[t._v("通道过滤器")]),t._v(" "),s("el-button",{staticStyle:{float:"right","margin-left":"1px"},attrs:{type:"danger",size:"mini",plain:""},on:{click:function(e){return t.checkAllFilters("channel_filters",!0)}}},[t._v("一键过滤")]),t._v(" "),s("el-button",{staticStyle:{float:"right","margin-right":"1px"},attrs:{type:"success",size:"mini",plain:""},on:{click:function(e){return t.checkAllFilters("channel_filters",!1)}}},[t._v("一键通过")])],1),t._v(" "),s("div",{staticStyle:{flex:"1 0 0",overflow:"auto",padding:"20px"}},t._l(t.filters.channel_filters,function(e,a){return s("el-row",{key:a,staticClass:"filter-row"},[s("el-col",{attrs:{span:12}},[s("i",{staticClass:"el-icon-link"}),s("span",{staticClass:"filter-channel"},[t._v(t._s(a))])]),t._v(" "),s("el-col",{attrs:{span:12}},[s("el-switch",{attrs:{"active-text":"过滤","inactive-text":"通过","inactive-color":"#13ce66","active-color":"#ff4949"},model:{value:t.filters.channel_filters[a],callback:function(e){t.$set(t.filters.channel_filters,a,e)},expression:"filters['channel_filters'][id]"}})],1)],1)}),1)])])]),t._v(" "),s("div",{staticStyle:{flex:"0 28px",margin:"2px 0"}},[s("span",{staticStyle:{"font-size":"12px",color:"gray","line-height":"24px"}},[t._v("\n                            当过滤器生效时，相关的信号都会被过滤掉！修改完过滤器，一定要记得"),s("strong",[t._v("提交")]),t._v("！提交以后会在"),s("strong",[t._v("1分钟内")]),t._v("生效！\n                        ")]),t._v(" "),s("el-button",{staticStyle:{float:"right"},attrs:{type:"danger",icon:"el-icon-finished"},on:{click:function(e){return t.onCommitFilters()}}},[t._v("提交")])],1)])]),t._v(" "),t.isAdmin?s("div",{directives:[{name:"show",rawName:"v-show",value:"fnd"==t.selCat,expression:"selCat=='fnd'"},{name:"loading",rawName:"v-loading",value:t.loading.fund,expression:"loading.fund"}],staticStyle:{height:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{height:"40px",display:"inline-block",flex:"0",margin:"4px"}},[s("el-row",[s("el-col",{staticStyle:{"margin-top":"2px"},attrs:{span:2}},[s("i",{staticClass:"el-icon-money"}),t._v(" "),s("a",[t._v("资金规模")])]),t._v(" "),s("el-col",{attrs:{span:3}},[s("el-input",{attrs:{placeholder:"请输入资金规模",size:"mini",type:"number",min:"1000000",step:"1000000"},model:{value:t.capital,callback:function(e){t.capital=e},expression:"capital"}})],1),t._v(" "),s("el-col",{staticStyle:{"margin-left":"2px"},attrs:{span:2}},[s("el-button",{attrs:{size:"mini",plain:"",type:"danger"},on:{click:t.onClickResetCapital}},[t._v("刷新数据")])],1)],1)],1),t._v(" "),s("div",{staticStyle:{flex:"1",width:"100%",overflow:"auto",height:"50%","border-bottom":"1px solid #E4E7ED"}},[s("div",{staticStyle:{"max-height":"100%"}},[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"",data:t.funds}},[s("el-table-column",{attrs:{label:"日期",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtDate(e.row.date)))])]}}],null,!1,1157224088)}),t._v(" "),s("el-table-column",{attrs:{label:"平仓盈亏",width:"90"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.closeprofit>=0?"text-danger":"text-success"},[t._v(t._s(e.row.closeprofit.toFixed(1)))])]}}],null,!1,298912261)}),t._v(" "),s("el-table-column",{attrs:{label:"浮动盈亏",width:"90"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.dynprofit>=0?"text-danger":"text-success"},[t._v(t._s(e.row.dynprofit.toFixed(1)))])]}}],null,!1,103057029)}),t._v(" "),s("el-table-column",{attrs:{prop:"fee",label:"佣金",width:"80",formatter:t.formatAmount}}),t._v(" "),s("el-table-column",{attrs:{label:"动态权益",width:"110"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.dynbalance+e.row.capital>=0?"text-danger":"text-success"},[t._v(t._s((e.row.dynbalance+e.row.capital).toFixed(1)))])]}}],null,!1,4057529733)}),t._v(" "),s("el-table-column",{attrs:{label:"日内最大市值",width:"140"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{staticClass:"text-danger"},[t._v(t._s((e.row.maxdynbalance+e.row.capital).toFixed(1)+"("+t.fmtFundTime(e.row.maxtime)+")"))])]}}],null,!1,2563446024)}),t._v(" "),s("el-table-column",{attrs:{label:"日内最小市值",width:"140"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{staticClass:"text-success"},[t._v(t._s((e.row.mindynbalance+e.row.capital).toFixed(1)+"("+t.fmtFundTime(e.row.mintime)+")"))])]}}],null,!1,1140179728)}),t._v(" "),s("el-table-column",{attrs:{label:"多日最大市值",width:"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{staticClass:"text-danger"},[t._v(t._s((e.row.mdmaxbalance+e.row.capital).toFixed(1)+"("+t.fmtFundDate(e.row.mdmaxdate)+")"))])]}}],null,!1,3597427227)}),t._v(" "),s("el-table-column",{attrs:{label:"多日最小市值",width:"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{staticClass:"text-success"},[t._v(t._s((e.row.mdminbalance+e.row.capital).toFixed(1)+"("+t.fmtFundDate(e.row.mdmindate)+")"))])]}}],null,!1,1635711075)})],1)],1)]),t._v(" "),s("div",{staticStyle:{flex:"1",width:"100%",overflow:"auto",display:"flex","flex-direction":"column",margin:"4px"}},[s("div",{staticStyle:{flex:"1",width:"100%","border-top":"1px solid #E4E7ED"}},[s("div",{staticStyle:{width:"100%",height:"100%"},attrs:{id:"grptrend"}})])])]):t._e()]),t._v(" "),s("el-footer",{staticStyle:{height:"24px"}},[s("span",{staticStyle:{"font-size":"12px",color:"gray","line-height":"24px"}},[t._v("数据刷新时间: "+t._s(t.refreshTime))])])],1)],1)},staticRenderFns:[]};var D=s("VU/8")(N,A,!1,function(t){s("b3w7")},"data-v-4147835e",null).exports,T=s("E5Az"),E=(s("tWbI"),s("5IAE"),s("4/hK"),s("Yokd"),s("GUiZ"),s("Z6qg"),s("aGTD"),s("7Xsf"),s("THjC"),s("Kk9m"),s("fo6W"),s("U3HU"),s("soCA"),s("aX1R"),s("vq+x"),{name:"editor",props:{groupid:{type:String,default:function(){return""}}},computed:{curFilePath:function(){return null==this.curFile?"":this.curFile.path}},components:{codemirror:T.codemirror},watch:{groupid:function(t,e){t=t||"",e=e||"",0!=t.length&&t!=e&&this.queryFiles()}},data:function(){return{folders:[],edit:!1,filename:"",content_s:"",content_backup:"",curFile:null,fileOnway:!1,cmOptions:{mode:"python",keyMap:"sublime",lineNumbers:!0,smartIndent:!0,indentUnit:4,indentWithTabs:!0,lineWrapping:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter","CodeMirror-lint-markers"],foldGutter:!0,autofocus:!0,matchBrackets:!0,autoCloseBrackets:!0,styleActiveLine:!0,readOnly:!0}}},methods:{queryFiles:function(){var t=this,e=this;e.$api.getGroupDir(e.groupid,function(s){s.result<0?e.$notify.error("获取组合目录结构失败："+s.message):t.folders=[s.tree]})},handleFileClick:function(t){var e=this;if(t.isfile){var s=t.path.split("."),a=s[s.length-1].toLowerCase();if(-1==["py","json","js","csv"].indexOf(a))return void this.$toast("该文件不可查看");e.fileOnway=!0,e.curFile=t,e.$api.getGroupFile(this.groupid,t.path,function(t){t.result<0?e.$notify.error("获取文件内容失败"+t.message):(e.content_s=t.content,e.cmOptions.mode=function(t){return"py"==t?"python":"json"==t?{name:"javascript",json:!0}:"js"==t?"javascript":"text/plain"}(a),e.fileOnway=!1)})}},onClickEdit:function(){this.content_backup=this.content_s,this.cmOptions.readOnly=!1,this.edit=!0},onClickCancel:function(){var t=this;this.content_s!=this.content_backup?this.$confirm("内容已被修改，确定要放弃修改吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.content_s=t.content_backup,t.cmOptions.readOnly=!0,t.edit=!1}).catch(function(){}):(this.content_s=this.content_backup,this.cmOptions.readOnly=!0,this.edit=!1)},onClickCommit:function(){var t=this;this.loading=!0,this.$api.commitGroupFile(this.groupid,this.curFile.path,this.content_s,function(e){e.result<0?t.$message.error("文件提交失败:"+e.message):t.$message({message:"文件提交成功",type:"success"}),t.edit=!1,t.cmOptions.readOnly=!0,t.loading=!1})}},mounted:function(){}}),I={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticStyle:{height:"100%",width:"100%",display:"flex","flex-direction":"row"}},[s("div",{staticStyle:{flex:"0 320px","min-width":"320px",border:"1px solid #DCDFE6","border-radius":"2px",margin:"4px"}},[s("div",{staticStyle:{height:"100%",overflow:"auto"}},[s("el-tree",{attrs:{data:t.folders},on:{"node-click":t.handleFileClick}})],1)]),t._v(" "),s("div",{staticStyle:{flex:"1",margin:"4px",display:"flex","flex-direction":"column",overflow:"auto"}},[s("div",{directives:[{name:"loading",rawName:"v-loading",value:t.fileOnway,expression:"fileOnway"}],staticStyle:{flex:"1",height:"100%",overflow:"auto",border:"1px solid #DCDFE6","border-radius":"2px"}},[s("div",{staticStyle:{height:"100%"}},[s("codemirror",{ref:"mycode",staticStyle:{height:"100% !important"},attrs:{options:t.cmOptions},model:{value:t.content_s,callback:function(e){t.content_s=e},expression:"content_s"}})],1)]),t._v(" "),s("div",{staticStyle:{flex:"0 32px","margin-top":"8px"}},[s("span",{staticStyle:{"font-size":"12px",color:"gray",float:"left"}},[t._v("当前文件:"+t._s(t.curFilePath))]),t._v(" "),s("el-button",{directives:[{name:"show",rawName:"v-show",value:!t.edit,expression:"!edit"}],staticStyle:{float:"right"},attrs:{size:"mini"},on:{click:function(e){return t.onClickEdit()}}},[s("i",{staticClass:"el-icon-edit"}),t._v("修改\n            ")]),t._v(" "),s("el-button",{directives:[{name:"show",rawName:"v-show",value:t.edit,expression:"edit"}],staticStyle:{float:"right"},attrs:{size:"mini"},on:{click:function(e){return t.onClickCommit()}}},[s("i",{staticClass:"el-icon-set-up"}),t._v("提交\n            ")]),t._v(" "),s("el-button",{directives:[{name:"show",rawName:"v-show",value:t.edit,expression:"edit"}],staticStyle:{float:"right"},attrs:{size:"mini"},on:{click:function(e){return t.onClickCancel()}}},[s("i",{staticClass:"el-icon-refresh-left"}),t._v("取消\n            ")])],1)])])},staticRenderFns:[]};var G={name:"empty",components:{StrategyData:_,ChannelData:S,PorfolioData:D,Editor:s("VU/8")(E,I,!1,function(t){s("C17c")},null,null).exports},computed:d()({},Object(p.b)(["cache"]),{isAdmin:function(){var t=this.cache.userinfo;return!!t&&("admin"==t.role||"superman"==t.role)},groupid:function(){return null==this.groupinfo?"":this.groupinfo.id}}),props:{groupinfo:{type:Object,default:function(){return{id:"",name:"",path:"",info:"",gtype:"cta",datmod:"auto"}}}},watch:{groupinfo:function(t,e){var s=this;null!=t&&(null!=e&&t.id==e.id||(this.logScroll="auto"==t.datmod,setTimeout(function(){s.queryLogs(!0)},300)))}},data:function(){return{selData:"sdata",logs:"",logfilter:"total",logCache:"",logLines:0,logScroll:!0,logOnway:!1,autoLog:!1,logInterval:0,logTime:(new Date).format("yyyy.MM.dd hh:mm:ss")}},methods:{handleClickTab:function(t,e){var s=this;this.selData=t.name,"pdata"==t.name&&setTimeout(function(){s.$refs.portfolio.$emit("resize")},150)},handleClickQryLog:function(){var t=this;setTimeout(function(){t.queryLogs(!0)},300)},handleCheckAutoLog:function(t){this.resetLogInterval()},resetLogInterval:function(){var t=this;this.autoLog?(0!=this.logInterval&&clearInterval(this.logInterval),this.logInterval=setInterval(function(){t.queryLogs()},15e3)):0!=this.logInterval&&clearInterval(this.logInterval)},queryLogs:function(t){var e=this;t=t||!1;var s=this;""!=this.groupinfo.id&&(s.logOnway=!0,this.$api.getLogs(this.groupinfo.id,this.logfilter,function(a){a.result<0?(e.logs="",e.logLines=0,e.$notify.error("组合日志拉取失败："+a.message),s.$nextTick(function(){s.$refs.logs.scrollTo(0,0)})):(e.logs=a.content,e.logLines=a.lines||0,s.$nextTick(function(){var t=s.$refs.logs.scrollHeight;s.$refs.logs.scrollTo(0,t)})),s.logTime=(new Date).format("yyyy.MM.dd hh:mm:ss"),s.logOnway=!1,t&&s.resetLogInterval()}))},processLog:function(t){var e=this,s=t.message||"";if(s.length>0){var a=0==e.logCache.length,i="["+new Date(t.time).format("yyyy.MM.dd hh:mm:ss")+" - "+t.tag+"] "+s+"\n";e.logCache+=i,e.logLines++,a&&e.$nextTick(function(){e.logLines>=200&&(e.logs="",e.logLines=0),e.logs+=e.logCache,e.logCache="",e.$nextTick(function(){var t=e.$refs.logs.scrollHeight;e.$refs.logs.scrollTo(0,t)})})}},processEvent:function(t){var e=t.evttype||"";if(""!=e)if("notify"==e)this.$notify({title:"订单回报",type:"error",message:"交易通道{0}错误：{1}".format(t.channel,t.message),duration:0});else if("order"==e){if(!t.data.canceled)return;this.$notify({title:"订单回报",type:"error",message:"交易通道{0}订单已撤销，本地订单号：{1}".format(t.channel,t.data.localid),duration:0})}else if("trade"==e){var s=(t.data.isopen?"开":"平")+(t.data.islong?"多":"空");this.$notify({title:"成交回报",type:"success",message:"交易通道：{0}，操作：{1}，代码：{2}，数量：{3}，成交价：{4}，本地订单号：{5}".format(t.channel,s,t.data.code,t.data.volume,t.data.price,t.data.localid)})}}},mounted:function(){var t=this;t.$on("notify",function(e){if(e.groupid==t.groupinfo.id)if("gplog"==e.type){if(!t.logScroll)return;t.processLog(e)}else"chnlevt"==e.type&&t.processEvent(e)})}},F={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticStyle:{height:"100vh",width:"100%"}},[s("el-row",{staticStyle:{height:"100%"}},[s("el-col",{staticStyle:{height:"100%"},attrs:{span:8}},[s("div",{staticStyle:{height:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"0",margin:"2px 4px 0px 4px","min-height":"39px",display:"flex","flex-direction":"row"}},[s("div",{staticClass:"simtab",staticStyle:{flex:"0"}},[s("span",[t._v("滚动日志")])]),t._v(" "),s("div",{staticStyle:{flex:"1","border-bottom":"1px solid #E4E7ED","margin-top":"6px"}}),t._v(" "),s("div",{staticStyle:{flex:"0 160px","border-bottom":"1px solid #E4E7ED","margin-top":"6px",display:"inline-block"}},[s("el-row",{directives:[{name:"show",rawName:"v-show",value:!t.logScroll,expression:"!logScroll"}]},[s("el-col",{attrs:{span:11}},[s("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"每个15秒刷新一次",placement:"top"}},[s("el-checkbox",{staticStyle:{float:"right","margin-top":"6px"},on:{change:t.handleCheckAutoLog},model:{value:t.autoLog,callback:function(e){t.autoLog=e},expression:"autoLog"}},[t._v("自动刷新")])],1)],1),t._v(" "),s("el-col",{attrs:{offset:1,span:12}},[s("el-button",{attrs:{type:"primary",icon:"el-icon-refresh",size:"mini",plain:""},on:{click:function(e){return t.handleClickQryLog()}}},[t._v("刷新")])],1)],1)],1)]),t._v(" "),s("div",{directives:[{name:"loading",rawName:"v-loading",value:t.logOnway,expression:"logOnway"}],staticStyle:{flex:"1",margin:"10px 4px"}},[s("textarea",{ref:"logs",staticClass:"el-textarea__inner",attrs:{readonly:"readonly",autocomplete:"off",placeholder:"这里是日志内容"},domProps:{value:t.logs}})]),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:!t.logScroll,expression:"!logScroll"}],staticStyle:{flex:"0 24px","align-items":"right"}},[s("span",{staticStyle:{"font-size":"12px",color:"gray"}},[t._v("日志刷新时间: "+t._s(t.logTime))])])])]),t._v(" "),s("el-col",{staticStyle:{height:"100%","border-left":"1px solid #E4E7ED"},attrs:{span:16}},[s("div",{staticStyle:{height:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"0",margin:"2px 4px 0px 4px","min-height":"44px"}},[s("el-tabs",{staticStyle:{height:"100%"},attrs:{value:t.selData,type:"card"},on:{"tab-click":t.handleClickTab}},[s("el-tab-pane",{attrs:{label:"策略管理",name:"sdata"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"组合管理",name:"pdata"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"通道管理",name:"tdata"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"配置管理",name:"editor"}})],1)],1),t._v(" "),s("div",{staticStyle:{flex:"1",margin:"2px",overflow:"auto"}},[s("StrategyData",{directives:[{name:"show",rawName:"v-show",value:"sdata"==t.selData,expression:"selData=='sdata'"}],attrs:{groupid:t.groupid}}),t._v(" "),s("ChannelData",{directives:[{name:"show",rawName:"v-show",value:"tdata"==t.selData,expression:"selData=='tdata'"}],attrs:{groupid:t.groupid}}),t._v(" "),s("PorfolioData",{directives:[{name:"show",rawName:"v-show",value:"pdata"==t.selData,expression:"selData=='pdata'"}],ref:"portfolio",attrs:{groupid:t.groupid}}),t._v(" "),s("Editor",{directives:[{name:"show",rawName:"v-show",value:"editor"==t.selData,expression:"selData=='editor'"}],attrs:{groupid:t.groupid}})],1)])])],1)],1)},staticRenderFns:[]};var M=s("VU/8")(G,F,!1,function(t){s("g1Tk")},"data-v-7f597c06",null).exports,q={render:function(){this.$createElement;this._self._c;return this._m(0)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"empty-box"},[e("div",{staticClass:"content"},[e("h2",[this._v("尚未添加组合")])])])}]};var $=s("VU/8")({name:"empty",components:{},data:function(){return{}},methods:{}},q,!1,function(t){s("SP1q")},"data-v-53f6add5",null).exports,B={name:"schedule",computed:d()({},Object(p.b)(["folders"])),props:{fixinfo:{type:Boolean,default:function(){return!1}},forapp:{type:Boolean,default:function(){return!1}},config:{type:Object,default:function(){return{id:"",folder:"",path:"",param:"",mqurl:"",span:3,guard:!1,redirect:!1,schedule:{active:!0,weekflag:"0111110",weekmask:[!1,!0,!0,!0,!0,!0,!1],tasks:[{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0}]}}}}},data:function(){return{showfolders:!1,selfolder:"",actions:["启动","停止","重启"]}},methods:{onLinkPython:function(){var t=this;this.$api.getPythonPath(function(e){e.result<0?t.$alert(e.message):t.config.path=e.path})},handlePickFolder:function(t){var e=this,s=this;s.selfolder="",0==s.folders.length?this.$api.getFolders(function(t){t.result<0?s.$alert(t.message):(e.$store.commit("setfolders",{folders:[t.tree]}),s.showfolders=!0)}):s.showfolders=!0},handleFolderPicked:function(){""==this.selfolder?this.$alert("请选择目录"):(this.config.folder=this.selfolder,this.showfolders=!1)},handleFolderClick:function(t){this.selfolder=t.path},onConfigCommit:function(){var t=this,e=JSON.parse(g()(this.config));if(0!=e.path.length)if(0!=e.id.length)if(0!=e.folder.length){e.schedule.weekflag="";for(var s=0;s<7;s++)e.schedule.weekflag+=e.schedule.weekmask[s]?"1":"0";for(var a=0;a<6;a++){var i=e.schedule.tasks[a].time;i=i.replace(":",""),e.schedule.tasks[a].time=parseInt(i)}e.redirect=!this.forapp,e.isapp=this.forapp,this.$confirm("确定要提交该调度配置?","自动调度",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){delete e.schedule.weekmask,t.$api.commitMonCfg(e,function(e){e.result<0?t.$message.error(e.message):(t.$message({message:"监控配置已提交成功",type:"success"}),t.$emit("cfgudt"))})})}else this.$alert("执行目录不能为空");else this.$alert("应用ID不能为空");else this.$alert("执行程序路径不能为空")}}},O={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticStyle:{display:"flex","flex-direction":"column",margin:"4px 20px"}},[t._m(0),t._v(" "),s("el-divider",{attrs:{"content-position":"left"}},[t._v("任务信息")]),t._v(" "),s("div",{staticClass:"config-label"},[s("el-row",[s("el-col",{attrs:{span:4}},[s("a",[t._v("任务ID：")])]),t._v(" "),s("el-col",{attrs:{span:7}},[s("el-input",{attrs:{size:"mini",disabled:t.fixinfo},model:{value:t.config.id,callback:function(e){t.$set(t.config,"id",e)},expression:"config.id"}})],1),t._v(" "),s("el-col",{attrs:{span:4,offset:2}},[s("a",[t._v("启动参数：")])]),t._v(" "),s("el-col",{attrs:{span:7}},[s("el-input",{attrs:{size:"mini",placeholder:"run.py"},model:{value:t.config.param,callback:function(e){t.$set(t.config,"param",e)},expression:"config.param"}})],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:4}},[s("a",[t._v("执行程序：")])]),t._v(" "),s("el-col",{attrs:{span:20}},[s("el-input",{attrs:{size:"mini",placeholder:"python执行程序所在目录，请上服务器查询"},model:{value:t.config.path,callback:function(e){t.$set(t.config,"path",e)},expression:"config.path"}},[s("el-tooltip",{attrs:{slot:"append",effect:"dark",content:"直接获取python路径",placement:"top"},slot:"append"},[s("el-button",{attrs:{icon:"el-icon-link"},on:{click:t.onLinkPython}})],1)],1)],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:4}},[s("a",[t._v("工作目录：")])]),t._v(" "),s("el-col",{attrs:{span:20}},[s("el-input",{attrs:{size:"mini",disabled:t.fixinfo},model:{value:t.config.folder,callback:function(e){t.$set(t.config,"folder",e)},expression:"config.folder"}},[s("el-tooltip",{attrs:{slot:"append",effect:"dark",content:"选择组合所在的目录",placement:"top"},slot:"append"},[s("el-button",{attrs:{icon:"el-icon-folder",disabled:t.fixinfo},on:{click:t.handlePickFolder}})],1)],1)],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:4}},[s("a",[t._v("消息地址：")])]),t._v(" "),s("el-col",{attrs:{span:20}},[s("el-input",{attrs:{size:"mini",placeholder:"请输入消息队列的URL",disabled:t.forapp},model:{value:t.config.mqurl,callback:function(e){t.$set(t.config,"mqurl",e)},expression:"config.mqurl"}})],1)],1)],1),t._v(" "),s("el-divider",{attrs:{"content-position":"left"}},[t._v("监控设置")]),t._v(" "),s("div",{staticClass:"config-row"},[s("div",{staticStyle:{flex:"0","margin-top":"6px","padding-right":"16px"}},[s("el-checkbox",{model:{value:t.config.guard,callback:function(e){t.$set(t.config,"guard",e)},expression:"config.guard"}},[t._v("进程守护")])],1),t._v(" "),s("div",{staticStyle:{flex:"0:display:inline"}},[s("span",{staticClass:"config-label"},[t._v("检测间隔")]),t._v(" "),s("el-input-number",{attrs:{size:"mini",min:1,max:100,label:"检测间隔"},model:{value:t.config.span,callback:function(e){t.$set(t.config,"span",e)},expression:"config.span"}}),t._v(" "),s("span",{staticClass:"config-label"},[t._v("s")])],1),t._v(" "),s("div",{staticStyle:{flex:"1"}}),t._v(" "),s("div",{staticStyle:{flex:"0","margin-top":"6px"}},[s("el-checkbox",{model:{value:t.config.schedule.active,callback:function(e){t.$set(t.config.schedule,"active",e)},expression:"config.schedule.active"}},[t._v("计划任务")])],1)]),t._v(" "),s("el-divider",{attrs:{"content-position":"left"}},[t._v("计划任务")]),t._v(" "),s("div",{staticClass:"config-row"},[s("div",{staticClass:"week-marker"},[s("el-checkbox",{attrs:{disabled:!t.config.schedule.active},model:{value:t.config.schedule.weekmask[0],callback:function(e){t.$set(t.config.schedule.weekmask,0,e)},expression:"config.schedule.weekmask[0]"}},[t._v("周日")])],1),t._v(" "),s("div",{staticClass:"week-marker"},[s("el-checkbox",{attrs:{disabled:!t.config.schedule.active},model:{value:t.config.schedule.weekmask[1],callback:function(e){t.$set(t.config.schedule.weekmask,1,e)},expression:"config.schedule.weekmask[1]"}},[t._v("周一")])],1),t._v(" "),s("div",{staticClass:"week-marker"},[s("el-checkbox",{attrs:{disabled:!t.config.schedule.active},model:{value:t.config.schedule.weekmask[2],callback:function(e){t.$set(t.config.schedule.weekmask,2,e)},expression:"config.schedule.weekmask[2]"}},[t._v("周二")])],1),t._v(" "),s("div",{staticClass:"week-marker"},[s("el-checkbox",{attrs:{disabled:!t.config.schedule.active},model:{value:t.config.schedule.weekmask[3],callback:function(e){t.$set(t.config.schedule.weekmask,3,e)},expression:"config.schedule.weekmask[3]"}},[t._v("周三")])],1),t._v(" "),s("div",{staticClass:"week-marker"},[s("el-checkbox",{attrs:{disabled:!t.config.schedule.active},model:{value:t.config.schedule.weekmask[4],callback:function(e){t.$set(t.config.schedule.weekmask,4,e)},expression:"config.schedule.weekmask[4]"}},[t._v("周四")])],1),t._v(" "),s("div",{staticClass:"week-marker"},[s("el-checkbox",{attrs:{disabled:!t.config.schedule.active},model:{value:t.config.schedule.weekmask[5],callback:function(e){t.$set(t.config.schedule.weekmask,5,e)},expression:"config.schedule.weekmask[5]"}},[t._v("周五")])],1),t._v(" "),s("div",{staticClass:"week-marker"},[s("el-checkbox",{attrs:{disabled:!t.config.schedule.active},model:{value:t.config.schedule.weekmask[6],callback:function(e){t.$set(t.config.schedule.weekmask,6,e)},expression:"config.schedule.weekmask[6]"}},[t._v("周六")])],1)]),t._v(" "),s("el-row",[s("el-col",{attrs:{span:5}},[s("el-checkbox",{attrs:{disabled:!t.config.schedule.active},model:{value:t.config.schedule.tasks[0].active,callback:function(e){t.$set(t.config.schedule.tasks[0],"active",e)},expression:"config.schedule.tasks[0].active"}},[t._v("任务一")])],1),t._v(" "),s("el-col",{attrs:{span:6}},[s("el-input",{attrs:{placeholder:"请输入时间","suffix-icon":"el-icon-time",size:"mini",type:"time",disabled:!t.config.schedule.tasks[0].active||!t.config.schedule.active},model:{value:t.config.schedule.tasks[0].time,callback:function(e){t.$set(t.config.schedule.tasks[0],"time",e)},expression:"config.schedule.tasks[0].time"}})],1),t._v(" "),s("el-col",{attrs:{span:5,offset:1}},[s("el-select",{attrs:{placeholder:"请选择",size:"mini",disabled:!t.config.schedule.tasks[0].active||!t.config.schedule.active},model:{value:t.config.schedule.tasks[0].action,callback:function(e){t.$set(t.config.schedule.tasks[0],"action",e)},expression:"config.schedule.tasks[0].action"}},t._l(t.actions,function(t,e){return s("el-option",{key:e,attrs:{label:t,value:e}})}),1)],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:5}},[s("el-checkbox",{attrs:{disabled:!t.config.schedule.active},model:{value:t.config.schedule.tasks[1].active,callback:function(e){t.$set(t.config.schedule.tasks[1],"active",e)},expression:"config.schedule.tasks[1].active"}},[t._v("任务二")])],1),t._v(" "),s("el-col",{attrs:{span:6}},[s("el-input",{attrs:{placeholder:"请输入时间","suffix-icon":"el-icon-time",size:"mini",type:"time",disabled:!t.config.schedule.tasks[1].active||!t.config.schedule.active},model:{value:t.config.schedule.tasks[1].time,callback:function(e){t.$set(t.config.schedule.tasks[1],"time",e)},expression:"config.schedule.tasks[1].time"}})],1),t._v(" "),s("el-col",{attrs:{span:5,offset:1}},[s("el-select",{attrs:{placeholder:"请选择",size:"mini",disabled:!t.config.schedule.tasks[1].active||!t.config.schedule.active},model:{value:t.config.schedule.tasks[1].action,callback:function(e){t.$set(t.config.schedule.tasks[1],"action",e)},expression:"config.schedule.tasks[1].action"}},t._l(t.actions,function(t,e){return s("el-option",{key:e,attrs:{label:t,value:e}})}),1)],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:5}},[s("el-checkbox",{attrs:{disabled:!t.config.schedule.active},model:{value:t.config.schedule.tasks[2].active,callback:function(e){t.$set(t.config.schedule.tasks[2],"active",e)},expression:"config.schedule.tasks[2].active"}},[t._v("任务三")])],1),t._v(" "),s("el-col",{attrs:{span:6}},[s("el-input",{attrs:{placeholder:"请输入时间","suffix-icon":"el-icon-time",size:"mini",type:"time",disabled:!t.config.schedule.tasks[2].active||!t.config.schedule.active},model:{value:t.config.schedule.tasks[2].time,callback:function(e){t.$set(t.config.schedule.tasks[2],"time",e)},expression:"config.schedule.tasks[2].time"}})],1),t._v(" "),s("el-col",{attrs:{span:5,offset:1}},[s("el-select",{attrs:{placeholder:"请选择",size:"mini",disabled:!t.config.schedule.tasks[2].active||!t.config.schedule.active},model:{value:t.config.schedule.tasks[2].action,callback:function(e){t.$set(t.config.schedule.tasks[2],"action",e)},expression:"config.schedule.tasks[2].action"}},t._l(t.actions,function(t,e){return s("el-option",{key:e,attrs:{label:t,value:e}})}),1)],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:5}},[s("el-checkbox",{attrs:{disabled:!t.config.schedule.active},model:{value:t.config.schedule.tasks[3].active,callback:function(e){t.$set(t.config.schedule.tasks[3],"active",e)},expression:"config.schedule.tasks[3].active"}},[t._v("任务四")])],1),t._v(" "),s("el-col",{attrs:{span:6}},[s("el-input",{attrs:{placeholder:"请输入时间","suffix-icon":"el-icon-time",size:"mini",type:"time",disabled:!t.config.schedule.tasks[3].active||!t.config.schedule.active},model:{value:t.config.schedule.tasks[3].time,callback:function(e){t.$set(t.config.schedule.tasks[3],"time",e)},expression:"config.schedule.tasks[3].time"}})],1),t._v(" "),s("el-col",{attrs:{span:5,offset:1}},[s("el-select",{attrs:{placeholder:"请选择",size:"mini",disabled:!t.config.schedule.tasks[3].active||!t.config.schedule.active},model:{value:t.config.schedule.tasks[3].action,callback:function(e){t.$set(t.config.schedule.tasks[3],"action",e)},expression:"config.schedule.tasks[3].action"}},t._l(t.actions,function(t,e){return s("el-option",{key:e,attrs:{label:t,value:e}})}),1)],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:5}},[s("el-checkbox",{attrs:{disabled:!t.config.schedule.active},model:{value:t.config.schedule.tasks[4].active,callback:function(e){t.$set(t.config.schedule.tasks[4],"active",e)},expression:"config.schedule.tasks[4].active"}},[t._v("任务五")])],1),t._v(" "),s("el-col",{attrs:{span:6}},[s("el-input",{attrs:{placeholder:"请输入时间","suffix-icon":"el-icon-time",size:"mini",type:"time",disabled:!t.config.schedule.tasks[4].active||!t.config.schedule.active},model:{value:t.config.schedule.tasks[4].time,callback:function(e){t.$set(t.config.schedule.tasks[4],"time",e)},expression:"config.schedule.tasks[4].time"}})],1),t._v(" "),s("el-col",{attrs:{span:5,offset:1}},[s("el-select",{attrs:{placeholder:"请选择",size:"mini",disabled:!t.config.schedule.tasks[4].active||!t.config.schedule.active},model:{value:t.config.schedule.tasks[4].action,callback:function(e){t.$set(t.config.schedule.tasks[4],"action",e)},expression:"config.schedule.tasks[4].action"}},t._l(t.actions,function(t,e){return s("el-option",{key:e,attrs:{label:t,value:e}})}),1)],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:5}},[s("el-checkbox",{attrs:{disabled:!t.config.schedule.active},model:{value:t.config.schedule.tasks[5].active,callback:function(e){t.$set(t.config.schedule.tasks[5],"active",e)},expression:"config.schedule.tasks[5].active"}},[t._v("任务六")])],1),t._v(" "),s("el-col",{attrs:{span:6}},[s("el-input",{attrs:{placeholder:"请输入时间","suffix-icon":"el-icon-time",size:"mini",type:"time",disabled:!t.config.schedule.tasks[5].active||!t.config.schedule.active},model:{value:t.config.schedule.tasks[5].time,callback:function(e){t.$set(t.config.schedule.tasks[5],"time",e)},expression:"config.schedule.tasks[5].time"}})],1),t._v(" "),s("el-col",{attrs:{span:5,offset:1}},[s("el-select",{attrs:{placeholder:"请选择",size:"mini",disabled:!t.config.schedule.tasks[5].active||!t.config.schedule.active},model:{value:t.config.schedule.tasks[5].action,callback:function(e){t.$set(t.config.schedule.tasks[5],"action",e)},expression:"config.schedule.tasks[5].action"}},t._l(t.actions,function(t,e){return s("el-option",{key:e,attrs:{label:t,value:e}})}),1)],1)],1),t._v(" "),s("div",{staticStyle:{padding:"8px 4px"}},[s("div",{staticStyle:{flex:"1:display:inline",float:"right"}},[s("el-button",{staticStyle:{float:"right"},attrs:{type:"primary",size:"mini",plain:""},on:{click:function(e){return t.onConfigCommit()}}},[t._v("提交设置")])],1)]),t._v(" "),s("el-dialog",{attrs:{title:"选择目录",visible:t.showfolders,width:"25%"},on:{"update:visible":function(e){t.showfolders=e}}},[s("div",{staticStyle:{width:"100%",height:"300px",overflow:"auto",border:"1px solid #E4E7ED"}},[s("el-tree",{attrs:{data:t.folders},on:{"node-click":t.handleFolderClick}})],1),t._v(" "),s("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{on:{click:function(e){t.showfolders=!1}}},[t._v("取 消")]),t._v(" "),s("el-button",{attrs:{type:"primary",plain:""},on:{click:t.handleFolderPicked}},[t._v("确 定")])],1)])],1)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticStyle:{"padding-bottom":"12px"}},[e("h4",[this._v("调度设置")])])}]};var P=s("VU/8")(B,O,!1,function(t){s("+B9X")},"data-v-4b8c701c",null).exports,U={name:"monitor",computed:d()({},Object(p.b)(["folders","cache"]),{grpname:function(){return null==this.curGroup?"组合基本信息":this.curGroup.name},isAdmin:function(){var t=this.cache.userinfo;return!!t&&("admin"==t.role||"superman"==t.role)}}),components:{Group:M,Empty:$,Schedule:P},data:function(){return{groups:[],selectedIdx:"",schedule:!1,baseinfo:!1,showgrpdlg:!1,curGroup:null,addGroup:!1,editGroup:!1,copyGroup:{id:"",name:"",path:"",info:"",gtype:"cta",datmod:"mannual",env:"product",mqurl:""},showfolders:!1,selfolder:"",monitors:{},curMonCfg:{id:"",folder:"",path:"",param:"",span:3,guard:!1,redirect:!1,schedule:{active:!1,weekflag:"0111110",weekmask:[!1,!0,!0,!0,!0,!0,!1],tasks:[{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0}]}}}},methods:{handlePickFolder:function(t){var e=this,s=this;s.selfolder="",0==s.folders.length?this.$api.getFolders(function(t){t.result<0?s.$notify.error("查询目录结构出错："+t.message):(e.$store.commit("setfolders",{folders:[t.tree]}),s.showfolders=!0)}):s.showfolders=!0},handleFolderPicked:function(){""==this.selfolder?this.$alert("请选择目录"):(this.copyGroup.path=this.selfolder,this.showfolders=!1)},handleFolderClick:function(t){this.selfolder=t.path},handleTabSel:function(t,e){var s=this;s.selectedIdx=t,s.groups.forEach(function(e){if(e.id==t)return s.curGroup=e,!0})},handleClickSchedule:function(){var t=this,e=this,s=e.curGroup.id;e.monitors[s]?(e.curMonCfg=e.monitors[s],e.schedule=!0):e.$api.getMonCfg(s,function(a){if(a.result<0)e.$notify.error(a.message);else if(a.config){var i=a.config;i.schedule.weekmask=[];for(var n=0;n<i.schedule.weekflag.length;n++)i.schedule.weekmask.push("1"==i.schedule.weekflag[n]);for(var o=0;o<6;o++){var r=i.schedule.tasks[o].time+"";1==r.length?i.schedule.tasks[o].time="00:0"+r:2==r.length?i.schedule.tasks[o].time="00:"+r:3==r.length?i.schedule.tasks[o].time="0"+r[0]+":"+r.substr(1):i.schedule.tasks[o].time=r.substr(0,2)+":"+r.substr(2)}e.monitors[s]=i,e.curMonCfg=i,e.schedule=!0}else t.$confirm("该组合尚未配置自动调度，马上去配置?","自动调度",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var t={id:"",folder:"",path:"",param:"",span:3,guard:!1,redirect:!1,mqurl:"",schedule:{active:!1,weekflag:"0111110",weekmask:[!1,!0,!0,!0,!0,!0,!1],tasks:[{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0}]}};t.id=e.curGroup.id,t.folder=e.curGroup.path,t.redirect=!0,t.mqurl=e.curGroup.mqurl,e.curMonCfg=t,e.schedule=!0})})},handleGrpCmd:function(t){var e=this,s=this;if("addgrp"==t)this.copyGroup={id:"",name:"",path:"",info:"",gtype:"cta",datmod:"mannual",env:"product",mqurl:""},this.addGroup=!0,this.showgrpdlg=!0,this.editGroup=!0;else if("delgrp"==t){this.addGroup=!1,this.showgrpdlg=!1;var a=s.curGroup;this.$confirm("确定要删除该组合?","组合管理",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){e.$api.delGroup(a.id,function(t){if(t.result<0)s.$notify.error("删除组合失败："+t.message);else for(var e=0;e<s.groups.length;e++)if(s.groups[e].id==a.id){s.groups.splice(e,1),e;break}})})}},onCommitGroup:function(){var t=this,e=this,s=this.copyGroup;this.$api.commitGroup(s,this.addGroup?"add":"mod",function(a){a.result<0?e.$notify.error("提交组合信息失败："+a.message):(t.addGroup&&e.groups.push(s),e.showgrpdlg=!1,null==e.curGroup&&(e.selectedIdx=s.id,e.curGroup=s))})},onCloseGrpDlg:function(t){t()},handleViewGrop:function(){null!=this.curGroup&&""!=this.curGroup.id&&(this.copyGroup=JSON.parse(g()(this.curGroup)),this.copyGroup.datmod=this.copyGroup.datmod||"mannual",this.addGroup=!1,this.editGroup=!1,this.showgrpdlg=!0)},handleStartGroup:function(){var t=this;if(null!=this.curGroup&&""!=this.curGroup.id)if(this.curGroup.running)this.$notify("组合正在运行");else{var e=this,s=e.curGroup.id;e.monitors[s]?this.$api.startGroup(this.curGroup.id,function(e){e.result<0&&t.$notify.error("启动组合失败："+e.message)}):e.$api.getMonCfg(s,function(a){if(a.result<0)e.$notify.error(a.message);else if(a.config){var i=a.config;i.schedule.weekmask=[];for(var n=0;n<i.schedule.weekflag.length;n++)i.schedule.weekmask.push("1"==i.schedule.weekflag[n]);for(var o=0;o<6;o++){var r=i.schedule.tasks[o].time+"";1==r.length?i.schedule.tasks[o].time="00:0"+r:2==r.length?i.schedule.tasks[o].time="00:"+r:3==r.length?i.schedule.tasks[o].time="0"+r[0]+":"+r.substr(1):i.schedule.tasks[o].time=r.substr(0,2)+":"+r.substr(2)}e.monitors[s]=i,t.$api.startGroup(t.curGroup.id,function(e){e.result<0&&t.$notify.error(e.message)})}else e.$alert("该组合尚未配置调度，不能启动")})}},handleStopGroup:function(){var t=this;null!=this.curGroup&&""!=this.curGroup.id&&(this.curGroup.running?this.$confirm("确定要停止该组合吗?","手动停止",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.$api.stopGroup(t.curGroup.id,function(e){e.result<0&&t.$notify.error(e.message)})}):this.$notify("组合已经处于停止状态"))}},mounted:function(){var t=this;t.$nextTick(function(){t.$api.getGroups(function(e){e.result<0?t.$notify.error("查询组合出错："+e.message):(t.groups=e.groups,t.groups.length>0&&(t.selectedIdx=t.groups[0].id,t.curGroup=t.groups[0]),t.sockets.subscribe("notify",function(e){if("gpevt"==e.type&&("start"==e.evttype?setTimeout(function(){t.$notify({message:"组合"+e.groupid+"已启动",type:"success"})},300):"stop"==e.evttype&&setTimeout(function(){t.$notify.error("组合"+e.groupid+"已停止")},300)),"chnlevt"==e.type){var s=null,a=e.evttype||"",i=null;if(t.groups.forEach(function(t){t.id==e.groupid&&(i=t)}),null!=i){if("notify"==a)s={time:new Date,group:i.name,channel:e.channel,title:"事件通知",type:"error",message:"错误：{1}".format(e.channel,e.message)};else if("order"==a)e.data.canceled&&(s={time:new Date,group:i.name,channel:e.channel,title:"订单回报",type:"danger",message:"订单已撤销，本地订单号：{1}".format(e.channel,e.data.localid)});else if("trade"==a){var n=(e.data.isopen?"开":"平")+(e.data.islong?"多":"空");s={time:new Date,group:i.name,channel:e.channel,title:"成交回报",type:"success",message:"操作：{1}，代码：{2}，数量：{3}，成交价：{4}，本地订单号：{5}".format(e.channel,n,e.data.code,e.data.volume,e.data.price,e.data.localid)}}null!=s&&t.$emit("notify",s)}}null!=t.curGroup&&e.groupid==t.curGroup.id&&("gplog"==e.type||"chnlevt"==e.type?t.$refs.group&&t.$refs.group.$emit("notify",e):"gpevt"==e.type&&("start"==e.evttype?t.curGroup.running=!0:"stop"==e.evttype&&(t.curGroup.running=!1)))}))})})}},z={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticStyle:{height:"100%"}},[s("el-container",{staticStyle:{height:"100%"}},[s("el-header",{staticStyle:{height:"44px !important"}},[s("div",{staticStyle:{float:"left",height:"100%","margin-top":"7px"}},[s("el-menu",{staticClass:"el-menu-demo",attrs:{"default-active":t.selectedIdx,mode:"horizontal"},on:{select:t.handleTabSel}},t._l(t.groups,function(e,a){return s("el-menu-item",{key:a,attrs:{index:e.id}},[t._v("\n                        "+t._s(e.name)+"\n                        "),s("i",{class:"auto"==e.datmod?"el-icon-monitor":"el-icon-thumb"})])}),1)],1),t._v(" "),s("div",{staticStyle:{float:"right",margin:"6px 0px"}},[s("el-row",[s("el-tooltip",{directives:[{name:"show",rawName:"v-show",value:""!=t.selectedIdx&&t.curGroup.running,expression:"selectedIdx!='' && curGroup.running"}],staticClass:"item",attrs:{effect:"dark",content:"手动停止组合",placement:"top-start"}},[s("el-button",{attrs:{type:"danger",icon:"el-icon-magic-stick",size:"mini",plain:""},on:{click:t.handleStopGroup}},[t._v("停止")])],1),t._v(" "),s("el-tooltip",{directives:[{name:"show",rawName:"v-show",value:""!=t.selectedIdx&&!t.curGroup.running,expression:"selectedIdx!='' && !curGroup.running"}],staticClass:"item",attrs:{effect:"dark",content:"手动启动组合",placement:"top-start"}},[s("el-button",{attrs:{type:"success",icon:"el-icon-magic-stick",size:"mini",plain:""},on:{click:t.handleStartGroup}},[t._v("启动")])],1),t._v(" "),s("el-tooltip",{directives:[{name:"show",rawName:"v-show",value:""!=t.selectedIdx,expression:"selectedIdx!=''"}],staticClass:"item",attrs:{effect:"dark",content:"查看策略组合的基本信息",placement:"top-start"}},[s("el-button",{attrs:{type:"primary",icon:"el-icon-magic-stick",size:"mini",plain:""},on:{click:t.handleViewGrop}},[t._v("查看")])],1),t._v(" "),t.isAdmin?s("el-tooltip",{directives:[{name:"show",rawName:"v-show",value:""!=t.selectedIdx,expression:"selectedIdx!=''"}],staticClass:"item",attrs:{effect:"dark",content:"配置策略组合的自动调度",placement:"top-start"}},[s("el-button",{attrs:{type:"primary",icon:"el-icon-time",size:"mini",plain:""},on:{click:t.handleClickSchedule}},[t._v("调度")])],1):t._e(),t._v(" "),s("el-divider",{attrs:{direction:"vertical"}}),t._v(" "),s("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"管理策略组合",placement:"top-start"}},[s("el-dropdown",{attrs:{"split-button":"",type:"danger",size:"mini",trigger:"click"},on:{command:t.handleGrpCmd}},[t._v("\n                            组合管理\n                            "),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[s("el-dropdown-item",{attrs:{command:"addgrp"}},[s("i",{staticClass:"el-icon-plus"}),t._v(" "),s("span",[t._v("添加组合")])]),t._v(" "),s("el-dropdown-item",{directives:[{name:"show",rawName:"v-show",value:null!=t.curGroup,expression:"curGroup!=null"}],attrs:{command:"delgrp"}},[s("i",{staticClass:"el-icon-delete"}),t._v(" "),s("span",[t._v("删除组合")])])],1)],1)],1)],1)],1)]),t._v(" "),s("el-main",[s("div",{staticStyle:{height:"100%",width:"100%"}},[s("Empty",{directives:[{name:"show",rawName:"v-show",value:0==t.groups.length,expression:"groups.length==0"}],staticStyle:{height:"100%",width:"100%"}}),t._v(" "),s("Group",{directives:[{name:"show",rawName:"v-show",value:0!=t.groups.length,expression:"groups.length!=0"}],ref:"group",staticStyle:{height:"100%",width:"100%"},attrs:{groupinfo:t.curGroup}})],1)])],1),t._v(" "),s("el-drawer",{attrs:{title:"计划任务","with-header":!1,visible:t.schedule,direction:"rtl",size:"500px"},on:{"update:visible":function(e){t.schedule=e}}},[s("Schedule",{attrs:{config:t.curMonCfg,fixinfo:!0}})],1),t._v(" "),s("el-dialog",{attrs:{title:"选择目录",visible:t.showfolders,width:"25%"},on:{"update:visible":function(e){t.showfolders=e}}},[s("div",{staticStyle:{width:"100%",height:"300px",overflow:"auto",border:"1px solid #E4E7ED"}},[s("el-tree",{attrs:{data:t.folders},on:{"node-click":t.handleFolderClick}})],1),t._v(" "),s("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{on:{click:function(e){t.showfolders=!1}}},[t._v("取 消")]),t._v(" "),s("el-button",{attrs:{type:"primary",plain:""},on:{click:t.handleFolderPicked}},[t._v("确 定")])],1)]),t._v(" "),s("el-dialog",{staticClass:"dialog-group",attrs:{title:t.addGroup?"添加组合":"修改组合",visible:t.showgrpdlg,width:"25%","before-close":t.onCloseGrpDlg},on:{"update:visible":function(e){t.showgrpdlg=e}}},[s("el-row",[s("el-col",{attrs:{span:6}},[s("a",[t._v("组合ID：")])]),t._v(" "),s("el-col",{attrs:{span:18}},[s("el-input",{attrs:{size:"mini",disabled:!t.editGroup},model:{value:t.copyGroup.id,callback:function(e){t.$set(t.copyGroup,"id",e)},expression:"copyGroup.id"}})],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:6}},[s("a",[t._v("组合名称：")])]),t._v(" "),s("el-col",{attrs:{span:18}},[s("el-input",{attrs:{size:"mini",disabled:!t.editGroup},model:{value:t.copyGroup.name,callback:function(e){t.$set(t.copyGroup,"name",e)},expression:"copyGroup.name"}})],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:6}},[s("a",[t._v("组合路径：")])]),t._v(" "),s("el-col",{attrs:{span:18}},[s("el-input",{attrs:{size:"mini",disabled:!t.editGroup},model:{value:t.copyGroup.path,callback:function(e){t.$set(t.copyGroup,"path",e)},expression:"copyGroup.path"}},[s("el-tooltip",{attrs:{slot:"append",effect:"dark",content:"选择组合所在的目录",placement:"top"},slot:"append"},[s("el-button",{attrs:{icon:"el-icon-folder",disabled:!t.editGroup},on:{click:t.handlePickFolder}})],1)],1)],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:6}},[s("a",[t._v("组合类型：")])]),t._v(" "),s("el-col",{attrs:{span:18}},[s("el-radio",{attrs:{label:"cta",disabled:!t.editGroup},model:{value:t.copyGroup.gtype,callback:function(e){t.$set(t.copyGroup,"gtype",e)},expression:"copyGroup.gtype"}},[t._v("CTA组合")]),t._v(" "),s("el-radio",{attrs:{label:"hft",disabled:!t.editGroup},model:{value:t.copyGroup.gtype,callback:function(e){t.$set(t.copyGroup,"gtype",e)},expression:"copyGroup.gtype"}},[t._v("HFT组合")]),t._v(" "),s("el-radio",{attrs:{label:"sel",disabled:!t.editGroup},model:{value:t.copyGroup.gtype,callback:function(e){t.$set(t.copyGroup,"gtype",e)},expression:"copyGroup.gtype"}},[t._v("SEL组合")])],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:6}},[s("a",[t._v("数据模式：")])]),t._v(" "),s("el-col",{attrs:{span:18}},[s("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"组合会自动向监控服务推送数据",placement:"top"}},[s("el-radio",{attrs:{label:"auto",disabled:!t.editGroup},model:{value:t.copyGroup.datmod,callback:function(e){t.$set(t.copyGroup,"datmod",e)},expression:"copyGroup.datmod"}},[t._v("自动")])],1),t._v(" "),s("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"监控服务只在有请求的时候去读取数据",placement:"top"}},[s("el-radio",{attrs:{label:"mannual",disabled:!t.editGroup},model:{value:t.copyGroup.datmod,callback:function(e){t.$set(t.copyGroup,"datmod",e)},expression:"copyGroup.datmod"}},[t._v("手动")])],1)],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:6}},[s("a",[t._v("消息地址：")])]),t._v(" "),s("el-col",{attrs:{span:18}},[s("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"消息订阅地址要和配置文件中的notifier一致",placement:"top"}},[s("el-input",{attrs:{size:"mini",disabled:!t.editGroup||"auto"!=t.copyGroup.datmod,placeholder:"请输入消息队列的订阅地址"},model:{value:t.copyGroup.mqurl,callback:function(e){t.$set(t.copyGroup,"mqurl",e)},expression:"copyGroup.mqurl"}})],1)],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:6}},[s("a",[t._v("组合环境：")])]),t._v(" "),s("el-col",{attrs:{span:18}},[s("el-radio",{attrs:{label:"product",disabled:!t.editGroup},model:{value:t.copyGroup.env,callback:function(e){t.$set(t.copyGroup,"env",e)},expression:"copyGroup.env"}},[t._v("生产环境")]),t._v(" "),s("el-radio",{attrs:{label:"backtest",disabled:!t.editGroup},model:{value:t.copyGroup.env,callback:function(e){t.$set(t.copyGroup,"env",e)},expression:"copyGroup.env"}},[t._v("回测环境")])],1)],1),t._v(" "),s("el-row",{staticStyle:{height:"60px"}},[s("el-col",{attrs:{span:6}},[s("a",[t._v("组合介绍：")])]),t._v(" "),s("el-col",{attrs:{span:18}},[s("el-input",{staticStyle:{"min-height":"80px"},attrs:{type:"textarea",disabled:!t.editGroup},model:{value:t.copyGroup.info,callback:function(e){t.$set(t.copyGroup,"info",e)},expression:"copyGroup.info"}})],1)],1),t._v(" "),s("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{directives:[{name:"show",rawName:"v-show",value:!t.addGroup&&!t.editGroup,expression:"!addGroup && !editGroup"}],attrs:{type:"primary",plain:"",size:"mini",icon:"el-icon-edit"},on:{click:function(e){t.editGroup=!0}}},[t._v("编辑")]),t._v(" "),s("el-button",{attrs:{type:"primary",plain:"",size:"mini",icon:"el-icon-thumb"},on:{click:function(e){return t.onCommitGroup()}}},[t._v("提交")])],1)],1),t._v(" "),s("el-dialog",{attrs:{title:"选择目录",visible:t.showfolders,width:"25%"},on:{"update:visible":function(e){t.showfolders=e}}},[s("div",{staticStyle:{width:"100%",height:"300px",overflow:"auto",border:"1px solid #E4E7ED"}},[s("el-tree",{attrs:{data:t.folders},on:{"node-click":t.handleFolderClick}})],1),t._v(" "),s("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{attrs:{size:"mini"},on:{click:function(e){t.showfolders=!1}}},[t._v("取 消")]),t._v(" "),s("el-button",{attrs:{type:"primary",plain:"",size:"mini"},on:{click:t.handleFolderPicked}},[t._v("确 定")])],1)])],1)},staticRenderFns:[]};var L=s("VU/8")(U,z,!1,function(t){s("nZf+")},"data-v-6717c4fd",null).exports,j={render:function(){this.$createElement;this._self._c;return this._m(0)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"loginBox"},[e("div",{staticClass:"login"},[this._v("\n        在线部署功能建设中，敬请期待\n    ")])])}]};var Z=s("VU/8")({name:"Deploy",data:function(){return{}},methods:{},mounted:function(){}},j,!1,function(t){s("DoUX")},"data-v-0cbbd64e",null).exports,R=(s("jQeI"),s("CK2l"),s("c+I8"),s("iHuw"),s("RkhK"),s("LxZp"),{name:"BTComp",props:{btInfo:{type:Object,default:function(){return null}},straInfo:{type:Object,default:function(){return null}}},watch:{btInfo:function(t,e){var s=this;null!=t&&(null!=e&&t.id==e.id||setTimeout(function(){s.queryTrades(),s.queryRounds(),s.queryFunds(),s.querySignals()},300))}},data:function(){return{loading:{signal:!1,round:!1,fund:!1,trade:!1},selCat:"summary",signals:[],rounds:[],funds:[],trades:[],kChart:null,tChart:null,bars:[]}},methods:{fmtBtTime:function(t){return(t+="").substr(0,4)+"."+t.substr(4,2)+"."+t.substr(6,2)+" "+t.substr(8,2)+":"+t.substr(10,2)},onCatSel:function(t,e){var s=this;this.selCat!=t.name&&(this.selCat=t.name,"kline"==t.name&&this.kChart?setTimeout(function(){s.kChart.resize()},300):"summary"==t.name&&this.tChart&&setTimeout(function(){s.tChart.resize()},300))},queryBars:function(){var t=this;if(null!=this.btInfo){var e=this.btInfo.state.code,s=this.btInfo.state.stime,a=this.btInfo.state.etime,i=this.btInfo.state.period;this.$api.getBtBars(e,i,s,a,function(e){e.result<0?t.$notify.error("拉取K线出错："+e.message):(t.bars=e.bars,t.paintChart(!1))})}},querySignals:function(){var t=this,e=this.straInfo.id,s=this.btInfo.id;this.loading.signal=!0,this.$api.getBtSignals(e,s,function(e){e.result<0?t.$notify.error("查询信号出错："+e.message):(t.signals=e.signals,t.signals.reverse()),t.loading.signal=!1})},queryTrades:function(){var t=this,e=this.straInfo.id,s=this.btInfo.id;this.loading.trade=!0,this.$api.getBtTrades(e,s,function(e){e.result<0?t.$notify.error("查询成交出错："+e.message):(e.trades.forEach(function(t){var e="";"OPEN"==t.offset?e+="开":e+="平","LONG"==t.direction?e+="多":e+="空",t.action=e}),t.trades=e.trades,t.trades.reverse()),t.loading.trade=!1,setTimeout(function(){t.queryBars()},300)})},queryRounds:function(){var t=this,e=this.straInfo.id,s=this.btInfo.id;this.loading.round=!1,this.$api.getBtRounds(e,s,function(e){e.result<0?t.$notify.error("查询回合出错："+e.message):(t.rounds=e.rounds,t.rounds.reverse()),t.loading.round=!1})},queryFunds:function(){var t=this,e=this.straInfo.id,s=this.btInfo.id;this.loading.fund=!0,this.$api.getBtFunds(e,s,function(e){e.result<0?t.$notify.error("查询绩效出错："+e.message):(t.funds=e.funds,t.funds.reverse(),t.paintTrend()),t.loading.fund=!1})},getTrdSum:function(t){var e=t.columns,s=t.data,a=[];return e.forEach(function(t,e){if(e<3||e>5)a[e]="";else if(3!=e){if(4==e)a[e]=s.length+"笔";else if(5==e){var i=s.map(function(t){return Number(t.volume)});i.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=i.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0)+"手"}}else a[e]="总计"}),a},getSigSum:function(t){var e=t.columns,s=t.data,a=[];return e.forEach(function(t,e){e>1?a[e]="":0!=e?1==e&&(a[e]=s.length+"笔"):a[e]="总计"}),a},getRndSum:function(t){var e=t.columns,s=t.data,a=[];return e.forEach(function(t,e){if(5==e||6==e||7==e||8==e)if(5!=e)if(6!=e){if(7==e){var i=s.map(function(t){return Number(t.qty)});i.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=i.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0)+"手"}else if(8==e){var n=s.map(function(t){return Number(t.profit)});n.every(function(t){return isNaN(t)})?a[e]="N/A":a[e]=n.reduce(function(t,e){var s=Number(e);return isNaN(s)?t:t+e},0).toFixed(1)}}else a[e]=s.length+"笔";else a[e]="总计";else a[e]=""}),a},paintChart:function(t){var e=this.bars||[];t=t||!1;null==this.kChart&&(this.kChart=this.$echarts.init(document.getElementById("bt_kline")));var s=[],a=[];e.forEach(function(e,i){var n=e.date+"";if(n=n.substr(0,4)+"/"+parseInt(n.substr(4,2))+"/"+parseInt(n.substr(6,2)),!t){var o=e.time%1e4+"";3==o.length&&(o="0"+o),n+=" "+o.substr(0,2)+":"+o.substr(2,2)}s.push(n),a.push([e.open,e.close,e.low,e.high])});var i=[],n=[],o="";JSON.parse(g()(this.trades)).reverse().forEach(function(t){var e=t.time+"";e=e.substr(0,4)+"/"+parseInt(e.substr(4,2))+"/"+parseInt(e.substr(6,2))+" "+e.substr(8,2)+":"+e.substr(10,2);var s="开多"==t.action||"平空"==t.action||"OL"==t.action||"CS"==t.action,a="开"==t.action[0]||"O"==t.action[0];if(o==e){var r=i[i.length-1];r.data.volume+=t.volume,r.data.flag+=a?1:2}else i.push({value:[e,t.price],symbol:"triangle",symbolRotate:s?0:180,symbolOffset:[0,s?"50%":"-50%"],itemStyle:{color:s?"#f00":"#0f0"},data:{isBuy:s,volume:t.volume,price:t.price,flag:a?1:2}});var l=i[i.length-1],c=i[i.length-2];if(l.data.flag>=2){var u=(l.data.price-c.data.price)*(s?-1:1)>=0;n.push({source:i.length-2,target:i.length-1,lineStyle:{color:u?"#f00":"#0f0",type:"solid",width:1}})}o=e});var r={title:{text:this.btInfo.state.code+" "+this.btInfo.state.period},toolbox:{show:!0,orient:"horizontal",feature:{saveAsImage:{},restore:{}}},tooltip:{trigger:"axis",axisPointer:{type:"cross"},formatter:function(t){t.sort(function(t,e){return t.seriesIndex-e.seriesIndex});var e,s=t[0].axisValue,a=t[0].data,i=s+"<br/><br/>";if(i+=t[0].marker+"开: "+a[1].toFixed(2)+"<br/>",i+=t[0].marker+"高: "+a[4].toFixed(2)+"<br/>",i+=t[0].marker+"低: "+a[3].toFixed(2)+"<br/>",i+=t[0].marker+"收: "+a[2].toFixed(2)+"<br/>",t.length>1){var n=t[1].data.data,o=(e=n).isBuy?3==e.flag?"翻多: +":2==e.flag?"平空: +":"开多: +":3==e.flag?"翻空: -":2==e.flag?"平多: -":"开空: -";i+=t[1].marker+o+n.volume+"@"+n.price+"<br/>"}return i}},axisPointer:{link:{xAxisIndex:"all"},label:{backgroundColor:"#777"}},grid:{left:"4%",right:"4%",bottom:"10%"},xAxis:{type:"category",data:s,scale:!0,boundaryGap:!0,axisLine:{onZero:!1},splitLine:{show:!1},splitNumber:20,min:"dataMin",max:"dataMax"},yAxis:{scale:!0,splitArea:{show:!0}},dataZoom:[{type:"inside",start:90,end:100},{show:!0,type:"slider",y:"95%",start:90,end:100}],series:[{name:"K线",type:"candlestick",data:a,yAxisIndex:"0",itemStyle:{normal:{color:"#ec0000",color0:"#00da3c",borderColor:"#8A0000",borderColor0:"#008F28"}},markLine:{symbol:["none","none"],data:[{name:"min line on close",type:"min",valueDim:"close"},{name:"max line on close",type:"max",valueDim:"close"}]}},{type:"graph",layout:"none",coordinateSystem:"cartesian2d",data:i,links:n,symbolSize:20,zlevel:9}]};this.kChart.setOption(r)},fmtDate:function(t){var e=t+"";return e.substr(0,4)+"."+e.substr(4,2)+"."+e.substr(6,2)},fmtProfit:function(t){return t>0?"text-danger":t<0?"text-success":""},fmtTime:function(t,e){if(e=e||!1){var s=t+"";return s.substr(2,2)+"."+s.substr(4,2)+"."+s.substr(6,2)+" "+s.substr(8,2)+":"+s.substr(10,2)+":"+s.substr(12,2)+","+s.substr(14,3)}var a=t+"";return a.substr(2,2)+"."+a.substr(4,2)+"."+a.substr(6,2)+" "+a.substr(8,2)+":"+a.substr(10,2)},formatAmount:function(t,e){return t[e.property].toFixed(2)},fmtPrice:function(t){for(var e=t.toFixed(4),s=0;s<e.length&&"0"==e[e.length-1-s];s++);"."==e[e.length-1-s]&&s++;var a=e.length-s;return e.substr(0,a)},paintTrend:function(){null==this.tChart&&(this.tChart=this.$echarts.init(document.getElementById("bt_fund")));for(var t={title:{text:"净值走势"},tooltip:{trigger:"axis",axisPointer:{label:{backgroundColor:"#6a7985",formatter:function(t){var e=t.value+"";return e.substr(0,4)+"."+e.substr(4,2)+"."+e.substr(6,2)}}},formatter:function(t){if(0==t.length)return"收益曲线";var e=t[0].axisValueLabel;for(var s in t)"净值"==t[s].seriesName?e+="<br/>净值: "+t[s].value.toFixed(4):e+="<br/>"+t[s].seriesName+": "+t[s].value;return e}},grid:{top:42,left:"8",right:"8",bottom:"8",containLabel:!0},xAxis:{type:"category",data:[],boundaryGap:!1,axisLabel:{textStyle:{color:"#000"},formatter:function(t,e){return(t+="").substr(0,4)+"."+t.substr(4,2)+"."+t.substr(6,2)}},axisLine:{lineStyle:{color:"#000"}}},yAxis:[{type:"value",axisLabel:{textStyle:{color:"#000"},formatter:function(t,e){return t.toFixed(4)}},axisLine:{lineStyle:{color:"#000"}},scale:!0}],series:[{name:"净值",type:"line",stack:"净值",areaStyle:{normal:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(102,156,214,0.5)"},{offset:1,color:"rgba(242,242,242,0.3)"}],globalCoord:!1}}},data:[],lineStyle:{normal:{color:"rgb(102,156,214)",width:2}},itemStyle:{normal:{color:"rgb(102,156,214)",borderWidth:1}}}]},e=[],s=[],a=parseInt(this.btInfo.capital),i=this.funds.length-1;i>=0;i--){var n=this.funds[i];e.push(n.date);var o=a+n.dynbalance;s.push(o/a)}var r=Math.max.apply(null,s),l=Math.min.apply(null,s);if(r==l)r*=1.05,l*=.95;else{var c=r-l;r+=.05*c,l=Math.max(0,l-.05*c)}t.xAxis.data=e,t.series[0].data=s,t.yAxis[0].max=r,t.yAxis[0].min=l,this.tChart.setOption(t)},getClass:function(t){return t>=0?"text-danger":"text-success"}},mounted:function(){window.onresize=function(){var t=this;t.zooming||(t.zooming=!0,setTimeout(function(){t.kChart&&t.kChart.resize(),t.tChart&&t.tChart.resize(),t.zooming=!1},300))}}}),V={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticStyle:{height:"100%",width:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"0 44px"}},[s("el-tabs",{staticStyle:{height:"100%",margin:"0"},attrs:{value:t.selCat,"tab-position":"top"},on:{"tab-click":t.onCatSel}},[s("el-tab-pane",{attrs:{label:"绩效概览",name:"summary"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"信号分析",name:"kline"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"成交明细",name:"trd"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"信号明细",name:"sig"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"回合明细",name:"rnd"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"每日绩效",name:"fnd"}})],1)],1),t._v(" "),s("div",{staticStyle:{flex:"1",overflow:"auto",width:"100%"}},[s("div",{directives:[{name:"show",rawName:"v-show",value:"kline"==t.selCat,expression:"selCat=='kline'"}],staticStyle:{height:"100%",width:"100%",overflow:"auto"}},[t._m(0)]),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:"summary"==t.selCat,expression:"selCat=='summary'"}],staticStyle:{height:"100%",width:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"0 200px",width:"100%"}},[s("el-row",[s("el-col",{attrs:{span:4}},[s("div",{staticClass:"panel"},[s("p",{staticClass:"panel-tag"},[t._v("回测天数")]),t._v(" "),s("p",{staticClass:"panel-val text-info"},[t._v(t._s(t.btInfo?t.btInfo.perform.days:0)+"天")])])]),t._v(" "),s("el-col",{attrs:{span:4}},[s("div",{staticClass:"panel"},[s("p",{staticClass:"panel-tag"},[t._v("开始时间")]),t._v(" "),s("p",{staticClass:"panel-val text-info"},[t._v(t._s(t.btInfo?t.fmtBtTime(t.btInfo.state.stime):"-"))])])]),t._v(" "),s("el-col",{attrs:{span:4}},[s("div",{staticClass:"panel"},[s("p",{staticClass:"panel-tag"},[t._v("结束时间")]),t._v(" "),s("p",{staticClass:"panel-val text-info"},[t._v(t._s(t.btInfo?t.fmtBtTime(t.btInfo.state.etime):"-"))])])]),t._v(" "),s("el-col",{attrs:{span:4}},[s("div",{staticClass:"panel"},[s("p",{staticClass:"panel-tag"},[t._v("初始资金")]),t._v(" "),s("p",{staticClass:"panel-val text-info"},[t._v(t._s(t.btInfo?t.btInfo.capital.toFixed(1):0))])])]),t._v(" "),s("el-col",{attrs:{span:4}},[s("div",{staticClass:"panel"},[s("p",{staticClass:"panel-tag"},[t._v("总收益率")]),t._v(" "),s("p",{staticClass:"panel-val",class:t.getClass(t.btInfo?t.btInfo.perform.total_return:0)},[t._v(t._s(t.btInfo?t.btInfo.perform.total_return.toFixed(2):"0.00")+"%")])])]),t._v(" "),s("el-col",{attrs:{span:4}},[s("div",{staticClass:"panel"},[s("p",{staticClass:"panel-tag"},[t._v("胜率")]),t._v(" "),s("p",{staticClass:"panel-val text-danger"},[t._v(t._s(t.btInfo?t.btInfo.perform.win_rate.toFixed(2):"0.00")+"%")])])])],1),t._v(" "),s("div",{staticClass:"divider"}),t._v(" "),s("el-row",[s("el-col",{attrs:{span:4}},[s("div",{staticClass:"panel"},[s("p",{staticClass:"panel-tag"},[t._v("年化收益率")]),t._v(" "),s("p",{staticClass:"panel-val",class:t.getClass(t.btInfo?t.btInfo.perform.annual_return:0)},[t._v(t._s(t.btInfo?t.btInfo.perform.annual_return.toFixed(2):"0.00")+"%")])])]),t._v(" "),s("el-col",{attrs:{span:4}},[s("div",{staticClass:"panel"},[s("p",{staticClass:"panel-tag"},[t._v("最大回撤")]),t._v(" "),s("p",{staticClass:"panel-val text-success"},[t._v(t._s(t.btInfo?t.btInfo.perform.max_falldown.toFixed(2):"0.00")+"%")])])]),t._v(" "),s("el-col",{attrs:{span:4}},[s("div",{staticClass:"panel"},[s("p",{staticClass:"panel-tag"},[t._v("最大盈利")]),t._v(" "),s("p",{staticClass:"panel-val text-danger"},[t._v(t._s(t.btInfo?t.btInfo.perform.max_profratio.toFixed(2):"0.00")+"%")])])]),t._v(" "),s("el-col",{attrs:{span:4}},[s("div",{staticClass:"panel"},[s("p",{staticClass:"panel-tag"},[t._v("夏普率")]),t._v(" "),s("p",{staticClass:"panel-val text-info"},[t._v(t._s(t.btInfo?t.btInfo.perform.sharpe_ratio.toFixed(2):"0.00"))])])]),t._v(" "),s("el-col",{attrs:{span:4}},[s("div",{staticClass:"panel"},[s("p",{staticClass:"panel-tag"},[t._v("索提诺比率")]),t._v(" "),s("p",{staticClass:"panel-val text-info"},[t._v(t._s(t.btInfo?t.btInfo.perform.sortino_ratio.toFixed(2):"0.00"))])])]),t._v(" "),s("el-col",{attrs:{span:4}},[s("div",{staticClass:"panel"},[s("p",{staticClass:"panel-tag"},[t._v("卡尔玛比率")]),t._v(" "),s("p",{staticClass:"panel-val text-info"},[t._v(t._s(t.btInfo?t.btInfo.perform.calmar_ratio.toFixed(2):"0.00"))])])])],1)],1),t._v(" "),s("div",{staticClass:"divider"}),t._v(" "),t._m(1)]),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:"sig"==t.selCat,expression:"selCat=='sig'"},{name:"loading",rawName:"v-loading",value:t.loading.signal,expression:"loading.signal"}],staticStyle:{"max-height":"100%",overflow:"auto"}},[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"",data:t.signals}},[s("el-table-column",{attrs:{prop:"code",label:"品种",width:"120",sortable:""}}),t._v(" "),s("el-table-column",{attrs:{prop:"target",label:"目标数量",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:t.fmtProfit(e.row.target)},[t._v(t._s(e.row.target))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"触发价格",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtPrice(e.row.sigprice)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"触发时间",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtTime(e.row.gentime,!0)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"tag",label:"标记",sortable:"",width:"180"}})],1)],1),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:"rnd"==t.selCat,expression:"selCat=='rnd'"},{name:"loading",rawName:"v-loading",value:t.loading.round,expression:"loading.round"}],staticStyle:{"max-height":"100%",overflow:"auto"}},[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"",data:t.rounds}},[s("el-table-column",{attrs:{prop:"code",label:"品种",width:"120",sortable:""}}),t._v(" "),s("el-table-column",{attrs:{label:"方向",width:"64"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:"LONG"==e.row.direct?"text-danger":"text-success"},[t._v(t._s("LONG"==e.row.direct?"多":"空"))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"开仓时间",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtTime(e.row.opentime)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"开仓价格",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtPrice(e.row.openprice)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"平仓时间",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtTime(e.row.closetime)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"平仓价格",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtPrice(e.row.closeprice)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"qty",label:"数量",width:"64"}}),t._v(" "),s("el-table-column",{attrs:{label:"盈亏",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.profit>=0?"text-danger":"text-success"},[t._v(t._s(e.row.profit.toFixed(1)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"潜在盈利",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{staticClass:"text-danger"},[t._v(t._s(e.row.maxprofit.toFixed(1)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"潜在亏损",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{staticClass:"text-success"},[t._v(t._s(e.row.maxloss.toFixed(1)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"entertag",label:"进场标记",width:"100"}}),t._v(" "),s("el-table-column",{attrs:{prop:"exittag",label:"出场标记",width:"100"}})],1)],1),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:"fnd"==t.selCat,expression:"selCat=='fnd'"},{name:"loading",rawName:"v-loading",value:t.loading.fund,expression:"loading.fund"}],staticStyle:{"max-height":"100%",overflow:"auto"}},[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"",data:t.funds}},[s("el-table-column",{attrs:{label:"日期",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtDate(e.row.date)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"平仓盈亏",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.closeprofit>=0?"text-danger":"text-success"},[t._v(t._s(e.row.closeprofit.toFixed(1)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"浮动盈亏",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.dynprofit>=0?"text-danger":"text-success"},[t._v(t._s(e.row.dynprofit.toFixed(1)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"fee",label:"手续费",width:"120"}}),t._v(" "),s("el-table-column",{attrs:{prop:"dynbalance",label:"动态权益",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.dynbalance>=0?"text-danger":"text-success"},[t._v(t._s(e.row.dynbalance.toFixed(1)))])]}}])})],1)],1),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:"trd"==t.selCat,expression:"selCat=='trd'"},{name:"loading",rawName:"v-loading",value:t.loading.trade,expression:"loading.trade"}],staticStyle:{"max-height":"100%",overflow:"auto"}},[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"",data:t.trades,"summary-method":t.getTrdSum,"show-summary":""}},[s("el-table-column",{attrs:{prop:"code",label:"品种",width:"120",sortable:""}}),t._v(" "),s("el-table-column",{attrs:{label:"时间",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtTime(e.row.time)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"动作",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:"开多"==e.row.action||"平空"==e.row.action?"text-danger":"text-success"},[t._v(t._s(e.row.action))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"价格",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtPrice(e.row.price)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"volume",label:"数量",width:"80"}}),t._v(" "),s("el-table-column",{attrs:{prop:"tag",label:"标记",sortable:""}})],1)],1)])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticStyle:{height:"100%",width:"100%"},attrs:{id:"bt_kline"}},[e("p",[this._v("这里绘制K线和信号列表")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticStyle:{flex:"1",width:"100%"}},[e("div",{staticStyle:{height:"100%",width:"100%"}},[e("div",{staticStyle:{height:"100%",width:"100%"},attrs:{id:"bt_fund"}},[e("p",[this._v("这里绘制每日收益曲线")])])])])}]};var Y=s("VU/8")(R,V,!1,function(t){s("JgyK")},"data-v-64b19f62",null).exports,J={name:"Backtest",components:{codemirror:T.codemirror,BTComp:Y},data:function(){var t=this;return{btConfig:{startTime:(new Date).addDays(-92),endTime:new Date,capital:5e5,slippage:0},pickerOption:{format:"yyyy-MM-dd HH:mm"},selData:"editor",strategies:[],strasOnWay:!1,showBTCfg:!1,curStra:null,curBT:null,backtests:[],edit:!1,content:"",content_bak:"",cmOptions:{mode:"python",keyMap:"sublime",lineNumbers:!0,smartIndent:!0,indentUnit:4,indentWithTabs:!1,lineWrapping:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter","CodeMirror-lint-markers"],foldGutter:!0,autofocus:!0,matchBrackets:!0,autoCloseBrackets:!0,styleActiveLine:!0,extraKeys:{"Ctrl-S":function(){t.onSaveCode()}}}}},methods:{fmtTime:function(t){return(t+="").substr(0,4)+"."+t.substr(4,2)+"."+t.substr(6,2)+" "+t.substr(8,2)+":"+t.substr(10,2)},onDelBacktest:function(t){var e=this;100==t.progress?this.$confirm("确定要删除该回测记录吗","删除回测",{confirmButtonText:"确定",cancelButtonText:"取消"}).then(function(){e.$api.delBacktest(t.id,function(s){if(s.result<0)e.$message.error("回测任务删除失败:"+s.message);else{e.$message({message:"回测任务删除成功",type:"success"});for(var a=0;a<e.backtests.length;a++)if(e.backtests[a].id==t.id){e.backtests.splice(a,1);break}}})}).catch(function(){}):this.$message({message:"回测任务尚未结束，无法删除",type:"danger"})},onViewBacktest:function(t){this.curBT=t,this.selData="backtest"},onAddStrategy:function(){var t=this;this.$prompt("请输入策略名称","新建策略",{confirmButtonText:"确定",cancelButtonText:"取消"}).then(function(e){t.$api.addBtStrategy(e.value,function(e){e.result<0?t.$message.error("新建策略失败:"+e.message):t.strategies.push(e.strategy)})}).catch(function(){})},onRunBacktest:function(t){var e=this;this.$confirm("确定要启动回测任务吗","启动回测",{confirmButtonText:"确定",cancelButtonText:"取消"}).then(function(){var t=e.curStra.id,s=e.btConfig.startTime.format("yyyyMMdd"),a=e.btConfig.endTime.format("yyyyMMdd"),i=e.btConfig.capital,n=e.btConfig.slippage;e.$api.runBacktest(t,s,a,i,n,function(t){t.result<0?e.$message.error("回测任务启动失败:"+t.message):(e.$message({message:"回测任务启动成功",type:"success"}),e.backtests.push(t.backtest)),e.showBTCfg=!1})}).catch(function(){})},onSaveCode:function(t){var e=this;null!=this.curStra&&this.content!=this.content_bak&&this.$api.commitBtStraCode(this.curStra.id,this.content,function(t){t.result<0?e.$message.error("策略代码提交失败:"+t.message):(e.$message({message:"策略代码保存成功",type:"success"}),e.content_bak=e.content)})},onDelStrategy:function(t){var e=this;this.$confirm("确定要删除该策略吗","删除策略",{confirmButtonText:"确定",cancelButtonText:"取消"}).then(function(s){e.$api.delBtStrategy(t,function(t){t.result<0?e.$message.error("删除策略失败:"+t.message):(e.$message.success("删除策略成功"),e.refreshStras())})}).catch(function(){})},onRefreshStrategy:function(){this.refreshStras()},onOpenStrategy:function(t){var e=this;this.curStra=t,this.$api.getBtStraCode(t.id,function(t){t.result<0?e.$message.error("拉取策略代码失败:"+t.message):(e.content_bak=t.content,e.content=t.content)}),this.$api.getBacktests(t.id,function(t){t.result<0?e.$message.error("拉取策略回测记录失败:"+t.message):e.backtests=t.backtests})},handleClickTab:function(t,e){this.selData=t.name},onClickCancel:function(){var t=this;this.content!=this.content_bak?this.$confirm("内容已被修改，确定要放弃修改吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.content=t.content_bak,t.cmOptions.readOnly=!0,t.edit=!1}).catch(function(){}):(this.content=this.content_bak,this.cmOptions.readOnly=!0,this.edit=!1)},onClickCommit:function(){var t=this;null!=this.curStra&&this.content!=this.content_bak&&(this.loading=!0,this.$api.commitBtStraCode(this.curStra.id,this.content,function(e){e.result<0?t.$message.error("策略代码提交失败:"+e.message):t.$message({message:"策略代码提交成功",type:"success"}),t.edit=!1,t.cmOptions.readOnly=!0,t.loading=!1}))},refreshStras:function(){var t=this;this.strasOnWay=!0,this.$api.getBtStrategies(function(e){e.result<0?t.$message.error("拉取策略列表失败:"+e.message):t.strategies=e.strategies,t.strasOnWay=!1})}},mounted:function(){var t=this;this.$nextTick(function(){setTimeout(function(){t.refreshStras()},300)})}},Q={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticStyle:{height:"100%",width:"100%"}},[s("div",{staticStyle:{height:"100%",display:"flex","flex-direction":"row"}},[s("div",{staticStyle:{height:"100%",flex:"0 320px"}},[s("div",{staticStyle:{display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"0 40px",display:"flex","flex-direction":"row"}},[t._m(0),t._v(" "),s("div",{staticStyle:{flex:"1","border-bottom":"1px solid #E4E7ED","margin-top":"10px","margin-right":"6px"}},[s("el-tooltip",{staticStyle:{float:"right"},attrs:{placement:"top"}},[s("div",{attrs:{slot:"content"},slot:"content"},[t._v("刷新列表")]),t._v(" "),s("i",{staticClass:"el-icon-refresh button",staticStyle:{float:"right"},on:{click:t.onRefreshStrategy}})]),t._v(" "),s("el-tooltip",{staticStyle:{float:"right"},attrs:{placement:"top"}},[s("div",{attrs:{slot:"content"},slot:"content"},[t._v("新建策略")]),t._v(" "),s("i",{staticClass:"el-icon-plus button",staticStyle:{float:"right"},on:{click:t.onAddStrategy}})])],1)]),t._v(" "),s("div",{staticStyle:{flex:"1 1"}},[s("div",{directives:[{name:"loading",rawName:"v-loading",value:t.strasOnWay,expression:"strasOnWay"}],staticClass:"stra-list",staticStyle:{overflow:"auto"}},t._l(t.strategies,function(e,a){return s("div",{key:a,staticClass:"stra-item"},[s("el-row",{staticClass:"stra-line"},[s("i",{staticClass:"el-icon-cpu"}),t._v(" "),s("span",{staticClass:"stra-title"},[t._v(t._s(e.name))]),t._v(" "),s("el-tooltip",{staticStyle:{float:"right"},attrs:{placement:"top"}},[s("div",{attrs:{slot:"content"},slot:"content"},[t._v("删除策略")]),t._v(" "),s("i",{staticClass:"el-icon-delete button",staticStyle:{float:"right"},on:{click:function(s){return t.onDelStrategy(e.id)}}})]),t._v(" "),s("el-tooltip",{staticStyle:{float:"right"},attrs:{placement:"top"}},[s("div",{attrs:{slot:"content"},slot:"content"},[t._v("查看策略")]),t._v(" "),s("i",{staticClass:"el-icon-view button",staticStyle:{float:"right"},on:{click:function(s){return t.onOpenStrategy(e)}}})])],1),t._v(" "),s("el-row",{staticClass:"stra-line"},[s("el-col",{attrs:{span:12}},[s("span",{staticClass:"stra-label"},[t._v("年化：")]),t._v(" "),s("span",{staticClass:"stra-return"},[t._v(t._s(e.perform.annual_return.toFixed(2))+"%")])]),t._v(" "),s("el-col",{attrs:{span:12}},[s("span",{staticClass:"stra-label"},[t._v("最大回撤：")]),t._v(" "),s("span",{staticClass:"stra-mdd"},[t._v(t._s(e.perform.max_falldown.toFixed(2))+"%")])])],1)],1)}),0)])])]),t._v(" "),s("div",{staticStyle:{height:"100%","border-left":"1px solid #E4E7ED",flex:"1 0"}},[s("div",{staticStyle:{height:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"0 44px",margin:"2px 4px 0px 4px"}},[s("el-tabs",{staticStyle:{height:"100%"},attrs:{value:t.selData,type:"card"},on:{"tab-click":t.handleClickTab}},[s("el-tab-pane",{attrs:{label:"策略查看",name:"editor"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"回测详情",name:"backtest"}})],1)],1),t._v(" "),s("div",{staticStyle:{flex:"1",overflow:"auto",margin:"4px"}},[s("div",{directives:[{name:"show",rawName:"v-show",value:"editor"==t.selData,expression:"selData=='editor'"}],staticStyle:{height:"100%",width:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"2",width:"100%",overflow:"auto"}},[s("div",{staticStyle:{height:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"0"}},[s("span",{staticStyle:{color:"gray"}},[t._v("快捷操作：")]),t._v(" "),s("el-tooltip",{attrs:{placement:"top"}},[s("div",{attrs:{slot:"content"},slot:"content"},[t._v("提交代码")]),t._v(" "),s("i",{staticClass:"el-icon-upload2 toolbar",on:{click:function(e){return t.onClickCommit()}}})]),t._v(" "),s("el-tooltip",{attrs:{placement:"top"}},[s("div",{attrs:{slot:"content"},slot:"content"},[t._v("放弃修改")]),t._v(" "),s("i",{staticClass:"el-icon-refresh-left toolbar",on:{click:function(e){return t.onClickCancel()}}})]),t._v(" "),s("el-tooltip",{attrs:{placement:"top"}},[s("div",{attrs:{slot:"content"},slot:"content"},[t._v("启动回测")]),t._v(" "),s("i",{staticClass:"el-icon-video-play toolbar",on:{click:function(e){t.showBTCfg=!0}}})]),t._v(" "),s("span",{staticStyle:{color:"gray",float:"right"}},[t._v("当前策略:"+t._s(t.curStra?t.curStra.name:""))])],1),t._v(" "),s("div",{staticStyle:{flex:"1",overflow:"auto",margin:"20px",border:"1px solid #DCDFE6","border-radius":"2px"}},[s("div",{staticStyle:{height:"100%"}},[s("div",{staticStyle:{height:"100%"}},[s("codemirror",{ref:"mycode",staticStyle:{height:"100% !important"},attrs:{options:t.cmOptions},model:{value:t.content,callback:function(e){t.content=e},expression:"content"}})],1)])])])]),t._v(" "),s("div",{staticClass:"divider"}),t._v(" "),s("div",{staticStyle:{flex:"1",overflow:"auto"}},[s("div",{staticStyle:{"max-height":"100%",overflow:"auto"}},[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"",data:t.backtests}},[s("el-table-column",{attrs:{prop:"runtime",label:"回测时间",width:"150"}}),t._v(" "),s("el-table-column",{attrs:{label:"开始时间",width:"140"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtTime(e.row.state.stime)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"结束时间",width:"140"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.fmtTime(e.row.state.etime)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"累计收益率%",width:"110"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(e.row.perform.total_return.toFixed(2)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"年化收益率%",width:"110"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(e.row.perform.annual_return.toFixed(2)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"最大回撤%",width:"90"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(e.row.perform.max_falldown.toFixed(2)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"夏普率",width:"72"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(e.row.perform.sharpe_ratio.toFixed(2)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"卡尔玛比率",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(e.row.perform.calmar_ratio.toFixed(2)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"回测进度"},scopedSlots:t._u([{key:"default",fn:function(t){return[s("el-progress",{attrs:{percentage:t.row.state.progress,color:"#409eff"}})]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"耗时s",width:"60"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s((e.row.state.elapse/1e9).toFixed(2)))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"操作",width:"60"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("el-tooltip",{attrs:{placement:"top"}},[s("div",{attrs:{slot:"content"},slot:"content"},[t._v("删除该回测记录")]),t._v(" "),s("i",{staticClass:"el-icon-delete btopt-btn",on:{click:function(s){return t.onDelBacktest(e.row)}}})]),t._v(" "),s("el-tooltip",{attrs:{placement:"top"}},[s("div",{attrs:{slot:"content"},slot:"content"},[t._v("查看回测详情")]),t._v(" "),s("i",{staticClass:"el-icon-view btopt-btn",on:{click:function(s){return t.onViewBacktest(e.row)}}})])]}}])})],1)],1)])]),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:"backtest"==t.selData,expression:"selData=='backtest'"}],staticStyle:{height:"100%",width:"100%"}},[s("BTComp",{staticStyle:{height:"100%"},attrs:{btInfo:t.curBT,straInfo:t.curStra}})],1)])])])]),t._v(" "),s("el-dialog",{attrs:{title:"回测配置",visible:t.showBTCfg,width:"300px"},on:{"update:visible":function(e){t.showBTCfg=e}}},[s("el-row",{staticStyle:{margin:"8px 0"}},[s("el-col",{attrs:{span:8}},[s("span",[t._v("开始时间：")])]),t._v(" "),s("el-col",{attrs:{span:16}},[s("el-date-picker",{staticStyle:{width:"100%"},attrs:{size:"mini",type:"date",format:"yyyy-MM-dd",placeholder:"选择开始时间"},model:{value:t.btConfig.startTime,callback:function(e){t.$set(t.btConfig,"startTime",e)},expression:"btConfig.startTime"}})],1)],1),t._v(" "),s("el-row",{staticStyle:{margin:"8px 0"}},[s("el-col",{attrs:{span:8}},[s("span",[t._v("结束时间：")])]),t._v(" "),s("el-col",{attrs:{span:16}},[s("el-date-picker",{staticStyle:{width:"100%"},attrs:{size:"mini",type:"date",format:"yyyy-MM-dd",placeholder:"选择结束时间"},model:{value:t.btConfig.endTime,callback:function(e){t.$set(t.btConfig,"endTime",e)},expression:"btConfig.endTime"}})],1)],1),t._v(" "),s("el-row",{staticStyle:{margin:"8px 0"}},[s("el-col",{attrs:{span:8}},[s("span",[t._v("初始资金：")])]),t._v(" "),s("el-col",{attrs:{span:16}},[s("el-input-number",{staticStyle:{width:"100%"},attrs:{size:"mini",min:1e5,max:2e6,step:1e4,label:"初始资金"},model:{value:t.btConfig.capital,callback:function(e){t.$set(t.btConfig,"capital",e)},expression:"btConfig.capital"}})],1)],1),t._v(" "),s("el-row",{staticStyle:{margin:"8px 0"}},[s("el-col",{attrs:{span:8}},[s("span",[t._v("价格滑点：")])]),t._v(" "),s("el-col",{attrs:{span:16}},[s("el-input-number",{staticStyle:{width:"100%"},attrs:{size:"mini",min:0,max:20,label:"价格滑点"},model:{value:t.btConfig.slippage,callback:function(e){t.$set(t.btConfig,"slippage",e)},expression:"btConfig.slippage"}})],1)],1),t._v(" "),s("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{attrs:{type:"danger",size:"mini",plain:""},on:{click:t.onRunBacktest}},[t._v("启动")])],1)],1)],1)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"simtab",staticStyle:{flex:"0"}},[e("span",[this._v("我的策略")])])}]};var W=s("VU/8")(J,Q,!1,function(t){s("iP0y"),s("Cb2R")},"data-v-081057d1",null).exports,H=s("fZjL"),K=s.n(H),X={name:"Schedule",components:{MoniforCfg:P},data:function(){return{selCat:"list",showfolders:!1,selfolder:"",loading:!1,committing:!1,addApp:!1,monitors:[],logs:"",logLines:0,logOnway:!1,curMonCfg:{id:"",folder:"",path:"",param:"",type:0,span:3,guard:!1,redirect:!1,schedule:{active:!1,weekflag:"0111110",weekmask:[!1,!0,!0,!0,!0,!0,!1],tasks:[{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0}]}}}},methods:{handleClickTab:function(t,e){this.selCat=t.name,"logs"==t.name&&this.queryLogs()},onCfgUpdated:function(){this.queryData()},handleSelectApp:function(t){console.log(t);var e=JSON.parse(g()(t));e.schedule.weekmask=[];for(var s=0;s<e.schedule.weekflag.length;s++)e.schedule.weekmask.push("1"==e.schedule.weekflag[s]);for(var a=0;a<6;a++){var i=e.schedule.tasks[a].time+"";1==i.length?e.schedule.tasks[a].time="00:0"+i:2==i.length?e.schedule.tasks[a].time="00:"+i:3==i.length?e.schedule.tasks[a].time="0"+i[0]+":"+i.substr(1):e.schedule.tasks[a].time=i.substr(0,2)+":"+i.substr(2)}this.curMonCfg=e},resetConf:function(){this.curMonCfg={id:"",folder:"",path:"",param:"",span:3,guard:!1,redirect:!1,schedule:{active:!1,weekflag:"0111110",weekmask:[!1,!0,!0,!0,!0,!0,!1],tasks:[{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0},{active:!1,time:"00:00",action:0}]}}},queryLogs:function(){var t=this,e=this;e.logOnway=!0,this.$api.getMonLogs(function(s){s.result<0?t.$alert(s.message):(t.logs=s.content,t.logLines=s.lines||0,e.$nextTick(function(){var t=e.$refs.logs.scrollHeight;e.$refs.logs.scrollTo(0,t)})),e.logOnway=!1})},queryData:function(){var t=this;t.resetConf(),t.loading=!0,setTimeout(function(){t.$api.getMonApps(function(e){if(e.result<0)t.$message.error(e.message);else{for(var s=[],a=K()(e.schedules),i=0;i<a.length;i++){var n=a[i],o=e.schedules[n];o.state=o.running?"运行中":"未启动",o.guardstr=o.guard?"是":"否",o.task=o.schedule.active?"是":"否",s.push(o)}t.monitors=s}t.loading=!1})},300)},handleAppCommand:function(t){var e=this,s=this;"add"==t?(this.resetConf(),this.addApp=!0):"del"==t?this.$confirm("确定要删除该调度任务吗?","调度管理",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){e.$api.delApp(s.curMonCfg.id,function(t){if(t.result<0)s.$alert(t.message);else for(var e=0;e<s.monitors.length;e++)if(s.monitors[e].id==s.curMonCfg.id){s.monitors.splice(e,1),e;break}})}):"refresh"==t?this.queryData():"start"==t?this.$api.startApp(this.curMonCfg.id,function(t){if(t.result<0)e.$message.error(t.message);else for(var s=0;s<e.monitors.length;s++)if(e.monitors[s].id==e.curMonCfg.id){e.monitors[s].state="运行中",e.monitors[s].running=!0;break}}):"stop"==t&&this.$api.stopApp(this.curMonCfg.id,function(t){if(t.result<0)e.$message.error(t.message);else for(var s=0;s<e.monitors.length;s++)if(e.monitors[s].id==e.curMonCfg.id){e.monitors[s].state="未启动",e.monitors[s].running=!1;break}})}},mounted:function(){var t=this;this.$nextTick(function(){t.queryData(),t.queryLogs()})}},tt={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticStyle:{height:"100%",width:"100%"}},[s("el-row",{staticStyle:{height:"100%"}},[s("el-col",{staticStyle:{height:"100%"},attrs:{span:16}},[s("div",{staticStyle:{height:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"0",margin:"2px 4px 0px 4px","min-height":"39px",display:"flex","flex-direction":"row"}},[s("div",{staticStyle:{flex:"0",height:"100%"}},[s("el-tabs",{staticStyle:{height:"100%",margin:"0"},attrs:{value:t.selCat,type:"card","tab-position":"top"},on:{"tab-click":t.handleClickTab}},[s("el-tab-pane",{attrs:{label:"调度列表",name:"list"}}),t._v(" "),s("el-tab-pane",{attrs:{label:"调度日志",name:"logs"}})],1)],1),t._v(" "),s("div",{staticStyle:{flex:"1","border-bottom":"1px solid #E4E7ED","margin-top":"6px",height:"34px"}},[s("el-dropdown",{staticStyle:{float:"right"},attrs:{"split-button":"",type:"danger",size:"mini",trigger:"click"},on:{command:t.handleAppCommand}},[s("i",{staticClass:"el-icon-edit-outline"}),t._v("管理\n                                "),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[s("el-dropdown-item",{attrs:{command:"add"}},[s("i",{staticClass:"el-icon-circle-plus-outline"}),t._v("添加应用")]),t._v(" "),s("el-dropdown-item",{attrs:{command:"del"}},[s("i",{staticClass:"el-icon-delete"}),t._v("删除应用")]),t._v(" "),s("el-dropdown-item",{attrs:{divided:"",command:"refresh"}},[s("i",{staticClass:"el-icon-refresh"}),t._v("刷新列表")]),t._v(" "),s("el-dropdown-item",{staticClass:"text-success",attrs:{divided:"",command:"start"}},[s("i",{staticClass:"el-icon-video-play"}),t._v("启动应用")]),t._v(" "),s("el-dropdown-item",{staticClass:"text-danger",attrs:{command:"stop"}},[s("i",{staticClass:"el-icon-switch-button"}),t._v("停止应用")])],1)],1)],1)]),t._v(" "),s("div",{staticStyle:{flex:"1",margin:"10px 4px",height:"100%"}},[s("div",{directives:[{name:"show",rawName:"v-show",value:"logs"==t.selCat,expression:"selCat=='logs'"},{name:"loading",rawName:"v-loading",value:t.logOnway,expression:"logOnway"}],staticStyle:{height:"100%"}},[s("textarea",{ref:"logs",staticClass:"el-textarea__inner",attrs:{readonly:"readonly",autocomplete:"off",placeholder:"这里是日志内容"},domProps:{value:t.logs}})]),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:"list"==t.selCat,expression:"selCat=='list'"}],staticStyle:{"max-height":"100%",overflow:"auto"}},[s("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"table",attrs:{border:"",stripe:"",data:t.monitors,"highlight-current-row":""},on:{"current-change":t.handleSelectApp}},[s("el-table-column",{attrs:{label:"名称",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("i",{class:e.row.group?"el-icon-data-analysis":"el-icon-monitor"}),t._v(" "),s("a",{staticStyle:{"padding-left":"8px"}},[t._v(t._s(e.row.id))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"状态",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:e.row.running?"text-success":"text-danger"},[t._v(t._s(e.row.state))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"守护",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:"是"==e.row.guard?"text-success":"text-danger"},[t._v(t._s(e.row.guardstr))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"任务",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",{class:"是"==e.row.task?"text-success":"text-danger"},[t._v(t._s(e.row.task))])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"param",label:"参数",width:"80"}}),t._v(" "),s("el-table-column",{attrs:{prop:"span",label:"间隔(s)",width:"80"}}),t._v(" "),s("el-table-column",{attrs:{prop:"path",label:"路径"}}),t._v(" "),s("el-table-column",{attrs:{prop:"folder",label:"目录"}})],1)],1)])])]),t._v(" "),s("el-col",{staticStyle:{height:"100%","border-left":"1px solid #E4E7ED"},attrs:{span:8}},[s("MoniforCfg",{attrs:{config:t.curMonCfg,fixinfo:!t.addApp,forapp:0==t.curMonCfg.type},on:{cfgudt:t.onCfgUpdated}})],1)],1)],1)},staticRenderFns:[]};var et=s("VU/8")(X,tt,!1,function(t){s("7tVw")},"data-v-42cf5d6d",null).exports,st={name:"Login",data:function(){return{users:[],actions:[],curUser:{loginid:"",name:"",remark:"",role:"admin",passwd:"",iplist:""},daterange:[],showUserDlg:!1,addUser:!0,loading_user:!1}},methods:{handleSelectUser:function(t){this.curUser=JSON.parse(g()(t))},handleDtRangeChange:function(){},onClickQryActions:function(){var t=this;0==this.daterange.length&&this.$alert("请选选择日期范围");var e=this.daterange[0].format("yyyy-MM-dd 00:00:00"),s=this.daterange[1].format("yyyy-MM-dd 23:59:59");this.$api.getActions(e,s,function(e){e.result>=0&&(t.actions=e.actions)})},onCommitUser:function(){var t=this;this.$api.commitUser(this.curUser,this.addUser?"add":"mod",function(e){e.result<0?t.$notify.error(e.message):(t.$notify({message:"用户信息提交成功",type:"success"}),t.showUserDlg=!1,t.queryUsers())})},queryUsers:function(){var t=this;this.loading_user=!0,this.$api.getUsers(function(e){e.result>=0?t.users=e.users:t.$notify.error(e.message),t.loading_user=!1})},handleUserCmd:function(t){var e=this;if("add"==t)this.curUser={loginid:"",name:"",remark:"",role:"admin",passwd:"",iplist:""},this.addUser=!0,this.showUserDlg=!0;else if("mod"==t){if(""==this.curUser.loginid)return void this.$alert("请选择要修改的用户");this.curUser.passwd="********",this.addUser=!1,this.showUserDlg=!0}else if("del"==t){if(""==this.curUser.loginid)return void this.$alert("请选择要删除的用户");this.$confirm("确定要删除用户"+this.curUser.loginid+"吗?","删除用户",{confirmButtonText:"确定",cancelButtonText:"取消",type:"danger"}).then(function(){e.$api.delUser(e.curUser.loginid,function(t){t.result<0?e.$notify.error(t.message):(e.$notify({message:"用户已删除",type:"success"}),e.queryUsers())})})}else if("reset"==t){if(""==this.curUser.loginid)return void this.$alert("请选择要重置密码的用户");this.$prompt("请输入新的密码","重置密码",{confirmButtonText:"确定",cancelButtonText:"取消",inputType:"password"}).then(function(t){var s=t.value;e.$confirm("确定要重置用户"+e.curUser.loginid+"的密码吗?","重置密码",{confirmButtonText:"确定",cancelButtonText:"取消",type:"danger"}).then(function(){e.$api.resetpwd(e.curUser.loginid,s,function(t){t.result<0?e.$notify.error(t.message):e.$notify({message:"密码重置成功",type:"success"})})})}).catch(function(){})}else"refresh"==t&&this.queryUsers()}},mounted:function(){var t=this;this.$nextTick(function(){t.queryUsers()})}},at={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticStyle:{height:"100%",width:"100%"}},[s("el-row",{staticStyle:{height:"100%"}},[s("el-col",{staticStyle:{height:"100%"},attrs:{span:12}},[s("div",{staticStyle:{height:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"0",margin:"2px 4px 0px 4px","min-height":"39px",display:"flex","flex-direction":"row"}},[s("div",{staticClass:"simtab",staticStyle:{flex:"0"}},[s("span",[t._v("用户列表")])]),t._v(" "),s("div",{staticStyle:{flex:"1","border-bottom":"1px solid #E4E7ED","margin-top":"6px"}},[s("el-dropdown",{staticStyle:{float:"right"},attrs:{"split-button":"",type:"danger",size:"mini",trigger:"click"},on:{command:t.handleUserCmd}},[s("i",{staticClass:"el-icon-edit-outline"}),t._v("管理\n                                "),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[s("el-dropdown-item",{attrs:{command:"add"}},[s("i",{staticClass:"el-icon-circle-plus-outline"}),t._v("添加用户")]),t._v(" "),s("el-dropdown-item",{attrs:{command:"mod"}},[s("i",{staticClass:"el-icon-edit-outline"}),t._v("修改用户")]),t._v(" "),s("el-dropdown-item",{attrs:{command:"del"}},[s("i",{staticClass:"el-icon-delete"}),t._v("删除用户")]),t._v(" "),s("el-dropdown-item",{attrs:{command:"reset"}},[s("i",{staticClass:"el-icon-switch-button"}),t._v("重置密码")]),t._v(" "),s("el-dropdown-item",{attrs:{divided:"",command:"refresh"}},[s("i",{staticClass:"el-icon-refresh"}),t._v("刷新数据")])],1)],1)],1)]),t._v(" "),s("div",{staticStyle:{flex:"1",margin:"10px 4px",height:"100%"}},[s("div",{staticStyle:{"max-height":"100%",overflow:"auto"}},[s("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading_user,expression:"loading_user"}],staticClass:"table",attrs:{border:"",stripe:"",data:t.users,"highlight-current-row":""},on:{"update:data":function(e){t.users=e},"current-change":t.handleSelectUser}},[s("el-table-column",{attrs:{prop:"loginid",label:"登录名",width:"100"}}),t._v(" "),s("el-table-column",{attrs:{prop:"name",label:"姓名",width:"80"}}),t._v(" "),s("el-table-column",{attrs:{prop:"createtime",label:"创建时间",width:"100"}}),t._v(" "),s("el-table-column",{attrs:{prop:"createby",label:"创建人",width:"100"}}),t._v(" "),s("el-table-column",{attrs:{prop:"modifytime",label:"修改时间",width:"100"}}),t._v(" "),s("el-table-column",{attrs:{prop:"modifyby",label:"修改人",width:"100"}}),t._v(" "),s("el-table-column",{attrs:{prop:"remark",label:"备注"}})],1)],1)])])]),t._v(" "),s("el-col",{staticStyle:{height:"100%","border-left":"1px solid #E4E7ED"},attrs:{span:12}},[s("div",{staticStyle:{height:"100%",display:"flex","flex-direction":"column"}},[s("div",{staticStyle:{flex:"0",margin:"2px 4px 0px 4px","min-height":"39px",display:"flex","flex-direction":"row"}},[s("div",{staticClass:"simtab",staticStyle:{flex:"0"}},[s("span",[t._v("操作日志")])]),t._v(" "),s("div",{staticStyle:{flex:"1","border-bottom":"1px solid #E4E7ED","margin-top":"6px"}},[s("el-row",{staticStyle:{height:"100%"}},[s("el-col",{attrs:{span:12,offset:9}},[s("el-date-picker",{staticStyle:{float:"right"},attrs:{type:"daterange",align:"right",size:"mini","unlink-panels":"","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},on:{change:t.handleDtRangeChange},model:{value:t.daterange,callback:function(e){t.daterange=e},expression:"daterange"}})],1),t._v(" "),s("el-col",{attrs:{span:3}},[s("el-button",{staticStyle:{float:"right"},attrs:{type:"primary",icon:"el-icon-refresh",size:"mini",plain:""},on:{click:t.onClickQryActions}},[t._v("刷新")])],1)],1)],1)]),t._v(" "),s("div",{staticStyle:{flex:"1",margin:"10px 4px",height:"100%"}},[s("div",{staticStyle:{"max-height":"100%",overflow:"auto"}},[s("el-table",{staticClass:"table",attrs:{border:"",stripe:"",data:t.actions}},[s("el-table-column",{attrs:{prop:"loginid",label:"登录名",width:"100"}}),t._v(" "),s("el-table-column",{attrs:{prop:"actiontime",label:"操作时间",width:"100"}}),t._v(" "),s("el-table-column",{attrs:{prop:"actionip",label:"来源IP",width:"120"}}),t._v(" "),s("el-table-column",{attrs:{prop:"action",label:"类型",width:"80"}}),t._v(" "),s("el-table-column",{attrs:{prop:"remark",label:"备注"}})],1)],1)])])])],1),t._v(" "),s("el-dialog",{staticClass:"dialog-user",attrs:{title:t.addUser?"添加用户":"修改用户",visible:t.showUserDlg,width:"25%"},on:{"update:visible":function(e){t.showUserDlg=e}}},[s("el-row",[s("el-col",{attrs:{span:6}},[s("a",[t._v("登录名：")])]),t._v(" "),s("el-col",{attrs:{span:18}},[s("el-input",{attrs:{size:"mini",disabled:!t.addUser},model:{value:t.curUser.loginid,callback:function(e){t.$set(t.curUser,"loginid",e)},expression:"curUser.loginid"}})],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:6}},[s("a",[t._v("用户姓名：")])]),t._v(" "),s("el-col",{attrs:{span:18}},[s("el-input",{attrs:{size:"mini"},model:{value:t.curUser.name,callback:function(e){t.$set(t.curUser,"name",e)},expression:"curUser.name"}})],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:6}},[s("a",[t._v("用户类型：")])]),t._v(" "),s("el-col",{attrs:{span:18}},[s("el-tooltip",{attrs:{effect:"dark",content:"拥有全部的管理权限",placement:"top-start"}},[s("el-radio",{attrs:{label:"admin"},model:{value:t.curUser.role,callback:function(e){t.$set(t.curUser,"role",e)},expression:"curUser.role"}},[t._v("管理员")])],1),t._v(" "),s("el-tooltip",{attrs:{effect:"dark",content:"拥有风控权限",placement:"top-start"}},[s("el-radio",{attrs:{label:"risker"},model:{value:t.curUser.role,callback:function(e){t.$set(t.curUser,"role",e)},expression:"curUser.role"}},[t._v("风控员")])],1)],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:6}},[s("a",[t._v("登录密码：")])]),t._v(" "),s("el-col",{attrs:{span:18}},[s("el-input",{attrs:{size:"mini",type:"password","show-password":"",disabled:!t.addUser},model:{value:t.curUser.passwd,callback:function(e){t.$set(t.curUser,"passwd",e)},expression:"curUser.passwd"}})],1)],1),t._v(" "),s("el-row",{staticStyle:{height:"60px"}},[s("el-col",{attrs:{span:6}},[s("a",[t._v("IP限制：")])]),t._v(" "),s("el-col",{attrs:{span:18}},[s("el-input",{attrs:{type:"textarea",size:"mini"},model:{value:t.curUser.iplist,callback:function(e){t.$set(t.curUser,"iplist",e)},expression:"curUser.iplist"}})],1)],1),t._v(" "),s("el-row",{staticStyle:{height:"60px"}},[s("el-col",{attrs:{span:6}},[s("a",[t._v("备注信息：")])]),t._v(" "),s("el-col",{attrs:{span:18}},[s("el-input",{staticStyle:{"min-height":"80px"},attrs:{type:"textarea"},model:{value:t.curUser.remark,callback:function(e){t.$set(t.curUser,"remark",e)},expression:"curUser.remark"}})],1)],1),t._v(" "),s("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{attrs:{type:"primary",plain:"",size:"mini"},on:{click:t.onCommitUser}},[t._v("提交数据")])],1)],1)],1)},staticRenderFns:[]};var it=s("VU/8")(st,at,!1,function(t){s("wpV1")},"data-v-c381bfac",null).exports;a.default.use(o.a);var nt=new o.a({routes:[{path:"/",redirect:"/login"},{path:"/login",name:"Login",component:c},{path:"/index",name:"Index",component:h,redirect:"/monitor",children:[{path:"/monitor",name:"monitor",component:L},{path:"/deploy",name:"deploy",component:Z},{path:"/backtest",name:"backtest",component:W},{path:"/schedule",name:"schedule",component:et},{path:"/admins",name:"admins",component:it}]}]});a.default.use(p.a);var ot=new p.a.Store({state:{cache:{userinfo:{loginid:"",name:"",loginip:"",logintime:""},isLogined:!1,loginid:""},folders:[]},getters:{cache:function(t){return t.cache},folders:function(t){return t.folders}},modules:{},actions:{},mutations:{loginok:function(t,e){t.cache.userinfo=e.userinfo,t.cache.isLogined=!0,t.cache.loginid=e.loginid},logoutok:function(t){t.cache.userinfo={loginid:"",name:"",loginip:"",logintime:""},t.cache.isLogined=!1,t.cache.loginid=""},setfolders:function(t,e){t.folders=e.folders}}}),rt=s("HI0L"),lt=s.n(rt),ct=s("zL8q"),ut=s.n(ct),dt=(s("wLZQ"),s("XLwt")),pt=s.n(dt),ft=s("woOf"),mt=s.n(ft),ht=s("pFYg"),vt=s.n(ht),gt=s("7t+N"),bt=s.n(gt),yt=s("NC6I"),wt=s.n(yt);Date.prototype.format=function(t){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var s in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t},Date.prototype.addDays=function(t){var e=this.valueOf();return new Date(e+=864e5*t)},String.prototype.format=function(t){if(arguments.length>0){var e=this;if(1==arguments.length&&"object"==(void 0===t?"undefined":vt()(t)))for(var s in t){var a=new RegExp("({"+s+"})","g");e=e.replace(a,t[s])}else for(var i=0;i<arguments.length;i++){if(void 0==arguments[i])return"";a=new RegExp("({["+i+"]})","g");e=e.replace(a,arguments[i])}return e}return this};a.default.prototype.$echarts=pt.a,a.default.config.productionTip=!1,a.default.use(ut.a),a.default.use(new lt.a({debug:!1,connection:"http://"+document.domain+":"+location.port,vuex:{}})),a.default.prototype.$api=new function(){this.setItem=function(t,e){return window.localStorage.setItem(t,e)},this.getItem=function(t){return window.localStorage.getItem(t)||""},this.token=this.getItem("token"),this.removeItem=function(t){return window.localStorage.removeItem(t)},this.login=function(t,e,s){var a={loginid:t,passwd:wt()(e)};bt.a.post("/mgr/login",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.modpwd=function(t,e,s){var a={oldpwd:wt()(t),newpwd:wt()(e)};bt.a.post("/mgr/modpwd",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.resetpwd=function(t,e,s){var a={loginid:t,passwd:wt()(e)};bt.a.post("/mgr/resetpwd",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getGroups=function(t){bt.a.post("/mgr/qrygrp",g()({}),function(e,s){t("success"!=s?{result:-9999,message:s}:e)},"json")},this.startGroup=function(t,e){var s={groupid:t||""};bt.a.post("/mgr/startgrp",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.stopGroup=function(t,e){var s={groupid:t||""};bt.a.post("/mgr/stopgrp",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.delGroup=function(t,e){var s={groupid:t||""};bt.a.post("/mgr/delgrp",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.getFolders=function(t){bt.a.post("/mgr/qrydir",g()({}),function(e,s){t("success"!=s?{result:-9999,message:s}:e)},"json")},this.commitGroup=function(t,e,s){var a=JSON.parse(g()(t));a.groupid=t.id,a.action=e,bt.a.post("/mgr/addgrp",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getGroupDir=function(t,e){var s={groupid:t};bt.a.post("/mgr/qrygrpdir",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.getGroupFile=function(t,e,s){var a={groupid:t,path:e};bt.a.post("/mgr/qrygrpfile",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.commitGroupFile=function(t,e,s,a){var i={groupid:t,path:e,content:s};bt.a.post("/mgr/cmtgrpfile",g()(i),function(t,e){a("success"!=e?{result:-9999,message:e}:t)},"json")},this.getLogs=function(t,e,s){"function"==typeof e&&(s=e,e="");var a={id:t,type:e};bt.a.post("/mgr/qrylogs",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getMonCfg=function(t,e){var s={groupid:t};bt.a.post("/mgr/qrymon",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.commitMonCfg=function(t,e){var s=t;bt.a.post("/mgr/cfgmon",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.getStrategies=function(t,e,s){"function"==typeof e&&(s=e,e="");var a={groupid:t,type:e};bt.a.post("/mgr/qrystras",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getChannels=function(t,e){var s={groupid:t};bt.a.post("/mgr/qrychnls",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.getTrades=function(t,e,s){"function"==typeof e&&(s=e,e="");var a={groupid:t,strategyid:e};bt.a.post("/mgr/qrytrds",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getSignals=function(t,e,s){"function"==typeof e&&(s=e,e="");var a={groupid:t,strategyid:e};bt.a.post("/mgr/qrysigs",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getRounds=function(t,e,s){"function"==typeof e&&(s=e,e="");var a={groupid:t,strategyid:e};bt.a.post("/mgr/qryrnds",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getPositions=function(t,e,s){"function"==typeof e&&(s=e,e="");var a={groupid:t,strategyid:e};bt.a.post("/mgr/qrypos",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getFunds=function(t,e,s){"function"==typeof e&&(s=e,e="");var a={groupid:t,strategyid:e};bt.a.post("/mgr/qryfunds",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getChnlOrders=function(t,e,s){"function"==typeof e&&(s=e,e="");var a={groupid:t,channelid:e};bt.a.post("/mgr/qrychnlords",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getChnlTrades=function(t,e,s){"function"==typeof e&&(s=e,e="");var a={groupid:t,channelid:e};bt.a.post("/mgr/qrychnltrds",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getChnlPositions=function(t,e,s){"function"==typeof e&&(s=e,e="");var a={groupid:t,channelid:e};bt.a.post("/mgr/qrychnlpos",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getChnlFunds=function(t,e,s){"function"==typeof e&&(s=e,e="");var a={groupid:t,channelid:e};bt.a.post("/mgr/qrychnlfund",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getUsers=function(t){bt.a.post("/mgr/qryusers",g()({}),function(e,s){t("success"!=s?{result:-9999,message:s}:e)},"json")},this.commitUser=function(t,e,s){var a=mt()({},t);a.action=e||"add","********"!=a.passwd&&(a.passwd=wt()(a.passwd)),bt.a.post("/mgr/cmtuser",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.delUser=function(t,e){var s={loginid:t};bt.a.post("/mgr/deluser",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.getActions=function(t,e,s){var a={sdate:t,edate:e};bt.a.post("/mgr/qryacts",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getPythonPath=function(t){bt.a.post("/mgr/qryexec",g()({}),function(e,s){t("success"!=s?{result:-9999,message:s}:e)},"json")},this.getMonApps=function(t){bt.a.post("/mgr/qrymons",g()({}),function(e,s){t("success"!=s?{result:-9999,message:s}:e)},"json")},this.startApp=function(t,e){var s={appid:t||""};bt.a.post("/mgr/startapp",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.stopApp=function(t,e){var s={appid:t||""};bt.a.post("/mgr/stopapp",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.getMonLogs=function(t){bt.a.post("/mgr/qrymonlog",g()({}),function(e,s){t("success"!=s?{result:-9999,message:s}:e)},"json")},this.delApp=function(t,e){var s={appid:t||""};bt.a.post("/mgr/delapp",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.getPortPositions=function(t,e){var s={groupid:t};bt.a.post("/mgr/qryportpos",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.getPortFunds=function(t,e){var s={groupid:t};bt.a.post("/mgr/qryportfunds",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.getPortPerfs=function(t,e){var s={groupid:t};bt.a.post("/mgr/qryportperfs",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.getPortFilters=function(t,e){var s={groupid:t};bt.a.post("/mgr/qryportfilters",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.commitPortFilters=function(t,e,s){var a={groupid:t,filters:e};bt.a.post("/mgr/cmtgrpfilters",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getBtStrategies=function(t){bt.a.post("/bt/qrystras",g()({}),function(e,s){t("success"!=s?{result:-9999,message:s}:e)},"json")},this.addBtStrategy=function(t,e){var s={name:t};bt.a.post("/bt/addstra",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.delBtStrategy=function(t,e){var s={straid:t};bt.a.post("/bt/delstra",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.getBtStraCode=function(t,e){var s={straid:t};bt.a.post("/bt/qrycode",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.commitBtStraCode=function(t,e,s){var a={straid:t,content:e};bt.a.post("/bt/setcode",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getBacktests=function(t,e){var s={straid:t};bt.a.post("/bt/qrystrabts",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.runBacktest=function(t,e,s,a,i,n){"function"==typeof i&&(n=i,i=0);var o={straid:t,stime:e,etime:s,capital:a,slippage:i};bt.a.post("/bt/runstrabt",g()(o),function(t,e){n("success"!=e?{result:-9999,message:e}:t)},"json")},this.delBacktest=function(t,e){var s={btid:t};bt.a.post("/bt/delstrabt",g()(s),function(t,s){e("success"!=s?{result:-9999,message:s}:t)},"json")},this.getBtSignals=function(t,e,s){var a={straid:t,btid:e};bt.a.post("/bt/qrybtsigs",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getBtTrades=function(t,e,s){var a={straid:t,btid:e};bt.a.post("/bt/qrybttrds",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getBtRounds=function(t,e,s){var a={straid:t,btid:e};bt.a.post("/bt/qrybtrnds",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getBtFunds=function(t,e,s){var a={straid:t,btid:e};bt.a.post("/bt/qrybtfunds",g()(a),function(t,e){s("success"!=e?{result:-9999,message:e}:t)},"json")},this.getBtBars=function(t,e,s,a,i){var n={code:t,period:e,stime:s,etime:a};bt.a.post("/bt/qrybars",g()(n),function(t,e){i("success"!=e?{result:-9999,message:e}:t)},"json")}},new a.default({store:ot,el:"#app",router:nt,components:{App:n},template:"<App/>"})},SP1q:function(t,e){},Yokd:function(t,e){},b3w7:function(t,e){},g1Tk:function(t,e){},iP0y:function(t,e){},"kk+i":function(t,e){},"n+8b":function(t,e){},"nZf+":function(t,e){},pKwi:function(t,e){},tvDO:function(t,e){},wLZQ:function(t,e){},wpV1:function(t,e){},wx9h:function(t,e){}},["NHnr"]);
  //# sourceMappingURL=app.d3652914f874ea570f72.js.map