import{p as w,a as y}from"./message-DjfehpFe.js";import{_ as k,r as a,C as q,D as F,e as r,o as c,c as _,f as o,h as n,F as N,I as j,J as B,m as v,i as P,B as R,v as L}from"./index-C1_1_QXk.js";const S={class:"container"},U=R({name:"Post"}),$=Object.assign(U,{setup(E){const{proxy:u}=L();a([]);const g=a(!1);a(!0),a(!0),a(0),a("");const m=a([]),l=a({title:"",project:"",content:""}),b=q({form:{},queryParams:{name:"",phoneNumber:"",openId:""},rules:{title:[{required:!0,message:"请输入标题",trigger:"blur"}],proId:[{required:!0,message:"请选择项目",trigger:"blur"}],content:[{required:!0,message:"请输入内容",trigger:"blur"},{max:255,message:"最多输入255个汉字",trigger:"blur"}]}}),{queryParams:J,form:O,rules:h}=F(b);w().then(s=>{m.value=[{value:"",label:"请选择"},...s.map(e=>(e=JSON.parse(e),{value:e.id,label:e.name,id:e.id}))]});function x(){u.$refs.ruleFormRef.validate(s=>{s&&(m.value.forEach(e=>{e.id==l.value.proId&&(l.value.proName=e.label)}),y(l.value).then(e=>{u.$modal.msgSuccess(e.code),g.value=!1,p()}))})}function p(){u.$router.push("/message")}return(s,e)=>{const i=r("el-input"),d=r("el-form-item"),C=r("el-option"),V=r("el-select"),f=r("el-button"),I=r("el-form");return c(),_("div",S,[o(I,{"label-position":"right","label-width":"auto",model:l.value,style:{"max-width":"600px"},ref:"ruleFormRef",rules:P(h)},{default:n(()=>[o(d,{label:"标题：",prop:"title"},{default:n(()=>[o(i,{modelValue:l.value.title,"onUpdate:modelValue":e[0]||(e[0]=t=>l.value.title=t),maxlength:"15"},null,8,["modelValue"])]),_:1}),o(d,{label:"招聘项目：",prop:"proId"},{default:n(()=>[o(V,{modelValue:l.value.proId,"onUpdate:modelValue":e[1]||(e[1]=t=>l.value.proId=t),placeholder:"请选择",style:{width:"530px"},onChange:s.handleProjectChange},{default:n(()=>[(c(!0),_(N,null,j(m.value,t=>(c(),B(C,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),o(d,{label:"内容：",prop:"content"},{default:n(()=>[o(i,{type:"textarea",modelValue:l.value.content,"onUpdate:modelValue":e[2]||(e[2]=t=>l.value.content=t),autosize:{minRows:4},maxlength:"255","show-word-limit":""},null,8,["modelValue"])]),_:1}),o(f,{onClick:x},{default:n(()=>[v("发送")]),_:1}),o(f,{onClick:p},{default:n(()=>[v("取消")]),_:1})]),_:1},8,["model","rules"])])}}}),D=k($,[["__scopeId","data-v-78169c51"]]);export{D as default};
