import{u as E}from"./hooks.428ba1c3.js";import{b as v,k as n,o as C,h as w,A as t,j as e,l as u,t as d,f as s,br as y,a as c}from"./index.4d3e3847.js";const B={class:"w-full flex justify-between"},F=c("p",null,"\u64CD\u4F5C",-1),V=v({__name:"ladder-table",props:{ladder:null,readonly:{type:Boolean}},emits:["choose","delete","update"],setup(_,{emit:p}){return(T,i)=>{const o=n("ElTableColumn"),m=n("ElTag"),f=n("ElImage"),b=n("el-input-number"),r=n("ElButton"),x=n("ElTooltip"),h=n("ElTable");return C(),w(h,{size:"small",border:"",data:_.ladder,"max-height":"500px"},{default:t(()=>[e(o,{prop:"name",label:"\u987A\u5E8F",width:"110px",fixed:"left"},{default:t(({$index:l})=>[u(d(l+1),1)]),_:1}),e(o,{prop:"type",label:"\u5546\u54C1\u7C7B\u578B",width:"110px"},{default:t(({row:l})=>[e(m,null,{default:t(()=>{var a;return[u(d(((a=s(y).find(({id:g})=>g===l.type+""))==null?void 0:a.label)||"--"),1)]}),_:2},1024)]),_:1}),e(o,{prop:"good_cover_img",width:"60",label:"\u56FE\u7247"},{default:t(({row:l})=>[e(f,{src:l.good_cover_img,fit:"cover",lazy:"","preview-src-list":l.good_cover_img!==""?[l.good_cover_img]:[],"z-index":"99999","preview-teleported":""},null,8,["src","preview-src-list"])]),_:1}),e(o,{prop:"good_name",label:"\u5546\u54C1\u540D\u79F0"}),e(o,{prop:"inventory",label:"\u6DFB\u52A0\u5E93\u5B58\u6570",width:"150px"},{default:t(({row:l})=>[e(b,{modelValue:l.inventory,"onUpdate:modelValue":a=>l.inventory=a,step:1,min:0,precision:0,size:"small",max:99999999,"value-on-clear":"min","controls-position":"right","step-strictly":""},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(o,{prop:"unit",label:"\u5355\u4F4D",width:"80px"}),e(o,{prop:"moq",label:"\u8D77\u8BA2\u91CF",width:"80px"}),e(o,{prop:"step",label:"\u6B65\u957F",width:"80px"}),e(o,{prop:"price",label:"\u552E\u4EF7",width:"110px"}),e(o,{width:"80px",fixed:"right"},{header:t(()=>[c("div",B,[F,e(x,{content:"\u6DFB\u52A0",placement:"top"},{default:t(()=>[e(r,{link:"",icon:s(E)("add"),onClick:i[0]||(i[0]=()=>p("choose"))},null,8,["icon"])]),_:1})])]),default:t(({$index:l,row:a})=>[e(r,{text:"",type:"primary",size:"small",onClick:()=>p("delete",l)},{default:t(()=>[u("\u5220\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])}}});export{V as _};
