import{I as x}from"./image.7849d972.js";import{b as O,p as s,a3 as L,e as P,k as m,o as p,h as _,A as t,j as a,f as r,E as V,c as D,r as j,bv as R,F as k,bw as S,a as M,l as A,b2 as $}from"./index.4d3e3847.js";const J={class:"w-full flex justify-end"},H=O({__name:"ladder-modal",emits:["push","update"],setup(Y,{expose:I,emit:U}){s();const g={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"],F=s(!1),d=s(!1),i=s(""),B=s(null),c=s("0"),l=s({...g});let f=L({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 w=P(()=>`${F.value?"\u4FEE\u6539":"\u6DFB\u52A0"}${q[Number(i.value)-1]}\u6570\u636E`);function N(){B.value.validate(n=>{!n||(U(F.value?"update":"push",r(l),r(c),r(i)),d.value=!1)})}function T(n){f.jump_param[0].required=n+""!="1"}return I({onDisplay:(n,e,o)=>{i.value=e!=null?e:"1",f.style_type[0].required=e+""=="4",o&&(o.cat_info=[],l.value=o,c.value=n!=null?n:"0"),d.value=!0,F.value=!!o}}),(n,e)=>{const o=m("ElFormItem"),y=m("ElInput"),C=m("el-option"),E=m("el-select"),b=m("ElButton"),h=m("ElDialog");return p(),_(h,{center:"",title:r(w),modelValue:d.value,"onUpdate:modelValue":e[6]||(e[6]=u=>d.value=u),onClose:e[7]||(e[7]=()=>l.value={...g})},{default:t(()=>[a(r($),{ref_key:"formRef",ref:B,model:l.value,width:"500px",rules:r(f),"label-width":"100px"},{default:t(()=>[a(o,{label:"\u56FE\u7247",prop:"img"},{default:t(()=>[a(r(x),{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(),_(o,{key:0,label:"\u6807\u9898",prop:"title"},{default:t(()=>[a(y,{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:T,style:{width:"100%"},placeholder:"\u8DF3\u8F6C\u7C7B\u578B"},{default:t(()=>[(p(!0),D(k,null,j(r(R),(u,v)=>(p(),_(C,{label:u.label,value:u.id,key:u.id+v},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(o,{label:"\u8DF3\u8F6C\u5730\u5740",prop:"jump_param"},{default:t(()=>[a(y,{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(),_(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),D(k,null,j(r(S),(u,v)=>(p(),_(C,{label:u.label,value:u.id,key:u.id+v},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):V("",!0),a(o,null,{default:t(()=>[M("div",J,[a(b,{type:"primary",onClick:N},{default:t(()=>[A("\u4FDD\u5B58")]),_:1}),a(b,{onClick:e[5]||(e[5]=()=>d.value=!1)},{default:t(()=>[A("\u53D6\u6D88")]),_:1})])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title","modelValue"])}}});export{H as _};
