1 |
- import{d as S,B as j,r as u,g as B,o as i,k as m,w as r,i as n,a,l as I,D as G,c as H,F as J,C as M,R as Y,G as A,H as E,I as K,Y as L,J as N,s as O,M as Q,_ as T,__tla as W}from"./index-2f799233.js";import{_ as X,__tla as Z}from"./Dialog-6fd39e06.js";import{a as $,g as ee,c as ae,u as le,__tla as te}from"./index-f0968341.js";import{u as se,__tla as re}from"./useMessage-e567ad40.js";let V,ue=Promise.all([(()=>{try{return W}catch{}})(),(()=>{try{return Z}catch{}})(),(()=>{try{return te}catch{}})(),(()=>{try{return re}catch{}})()]).then(async()=>{V=T(S({name:"CrmProductCategoryForm",__name:"ProductCategoryForm",emits:["success"],setup(oe,{expose:h,emit:C}){const{t:_}=j(),p=se(),o=u(!1),v=u(""),d=u(!1),f=u(""),s=u({id:void 0,name:void 0,parentId:void 0}),k=B({name:[{required:!0,message:"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],parentId:[{required:!0,message:"\u7236\u7EA7\u5206\u7C7B\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),c=u(),y=u([]);h({open:async(t,e)=>{if(o.value=!0,v.value=_("action."+t),f.value=t,P(),e){d.value=!0;try{s.value=await $(e)}finally{d.value=!1}}y.value=await ee({parentId:0})}});const F=C,x=async()=>{if(c&&await c.value.validate()){d.value=!0;try{const t=s.value;f.value==="create"?(await ae(t),p.success(_("common.createSuccess"))):(await le(t),p.success(_("common.updateSuccess"))),o.value=!1,F("success")}finally{d.value=!1}}},P=()=>{var t;s.value={id:void 0,name:void 0,parentId:void 0},(t=c.value)==null||t.resetFields()};return(t,e)=>{const g=A,U=E,b=K,q=L,z=N,w=O,D=X,R=Q;return i(),m(D,{title:a(v),modelValue:a(o),"onUpdate:modelValue":e[3]||(e[3]=l=>Y(o)?o.value=l:null)},{footer:r(()=>[n(w,{onClick:x,type:"primary",disabled:a(d)},{default:r(()=>[I("\u786E \u5B9A")]),_:1},8,["disabled"]),n(w,{onClick:e[2]||(e[2]=l=>o.value=!1)},{default:r(()=>[I("\u53D6 \u6D88")]),_:1})]),default:r(()=>[G((i(),m(z,{ref_key:"formRef",ref:c,model:a(s),rules:a(k),"label-width":"100px"},{default:r(()=>[n(b,{label:"\u7236\u7EA7\u5206\u7C7B",prop:"parentId"},{default:r(()=>[n(U,{modelValue:a(s).parentId,"onUpdate:modelValue":e[0]||(e[0]=l=>a(s).parentId=l),placeholder:"\u8BF7\u9009\u62E9\u4E0A\u7EA7\u5206\u7C7B"},{default:r(()=>[(i(),m(g,{key:0,label:"\u9876\u7EA7\u5206\u7C7B",value:0})),(i(!0),H(J,null,M(a(y),l=>(i(),m(g,{key:l.id,label:l.name,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),n(b,{label:"\u540D\u79F0",prop:"name"},{default:r(()=>[n(q,{modelValue:a(s).name,"onUpdate:modelValue":e[1]||(e[1]=l=>a(s).name=l),placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[R,a(d)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/crm/product/category/ProductCategoryForm.vue"]])});export{ue as __tla,V as default};
|