TagForm-c207d1fb.js 2.1 KB

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