1 |
- import{as as u,d as q,B,r as i,g as I,o as w,k as V,w as m,i as d,a as t,l as h,D as J,R as Y,Y as A,I as E,J as G,s as H,M as K,_ as L,__tla as N}from"./index-66208f93.js";import{_ as Q,__tla as W}from"./Dialog-948825d3.js";import{u as X,__tla as Z}from"./useMessage-798a77de.js";let p,x,k,S,T,$=Promise.all([(()=>{try{return N}catch{}})(),(()=>{try{return W}catch{}})(),(()=>{try{return Z}catch{}})()]).then(async()=>{x=async o=>await u.get({url:"/member/tag/page",params:o}),T=async()=>await u.get({url:"/member/tag/list-all-simple"}),S=async o=>await u.delete({url:"/member/tag/delete?id="+o}),p=L(q({__name:"TagForm",emits:["success"],setup(o,{expose:j,emit:z}){const{t:_}=B(),v=X(),l=i(!1),y=i(""),s=i(!1),g=i(""),r=i({id:void 0,name:void 0}),F=I({name:[{required:!0,message:"\u6807\u7B7E\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),n=i();j({open:async(a,e)=>{if(l.value=!0,y.value=_("action."+a),g.value=a,M(),e){s.value=!0;try{r.value=await(async f=>await u.get({url:"/member/tag/get?id="+f}))(e)}finally{s.value=!1}}}});const C=z,D=async()=>{if(n&&await n.value.validate()){s.value=!0;try{const a=r.value;g.value==="create"?(await(async e=>await u.post({url:"/member/tag/create",data:e}))(a),v.success(_("common.createSuccess"))):(await(async e=>await u.put({url:"/member/tag/update",data:e}))(a),v.success(_("common.updateSuccess"))),l.value=!1,C("success")}finally{s.value=!1}}},M=()=>{var a;r.value={id:void 0,name:void 0},(a=n.value)==null||a.resetFields()};return(a,e)=>{const f=A,U=E,O=G,b=H,P=Q,R=K;return w(),V(P,{title:t(y),modelValue:t(l),"onUpdate:modelValue":e[2]||(e[2]=c=>Y(l)?l.value=c:null)},{footer:m(()=>[d(b,{onClick:D,type:"primary",disabled:t(s)},{default:m(()=>[h("\u786E \u5B9A")]),_:1},8,["disabled"]),d(b,{onClick:e[1]||(e[1]=c=>l.value=!1)},{default:m(()=>[h("\u53D6 \u6D88")]),_:1})]),default:m(()=>[J((w(),V(O,{ref_key:"formRef",ref:n,model:t(r),rules:t(F),"label-width":"100px"},{default:m(()=>[d(U,{label:"\u6807\u7B7E\u540D\u79F0",prop:"name"},{default:m(()=>[d(f,{modelValue:t(r).name,"onUpdate:modelValue":e[0]||(e[0]=c=>t(r).name=c),placeholder:"\u8BF7\u8F93\u5165\u6807\u7B7E\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[R,t(s)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/member/tag/TagForm.vue"]]),k=Object.freeze(Object.defineProperty({__proto__:null,default:p},Symbol.toStringTag,{value:"Module"}))});export{p as T,$ as __tla,x as a,k as b,S as d,T as g};
|