import{m as x}from"./user-2cd65a42.js";import{M as i,A,p as R,R as D,F as M,I as U,e as k,q}from"./ui-ba7aaa7e.js";import{e as F,l as I,r as p,a2 as P,P as C,a3 as T,a4 as s,f as o,H as h}from"./vue-bf422dc1.js";import{_ as B}from"./index-8db2df2c.js";import"./icons-a8498fb6.js";import"./libs-51817cd7.js";import"./plugins-ca970193.js";import"./others-9f318174.js";import"./echarts-bf9d612c.js";const N={name:"MessagePopup"},S=F({...N,setup(j,{expose:u}){const d=[{label:"系统消息",value:"site"},{label:"电子邮件",value:"email"}],t=I({...{user_id:0,type:"site",title:"",content:""}}),r=p(!1);u({init:l=>{t.user_id=l,r.value=!0}});const _={type:[{required:!0,message:"必填",type:"error"}],content:[{required:!0,message:"必填",type:"error"}],title:[{required:!0,message:"必填",type:"error"}]},m=p(null),c=async()=>{const l=await m.value.validate();if(typeof l!="object"&&l)try{const e=await x(t);e.code===1?(i.success("发送成功"),r.value=!1):i.error(e.msg)}catch(e){i.error(e.msg)}};return(l,e)=>{const f=A,v=R,y=D,n=M,g=U,b=P("wp-editor"),V=k,w=q;return C(),T(w,{visible:r.value,"onUpdate:visible":e[3]||(e[3]=a=>r.value=a),size:"100%","close-on-overlay-click":!1,"destroy-on-close":!0,header:"发送消息","on-confirm":c},{default:s(()=>[o(f,{theme:"info"},{default:s(()=>[h("系统消息仅可纯文本，标题请尽量简短")]),_:1}),o(v),o(V,{ref_key:"formRef",ref:m,"label-align":"left",data:t,rules:_,"label-width":80},{default:s(()=>[o(n,{label:"消息类型",name:"type"},{default:s(()=>[o(y,{modelValue:t.type,"onUpdate:modelValue":e[0]||(e[0]=a=>t.type=a),options:d},null,8,["modelValue"])]),_:1}),o(n,{label:"标题",name:"title"},{default:s(()=>[o(g,{modelValue:t.title,"onUpdate:modelValue":e[1]||(e[1]=a=>t.title=a),clearable:"",placeholder:"请输入标题"},null,8,["modelValue"])]),_:1}),o(n,{label:"内容",name:"content"},{default:s(()=>[o(b,{modelValue:t.content,"onUpdate:modelValue":e[2]||(e[2]=a=>t.content=a),height:"500px",width:"100%",mode:"simple","user-type":"admin"},null,8,["modelValue"])]),_:1})]),_:1},8,["data"])]),_:1},8,["visible"])}}});const Y=B(S,[["__scopeId","data-v-df0756f3"]]);export{Y as default};
