1 |
- import{d as O,h as z,r as d,e as B,o as n,v as f,w as s,f as u,a as e,n as p,x as G,c as L,F as M,q as T,t as I,O as R,V as j,A as H,ah as P,ai as J,D as K,C as Q,I as W,_ as X,__tla as Y}from"./index-bd9277a1.js";import{_ as Z,__tla as $}from"./Dialog-eba103da.js";import{a as ee,D as ae,__tla as le}from"./dict-4b2e9fd3.js";import{g as te,c as se,u as re,__tla as ue}from"./index-4b4c8691.js";import{C as g}from"./constants-40f13f5e.js";import{u as oe,__tla as me}from"./useMessage-274788d4.js";let k,de=Promise.all([(()=>{try{return Y}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return le}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return me}catch{}})()]).then(async()=>{k=X(O({__name:"GroupForm",emits:["success"],setup(ie,{expose:w,emit:x}){const{t:_}=z(),v=oe(),o=d(!1),y=d(""),m=d(!1),h=d(""),t=d({id:void 0,name:void 0,remark:void 0,status:g.ENABLE}),C=B({name:[{required:!0,message:"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),i=d();w({open:async(r,a)=>{if(o.value=!0,y.value=_("action."+r),h.value=r,F(),a){m.value=!0;try{t.value=await te(a)}finally{m.value=!1}}}});const U=x,E=async()=>{if(i&&await i.value.validate()){m.value=!0;try{const r=t.value;h.value==="create"?(await se(r),v.success(_("common.createSuccess"))):(await re(r),v.success(_("common.updateSuccess"))),o.value=!1,U("success")}finally{m.value=!1}}},F=()=>{var r;t.value={id:void 0,name:void 0,remark:void 0,status:g.ENABLE},(r=i.value)==null||r.resetFields()};return(r,a)=>{const V=j,c=H,A=P,D=J,S=K,b=Q,q=Z,N=W;return n(),f(q,{title:e(y),modelValue:e(o),"onUpdate:modelValue":a[4]||(a[4]=l=>R(o)?o.value=l:null),width:"600"},{footer:s(()=>[u(b,{onClick:E,type:"primary",disabled:e(m)},{default:s(()=>[p("\u786E \u5B9A")]),_:1},8,["disabled"]),u(b,{onClick:a[3]||(a[3]=l=>o.value=!1)},{default:s(()=>[p("\u53D6 \u6D88")]),_:1})]),default:s(()=>[G((n(),f(S,{ref_key:"formRef",ref:i,model:e(t),rules:e(C),"label-width":"100px"},{default:s(()=>[u(c,{label:"\u540D\u79F0",prop:"name"},{default:s(()=>[u(V,{modelValue:e(t).name,"onUpdate:modelValue":a[0]||(a[0]=l=>e(t).name=l),placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue"])]),_:1}),u(c,{label:"\u72B6\u6001",prop:"status"},{default:s(()=>[u(D,{modelValue:e(t).status,"onUpdate:modelValue":a[1]||(a[1]=l=>e(t).status=l)},{default:s(()=>[(n(!0),L(M,null,T(e(ee)(e(ae).COMMON_STATUS),l=>(n(),f(A,{key:l.value,label:l.value},{default:s(()=>[p(I(l.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),u(c,{label:"\u5907\u6CE8",prop:"remark"},{default:s(()=>[u(V,{modelValue:e(t).remark,"onUpdate:modelValue":a[2]||(a[2]=l=>e(t).remark=l),type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[N,e(m)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/views/member/group/GroupForm.vue"]])});export{de as __tla,k as default};
|