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