import{k as S,j,r as U,R as z,an as I,a as q,I as M,al as C,b as s,o as V,c as N,d as e,e as l,g as n,F as O,h as T,s as H,H as g,t as K,f as y,K as W,S as k}from"./index.699f1124.js";import{g as $,u as A,i as G}from"./demand.e67e91cf.js";const J={class:"app-container"},Q=y("p",null,[y("b",null,"\u57FA\u672C\u4FE1\u606F")],-1),X=g("\u6DFB\u52A0"),Y=g("\u53D6\u6D88"),Z=g("\u63D0\u4EA4"),te={__name:"releaseService",setup(ee){S();const b=j(),P=U({form:{check:[],status:0},queryParams:{pageNum:1,pageSize:10,postCode:void 0},rules:{title:[{required:!0,message:"\u9700\u6C42\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],description:[{required:!0,message:"\u9700\u6C42\u63CF\u8FF0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],name:[{required:!0,message:"\u9700\u6C42\u8054\u7CFB\u4EBA\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],mobile:[{required:!0,message:"\u8054\u7CFB\u4EBA\u624B\u673A\u53F7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],username:[{required:!0,message:"\u9700\u6C42\u63D0\u4EA4\u4EBA\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],userPhone:[{required:!0,message:"\u624B\u673A\u53F7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}}),{form:t,rules:F}=z(P),w=140,d=U([...I]),i=q(""),m=q(),R=()=>{m.value.validate(async c=>{c&&(t.value.id!=null?(await A(t.value),k.success("\u4FEE\u6539\u6210\u529F")):(await G(t.value),k.success("\u65B0\u589E\u670D\u52A1\u9700\u6C42\u6210\u529F")),x())})},x=()=>{C.closeOpenPage({path:"/demand/serviceDemand"})};function B(){if(!i.value.trim().length)return k.error("\u8BF7\u8F93\u5165");d.some(a=>a.name.trim()==i.value.trim())||(d.push({id:d.length+1,name:i.value}),i.value="")}return M(()=>{if(m.value.resetFields(),b.query.id){const c=Object.assign({},b,{title:"\u4FEE\u6539\u670D\u52A1\u9700\u6C42"});C.updatePage(c),$({id:b.query.id}).then(a=>{a.data.kinds&&a.data.kinds.forEach((_,h)=>{d.find(r=>r.name==_)||d.push({id:h,name:_})}),t.value=a.data})}else t.value={check:[],status:0},m.value&&m.value.resetFields()}),(c,a)=>{const _=s("el-checkbox"),h=s("el-checkbox-group"),r=s("el-input"),u=s("el-col"),v=s("el-button"),f=s("el-row"),p=s("el-form-item"),D=s("wangEditor"),E=s("el-form"),L=s("el-card");return V(),N("div",J,[e(L,{shadow:"always",style:{width:"55%",margin:"0 auto"}},{default:l(()=>[e(E,{ref_key:"formRef",ref:m,model:n(t),rules:n(F),"label-width":w+"px"},{default:l(()=>[Q,e(f,null,{default:l(()=>[e(u,{span:24},{default:l(()=>[e(p,{label:"\u9700\u6C42\u7C7B\u522B:"},{default:l(()=>[e(h,{modelValue:n(t).kinds,"onUpdate:modelValue":a[0]||(a[0]=o=>n(t).kinds=o)},{default:l(()=>[(V(!0),N(O,null,T(d,o=>(V(),H(_,{key:o.id,label:o.name},{default:l(()=>[g(K(o.name),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"]),e(f,{gutter:20},{default:l(()=>[e(u,{span:20},{default:l(()=>[e(r,{modelValue:i.value,"onUpdate:modelValue":a[1]||(a[1]=o=>i.value=o),placeholder:"\u8BF7\u8F93\u5165\u9700\u6C42\u7C7B\u522B"},null,8,["modelValue"])]),_:1}),e(u,{span:4},{default:l(()=>[e(v,{type:"primary",onClick:B},{default:l(()=>[X]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),e(f,null,{default:l(()=>[e(u,{span:24},{default:l(()=>[e(p,{label:"\u9700\u6C42\u63CF\u8FF0:",prop:"description"},{default:l(()=>[e(D,{modelValue:n(t).description,"onUpdate:modelValue":a[2]||(a[2]=o=>n(t).description=o),width:"100%","min-height":"150px",onBlur:a[3]||(a[3]=o=>m.value.validateField("description"))},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(f,null,{default:l(()=>[e(u,{span:12},{default:l(()=>[e(p,{label:"\u9700\u6C42\u8054\u7CFB\u4EBA:",prop:"name"},{default:l(()=>[e(r,{modelValue:n(t).name,"onUpdate:modelValue":a[4]||(a[4]=o=>n(t).name=o),placeholder:"\u8BF7\u8F93\u5165\u9700\u6C42\u8054\u7CFB\u4EBA"},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:12},{default:l(()=>[e(p,{label:"\u8054\u7CFB\u4EBA\u624B\u673A\u53F7:",prop:"mobile"},{default:l(()=>[e(r,{modelValue:n(t).mobile,"onUpdate:modelValue":a[5]||(a[5]=o=>n(t).mobile=o),placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u4EBA\u624B\u673A\u53F7"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(f,null,{default:l(()=>[e(u,{span:12},{default:l(()=>[e(p,{label:"\u9700\u6C42\u63D0\u4EA4\u4EBA:",prop:"commitUserName"},{default:l(()=>[e(r,{modelValue:n(t).commitUserName,"onUpdate:modelValue":a[6]||(a[6]=o=>n(t).commitUserName=o),placeholder:"\u8BF7\u8F93\u5165\u9700\u6C42\u63D0\u4EA4\u4EBA"},null,8,["modelValue"])]),_:1})]),_:1}),e(u,{span:12},{default:l(()=>[e(p,{label:"\u9700\u6C42\u63D0\u4EA4\u4EBA\u624B\u673A\u53F7:",prop:"commitPhone"},{default:l(()=>[e(r,{modelValue:n(t).commitPhone,"onUpdate:modelValue":a[7]||(a[7]=o=>n(t).commitPhone=o),placeholder:"\u9700\u6C42\u63D0\u4EA4\u4EBA\u624B\u673A\u53F7"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules","label-width"]),y("div",{style:W({marginLeft:w+"px"})},[e(v,{onClick:x},{default:l(()=>[Y]),_:1}),e(v,{type:"primary",onClick:R},{default:l(()=>[Z]),_:1})],4)]),_:1})])}}};export{te as default};
