1 |
- import{am as u,d as D,h as G,r as m,e as K,o as w,x as h,w as o,f as c,a as t,y as V,z as M,l as X,R as A,C as B,H as E,G as I,K as J,_ as L,__tla as N}from"./index-8dc1e40a.js";import{_ as Q,__tla as W}from"./Dialog-41802231.js";import{u as Y,__tla as Z}from"./useMessage-7a27dd80.js";let p,x,k,R,S,$=Promise.all([(()=>{try{return N}catch{}})(),(()=>{try{return W}catch{}})(),(()=>{try{return Z}catch{}})()]).then(async()=>{x=async i=>await u.get({url:"/member/tag/page",params:i}),S=async()=>await u.get({url:"/member/tag/list-all-simple"}),R=async i=>await u.delete({url:"/member/tag/delete?id="+i}),p=L(D({__name:"TagForm",emits:["success"],setup(i,{expose:T,emit:j}){const{t:_}=G(),v=Y(),l=m(!1),y=m(""),s=m(!1),g=m(""),r=m({id:void 0,name:void 0}),z=K({name:[{required:!0,message:"\u6807\u7B7E\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),n=m();T({open:async(a,e)=>{if(l.value=!0,y.value=_("action."+a),g.value=a,U(),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=j,F=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}}},U=()=>{var a;r.value={id:void 0,name:void 0},(a=n.value)==null||a.resetFields()};return(a,e)=>{const f=A,O=B,H=E,b=I,P=Q,q=J;return w(),h(P,{title:t(y),modelValue:t(l),"onUpdate:modelValue":e[2]||(e[2]=d=>X(l)?l.value=d:null)},{footer:o(()=>[c(b,{onClick:F,type:"primary",disabled:t(s)},{default:o(()=>[V("\u786E \u5B9A")]),_:1},8,["disabled"]),c(b,{onClick:e[1]||(e[1]=d=>l.value=!1)},{default:o(()=>[V("\u53D6 \u6D88")]),_:1})]),default:o(()=>[M((w(),h(H,{ref_key:"formRef",ref:n,model:t(r),rules:t(z),"label-width":"100px"},{default:o(()=>[c(O,{label:"\u6807\u7B7E\u540D\u79F0",prop:"name"},{default:o(()=>[c(f,{modelValue:t(r).name,"onUpdate:modelValue":e[0]||(e[0]=d=>t(r).name=d),placeholder:"\u8BF7\u8F93\u5165\u6807\u7B7E\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[q,t(s)]])]),_:1},8,["title","modelValue"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/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,R as d,S as g};
|