import{I as O}from"./image.e35d846c.js";import{J as T,d as L}from"./status.2b37e8be.js";import{a as P,r as n,W as R,I as S,b as m,c as p,j as F,h as t,f as a,u as r,l as V,e as j,i as D,F as k,m as J,x as I,am as M}from"./index.4d061c66.js";const $={class:"w-full flex justify-end"},H=P({__name:"ladder-modal",emits:["push","update"],setup(W,{expose:U,emit:A}){n();const f={img:"",jump_type:"",jump_param:"",good_id:"",title:"",style_type:""},q=["\u8F6E\u64AD","\u4EA7\u54C1\u5BA3\u4F20","\u4EA7\u54C1\u5C55\u793A","\u4EA7\u54C1\u4F18\u52BF"],v=n(!1),d=n(!1),i=n(""),B=n(null),y=n("0"),l=n({...f});let g=R({img:[{trigger:"change",required:!0,message:"\u8BF7\u4E0A\u4F20\u56FE\u7247"}],jump_type:[{trigger:"change",required:!0,message:"\u8BF7\u9009\u62E9\u8DF3\u8F6C\u7C7B\u578B"}],jump_param:[{trigger:"blur",required:!0,message:"\u8BF7\u8F93\u5165\u8DF3\u8F6C\u5730\u5740"}],style_type:[{trigger:"change",required:!0,message:"\u8BF7\u9009\u62E9\u6837\u5F0F\u7C7B\u578B"}],title:[{trigger:"blur",required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0"}]});const N=S(()=>`${v.value?"\u4FEE\u6539":"\u6DFB\u52A0"}${q[Number(i.value)-1]}\u6570\u636E`);function w(){B.value.validate(s=>{!s||(A(v.value?"update":"push",r(l),r(y),r(i)),d.value=!1)})}function h(s){g.jump_param[0].required=s+""!="1"}return U({onDisplay:(s,e,o)=>{i.value=e!=null?e:"1",g.style_type[0].required=e+""=="4",o&&(o.cat_info=[],Object.keys(f).forEach(_=>{l.value[_]=o[_]+""}),y.value=s!=null?s:"0"),d.value=!0,v.value=!!o}}),(s,e)=>{const o=m("ElFormItem"),_=m("ElInput"),C=m("el-option"),E=m("el-select"),b=m("ElButton"),x=m("ElDialog");return p(),F(x,{center:"",title:r(N),modelValue:d.value,"onUpdate:modelValue":e[6]||(e[6]=u=>d.value=u),onClose:e[7]||(e[7]=()=>l.value={...f})},{default:t(()=>[a(r(M),{ref_key:"formRef",ref:B,model:l.value,width:"500px",rules:r(g),"label-width":"100px"},{default:t(()=>[a(o,{label:"\u56FE\u7247",prop:"img"},{default:t(()=>[a(r(O),{url:l.value.img,"onUpdate:url":e[0]||(e[0]=u=>l.value.img=u),descs:["\u5C0F\u4E8E1Mb"],types:["png","jpg","jpeg"]},null,8,["url"])]),_:1}),i.value==="2"?(p(),F(o,{key:0,label:"\u6807\u9898",prop:"title"},{default:t(()=>[a(_,{placeholder:"\u6807\u9898",modelValue:l.value.title,"onUpdate:modelValue":e[1]||(e[1]=u=>l.value.title=u)},null,8,["modelValue"])]),_:1})):V("",!0),a(o,{label:"\u8DF3\u8F6C\u7C7B\u578B",prop:"jump_type"},{default:t(()=>[a(E,{modelValue:l.value.jump_type,"onUpdate:modelValue":e[2]||(e[2]=u=>l.value.jump_type=u),onChange:h,style:{width:"100%"},placeholder:"\u8DF3\u8F6C\u7C7B\u578B"},{default:t(()=>[(p(!0),j(k,null,D(r(T),(u,c)=>(p(),F(C,{label:u.label,value:u.id,key:u.id+c},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(o,{label:"\u8DF3\u8F6C\u5730\u5740",prop:"jump_param"},{default:t(()=>[a(_,{placeholder:"\u8DF3\u8F6C\u5730\u5740",modelValue:l.value.jump_param,"onUpdate:modelValue":e[3]||(e[3]=u=>l.value.jump_param=u)},null,8,["modelValue"])]),_:1}),i.value==="4"?(p(),F(o,{key:1,label:"\u6837\u5F0F\u7C7B\u578B",prop:"style_type"},{default:t(()=>[a(E,{modelValue:l.value.style_type,"onUpdate:modelValue":e[4]||(e[4]=u=>l.value.style_type=u),style:{width:"100%"},placeholder:"\u6837\u5F0F\u7C7B\u578B"},{default:t(()=>[(p(!0),j(k,null,D(r(L),(u,c)=>(p(),F(C,{label:u.label,value:u.id,key:u.id+c},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):V("",!0),a(o,null,{default:t(()=>[J("div",$,[a(b,{type:"primary",onClick:w},{default:t(()=>[I("\u4FDD\u5B58")]),_:1}),a(b,{onClick:e[5]||(e[5]=()=>d.value=!1)},{default:t(()=>[I("\u53D6\u6D88")]),_:1})])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title","modelValue"])}}});export{H as _};
