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