(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-dc88a1de"],{"02f4":function(t,e,r){var i=r("4588"),n=r("be13");t.exports=function(t){return function(e,r){var s,o,a=String(n(e)),c=i(r),l=a.length;return c<0||c>=l?t?"":void 0:(s=a.charCodeAt(c),s<55296||s>56319||c+1===l||(o=a.charCodeAt(c+1))<56320||o>57343?t?a.charAt(c):s:t?a.slice(c,c+2):o-56320+(s-55296<<10)+65536)}}},"0390":function(t,e,r){"use strict";var i=r("02f4")(!0);t.exports=function(t,e,r){return e+(r?i(t,e).length:1)}},"214f":function(t,e,r){"use strict";r("b0c5");var i=r("2aba"),n=r("32e9"),s=r("79e5"),o=r("be13"),a=r("2b4c"),c=r("520a"),l=a("species"),u=!s(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}),f=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var r="ab".split(t);return 2===r.length&&"a"===r[0]&&"b"===r[1]}();t.exports=function(t,e,r){var h=a(t),d=!s(function(){var e={};return e[h]=function(){return 7},7!=""[t](e)}),p=d?!s(function(){var e=!1,r=/a/;return r.exec=function(){return e=!0,null},"split"===t&&(r.constructor={},r.constructor[l]=function(){return r}),r[h](""),!e}):void 0;if(!d||!p||"replace"===t&&!u||"split"===t&&!f){var m=/./[h],g=r(o,h,""[t],function(t,e,r,i,n){return e.exec===c?d&&!n?{done:!0,value:m.call(e,r,i)}:{done:!0,value:t.call(r,e,i)}:{done:!1}}),b=g[0],v=g[1];i(String.prototype,t,b),n(RegExp.prototype,h,2==e?function(t,e){return v.call(t,this,e)}:function(t){return v.call(t,this)})}}},"520a":function(t,e,r){"use strict";var i=r("0bfb"),n=RegExp.prototype.exec,s=String.prototype.replace,o=n,a="lastIndex",c=function(){var t=/a/,e=/b*/g;return n.call(t,"a"),n.call(e,"a"),0!==t[a]||0!==e[a]}(),l=void 0!==/()??/.exec("")[1],u=c||l;u&&(o=function(t){var e,r,o,u,f=this;return l&&(r=new RegExp("^"+f.source+"$(?!\\s)",i.call(f))),c&&(e=f[a]),o=n.call(f,t),c&&o&&(f[a]=f.global?o.index+o[0].length:e),l&&o&&o.length>1&&s.call(o[0],r,function(){for(u=1;u]*>)/g,d=/\$([$&`']|\d\d?)/g,p=function(t){return void 0===t?t:String(t)};r("214f")("replace",2,function(t,e,r,m){return[function(i,n){var s=t(this),o=void 0==i?void 0:i[e];return void 0!==o?o.call(i,s,n):r.call(String(s),i,n)},function(t,e){var n=m(r,t,this,e);if(n.done)return n.value;var f=i(t),h=String(this),d="function"===typeof e;d||(e=String(e));var b=f.global;if(b){var v=f.unicode;f.lastIndex=0}var C=[];while(1){var x=c(f,h);if(null===x)break;if(C.push(x),!b)break;var F=String(x[0]);""===F&&(f.lastIndex=a(h,s(f.lastIndex),v))}for(var w="",y=0,T=0;T=y&&(w+=h.slice(y,L)+I,y=L+$.length)}return w+h.slice(y)}];function g(t,e,i,s,o,a){var c=i+t.length,l=s.length,u=d;return void 0!==o&&(o=n(o),u=h),r.call(a,u,function(r,n){var a;switch(n.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,i);case"'":return e.slice(c);case"<":a=o[n.slice(1,-1)];break;default:var u=+n;if(0===u)return r;if(u>l){var h=f(u/10);return 0===h?r:h<=l?void 0===s[h-1]?n.charAt(1):s[h-1]+n.charAt(1):r}a=s[u-1]}return void 0===a?"":a})}})},b0c5:function(t,e,r){"use strict";var i=r("520a");r("5ca1")({target:"RegExp",proto:!0,forced:i!==/./.exec},{exec:i})},e749:function(t,e,r){"use strict";r.r(e);var i=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"email"},[r("div",{staticClass:"operation-btn"},[r("button",{on:{click:function(e){return t.send("ruleForm")}}},[t._v("发送")]),r("button",{on:{click:function(e){return t.saveDrafts("ruleForm")}}},[t._v("存草稿")]),r("button",{on:{click:function(e){return t.$router.back()}}},[t._v("返回")])]),r("div",{staticClass:"content-box"},[r("div",{staticClass:"content-header"},[r("div",{staticClass:"header-left"},[r("span",[t._v("发件人")]),r("span",[t._v(t._s(t.ruleForm.from)+"@"+t._s(t.emailSuffix))])]),r("div",{staticClass:"header-right"},[r("el-button",{attrs:{type:"mini",plain:""},on:{click:t.handleCC}},[t._v(t._s(t.ccOperation)+"抄送")]),r("el-button",{attrs:{type:"mini",plain:""},on:{click:t.handleBCC}},[t._v(t._s(t.bccOperation)+"密抄")])],1)]),r("el-form",{ref:"ruleForm",attrs:{model:t.ruleForm,"label-width":"60px",rules:t.rules}},[r("el-form-item",{attrs:{label:"收件人",prop:"to"}},[t.showTo?r("el-input",{ref:"toInput",attrs:{size:"small"},on:{change:function(e){return t.addToList("to")}},model:{value:t.ruleForm.to,callback:function(e){t.$set(t.ruleForm,"to",e)},expression:"ruleForm.to"}},[r("template",{slot:"append"},[r("el-button",{on:{click:function(e){return t.selectUser("to")}}},[t._v("选择")])],1)],2):r("div",{staticClass:"tag-box"},[r("div",{staticClass:"tag",on:{click:function(e){return e.stopPropagation(),t.showInput("to")}}},t._l(t.toTagList,function(e){return r("el-tag",{key:e.id,staticStyle:{"margin-right":"10px"},attrs:{size:"small",closable:""},on:{click:function(t){t.stopPropagation()},close:function(r){return t.handleTagClose("to",e)}}},[t._v(t._s(e.name))])}),1),r("el-button",{attrs:{size:"small"},on:{click:function(e){return t.selectUser("to")}}},[t._v("选择")])],1)],1),t.showCC?r("el-form-item",{attrs:{label:"抄送",prop:"cc"}},[t.showCCInput?r("el-input",{ref:"ccInput",attrs:{size:"small"},on:{change:function(e){return t.addToList("cc")}},model:{value:t.ruleForm.cc,callback:function(e){t.$set(t.ruleForm,"cc",e)},expression:"ruleForm.cc"}},[r("template",{slot:"append"},[r("el-button",{on:{click:function(e){return t.selectUser("cc")}}},[t._v("选择")])],1)],2):r("div",{staticClass:"tag-box"},[r("div",{staticClass:"tag",on:{click:function(e){return e.stopPropagation(),t.showInput("cc")}}},t._l(t.ccTagList,function(e){return r("el-tag",{key:e.id,staticStyle:{"margin-right":"10px"},attrs:{size:"small",closable:""},on:{click:function(t){t.stopPropagation()},close:function(r){return t.handleTagClose("cc",e)}}},[t._v(t._s(e.name))])}),1),r("el-button",{attrs:{size:"small"},on:{click:function(e){return t.selectUser("cc")}}},[t._v("选择")])],1)],1):t._e(),t.showBCC?r("el-form-item",{attrs:{label:"密送",prop:"bcc"}},[t.showBCCInput?r("el-input",{ref:"bccInput",attrs:{size:"small"},on:{change:function(e){return t.addToList("bcc")}},model:{value:t.ruleForm.bcc,callback:function(e){t.$set(t.ruleForm,"bcc",e)},expression:"ruleForm.bcc"}},[r("template",{slot:"append"},[r("el-button",{on:{click:function(e){return t.selectUser("bcc")}}},[t._v("选择")])],1)],2):r("div",{staticClass:"tag-box"},[r("div",{staticClass:"tag",on:{click:function(e){return e.stopPropagation(),t.showInput("bcc")}}},t._l(t.bccTagList,function(e){return r("el-tag",{key:e.id,staticStyle:{"margin-right":"10px"},attrs:{size:"small",closable:""},on:{click:function(t){t.stopPropagation()},close:function(r){return t.handleTagClose("bcc",e)}}},[t._v(t._s(e.name))])}),1),r("el-button",{attrs:{size:"small"},on:{click:function(e){return t.selectUser("bcc")}}},[t._v("选择")])],1)],1):t._e(),r("el-form-item",{attrs:{label:"主题",prop:"subject"}},[r("el-input",{staticStyle:{width:"80%"},attrs:{size:"small"},model:{value:t.ruleForm.subject,callback:function(e){t.$set(t.ruleForm,"subject",e)},expression:"ruleForm.subject"}}),r("el-select",{staticStyle:{width:"20%"},attrs:{size:"small"},model:{value:t.ruleForm.type,callback:function(e){t.$set(t.ruleForm,"type",e)},expression:"ruleForm.type"}},[r("el-option",{attrs:{label:"一般邮件",value:"0"}}),r("el-option",{attrs:{label:"重要邮件",value:"1"}}),r("el-option",{attrs:{label:"非常重要",value:"2"}})],1)],1),r("el-form-item",{staticClass:"mt10"},[r("UploadFile",{on:{getFileId:t.addFileId,subFileId:t.subFileId}})],1),r("el-form-item",{attrs:{label:"内容",prop:"content"}},[r("vue-ueditor-wrap",{staticClass:"ueditor",attrs:{config:t.myConfig},model:{value:t.ruleForm.content,callback:function(e){t.$set(t.ruleForm,"content",e)},expression:"ruleForm.content"}})],1)],1)],1),t.userVisible?r("User_Select",{ref:"userSelect",attrs:{userVisible:t.userVisible,rightSelectedUser:t.setRightUsersList},on:{closeUserVisiable:t.resetUserSelect,selectedUsersList:t.selectedUsersList}}):t._e()],1)},n=[],s=(r("a481"),r("cebc")),o=r("7421"),a=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("el-upload",{staticClass:"upload-demo",attrs:{action:t.contextPath+"/email/uploadAttachment",headers:t.headerObj,"on-remove":t.handleRemove,"on-success":t.handleSuccess,"before-remove":t.beforeRemove,"file-list":t.fileList,"before-upload":t.beforeUpload,data:t.data}},[r("el-button",{attrs:{size:"small",type:"primary"}},[t._v("附件上传")])],1)},c=[],l=(r("7f7f"),r("d1df")),u=(r("bc3a"),{data:function(){return{contextPath:l["a"].contextPath,headerObj:{"Content-Type":"multipart/form-data;boundary="+Math.random()},fileList:[],data:{files:""}}},methods:{handleSuccess:function(t,e,r){0==t.errcode&&(this.$emit("getFileId",e.uid),this.$message.success("成功上传附件!"))},handleRemove:function(t,e){var r=this;this.$api.deleteFile(t.uid,{onSucess:function(e){0==e.data.errcode?(r.$emit("subFileId",t.uid),r.$message.success("成功移除附件!")):r.$message.warning(e.data.errmsg)}})},beforeRemove:function(t,e){return this.$confirm("确定移除 ".concat(t.name,"?"))},beforeUpload:function(t){var e=this,r=new FileReader;r.readAsText(t,"UTF-8"),r.onload=function(t){var r=t.target.result;e.data.files=new Blob([r],{type:"text/plain"})}}}}),f=u,h=r("2877"),d=Object(h["a"])(f,a,c,!1,null,null,null),p=d.exports,m={name:"email",data:function(){return{loading:!0,rules:{subject:[{required:!0,message:"请输入主题",trigger:"blur"}],content:[{required:!0,message:"请输入内容",trigger:"blur"}]},ruleForm:{from:"",to:"",subject:"",cc:"",bcc:"",type:"0",content:"",attids:[]},myConfig:{toolbars:[["undo","redo","bold","indent","italic","underline","strikethrough","formatmatch","horizontal","removeformat","link","unlink","inserttable","insertrow","insertcol","mergeright","mergedown","deleterow","deletecol","splittorows","splittocols","splittocells","deletecaption","inserttitle","mergecells","deletetable","fontfamily","fontsize","simpleupload","emotion","justifyleft","justifyright","justifycenter","justifyjustify","forecolor","backcolor","insertorderedlist","insertunorderedlist","lineheight","edittip "]],autoHeightEnabled:!0,initialFrameHeight:240,initialFrameWidth:"100%",serverUrl:"http://localhost:8083/",UEDITOR_HOME_URL:"UEditor/"},showCC:!1,showBCC:!1,showTo:!1,toTagList:[],showCCInput:!1,ccTagList:[],showBCCInput:!1,bccTagList:[],emailSuffix:"",userVisible:!1,currentUser:""}},methods:{getSuffix:function(){var t=this;this.$api.getEmailSuffix({onSucess:function(e){0==e.data.errcode?t.emailSuffix=e.data.data:t.$message.warning(e.data.errmsg)}})},getDetail:function(){var t=this;this.loading=!0;var e=this.$route.query.folderId,r=this.$route.query.id;this.$api.getEmailDetail(e,r,{onSucess:function(e){if(0==e.data.errcode){t.loading=!1;var r=e.data.data,i="\n

-----------原始邮件------------

\n

发件人:".concat(r.emailBody.from,"

\n

时间:").concat(t.formDate(r.emailBody.sendDate),"

\n

收件人:").concat(r.emailBody.to,"

\n

");2==t.$route.query.type?(t.ruleForm.subject="转发:"+r.emailBody.subject,t.ruleForm.content=i+r.emailBody.content):1==t.$route.query.type?(t.ruleForm.subject="回复:"+r.emailBody.subject,t.ruleForm.content=i+r.emailBody.content,t.toTagList.push({name:r.emailBody.from,email:r.emailBody.from})):t.ruleForm={from:"",to:"",subject:"",cc:"",bcc:"",type:"0",content:"",attids:[]}}}})},handleBCC:function(){this.showBCC=!this.showBCC,this.showBCC||(this.bccTagList=[])},handleCC:function(){this.showCC=!this.showCC,this.showCC||(this.ccTagList=[])},showInput:function(t){var e=this;"to"==t?(this.showTo=!0,this.$nextTick(function(){e.$refs.toInput.focus()})):"cc"==t?(this.showCCInput=!0,this.$nextTick(function(){e.$refs.ccInput.focus()})):"bcc"==t&&(this.showBCCInput=!0,this.$nextTick(function(){e.$refs.bccInput.focus()}))},handleTagClose:function(t,e){"to"==t?this.toTagList.splice(this.toTagList.indexOf(e),1):"cc"==t?this.ccTagList.splice(this.ccTagList.indexOf(e),1):"bcc"==t&&this.bccTagList.splice(this.bccTagList.indexOf(e),1)},addToList:function(t){"to"==t?(this.toTagList.push({name:this.ruleForm.to,email:this.ruleForm.to}),this.ruleForm.to="",this.showTo=!1):"cc"==t?(this.ccTagList.push({name:this.ruleForm.cc,email:this.ruleForm.cc}),this.ruleForm.cc="",this.showCCInput=!1):"bcc"==t&&(this.bccTagList.push({name:this.ruleForm.bcc,email:this.ruleForm.bcc}),this.ruleForm.bcc="",this.showBCCInput=!1)},selectedUsersList:function(t){"to"==this.currentUser?this.toTagList=t:"cc"==this.currentUser?this.ccTagList=t:"bcc"==this.currentUser&&(this.bccTagList=t)},selectUser:function(t){this.userVisible=!0,this.currentUser=t},resetUserSelect:function(){this.userVisible=!1,this.$refs.userSelect.selectedUsers=[],this.$refs.userSelect.selectedUsersList=[],this.$refs.userSelect.deptUser=[],this.$refs.userSelect.searchData=[],this.$refs.userSelect.searchValue=""},addFileId:function(t){this.ruleForm.attids.push(t+"")},subFileId:function(t){this.ruleForm.attids.splice(this.ruleForm.attids.indexOf(t),1)},send:function(t){var e=this;this.$refs[t].validate(function(t){if(!t)return!1;var r=e.$store.state.inboxId,i=[];e.toTagList.length>0&&e.toTagList.map(function(t){return i.push(t.email)});var n=[];e.ccTagList.length>0&&e.ccTagList.map(function(t){return n.push(t.email)});var o=[];e.bccTagList.length>0&&e.bccTagList.map(function(t){return o.push(t.email)});var a=Object(s["a"])({},e.ruleForm,{from:e.ruleForm.from+"@"+e.emailSuffix,to:i.length>0?i.join(","):"",cc:n.length>0?n.join(","):"",bcc:o.length>0?o.join(","):""});e.$api.sendEmail(r,a,{onSucess:function(t){0==t.data.errcode?e.$router.replace("/tip"):e.$message.warning(t.data.errmsg)}})})},saveDrafts:function(t){var e=this;this.$refs[t].validate(function(t){if(!t)return!1;var r=e.$store.state.draftsId,i=[];e.toTagList.length>0&&e.toTagList.map(function(t){return i.push(t.email)});var n=[];e.ccTagList.length>0&&e.ccTagList.map(function(t){return n.push(t.email)});var o=[];e.bccTagList.length>0&&e.bccTagList.map(function(t){return o.push(t.email)});var a=Object(s["a"])({},e.ruleForm,{from:e.ruleForm.from+"@"+e.emailSuffix,to:i.length>0?i.join(","):"",cc:n.length>0?n.join(","):"",bcc:o.length>0?o.join(","):""});e.$api.sendEmail(r,a,{onSucess:function(t){if(0!=t.data.errcode)return e.$message.warning(t.data.errmsg);e.$message.success("邮件已存储到草稿箱!")}})})},formDate:function(t){var e=new Date(t),r=e.getFullYear(),i=e.getMonth()+1>=10?e.getMonth()+1:"0"+e.getMonth()+1,n=e.getDate()>=10?e.getDate():"0"+e.getDate(),s=e.getHours()>=10?e.getHours():"0"+e.getHours(),o=e.getMinutes()>=10?e.getMinutes():"0"+e.getMinutes(),a=e.getSeconds()>=10?e.getSeconds():"0"+e.getSeconds();return r+"-"+i+"-"+n+" "+s+":"+o+":"+a}},created:function(){this.ruleForm.from=JSON.parse(sessionStorage.getItem("emailUser")).account,this.getSuffix(),this.loading=!1;var t=this.$route.query.type;1!=t&&2!=t||this.getDetail()},computed:{ccOperation:function(){var t="";return t=this.showCC?"删除":"添加",t},bccOperation:function(){var t="";return t=this.showBCC?"删除":"添加",t},setRightUsersList:function(){var t=[];return"to"==this.currentUser?t=this.toTagList:"cc"==this.currentUser?t=this.ccTagList:"bcc"==this.currentUser&&(t=this.bccTagList),t}},components:{User_Select:o["a"],UploadFile:p}},g=m,b=Object(h["a"])(g,i,n,!1,null,null,null);e["default"]=b.exports}}]); //# sourceMappingURL=chunk-dc88a1de.6740727d.js.map