import{p as w,a as y}from"./message-DXvGgNDO.js";import{_ as k,r as a,A as q,B as F,c as r,d as c,e as _,f as o,h as n,i as N,I as j,F as B,J as P,G as R,m as v,v as L}from"./index-DQMN5y1g.js";const S={class:"container"},U=j({name:"Post"}),$=Object.assign(U,{setup(A){const{proxy:u}=L();a([]);const g=a(!1);a(!0),a(!0),a(0),a("");const d=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:E,form:J,rules:h}=F(b);w().then(s=>{d.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&&(d.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"),m=r("el-form-item"),V=r("el-option"),C=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:N(h)},{default:n(()=>[o(m,{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(m,{label:"招聘项目：",prop:"proId"},{default:n(()=>[o(C,{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),_(B,null,P(d.value,t=>(c(),R(V,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),o(m,{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"])])}}}),G=k($,[["__scopeId","data-v-df0798fc"]]);export{G as default};
