import{d as C,r as u,w as H,e as c,o as h,m as Q,_ as X,c as p,f as t,g as l,a as d,j as o,F as E,l as $,t as S,k as D,h as Z,E as ee,q as te}from"./index-AhVYV2OA.js";import{C as ae,_ as le}from"./ChatRecprdsHeader-9JjX2P9Q.js";const oe=C({__name:"DateTimeSelect",emits:["datetime"],setup(w,{emit:x}){const m=[new Date(2e3,1,1,0,0,0),new Date(2e3,2,1,23,59,59)],f=[{text:"全部",value:()=>{const a=new Date;return[new Date(2010,0,1,0,0,0),a]}},{text:"最近一周",value:()=>{const a=new Date,e=new Date;return e.setTime(e.getTime()-3600*1e3*24*7),[e,a]}},{text:"最近一个月",value:()=>{const a=new Date,e=new Date;return e.setTime(e.getTime()-3600*1e3*24*30),[e,a]}},{text:"最近三个月",value:()=>{const a=new Date,e=new Date;return e.setTime(e.getTime()-3600*1e3*24*90),[e,a]}},{text:"最近半年",value:()=>{const a=new Date,e=new Date;return e.setTime(e.getTime()-3600*1e3*24*180),[e,a]}},{text:"最近一年",value:()=>{const a=new Date,e=new Date;return e.setTime(e.getTime()-3600*1e3*24*365),[e,a]}},{text:"去年一整年",value:()=>{const a=new Date;a.setFullYear(a.getFullYear()-1),a.setMonth(0),a.setDate(1),a.setHours(0,0,0);const e=new Date;return e.setFullYear(e.getFullYear()-1),e.setMonth(11),e.setDate(31),e.setHours(23,59,59),[a,e]}}],_=u([Date,Date]),g=x;return H(()=>_.value,(a,e)=>{let i=a[0].getTime(),v=a[1].getTime();g("datetime",[i,v])}),(a,e)=>{const i=c("el-date-picker");return h(),Q(i,{modelValue:_.value,"onUpdate:modelValue":e[0]||(e[0]=v=>_.value=v),type:"datetimerange",shortcuts:f,"range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间","default-time":m,format:"YYYY-MM-DD HH:mm"},null,8,["modelValue"])}}}),se=X(oe,[["__scopeId","data-v-320582f6"]]),ne={id:"chat_export",style:{"background-color":"#d2d2fa",padding:"0"}},re={style:{"background-color":"#d2d2fa",height:"calc(100vh - 65px)",display:"grid","place-items":"center"}},ue={style:{"background-color":"#fff",width:"70%",height:"70%","border-radius":"10px",padding:"20px",overflow:"auto"}},ce=d("div",{style:{display:"flex","justify-content":"space-between","align-items":"center"}},[d("div",{style:{"font-size":"20px","font-weight":"bold"}},"导出与备份(未完待续...）"),d("div",{style:{display:"flex","justify-content":"space-between","align-items":"center"}})],-1),de={style:{"margin-top":"20px"}},ie=d("br",null,null,-1),he=d("br",null,null,-1),me=d("br",null,null,-1),_e={key:0},pe={key:1},we=d("strong",null,"** 时间(默认全部)：",-1),fe={key:2},ve={key:3},ye={key:4},xe=C({__name:"ChatExportMain",props:{userData:{type:Object,required:!0}},setup(w){const x=w,m=u(""),f=u([]),_=u(["文本"]),g=u(""),a=u(""),e=u(""),i={endb:{brief:"加密文件",detail:`导出的内容为微信加密数据库（）。
可还原回微信,但会覆盖微信后续消息。`,userShow:!1,timeShow:!1,chatTypeShow:!1,keyShow:!1,wxPathShow:!0},dedb:{brief:"解密文件",detail:"导出的文件为解密后的sqlite数据库，并且会自动合并msg和media数据库为同一个，但是无法还原会微信。",userShow:!1,timeShow:!0,chatTypeShow:!1,keyShow:!1,wxPathShow:!1},csv:{brief:"csv",detail:"只包含文本，但是可以用excel软件（wps，office）打开。",userShow:!0,timeShow:!1,chatTypeShow:!1,keyShow:!1,wxPathShow:!1},json:{brief:"json",detail:"只包含文本，可用于数据分析，情感分析等方面。",userShow:!0,timeShow:!1,chatTypeShow:!1,keyShow:!1,wxPathShow:!1},html:{brief:"html-开发中",detail:"主要用于浏览器可视化查看。",userShow:!0,timeShow:!0,chatTypeShow:!0,keyShow:!1,wxPathShow:!0},pdf:{brief:"pdf-开发中",detail:"就是html的pdf版本。",userShow:!0,timeShow:!0,chatTypeShow:!0,keyShow:!1,wxPathShow:!0},docx:{brief:"docx-开发中",detail:"就是html的docx版本。",userShow:!0,timeShow:!0,chatTypeShow:!0,keyShow:!1,wxPathShow:!0}},v=["文本","图片","语音","视频","动画表情","文件","卡片式链接","用户上传的GIF表情","转账消息","赠送红包封面","语音通话","系统通知","拍一拍","系统通知","其他"],b=u(!1),T=u(!0),I=s=>{_.value=s?v:[],T.value=!1},q=s=>{const n=s.length;b.value=n===v.length,T.value=n>0&&n<v.length},A=s=>{f.value=s},P=u(!1),U=u(!1),F=u(!1),Y=u(!1),M=u(!1);H(m,s=>{P.value=i[s].userShow,U.value=i[s].timeShow,F.value=i[s].chatTypeShow,Y.value=i[s].keyShow,M.value=i[s].wxPathShow,e.value=i[s].detail});const N=async()=>{try{if(m.value===""){e.value="导出类型不能为空";return}const s=await Z.post("/api/export",{export_type:m.value,start_time:f.value[0],end_time:f.value[1],chat_type:_.value,username:x.userData.username,wx_path:a.value});e.value=s}catch(s){ee.alert(s,"error",{confirmButtonText:"确认",callback:n=>{te({type:"error",message:`action: ${n}`})}}),e.value=String(s)+`
更多信息请查看控制台；`}};return(s,n)=>{const R=c("el-header"),z=c("el-option"),G=c("el-select"),y=c("el-text"),k=c("el-col"),L=c("el-row"),j=c("el-checkbox"),O=c("el-checkbox-group"),V=c("el-input"),W=c("el-button"),J=c("el-divider"),K=c("el-main");return h(),p("div",ne,[t(R,{style:{height:"65px","max-height":"65px",width:"100%","padding-top":"5px"}},{default:l(()=>[t(ae,{userData:w.userData},null,8,["userData"])]),_:1}),t(K,{style:{"overflow-y":"auto",height:"calc(100vh - 65px)",padding:"0"}},{default:l(()=>[d("div",re,[d("div",ue,[ce,d("div",de,[o(" 导出类型: "),t(G,{placeholder:"请选择导出类型",style:{width:"50%"},modelValue:m.value,"onUpdate:modelValue":n[0]||(n[0]=r=>m.value=r)},{default:l(()=>[(h(),p(E,null,$(i,(r,B)=>t(z,{label:r.brief,value:B,key:B},{default:l(()=>[o(S(r.brief),1)]),_:2},1032,["label","value"])),64))]),_:1},8,["modelValue"]),ie,he,d("div",null,[o(" 选项:"),me,P.value?(h(),p("div",_e,[o(" ** 用户(默认全部，从左边选择具体用户)： "),t(L,{gutter:5,style:{width:"100%"}},{default:l(()=>[t(k,{span:6,style:{"white-space":"nowrap"}},{default:l(()=>[t(y,{class:"label_color mx-1",truncated:""},{default:l(()=>[o("原始id:")]),_:1}),o("  "),t(y,{class:"data_color mx-1",truncated:""},{default:l(()=>[o(S(w.userData.username),1)]),_:1})]),_:1}),t(k,{span:6,style:{"white-space":"nowrap"}},{default:l(()=>[t(y,{class:"label_color mx-1",truncated:""},{default:l(()=>[o("账号:")]),_:1}),o("  "),t(y,{class:"data_color mx-1",truncated:""},{default:l(()=>[o(S(w.userData.account),1)]),_:1})]),_:1}),t(k,{span:6,style:{"white-space":"nowrap"}},{default:l(()=>[t(y,{class:"label_color mx-1",truncated:""},{default:l(()=>[o("昵称:")]),_:1}),o("  "),t(y,{class:"data_color mx-1",truncated:""},{default:l(()=>[o(S(w.userData.nickname),1)]),_:1})]),_:1}),t(k,{span:6,style:{"white-space":"nowrap"}},{default:l(()=>[t(y,{class:"label_color mx-1",truncated:""},{default:l(()=>[o("备注:")]),_:1}),o("  "),t(y,{class:"data_color mx-1",truncated:""},{default:l(()=>[o(S(w.userData.remark),1)]),_:1})]),_:1})]),_:1})])):D("",!0),U.value?(h(),p("div",pe,[we,t(se,{onDatetime:A})])):D("",!0),F.value?(h(),p("div",fe,[o(" ** 消息类型： "),t(j,{modelValue:b.value,"onUpdate:modelValue":n[1]||(n[1]=r=>b.value=r),indeterminate:T.value,onChange:I},{default:l(()=>[o("全选 ")]),_:1},8,["modelValue","indeterminate"]),t(O,{modelValue:_.value,"onUpdate:modelValue":n[2]||(n[2]=r=>_.value=r),onChange:q},{default:l(()=>[(h(),p(E,null,$(v,r=>t(j,{key:r,label:r},{default:l(()=>[o(S(r),1)]),_:2},1032,["label"])),64))]),_:1},8,["modelValue"])])):D("",!0),Y.value?(h(),p("div",ve,[o(" ** 微信文件夹路径： "),t(V,{placeholder:"密钥key[可为空]",modelValue:g.value,"onUpdate:modelValue":n[3]||(n[3]=r=>g.value=r),style:{width:"50%"}},null,8,["modelValue"])])):D("",!0),M.value?(h(),p("div",ye,[o(" ** 微信文件夹路径： "),t(V,{placeholder:"微信文件夹路径[可为空](eg: C:\\****\\WeChat Files\\wxid_**** )",modelValue:a.value,"onUpdate:modelValue":n[4]||(n[4]=r=>a.value=r),style:{width:"50%"}},null,8,["modelValue"])])):D("",!0)]),t(W,{style:{"margin-top":"10px",width:"50%"},type:"success",onClick:N},{default:l(()=>[o("导出")]),_:1}),t(J),t(V,{type:"textarea",rows:6,readonly:"",placeholder:"",modelValue:e.value,"onUpdate:modelValue":n[5]||(n[5]=r=>e.value=r),style:{width:"100%"}},null,8,["modelValue"])])])])]),_:1})])}}}),ge={id:"chat_view",class:"common-layout"},Se={style:{height:"calc(100vh)",width:"100%","background-color":"#d2d2fa"}},be=C({__name:"ExportView",setup(w){const x=u({account:"",describe:"",headImgUrl:"",nickname:"",remark:"",username:"",chat_count:0}),m=f=>{x.value=f};return(f,_)=>{const g=c("el-aside"),a=c("el-container");return h(),p("div",ge,[t(a,null,{default:l(()=>[t(g,{width:"266px",style:{"overflow-y":"auto",height:"calc(100vh)"}},{default:l(()=>[t(le,{onUserData:m})]),_:1}),d("div",Se,[t(xe,{userData:x.value},null,8,["userData"])])]),_:1})])}}});export{be as default};
