import{d as B,i as N,r as c,f as L,o as p,x as y,w as a,g as e,a as l,q as x,y as M,c as O,F as T,v as j,Q as G,X as J,B as Q,E as P,j as X,z as H,A as K,G as W,D as Y,J as Z,_ as $,__tla as ee}from"./index-7d5b26d3.js";import{_ as ae,__tla as le}from"./Dialog-2be588df.js";import{a as te,D as re,__tla as se}from"./dict-37d1dfe8.js";import{C as I}from"./constants-d55a3460.js";import{a as ue,c as oe,u as de,__tla as me}from"./index-aac743c0.js";import{u as ce,__tla as ne}from"./useMessage-c81eaa5b.js";let U,_e=Promise.all([(()=>{try{return ee}catch{}})(),(()=>{try{return le}catch{}})(),(()=>{try{return se}catch{}})(),(()=>{try{return me}catch{}})(),(()=>{try{return ne}catch{}})()]).then(async()=>{U=$(B({name:"SystemRoleForm",__name:"RoleForm",emits:["success"],setup(ie,{expose:q,emit:E}){const{t:f}=N(),V=ce(),o=c(!1),b=c(""),d=c(!1),h=c(""),s=c({id:void 0,name:"",code:"",sort:void 0,status:I.ENABLE,remark:"",categoryId:void 0}),F=L({name:[{required:!0,message:"\u5C97\u4F4D\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],code:[{required:!0,message:"\u5C97\u4F4D\u7F16\u7801\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}],sort:[{required:!0,message:"\u5C97\u4F4D\u987A\u5E8F\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}],status:[{required:!0,message:"\u5C97\u4F4D\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}],remark:[{required:!1,message:"\u5C97\u4F4D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],categoryId:[{required:!0,message:"\u7528\u6237\u7C7B\u522B\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),_=c(),S=()=>{var u;s.value={id:void 0,name:"",code:"",sort:void 0,status:I.ENABLE,remark:"",categoryId:void 0},(u=_.value)==null||u.resetFields()};q({open:async(u,t)=>{if(o.value=!0,b.value=f("action."+u),h.value=u,S(),t){d.value=!0;try{s.value=await ue(t)}finally{d.value=!1}}}});const A=E,C=async()=>{if(_&&await _.value.validate()){d.value=!0;try{const u=s.value;h.value==="create"?(await oe(u),V.success(f("common.createSuccess"))):(await de(u),V.success(f("common.updateSuccess"))),o.value=!1,A("success")}finally{d.value=!1}}};return(u,t)=>{const i=J,m=Q,n=P,v=X,g=H,k=K,D=W,w=Y,R=ae,z=Z;return p(),y(R,{modelValue:l(o),"onUpdate:modelValue":t[7]||(t[7]=r=>G(o)?o.value=r:null),title:l(b)},{footer:a(()=>[e(w,{disabled:l(d),type:"primary",onClick:C},{default:a(()=>[x("\u786E \u5B9A")]),_:1},8,["disabled"]),e(w,{onClick:t[6]||(t[6]=r=>o.value=!1)},{default:a(()=>[x("\u53D6 \u6D88")]),_:1})]),default:a(()=>[M((p(),y(D,{ref_key:"formRef",ref:_,model:l(s),rules:l(F),"label-width":"120x",style:{padding:"10px"}},{default:a(()=>[e(v,{gutter:30},{default:a(()=>[e(n,{span:"12"},{default:a(()=>[e(m,{label:"\u89D2\u8272\u540D\u79F0",prop:"name"},{default:a(()=>[e(i,{modelValue:l(s).name,"onUpdate:modelValue":t[0]||(t[0]=r=>l(s).name=r),placeholder:"\u8BF7\u8F93\u5165\u89D2\u8272\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1}),e(n,{span:"12"},{default:a(()=>[e(m,{label:"\u89D2\u8272\u6807\u8BC6",prop:"code"},{default:a(()=>[e(i,{modelValue:l(s).code,"onUpdate:modelValue":t[1]||(t[1]=r=>l(s).code=r),placeholder:"\u8BF7\u8F93\u5165\u89D2\u8272\u6807\u8BC6"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(v,{gutter:30},{default:a(()=>[e(n,{span:"12"},{default:a(()=>[e(m,{label:"\u663E\u793A\u987A\u5E8F",prop:"sort"},{default:a(()=>[e(i,{modelValue:l(s).sort,"onUpdate:modelValue":t[2]||(t[2]=r=>l(s).sort=r),placeholder:"\u8BF7\u8F93\u5165\u663E\u793A\u987A\u5E8F"},null,8,["modelValue"])]),_:1})]),_:1}),e(n,{span:"12"},{default:a(()=>[e(m,{label:"\u72B6\u6001",prop:"status"},{default:a(()=>[e(k,{modelValue:l(s).status,"onUpdate:modelValue":t[3]||(t[3]=r=>l(s).status=r),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001"},{default:a(()=>[(p(!0),O(T,null,j(l(te)(l(re).COMMON_STATUS),r=>(p(),y(g,{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(v,{gutter:30},{default:a(()=>[e(n,{span:"24"},{default:a(()=>[e(m,{label:"\u7528\u6237\u7C7B\u522B",prop:"categoryId"},{default:a(()=>[e(k,{modelValue:l(s).categoryId,"onUpdate:modelValue":t[4]||(t[4]=r=>l(s).categoryId=r),placeholder:"\u8BF7\u9009\u62E9"},{default:a(()=>[e(g,{label:"\u5E73\u53F0\u89D2\u8272",value:1}),e(g,{label:"\u5546\u6237\u89D2\u8272",value:2})]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(m,{label:"\u5907\u6CE8",prop:"remark"},{default:a(()=>[e(i,{style:{width:"430px"},modelValue:l(s).remark,"onUpdate:modelValue":t[5]||(t[5]=r=>l(s).remark=r),placeholder:"\u8BF7\u8F93\u5907\u6CE8",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[z,l(d)]])]),_:1},8,["modelValue","title"])}}}),[["__scopeId","data-v-94ce70f8"],["__file","D:/zx/mall-newfeifan-zx-business/src/views/system/role/RoleForm.vue"]])});export{_e as __tla,U as default};
