import{h as b}from"./axios--FnjuHWf.js";import{d as w,r as _,b as y,e as v,o as x,c as g,a as l,f as e,w as c,h as p,u as t,s as a,x as C}from"./index-go251NJo.js";const k={style:{"background-color":"#d2d2fa",height:"100vh",display:"grid","place-items":"center"}},j={style:{"background-color":"#fff",width:"90%",height:"80%","border-radius":"10px",padding:"20px",overflow:"auto"}},V={style:{display:"flex","justify-content":"space-between","align-items":"center"}},B=l("div",{style:{"font-size":"20px","font-weight":"bold"}},"微信信息（已经登录）",-1),E={style:{display:"flex","justify-content":"space-between","align-items":"center"}},S={style:{"margin-top":"20px"}},O=w({__name:"WxinfoView",setup(T){const r=_([]),d=async()=>{try{r.value=await b.post("/api/wxinfo")}catch(o){return console.error("Error fetching data:",o),[]}};y(d);const h=async()=>{await d()},f=()=>{const o=m(r.value);u(o,"wxinfo_data.csv")},m=o=>{const i=Object.keys(o[0]).join(","),n=o.map(s=>Object.values(s).join(","));return`${i}
${n.join(`
`)}`},u=(o,i)=>{const n=new Blob([new Uint8Array([239,187,191]),o],{type:"text/csv;charset=utf-8;"}),s=document.createElement("a");navigator.msSaveBlob?navigator.msSaveBlob(n,i):(s.href=URL.createObjectURL(n),s.setAttribute("download",i),document.body.appendChild(s),s.click(),document.body.removeChild(s)),ElNotification.success({title:"Success",message:"CSV file exported successfully!"})};return(o,i)=>{const n=v("el-button");return x(),g("div",k,[l("div",j,[l("div",V,[B,l("div",E,[e(n,{style:{"margin-right":"10px"},onClick:h},{default:c(()=>[p("刷新")]),_:1}),e(n,{style:{"margin-right":"10px"},onClick:f},{default:c(()=>[p("导出")]),_:1})])]),l("div",S,[e(t(C),{data:r.value,style:{width:"100%"}},{default:c(()=>[e(t(a),{"min-width":30,prop:"pid",label:"进程id"}),e(t(a),{"min-width":40,prop:"version",label:"微信版本"}),e(t(a),{"min-width":40,prop:"account",label:"账号"}),e(t(a),{"min-width":45,prop:"mobile",label:"手机号"}),e(t(a),{"min-width":40,prop:"name",label:"昵称"}),e(t(a),{"min-width":30,prop:"mail",label:"邮箱"}),e(t(a),{"min-width":50,prop:"wxid",label:"微信原始id"}),e(t(a),{prop:"filePath",label:"微信文件夹路径"}),e(t(a),{prop:"key",label:"密钥(key)"})]),_:1},8,["data"])])])])}}});export{O as default};
