1 |
- import{d as J,P as Q,r as o,x as W,o as d,C as n,A as r,f as s,a,D as f,k as Z,c as w,F as x,R as C,E as j,a2 as G,B as H,S as K,U as X,V as Y,a9 as $,bQ as ee,at as ae,au as le,W as te,J as re,Z as se,_ as ue,__tla as oe}from"./index-f6fb8e95.js";import{_ as de,__tla as ie}from"./Dialog-ac2b0e4e.js";import{_ as me,__tla as _e}from"./UploadImg-76a51b31.js";import{a as ne,D as ce,__tla as pe}from"./dict-c9a7f6a4.js";import{C as k}from"./constants-c811e5ff.js";import{a as fe,g as ve,c as ye,u as ge,__tla as be}from"./category-4baa8823.js";import{u as Ve,__tla as he}from"./useMessage-3b767a67.js";import{__tla as Ue}from"./index-b76b57e5.js";import{__tla as we}from"./el-image-viewer-cfdb08a7.js";let I,xe=Promise.all([(()=>{try{return oe}catch{}})(),(()=>{try{return ie}catch{}})(),(()=>{try{return _e}catch{}})(),(()=>{try{return pe}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return he}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return we}catch{}})()]).then(async()=>{let v;v=H("div",{style:{"font-size":"10px"},class:"pl-10px"},"\u63A8\u8350 180x180 \u56FE\u7247\u5206\u8FA8\u7387",-1),I=ue(J({name:"ProductCategory",__name:"CategoryForm",emits:["success"],setup(Ce,{expose:S,emit:q}){const{t:p}=Q(),y=Ve(),i=o(!1),g=o(""),m=o(!1),b=o(""),t=o({id:void 0,name:"",picUrl:"",status:k.ENABLE}),A=W({parentId:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E0A\u7EA7\u5206\u7C7B",trigger:"blur"}],name:[{required:!0,message:"\u5206\u7C7B\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],picUrl:[{required:!0,message:"\u5206\u7C7B\u56FE\u7247\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],sort:[{required:!0,message:"\u5206\u7C7B\u6392\u5E8F\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u5F00\u542F\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),c=o(),V=o([]);S({open:async(u,l)=>{if(i.value=!0,g.value=p("action."+u),b.value=u,z(),l){m.value=!0;try{t.value=await fe(l)}finally{m.value=!1}}V.value=await ve({parentId:0})}});const E=q,F=async()=>{if(c&&await c.value.validate()){m.value=!0;try{const u=t.value;b.value==="create"?(await ye(u),y.success(p("common.createSuccess"))):(await ge(u),y.success(p("common.updateSuccess"))),i.value=!1,E("success")}finally{m.value=!1}}},z=()=>{var u;t.value={id:void 0,name:"",picUrl:"",status:k.ENABLE},(u=c.value)==null||u.resetFields()};return(u,l)=>{const h=K,B=X,_=Y,R=$,D=me,L=ee,M=ae,N=le,P=te,U=re,O=de,T=se;return d(),n(O,{title:a(g),modelValue:a(i),"onUpdate:modelValue":l[6]||(l[6]=e=>G(i)?i.value=e:null)},{footer:r(()=>[s(U,{onClick:F,type:"primary",disabled:a(m)},{default:r(()=>[f("\u786E \u5B9A")]),_:1},8,["disabled"]),s(U,{onClick:l[5]||(l[5]=e=>i.value=!1)},{default:r(()=>[f("\u53D6 \u6D88")]),_:1})]),default:r(()=>[Z((d(),n(P,{ref_key:"formRef",ref:c,model:a(t),rules:a(A),"label-width":"120px"},{default:r(()=>[s(_,{label:"\u4E0A\u7EA7\u5206\u7C7B",prop:"parentId"},{default:r(()=>[s(B,{modelValue:a(t).parentId,"onUpdate:modelValue":l[0]||(l[0]=e=>a(t).parentId=e),placeholder:"\u8BF7\u9009\u62E9\u4E0A\u7EA7\u5206\u7C7B"},{default:r(()=>[(d(),n(h,{key:0,label:"\u9876\u7EA7\u5206\u7C7B",value:0})),(d(!0),w(x,null,C(a(V),e=>(d(),n(h,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),s(_,{label:"\u5206\u7C7B\u540D\u79F0",prop:"name"},{default:r(()=>[s(R,{modelValue:a(t).name,"onUpdate:modelValue":l[1]||(l[1]=e=>a(t).name=e),placeholder:"\u8BF7\u8F93\u5165\u5206\u7C7B\u540D\u79F0"},null,8,["modelValue"])]),_:1}),s(_,{label:"\u79FB\u52A8\u7AEF\u5206\u7C7B\u56FE",prop:"picUrl"},{default:r(()=>[s(D,{modelValue:a(t).picUrl,"onUpdate:modelValue":l[2]||(l[2]=e=>a(t).picUrl=e),limit:1,"is-show-tip":!1},null,8,["modelValue"]),v]),_:1}),s(_,{label:"\u5206\u7C7B\u6392\u5E8F",prop:"sort"},{default:r(()=>[s(L,{modelValue:a(t).sort,"onUpdate:modelValue":l[3]||(l[3]=e=>a(t).sort=e),"controls-position":"right",min:0},null,8,["modelValue"])]),_:1}),s(_,{label:"\u5F00\u542F\u72B6\u6001",prop:"status"},{default:r(()=>[s(N,{modelValue:a(t).status,"onUpdate:modelValue":l[4]||(l[4]=e=>a(t).status=e)},{default:r(()=>[(d(!0),w(x,null,C(a(ne)(a(ce).COMMON_STATUS),e=>(d(),n(M,{key:e.value,label:e.value},{default:r(()=>[f(j(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[T,a(m)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mall/product/category/CategoryForm.vue"]])});export{xe as __tla,I as default};
|