PageSourceSearch

https://mhtclouding.com/tongying/assets/index-CWc1R2wV.js

js mhtclouding.com collected 2026-10-02 16:03:20 UTC 8,995 bytes, 17 lines download raw bytes

1import{B as ce,_ as ue,r as d,M as de,w as pe,J as me,d as v,o as y,m as L,h as n,f as a,c as S,H as z,I as F,e as p,x as H,aC as fe,n as ve,ag as ge,p as b,K as T,s as _e,t as be}from"./index-uGWb9Yh4.js";function ye(g){return ce({url:"crm/email/send",method:"post",data:g,headers:{"Content-Type":"multipart/form-data"}})}const $=g=>(_e("data-v-644302b6"),g=g(),be(),g),he={class:"dynamic-input-group"},we={class:"add-button"},Ce={class:"editor-toolbar"},Me={class:"toolbar-buttons"},xe=$(()=>p("span",{style:{"font-weight":"bold"}},"B",-1)),ke=$(()=>p("span",{style:{"font-style":"italic"}},"I",-1)),je=$(()=>p("span",{style:{"text-decoration":"underline"}},"U",-1)),$e=$(()=>p("div",{class:"toolbar-divider"},null,-1)),Ve={class:"dialog-footer-fixed"},Ie={__name:"index",props:{visible:{type:Boolean,default:!1},to:{type:[String,Array],default:""},replyMail:{type:Object,default:null},forwardMail:{type:Object,default:null}},emits:["update:visible","success"],setup(g,{emit:N}){const o=g,B=N,V=d(o.visible),h=d(null),s=d(null),I=d(null),C=d(!1),M=d(!1),A=d(!1),E=d(!1),D=d(!1),l=de({to:[],cc:[""],subject:"",content:""}),J={to:[{required:!0,message:"请输入收件人",trigger:"blur"}],subject:[{required:!0,message:"请输入邮件主题",trigger:"blur"}],content:[{required:!0,validator:(t,e,r)=>{!e||e.trim()===""||e==="<br>"?r(new Error("请输入邮件内容")):r()},trigger:"blur"}],cc:[{validator:(t,e,r)=>{if(!e||!Array.isArray(e)){r();return}const m=e.filter(u=>!u||u.trim()===""?!1:!P(u.trim()));m.length>0?r(new Error(`抄送邮箱格式不正确: ${m.join(", ")}`)):r()},trigger:"blur"}]},_=d([]),O=d([{name:"Sam",email:"[email protected]"},{name:"王嘉琪",email:"[email protected]"},{name:"Reza Barzegar",email:"[email protected]"},{name:"John Doe",email:"[email protected]"}]),P=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),K=()=>{l.cc.push("")},G=t=>{l.cc.length>1&&l.cc.splice(t,1)},Q=t=>!t||!Array.isArray(t)?[]:t.map(e=>(e==null?void 0:e.trim())||"").filter(e=>e!==""),W=()=>{I.value&&I.value.click()},R=()=>{s.value&&(A.value=document.queryCommandState("bold"),E.value=document.queryCommandState("italic"),D.value=document.queryCommandState("underline"))},q=t=>{s.value&&(s.value.focus(),document.execCommand(t,!1,null),R(),w())};pe(()=>o.visible,t=>{V.value=t,t&&me(()=>{X()})});const X=()=>{if(o.to&&(Array.isArray(o.to)?l.to=o.to:l.to=[o.to]),s.value&&(s.value.innerHTML=""),l.content="",o.replyMail){l.to=[o.replyMail.senderEmail],l.subject=`Re: ${o.replyMail.subject}`;const t=`
2      <div style="border-left: 2px solid #ddd; padding-left: 10px; margin: 10px 0; color: #666;">
3        <p><strong>发件人:</strong>${o.replyMail.sender||o.replyMail.senderEmail}</p>
4        <p><strong>时间:</strong>${o.replyMail.time}</p>
5        <p><strong>主题:</strong>${o.replyMail.subject}</p>
6        <br>
7        <div>${o.replyMail.preview||""}</div>
8      </div>
9    `;s.value&&(s.value.innerHTML=t,l.content=t)}if(o.forwardMail&&!o.replyMail){l.subject=`Fw: ${o.forwardMail.subject}`;const t=`
10      <div style="border-left: 2px solid #ddd; padding-left: 10px; margin: 10px 0; color: #666;">
11        <p><strong>发件人:</strong>${o.forwardMail.sender||o.forwardMail.senderEmail}</p>
12        <p><strong>时间:</strong>${o.forwardMail.time}</p>
13        <p><strong>主题:</strong>${o.forwardMail.subject}</p>
14        <br>
15        <div>${o.forwardMail.preview||""}</div>
16      </div>
17    `;s.value&&(s.value.innerHTML=t,l.content=t)}},w=()=>{s.value&&(l.content=s.value.innerHTML)},Y=t=>{t.preventDefault();const e=t.clipboardData.getData("text/plain");document.execCommand("insertText",!1,e),w()},Z=()=>{if(!s.value)return;s.value.focus();const t=prompt("请输入链接地址:","https://");if(t){const e=prompt("请输入链接文本:",t);if(e!==null){const r=`<a href="${t}" target="_blank">${e}</a>`;document.execCommand("insertHTML",!1,r),w()}}},ee=t=>{const e=t.target.files[0];if(!e)return;const r=new FileReader;r.onload=m=>{if(!s.value)return;s.value.focus();const u=`<img src="${m.target.result}" style="max-width: 100%; height: auto; margin: 5px 0;" />`;document.execCommand("insertHTML",!1,u),w()}
17,r.readAsDataURL(e),t.target.value=""},te=(t,e)=>{_.value=e},le=(t,e)=>{_.value=e},x=()=>{B("update:visible",!1),ae()},ae=()=>{l.to=[],l.cc=[""],l.subject="",l.content="",_.value=[],s.value&&(s.value.innerHTML=""),h.value&&h.value.resetFields(),C.value=!1,M.value=!1,A.value=!1,E.value=!1,D.value=!1},oe=async()=>{try{M.value=!0,await new Promise(t=>setTimeout(t,800)),console.log("邮件已保存到草稿箱"),x()}catch(t){console.error("保存草稿失败:",t)}finally{M.value=!1}},ne=async()=>{var t;if(h.value)try{await h.value.validate(),C.value=!0;const e={to:Array.isArray(l.to)?l.to.join(","):l.to,subject:l.subject,content:l.content,htmlContent:!0},r=Q(l.cc);r.length>0&&(e.cc=r.join(",")),(t=o.replyMail)!=null&&t.clientId&&(e.clientId=o.replyMail.clientId);const m=new FormData,u=JSON.stringify(e),k=new Blob([u],{type:"application/json"});m.append("request",k),_.value.length>0&&_.value.forEach(f=>{f.raw&&m.append("files",f.raw,f.name)});const c=await ye(m);if(c.code===200)ElMessage.success("邮件发送成功"),B("success"),x();else throw new Error(c.msg||"发送失败")}catch(e){console.error("邮件发送失败:",e),ElMessage.error(e.message||"邮件发送失败")}finally{C.value=!1}};return(t,e)=>{const r=v("el-option"),m=v("el-select"),u=v("el-form-item"),k=v("el-input"),c=v("el-button"),f=v("el-tooltip"),se=v("el-upload"),re=v("el-form"),ie=v("el-dialog");return y(),L(ie,{modelValue:V.value,"onUpdate:modelValue":e[6]||(e[6]=i=>V.value=i),title:"写信",width:800,"close-on-click-modal":!1,onClose:x},{default:n(()=>[a(re,{ref_key:"formRef",ref:h,model:l,rules:J,"label-width":"60px","label-position":"left"},{default:n(()=>[a(u,{label:"收件人",prop:"to",required:""},{default:n(()=>[a(m,{modelValue:l.to,"onUpdate:modelValue":e[0]||(e[0]=i=>l.to=i),multiple:"",filterable:"","allow-create":"","default-first-option":"",placeholder:"请输入邮箱地址",style:{width:"100%"}},{default:n(()=>[(y(!0),S(z,null,F(O.value,i=>
17(y(),L(r,{key:i.email,label:`${i.name} <${i.email}>`,value:i.email},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(u,{label:"抄送",prop:"cc"},{default:n(()=>[p("div",he,[(y(!0),S(z,null,F(l.cc,(i,j)=>(y(),S("div",{class:"input-row",key:j},[a(k,{modelValue:l.cc[j],"onUpdate:modelValue":U=>l.cc[j]=U,placeholder:"请输入抄送邮箱地址",style:{flex:"1","margin-right":"8px"}},null,8,["modelValue","onUpdate:modelValue"]),l.cc.length>1?(y(),L(c,{key:0,type:"danger",size:"small",icon:H(fe),circle:"",onClick:U=>G(j)},null,8,["icon","onClick"])):ve("",!0)]))),128)),p("div",we,[a(c,{type:"primary",plain:"",size:"small",icon:H(ge),onClick:K},{default:n(()=>[b(" 添加抄送 ")]),_:1},8,["icon"])])])]),_:1}),a(u,{label:"主题",prop:"subject",required:""},{default:n(()=>[a(k,{modelValue:l.subject,"onUpdate:modelValue":e[1]||(e[1]=i=>l.subject=i),placeholder:"请输入邮件主题"},null,8,["modelValue"])]),_:1}),a(u,{label:"正文",prop:"content",required:""},{default:n(()=>[p("div",Ce,[p("div",Me,[a(f,{content:"加粗",placement:"top"},{default:n(()=>[a(c,{class:T(["toolbar-btn",{active:A.value}]),onClick:e[2]||(e[2]=i=>q("bold"))},{default:n(()=>[xe]),_:1},8,["class"])]),_:1}),a(f,{content:"斜体",placement:"top"},{default:n(()=>[a(c,{class:T(["toolbar-btn",{active:E.value}]),onClick:e[3]||(e[3]=i=>q("italic"))},{default:n(()=>[ke]),_:1},8,["class"])]),_:1}),a(f,{content:"下划线",placement:"top"},{default:n(()=>[a(c,{class:T(["toolbar-btn",{active:D.value}]),onClick:e[4]||(e[4]=i=>q("underline"))},{default:n(()=>[je]),_:1},8,["class"])]),_:1}),$e,a(f,{content:"插入链接",placement:"top"},{default:n(()=>[a(c,{class:"toolbar-btn",onClick:Z},{default:n(()=>[b(" 链接 ")]),_:1})]),_:1}),a(f,{content:"插入图片",placement:"top"},{default:n(()=>[a(c,{class:"toolbar-btn",onClick:W},{default:n(()=>[b(" 图片 ")]),_:1})]),_:1})])]),p("input",{ref_key:"imageInputRef",ref:I,type:"file",accept:"image/*",style:{display:"none"},onChange:ee},null,544),p("div",{ref_key:"editorRef",ref:s,class:"editor-content",contenteditable:"",placeholder:"请输入邮件正文...",onInput:w,onPaste:Y,onMouseup:R,onKeyup:R},null,544)]),_:1}),a(u,{label:"附件"},{default:n(()=>[a(se,{"file-list":_.value,"onUpdate:fileList":e[5]||(e[5]=i=>_.value=i),action:"#",multiple:"","auto-upload":!1,"on-change":te,"on-remove":le},{default:n(()=>[a(c,{type:"primary",plain:""},{default:n(()=>[b("添加附件")]),_:1})]),_:1},8,["file-list"])]),_:1})]),_:1},8,["model"]),p("div",Ve,[a(c,{onClick:x,size:"small"},{default:n(()=>[b("取消")]),_:1}),a(c,{onClick:oe,loading:M.value,size:"small"},{default:n(()=>[b(" 保存草稿 ")]),_:1},8,["loading"]),a(c,{type:"primary",onClick:ne,loading:C.value,size:"small"},{default:n(()=>[b(" 发送 ")]),_:1},8,["loading"])])]),_:1},8,["modelValue"])}}},Ee=ue(Ie,[["__scopeId","data-v-644302b6"]]);export{Ee as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.