import{s as K,g as O,a as X,c as Y}from"./strategy.144f1fe6.js";import{d as q,s as G,b as m,N as H,O as J,P as _,C as o,c as x,e as k,a as e,w as n,u as d,F as B,r as s,o as b,k as M,m as A,K as Q,M as T,I as W}from"./index.b616fdab.js";const ee=D=>(D*100).toFixed(2)+"%";const le={class:"demo-collapse"},te={style:{cursor:"pointer"}},oe=k("label",null," concel subscribe",-1),ae=q({setup(D){const g=W(),p=K(),w=G([]),v=m(),y=m(),C=m(0),V=m(["1"]),f=m(""),E=()=>{!v.value||X(v.value).then(l=>{_({message:o("p",null,[o("i",{style:"color: green"},"\u884C\u60C5\u8BA2\u9605\u6210\u529F")])}),p.select_subscribe_vt_symbols(),h()}).catch(l=>{_({message:o("p",null,[o("i",{style:"color: red"},"\u884C\u60C5\u8BA2\u9605\u5931\u8D25")])})})},N=()=>{!f.value||Y(f.value).then(l=>{_({message:o("p",null,[o("i",{style:"color: green"},"\u53D6\u6D88\u8BA2\u9605\u6210\u529F")])}),h()}).catch(l=>{_({message:o("p",null,[o("i",{style:"color: red"},"\u53D6\u6D88\u8BA2\u9605\u5931\u8D25")])})})},U=(l,t)=>{let a=(l.last_price-l.open_price)/l.open_price;return ee(a)},L=(l,t,a,i)=>{f.value=l.symbol+"."+l.exchange,console.log(f.value)},R=(l,t,a,i)=>{},P=(l,t,a)=>{var r;let i=(r=g==null?void 0:g.proxy)==null?void 0:r.$refs.contextmenu;a.preventDefault(),i.show({top:a.clientY,left:a.clientX}),window.onclick=()=>{i.hide()}},h=()=>(O().then(l=>{w.length=0,l.data.ticks.forEach(t=>{w.push(t)})}),h);return H(()=>{clearInterval(C.value),C.value=window.setInterval(h(),3e3)}),J(()=>{window.clearInterval(C.value)}),p.select_subscribe_vt_symbols().catch(l=>{_({message:o("p",null,[o("i",{style:"color: teal"},"\u8BFB\u53D6vt_symbols\u5931\u8D25")])})}),p.select_vt_symbols().catch(l=>{_({message:o("p",null,[o("i",{style:"color: teal"},"\u8BFB\u53D6vt_symbols\u5931\u8D25")])})}),p.select_exchanges().catch(l=>{_({message:o("p",null,[o("i",{style:"color: teal"},"\u8BFB\u53D6exchanges\u5931\u8D25")])})}),(l,t)=>{const a=s("el-option"),i=s("el-select"),r=s("el-col"),S=s("ZoomIn"),F=s("el-icon"),Z=s("el-row"),I=s("el-collapse-item"),u=s("el-table-column"),$=s("el-table"),j=s("el-collapse"),z=s("CircleClose");return b(),x(B,null,[k("div",le,[e(j,{modelValue:V.value,"onUpdate:modelValue":t[3]||(t[3]=c=>V.value=c)},{default:n(()=>[e(I,{title:"\u8BA2\u9605\u884C\u60C5",name:"2"},{default:n(()=>[e(Z,null,{default:n(()=>[e(r,{span:4},{default:n(()=>[e(i,{modelValue:y.value,"onUpdate:modelValue":t[0]||(t[0]=c=>y.value=c),placeholder:"select a exchange"},{default:n(()=>[(b(!0),x(B,null,M(d(p).exchanges,c=>(b(),A(a,{value:c},null,8,["value"]))),256))]),_:1},8,["modelValue"])]),_:1}),e(r,{span:1}),e(r,{span:4},{default:n(()=>[e(i,{modelValue:v.value,"onUpdate:modelValue":t[1]||(t[1]=c=>v.value=c),placeholder:"select a vt_symbol"},{default:n(()=>[(b(!0),x(B,null,M(d(p).vt_symbols.get(y.value),c=>(b(),A(a,{value:c},null,8,["value"]))),256))]),_:1},8,["modelValue"])]),_:1}),e(r,{span:1}),e(r,{span:4},{default:n(()=>[k("span",te,[e(F,{size:25,onClick:t[2]||(t[2]=c=>E())},{default:n(()=>[e(S)]),_:1})])]),_:1})]),_:1})]),_:1}),e(I,{title:"\u8BA2\u9605\u4E00\u89C8",name:"1"},{default:n(()=>[e($,{onRowContextmenu:P,onCellMouseEnter:L,onCellMouseLeave:R,data:d(w),style:{width:"100%"}},{default:n(()=>[e(u,{fixed:"",prop:"symbol",label:"symbol",width:"80"}),e(u,{prop:"exchange",label:"exchange",width:"100"}),e(u,{prop:"name",label:"Name",width:"120"}),e(u,{prop:"last_price",label:"last_price",width:"120"}),e(u,{prop:"volume",label:"volume",width:"100"}),e(u,{prop:"open_price",label:"open_price",width:"120"}),e(u,{prop:"high_price",label:"high_price",width:"120"}),e(u,{prop:"low_price",label:"low_price",width:"100"}),e(u,{prop:"differ",label:"differ",width:"70"}),e(u,{prop:"differ_percent",label:"differ_per",formatter:U,width:"120"})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])]),e(d(T),{"auto-ajust-placement":"",ref:"contextmenu"},{default:n(()=>[e(d(Q),{onClick:N},{default:n(()=>[e(F,{class:"contextmenu-icon"},{default:n(()=>[e(z)]),_:1}),oe]),_:1})]),_:1},512)],64)}}});export{ae as default};
