GroupForm-a34c2dc8.js 3.0 KB

1
  1. import{d as B,n as D,r as d,f as G,o as _,l as p,w as s,i as u,a as e,j as f,C as H,c as L,F as M,k as O,t as R,y as T,U as z,H as J,ag as K,ah as P,K as X,J as Z,N as I,_ as Q,__tla as W}from"./index-af173888.js";import{_ as Y,__tla as $}from"./Dialog-987c90a1.js";import{a as ee,D as ae,__tla as le}from"./dict-093d1dfa.js";import{a as te,c as se,u as re,__tla as ue}from"./index-811fbb31.js";import{C as k}from"./constants-a3c69b57.js";import{u as oe,__tla as me}from"./useMessage-170c1b43.js";let w,de=Promise.all([(()=>{try{return W}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return le}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return me}catch{}})()]).then(async()=>{w=Q(B({__name:"GroupForm",emits:["success"],setup(ie,{expose:g,emit:U}){const{t:n}=D(),v=oe(),o=d(!1),y=d(""),m=d(!1),b=d(""),t=d({id:void 0,name:void 0,remark:void 0,status:k.ENABLE}),C=G({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();g({open:async(r,a)=>{if(o.value=!0,y.value=n("action."+r),b.value=r,F(),a){m.value=!0;try{t.value=await te(a)}finally{m.value=!1}}}});const x=U,E=async()=>{if(i&&await i.value.validate()){m.value=!0;try{const r=t.value;b.value==="create"?(await se(r),v.success(n("common.createSuccess"))):(await re(r),v.success(n("common.updateSuccess"))),o.value=!1,x("success")}finally{m.value=!1}}},F=()=>{var r;t.value={id:void 0,name:void 0,remark:void 0,status:k.ENABLE},(r=i.value)==null||r.resetFields()};return(r,a)=>{const V=z,c=J,N=K,S=P,A=X,h=Z,j=Y,q=I;return _(),p(j,{title:e(y),modelValue:e(o),"onUpdate:modelValue":a[4]||(a[4]=l=>T(o)?o.value=l:null),width:"600"},{footer:s(()=>[u(h,{onClick:E,type:"primary",disabled:e(m)},{default:s(()=>[f("\u786E \u5B9A")]),_:1},8,["disabled"]),u(h,{onClick:a[3]||(a[3]=l=>o.value=!1)},{default:s(()=>[f("\u53D6 \u6D88")]),_:1})]),default:s(()=>[H((_(),p(A,{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(S,{modelValue:e(t).status,"onUpdate:modelValue":a[1]||(a[1]=l=>e(t).status=l)},{default:s(()=>[(_(!0),L(M,null,O(e(ee)(e(ae).COMMON_STATUS),l=>(_(),p(N,{key:l.value,label:l.value},{default:s(()=>[f(R(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"])),[[q,e(m)]])]),_:1},8,["title","modelValue"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/member/group/GroupForm.vue"]])});export{de as __tla,w as default};