1 |
- import{d as S,P as M,r,o as y,C as g,A as o,f as _,a as t,D as w,k as P,a2 as U,a9 as j,V as q,W as A,J as B,Z as J,_ as R,__tla as W}from"./index-286756b9.js";import{_ as Z,__tla as E}from"./Dialog-4c2de357.js";import{g as G,c as H,u as K,__tla as L}from"./index-b8379a75.js";import{u as N,__tla as O}from"./useMessage-084b1e70.js";let V,Q=Promise.all([(()=>{try{return W}catch{}})(),(()=>{try{return E}catch{}})(),(()=>{try{return L}catch{}})(),(()=>{try{return O}catch{}})()]).then(async()=>{V=R(S({name:"MpTagForm",__name:"TagForm",emits:["success"],setup(X,{expose:h,emit:x}){const{t:i}=M(),d=N(),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"}]},c=r(null),k=x;h({open:async(e,a,n)=>{if(s.value=!0,f.value=i("action."+e),v.value=e,C(),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 H(a),d.success(i("common.createSuccess"))):(await K(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,T=A,p=B,z=Z,D=J;return y(),g(z,{modelValue:t(s),"onUpdate:modelValue":a[2]||(a[2]=m=>U(s)?s.value=m:null),title:t(f)},{footer:o(()=>[_(p,{disabled:t(u),type:"primary",onClick:F},{default:o(()=>[w("\u786E \u5B9A")]),_:1},8,["disabled"]),_(p,{onClick:a[1]||(a[1]=m=>s.value=!1)},{default:o(()=>[w("\u53D6 \u6D88")]),_:1})]),default:o(()=>[P((y(),g(T,{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"])),[[D,t(u)]])]),_:1},8,["modelValue","title"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mp/tag/TagForm.vue"]])});export{Q as __tla,V as default};
|