1 |
- import{d as L,h as M,r as c,e as O,o as p,q as y,w as a,f as e,a as l,m as w,v as T,c as z,F as D,n as H,N as j,U as G,z as J,E as P,i as K,x as Q,y as W,C as X,B as Y,H as Z,__tla as $}from"./index-2eab2d23.js";import{_ as ee,__tla as ae}from"./Dialog-c2716df6.js";import{a as le,D as te,__tla as re}from"./dict-1ad71b6f.js";import{C as I}from"./constants-40f13f5e.js";import{a as se,c as ue,u as oe,__tla as de}from"./index-7a06606e.js";import{u as me,__tla as ce}from"./useMessage-171aa63e.js";import{_ as ne}from"./_plugin-vue_export-helper-1b428a4d.js";let q,_e=Promise.all([(()=>{try{return $}catch{}})(),(()=>{try{return ae}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return ce}catch{}})()]).then(async()=>{q=ne(L({name:"SystemRoleForm",__name:"RoleForm",emits:["success"],setup(ie,{expose:x,emit:C}){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:I.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(),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()};x({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 se(t)}finally{d.value=!1}}}});const F=C,N=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,F("success")}finally{d.value=!1}}};return(u,t)=>{const i=G,m=J,n=P,g=K,v=Q,k=W,A=X,U=Y,B=ee,R=Z;return p(),y(B,{modelValue:l(o),"onUpdate:modelValue":t[7]||(t[7]=r=>j(o)?o.value=r:null),title:l(b)},{footer:a(()=>[e(U,{disabled:l(d),type:"primary",onClick:N},{default:a(()=>[w("\u786E \u5B9A")]),_:1},8,["disabled"]),e(U,{onClick:t[6]||(t[6]=r=>o.value=!1)},{default:a(()=>[w("\u53D6 \u6D88")]),_:1})]),default:a(()=>[T((p(),y(A,{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),z(D,null,H(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"])),[[R,l(d)]])]),_:1},8,["modelValue","title"])}}}),[["__scopeId","data-v-5bf1972e"]])});export{_e as __tla,q as default};
|