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