import{b as h,p as d,e as w,k as g,o as q,h as b,A as a,j as n,a as V,l as C,f as s,b2 as k}from"./index.4d3e3847.js";const A={key:{trigger:"change",required:!0,message:"\u8BF7\u9009\u62E9\u5546\u54C1\u7C7B\u578B"},value:{trigger:"change",required:!0,message:"\u8BF7\u9009\u62E9\u5355\u4F4D"}},N={good_name:{trigger:"change",required:!0,validator(r,e){return e===""?new Error("\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"):!0}},good_cover_img:{trigger:"change",required:!0,message:"\u8BF7\u4E0A\u4F20\u5C01\u9762\u56FE",validator(r,e){return e===""?new Error("\u8BF7\u4E0A\u4F20\u5C01\u9762\u56FE"):!0}},type:{trigger:"change",required:!0,message:"\u8BF7\u9009\u62E9\u5546\u54C1\u7C7B\u578B"},unit_id:{trigger:"change",required:!0,message:"\u8BF7\u9009\u62E9\u5355\u4F4D"},price:{trigger:"change",required:!0,validator(r,e){return e===""?new Error("\u8BF7\u8F93\u5165\u552E\u4EF7"):!0}},moq:{trigger:"change",required:!0,validator(r,e){return typeof e!="number"?new Error("\u8BF7\u8F93\u5165\u8D77\u8BA2\u91CF"):Number(e+"")<1?new Error("\u8D77\u8BA2\u91CF\u4E0D\u80FD\u4F4E\u4E8E1"):!0}},step:{trigger:"change",required:!0,validator(r,e){return typeof e!="number"?new Error("\u8BF7\u8F93\u5165\u6B65\u957F"):Number(e+"")<1?new Error("\u6B65\u957F\u4E0D\u80FD\u4F4E\u4E8E1"):!0}},good_banner_img:{trigger:"change",type:"array",required:!0,validator(r,e){return e.length===0?new Error("\u8BF7\u4E0A\u4F20\u8F6E\u64AD\u56FE"):e.length<3||e.length>10?new Error("\u8F6E\u64AD\u56FE\u5E94\u4E3A3~10\u5F20\uFF01"):!0}},good_img:{trigger:"change",type:"array",required:!0,validator(r,e){return e.length===0?new Error("\u8BF7\u4E0A\u4F20\u8BE6\u60C5\u56FE"):e.length>20?new Error("\u8BE6\u60C5\u56FE\u4E0D\u5F97\u8D85\u8FC720\u5F20\uFF01"):!0}},good_param:{trigger:"change",type:"array",required:!0,validator(r,e){return e===""?new Error("\u8BF7\u8F93\u5165\u5546\u54C1\u53C2\u6570"):!0}},good_remark:{trigger:"change",required:!0,validator(r,e){return e?!0:new Error("\u8BF7\u8F93\u5165\u5907\u6CE8")}}},x={class:"w-full flex justify-end"},R=h({__name:"ladder-modal",emits:["push","update"],setup(r,{expose:e,emit:F}){const f={budget_price:"0.00",good_type:"1",good_name:"",cat_info:[],num:"0"},m=d(!1),l=d(!1),p=d(null),_=d("0"),t=d({...f}),v=w(()=>m.value?"\u4FEE\u6539\u5546\u54C1\u53C2\u6570":"\u6DFB\u52A0\u5546\u54C1\u53C2\u6570");function D(){p.value.validate(o=>{!o||(F(m.value?"update":"push",s(t),s(_)),l.value=!1)})}return e({onDisplay:(o,u="0")=>{o&&(o.cat_info=[],t.value=o,_.value=u),l.value=!0,m.value=!!o}}),(o,u)=>{const B=g("ElInput"),E=g("ElFormItem"),c=g("ElButton"),y=g("ElDialog");return q(),b(y,{center:"",title:s(v),modelValue:l.value,"onUpdate:modelValue":u[3]||(u[3]=i=>l.value=i),onClose:u[4]||(u[4]=()=>t.value={...f})},{default:a(()=>[n(s(k),{ref_key:"formRef",ref:p,model:t.value,rules:s(A),"label-width":"100px",size:"small"},{default:a(()=>[n(E,{label:"\u7C7B\u578B",prop:"key"},{default:a(()=>[n(B,{modelValue:t.value.key,"onUpdate:modelValue":u[0]||(u[0]=i=>t.value.key=i),placeholder:"\u7C7B\u578B"},null,8,["modelValue"])]),_:1}),n(E,{label:"\u7C7B\u578B\u503C",prop:"value"},{default:a(()=>[n(B,{placeholder:"\u7C7B\u578B\u503C",modelValue:t.value.value,"onUpdate:modelValue":u[1]||(u[1]=i=>t.value.value=i)},null,8,["modelValue"])]),_:1}),n(E,null,{default:a(()=>[V("div",x,[n(c,{type:"primary",onClick:D},{default:a(()=>[C("\u4FDD\u5B58")]),_:1}),n(c,{onClick:u[2]||(u[2]=()=>l.value=!1)},{default:a(()=>[C("\u53D6\u6D88")]),_:1})])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title","modelValue"])}}});export{R as _,N as p};
