import{g as R,l as V,u as I,r as P}from"./cta_strategy.8bc7a19b.js";import{d as S,s as $,b as T,c as r,a as e,w as t,u as W,R as L,r as a,o as u,m,L as i,h,e as M,P as j,C as F}from"./index.b616fdab.js";const q={class:"bookmark"},G=h("\u6DFB\u52A0\u7B56\u7565\u6A21\u677F"),H=h(" -> "),J=h(" \u4E0A\u4F20\u7B56\u7565\u6A21\u677F "),K=M("div",{class:"el-upload__tip text-red"}," \u4E00\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u6587\u4EF6 ",-1),O={key:0,style:{cursor:"pointer"}},Q={key:0,style:{cursor:"pointer"}},U={key:0,style:{cursor:"pointer"}},ee=S({setup(X){const d=$([]),_=T(),p=()=>{R().then(l=>{d.length=0,l.data.forEach((o,f)=>{d.push(o)})})},k=l=>{_.value.clearFiles();const o=l[0];o.uid=L(),_.value.handleStart(o)},b=()=>{_.value.submit(),p()},g=l=>{l.status=2,V(l.file_name).then(o=>{o.status==200&&(l.status=1),o.status==500&&(l.status=0)})},v=l=>{I(l.class_name).then(o=>{o.status==200&&(l.status=0),o.status==500&&(l.status=1)})},w=l=>{P(l.file_name).then(o=>{p()}).catch(o=>{j({message:F("p",null,[F("i",{style:"color: teal"},o)])})})};return p(),(l,o)=>{const f=a("el-button"),C=a("el-upload"),n=a("el-table-column"),B=a("InfoFilled"),c=a("el-icon"),E=a("SuccessFilled"),x=a("WarningFilled"),A=a("CirclePlusFilled"),D=a("RemoveFilled"),z=a("Delete"),N=a("el-table");return u(),r("div",q,[e(C,{ref_key:"upload",ref:_,class:"upload-demo",action:"http://localhost:5000/trader/api/v1/strategy_file",limit:1,"on-exceed":k,"auto-upload":!1},{trigger:t(()=>[e(f,{type:"primary"},{default:t(()=>[G]),_:1})]),tip:t(()=>[K]),default:t(()=>[H,e(f,{class:"ml-3",type:"success",onClick:b},{default:t(()=>[J]),_:1})]),_:1},512),e(N,{ref:"multipleTableRef",data:W(d),style:{width:"100%"}},{default:t(()=>[e(n,{type:"selection",width:"55"}),e(n,{type:"index",label:"index",width:"80"}),e(n,{prop:"file_name",label:"\u7B56\u7565\u6587\u4EF6\u540D",width:"200"}),e(n,{prop:"class_name",label:"\u7B56\u7565\u7C7B\u540D",width:"200"}),e(n,{prop:"status",label:"\u72B6\u6001",width:"60"},{default:t(s=>[s.row.status==0?(u(),m(c,{key:0,size:20},{default:t(()=>[e(B)]),_:1})):i("",!0),s.row.status==1?(u(),m(c,{key:1,size:20,color:"green"},{default:t(()=>[e(E)]),_:1})):i("",!0),s.row.status==2?(u(),m(c,{key:2,size:20,color:"gold"},{default:t(()=>[e(x)]),_:1})):i("",!0)]),_:1}),e(n,{prop:"url",label:"\u52A0\u8F7D",width:"60"},{default:t(s=>[s.row.status==0?(u(),r("span",O,[e(c,{size:20,onClick:y=>g(s.row),color:"blue"},{default:t(()=>[e(A)]),_:2},1032,["onClick"])])):i("",!0)]),_:1}),e(n,{prop:"url",label:"\u5378\u8F7D",width:"60"},{default:t(s=>[s.row.status==1?(u(),r("span",Q,[e(c,{size:20,onClick:y=>v(s.row),color:"red"},{default:t(()=>[e(D)]),_:2},1032,["onClick"])])):i("",!0)]),_:1}),e(n,{prop:"url",label:"\u5220\u9664",width:"60"},{default:t(s=>[s.row.status==0?(u(),r("span",U,[e(c,{size:20,onClick:y=>w(s.row),color:"red"},{default:t(()=>[e(z)]),_:2},1032,["onClick"])])):i("",!0)]),_:1})]),_:1},8,["data"])])}}});export{ee as default};
