TagForm-bd7ecc11.js 2.1 KB

1
  1. import{d as R,h as S,r,o as y,v as w,w as o,f as _,a as t,n as g,x as M,O as j,V as q,A as z,D as A,C as H,I as O,_ as P,__tla as X}from"./index-11e4820e.js";import{_ as B,__tla as E}from"./Dialog-bbfaf85c.js";import{g as G,c as J,u as K,__tla as L}from"./index-6512f09a.js";import{u as N,__tla as Q}from"./useMessage-06ddf735.js";let h,W=Promise.all([(()=>{try{return X}catch{}})(),(()=>{try{return E}catch{}})(),(()=>{try{return L}catch{}})(),(()=>{try{return Q}catch{}})()]).then(async()=>{h=P(R({name:"MpTagForm",__name:"TagForm",emits:["success"],setup(Y,{expose:V,emit:b}){const{t:i}=S(),d=N(),s=r(!1),f=r(""),u=r(!1),v=r(""),l=r({accountId:-1,name:""}),x={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u7B7E\u540D\u79F0",trigger:"blur"}]},c=r(null),k=b;V({open:async(e,a,n)=>{if(s.value=!0,f.value=i("action."+e),v.value=e,I(),l.value.accountId=a,n){u.value=!0;try{l.value=await G(n)}finally{u.value=!1}}}});const F=async()=>{var e;if(c&&await((e=c.value)==null?void 0:e.validate())){u.value=!0;try{const a=l.value;v.value==="create"?(await J(a),d.success(i("common.createSuccess"))):(await K(a),d.success(i("common.updateSuccess"))),s.value=!1,k("success")}finally{u.value=!1}}},I=()=>{var e;l.value={accountId:-1,name:""},(e=c.value)==null||e.resetFields()};return(e,a)=>{const n=q,C=z,T=A,p=H,U=B,D=O;return y(),w(U,{modelValue:t(s),"onUpdate:modelValue":a[2]||(a[2]=m=>j(s)?s.value=m:null),title:t(f)},{footer:o(()=>[_(p,{disabled:t(u),type:"primary",onClick:F},{default:o(()=>[g("\u786E \u5B9A")]),_:1},8,["disabled"]),_(p,{onClick:a[1]||(a[1]=m=>s.value=!1)},{default:o(()=>[g("\u53D6 \u6D88")]),_:1})]),default:o(()=>[M((y(),w(T,{ref_key:"formRef",ref:c,model:t(l),rules:x,"label-width":"80px"},{default:o(()=>[_(C,{label:"\u6807\u7B7E\u540D\u79F0",prop:"name"},{default:o(()=>[_(n,{modelValue:t(l).name,"onUpdate:modelValue":a[0]||(a[0]=m=>t(l).name=m),placeholder:"\u8BF7\u8F93\u5165\u6807\u7B7E\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])),[[D,t(u)]])]),_:1},8,["modelValue","title"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mp/tag/TagForm.vue"]])});export{W as __tla,h as default};