TagForm-46f34e51.js 2.1 KB

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