diff --git a/mail-vue/src/components/email-scroll/index.vue b/mail-vue/src/components/email-scroll/index.vue index 90c58c7..238fb31 100644 --- a/mail-vue/src/components/email-scroll/index.vue +++ b/mail-vue/src/components/email-scroll/index.vue @@ -148,7 +148,7 @@
${E.content}`,S()})}function S(){r.currentAccount.email?(f.sendEmail=r.currentAccount.email,f.accountId=r.currentAccount.accountId,f.name=r.currentAccount.name):(f.sendEmail=a.user.email,f.accountId=a.user.accountId,f.name=a.user.name),o.value=!0,i.value.focus()}const C=E=>{E.key==="Escape"&&x()};ut(()=>{window.addEventListener("keydown",C)}),Ja(()=>{window.removeEventListener("keydown",C)});function x(){o.value=!1}return(E,T)=>{const A=mP,k=Ki,O=vi;return rt((P(),Y("div",{class:"send",onClick:x},[M("div",{class:"write-box",onClick:T[2]||(T[2]=qe(()=>{},["stop"]))},[M("div",tne,[M("div",nne,[M("span",rne,[$(w(Ie),{icon:"hugeicons:quill-write-01",width:"28",height:"28"})]),T[3]||(T[3]=M("span",{class:"sender"},"发件人:",-1)),M("span",ine,de(f.name),1),M("span",ane,"<"+de(f.sendEmail)+">",1)]),M("div",{onClick:x,style:{cursor:"pointer"}},[$(w(Ie),{icon:"material-symbols-light:close-rounded",width:"22",height:"22"})])]),M("div",one,[$(A,{onAddTag:d,"tag-type":"primary",size:"default",modelValue:f.receiveEmail,"onUpdate:modelValue":T[0]||(T[0]=V=>f.receiveEmail=V),placeholder:"多邮个箱用, 分开 example1.com,example2.com"},{prefix:U(()=>T[4]||(T[4]=[M("div",{class:"item-title"},"收件人 ",-1)])),suffix:U(()=>[M("span",{class:K(["distribute",f.manyType?"checked":""]),onClick:qe(h,["stop"])},"分别发送",2)]),_:1},8,["modelValue"]),$(k,{modelValue:f.subject,"onUpdate:modelValue":T[1]||(T[1]=V=>f.subject=V),placeholder:"请输入邮件主题"},{prefix:U(()=>T[5]||(T[5]=[M("div",{class:"item-title"},"主题 ",-1)])),_:1},8,["modelValue"]),$(Fte,{"def-value":c.value,ref_key:"editor",ref:i,onChange:b},null,8,["def-value"]),M("div",sne,[M("div",{class:"att-add",onClick:g},[$(w(Ie),{icon:"iconamoon:attachment-fill",width:"24",height:"24"})]),M("div",{class:"att-clear",onClick:p},[$(w(Ie),{icon:"icon-park-outline:clear-format",width:"24",height:"24 "})]),M("div",lne,[(P(!0),Y(Ke,null,Kt(f.attachments,(V,z)=>(P(),Y("div",{class:"att-item",key:z},[$(w(Ie),{icon:w(cO)(V.filename),width:"20",height:"20"},null,8,["icon"]),M("span",une,de(V.filename),1),M("span",cne,de(w(lO)(V.size)),1),$(w(Ie),{style:{cursor:"pointer"},icon:"material-symbols-light:close-rounded",onClick:D=>v(z),width:"22",height:"22"},null,8,["onClick"])]))),128))]),M("div",null,[f.sendType==="reply"?(P(),Q(O,{key:0,type:"primary",onClick:m},{default:U(()=>T[6]||(T[6]=[Ae("回复")])),_:1})):(P(),Q(O,{key:1,type:"primary",onClick:m},{default:U(()=>T[7]||(T[7]=[Ae("发送")])),_:1}))])])])])],512)),[[Jt,o.value]])}}},dne=cn(fne,[["__scopeId","data-v-f9742904"]]),hne={__name:"index",setup(e){const t=Ml(),n=B({}),r=B(window.innerWidth<1025),i=()=>{r.value=window.innerWidth<1025,t.asideShow=window.innerWidth>1024};return ut(()=>{t.writerRef=n,window.addEventListener("resize",i),i()}),an(()=>{window.removeEventListener("resize",i)}),(a,o)=>{const s=SU,l=CU,u=xU,c=wU;return P(),Y(Ke,null,[$(c,{class:"layout"},{default:U(()=>[$(s,{class:K(["aside",w(t).asideShow?"aside-show":"el-aside-hide"])},{default:U(()=>[$(See)]),_:1},8,["class"]),M("div",{class:K(w(t).asideShow&&r.value?"overlay-show":"overlay-hide"),onClick:o[0]||(o[0]=f=>w(t).asideShow=!1)},null,2),$(c,{class:"main-container"},{default:U(()=>[$(u,null,{default:U(()=>[$(l,null,{default:U(()=>[$(jee)]),_:1}),$(hte)]),_:1})]),_:1})]),_:1}),$(dne,{ref_key:"writerRef",ref:n},null,512)],64)}}},pne=cn(hne,[["__scopeId","data-v-517b6d1b"]]),vne=Object.freeze(Object.defineProperty({__proto__:null,default:pne},Symbol.toStringTag,{value:"Module"})),gne={class:"email-container"},mne={class:"header-actions"},yne={class:"header-right"},bne={key:0,class:"email-count"},_ne={class:"scroll-box","infinite-scroll-immediate":!1,"infinite-scroll-distance":"600"},wne=["data-checked","onClick"],Sne=["onClick"],Cne={key:1},xne={key:0,class:"email-status"},Tne={key:1},Ene={class:"name"},Ane={class:"phone-time"},Mne={class:"email-text"},kne={class:"email-subject"},Ine={class:"email-content"},Dne={key:0,class:"user-info"},Pne={class:"user"},Lne={class:"account"},One={key:0,class:"del-status"},Rne={class:"email-time"},Nne={key:0,class:"follow-loading"},$ne={key:1,class:"noLoading"},Bne={key:2,class:"empty"},Fne={__name:"index",props:{getEmailList:Function,emailDelete:Function,starAdd:Function,starCancel:Function,cancelSuccess:Function,starSuccess:Function,actionLeft:{type:String,default:"0"},timeSort:{type:Number,default:0},showStatus:{type:Boolean,default:!1},showAccountIcon:{type:Boolean,default:!0},showUserInfo:{type:Boolean,default:!1},showStar:{type:Boolean,default:!0},allowStar:{type:Boolean,default:!0}},emits:["jump","refresh-before"],setup(e,{expose:t,emit:n}){const r=e,i=n,a=gi(),o=Ml(),s=kl(),l=B(!1),u=B(!1),c=B(!1),f=dt([]),d=B(0),h=B(!1),p=B(!1),v=B(null),g=B(!0);let m=0;const y=B(null),b=B(null);let _=!1;const S=dt({emailId:0,size:30});t({refreshList:X,deleteEmail:V,addItem:z,emailList:f,firstLoad:g,latestEmail:y,noLoading:c,total:d}),ad(()=>{v.value.scrollTop=m}),N(),jX(()=>{m=v.value.scrollTop}),Ce(()=>f.map(Z=>Z.checked),()=>{f.length>0&&R()},{deep:!0}),Ce(()=>s.deleteIds,()=>{s.deleteIds&&V(s.deleteIds)}),Ce(()=>s.cancelStarEmailId,()=>{f.forEach(Z=>{Z.emailId===s.cancelStarEmailId&&(Z.isStar=0)})});const C=H(()=>o.accountShow&&a.settings.manyEmail===0);function x(Z){}function E(Z){if(Z.content){const oe=document.createElement("div");oe.innerHTML=Z.content,oe.querySelectorAll("script, style, title").forEach(ee=>ee.remove());let ue=oe.textContent||oe.innerText||"";return ue=ue.replace(/\s+/g," ").trim(),T(ue)}return Z.text?T(Z.text):""}function T(Z){return Z.replace(/[\u200B-\u200F\uFEFF\u034F\u200B-\u200F\u00A0\u3000\u00AD]/g,"").replace(/\s+/g," ").trim()}function A(Z){if(Z.isStar)Z.isStar=0,r.starCancel(Z.emailId).then(()=>{Z.isStar=0,r.cancelSuccess?.(Z)}).catch(oe=>{console.error(oe),Z.isStar=1});else{if(!r.allowStar)return;Z.isStar=1,r.starAdd(Z.emailId).then(()=>{Z.isStar=1,r.starSuccess(Z)}).catch(oe=>{console.error(oe),Z.isStar=0})}}function k(){o.accountShow=!o.accountShow}const O=()=>{ai.confirm("确认批量删除这些邮件吗?",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{const Z=I();r.emailDelete(Z).then(()=>{Ue({message:"删除成功",type:"success",plain:!0}),s.deleteIds=Z})})};function V(Z){Z.forEach(oe=>{f.forEach((ge,ue)=>{oe===ge.emailId&&f.splice(ue,1)})}),f.length
1&&r>0?s:o}};return a;function o(){return tg[1]&&(g[1]=v)}return this._rawCount=this._count=l,{start:s,end:l}},e.prototype._initDataFromProvider=function(t,n,r){for(var i=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=et(o,function(y){return y.property}),c=0;cm[1]&&(m[1]=g)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=n,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(t,n){if(!(n>=0&&n