1 |
- import{d as T,B as G,r as o,g as H,o as i,k as n,w as r,i as s,a,l as f,D as J,c as w,F as k,C as x,t as W,R as Y,j as K,G as Q,H as Z,I as X,Y as $,aW as ee,aj as ae,ak as le,J as te,s as re,M as se,_ as ue,__tla as oe}from"./index-2f799233.js";import{_ as ie,__tla as de}from"./Dialog-6fd39e06.js";import{_ as me,__tla as _e}from"./UploadImg-d46c0539.js";import{a as ne,D as ce,__tla as pe}from"./dict-20c916e2.js";import{C}from"./constants-d55a3460.js";import{a as fe,g as ve,c as ye,u as ge,__tla as be}from"./category-6df467a3.js";import{u as Ve,__tla as he}from"./useMessage-e567ad40.js";import{__tla as Ue}from"./index-5f6db4a5.js";import{__tla as we}from"./el-image-viewer-8e9e3571.js";let I,ke=Promise.all([(()=>{try{return oe}catch{}})(),(()=>{try{return de}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=K("div",{style:{"font-size":"10px"},class:"pl-10px"},"\u63A8\u8350 180x180 \u56FE\u7247\u5206\u8FA8\u7387",-1),I=ue(T({name:"ProductCategory",__name:"CategoryForm",emits:["success"],setup(xe,{expose:q,emit:F}){const{t:p}=G(),y=Ve(),d=o(!1),g=o(""),m=o(!1),b=o(""),t=o({id:void 0,name:"",picUrl:"",status:C.ENABLE}),S=H({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([]);q({open:async(u,l)=>{if(d.value=!0,g.value=p("action."+u),b.value=u,B(),l){m.value=!0;try{t.value=await fe(l)}finally{m.value=!1}}V.value=await ve({parentId:0})}});const z=F,A=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"))),d.value=!1,z("success")}finally{m.value=!1}}},B=()=>{var u;t.value={id:void 0,name:"",picUrl:"",status:C.ENABLE},(u=c.value)==null||u.resetFields()};return(u,l)=>{const h=Q,E=Z,_=X,L=$,M=me,D=ee,N=ae,O=le,j=te,U=re,P=ie,R=se;return i(),n(P,{title:a(g),modelValue:a(d),"onUpdate:modelValue":l[6]||(l[6]=e=>Y(d)?d.value=e:null)},{footer:r(()=>[s(U,{onClick:A,type:"primary",disabled:a(m)},{default:r(()=>[f("\u786E \u5B9A")]),_:1},8,["disabled"]),s(U,{onClick:l[5]||(l[5]=e=>d.value=!1)},{default:r(()=>[f("\u53D6 \u6D88")]),_:1})]),default:r(()=>[J((i(),n(j,{ref_key:"formRef",ref:c,model:a(t),rules:a(S),"label-width":"120px"},{default:r(()=>[s(_,{label:"\u4E0A\u7EA7\u5206\u7C7B",prop:"parentId"},{default:r(()=>[s(E,{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(()=>[(i(),n(h,{key:0,label:"\u9876\u7EA7\u5206\u7C7B",value:0})),(i(!0),w(k,null,x(a(V),e=>(i(),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(L,{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(M,{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(D,{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(O,{modelValue:a(t).status,"onUpdate:modelValue":l[4]||(l[4]=e=>a(t).status=e)},{default:r(()=>[(i(!0),w(k,null,x(a(ne)(a(ce).COMMON_STATUS),e=>(i(),n(N,{key:e.value,label:e.value},{default:r(()=>[f(W(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[R,a(m)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/mall/product/category/CategoryForm.vue"]])});export{ke as __tla,I as default};
|