1 |
- import{d as N,Q as M,r as c,x as O,o as p,A as y,B as a,f as e,a as l,E as I,k as T,c as D,F as K,R as Q,a2 as W,a8 as Z,V as j,I as P,L as z,S as G,U as H,W as J,K as X,Z as Y,__tla as $}from"./index-e8bff8cb.js";import{_ as ee,__tla as ae}from"./Dialog-4d17ac25.js";import{a as le,D as te,__tla as re}from"./dict-4a54e490.js";import{C as q}from"./constants-c811e5ff.js";import{a as se,c as ue,u as oe,__tla as de}from"./index-055d2e3d.js";import{u as me,__tla as ce}from"./useMessage-de42a595.js";import{_ as ne}from"./_plugin-vue_export-helper-1b428a4d.js";let w,_e=Promise.all([(()=>{try{return $}catch{}})(),(()=>{try{return ae}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return ce}catch{}})()]).then(async()=>{w=ne(N({name:"SystemRoleForm",__name:"RoleForm",emits:["success"],setup(ie,{expose:x,emit:S}){const{t:f}=M(),V=me(),o=c(!1),b=c(""),d=c(!1),h=c(""),s=c({id:void 0,name:"",code:"",sort:void 0,status:q.ENABLE,remark:"",categoryId:void 0}),E=O({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(),A=()=>{var u;s.value={id:void 0,name:"",code:"",sort:void 0,status:q.ENABLE,remark:"",categoryId:void 0},(u=_.value)==null||u.resetFields()};x({open:async(u,t)=>{if(o.value=!0,b.value=f("action."+u),h.value=u,A(),t){d.value=!0;try{s.value=await se(t)}finally{d.value=!1}}}});const C=S,R=async()=>{if(_&&await _.value.validate()){d.value=!0;try{const u=s.value;h.value==="create"?(await ue(u),V.success(f("common.createSuccess"))):(await oe(u),V.success(f("common.updateSuccess"))),o.value=!1,C("success")}finally{d.value=!1}}};return(u,t)=>{const i=Z,m=j,n=P,g=z,v=G,k=H,B=J,U=X,F=ee,L=Y;return p(),y(F,{modelValue:l(o),"onUpdate:modelValue":t[7]||(t[7]=r=>W(o)?o.value=r:null),title:l(b)},{footer:a(()=>[e(U,{disabled:l(d),type:"primary",onClick:R},{default:a(()=>[I("\u786E \u5B9A")]),_:1},8,["disabled"]),e(U,{onClick:t[6]||(t[6]=r=>o.value=!1)},{default:a(()=>[I("\u53D6 \u6D88")]),_:1})]),default:a(()=>[T((p(),y(B,{ref_key:"formRef",ref:_,model:l(s),rules:l(E),"label-width":"120x",style:{padding:"10px"}},{default:a(()=>[e(g,{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(g,{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),D(K,null,Q(l(le)(l(te).COMMON_STATUS),r=>(p(),y(v,{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(g,{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(v,{label:"\u5E73\u53F0\u89D2\u8272",value:1}),e(v,{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"])),[[L,l(d)]])]),_:1},8,["modelValue","title"])}}}),[["__scopeId","data-v-5bf1972e"]])});export{_e as __tla,w as default};
|