import{u as C}from"./hooks.428ba1c3.js";import{b as w,k as a,o as i,h as c,A as t,j as e,l as p,t as _,f as m,br as y,a as f,E as B}from"./index.4d3e3847.js";const v={class:"w-full flex justify-between"},T=f("p",null,"\u64CD\u4F5C",-1),N=w({__name:"ladder-table",props:{ladder:null,readonly:{type:Boolean}},emits:["choose","delete","update"],setup(u,{emit:r}){return(F,d)=>{const o=a("ElTableColumn"),b=a("ElTag"),E=a("ElImage"),s=a("ElButton"),h=a("ElTooltip"),x=a("ElTable");return i(),c(x,{size:"small",border:"",data:u.ladder,"max-height":"500px"},{default:t(()=>[e(o,{prop:"name",label:"\u987A\u5E8F",width:"110px"},{default:t(({$index:l})=>[p(_(l+1),1)]),_:1}),e(o,{prop:"type",label:"\u5546\u54C1\u7C7B\u578B",width:"110px"},{default:t(({row:l})=>[e(b,null,{default:t(()=>{var n;return[p(_(((n=m(y).find(({id:g})=>g===l.type+""))==null?void 0:n.label)||"--"),1)]}),_:2},1024)]),_:1}),e(o,{prop:"good_cover_img",width:"60",label:"\u56FE\u7247"},{default:t(({row:l})=>[e(E,{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:"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"}),u.readonly?B("",!0):(i(),c(o,{key:0,width:"80px"},{header:t(()=>[f("div",v,[T,e(h,{content:"\u6DFB\u52A0",placement:"top"},{default:t(()=>[e(s,{link:"",icon:m(C)("add"),onClick:d[0]||(d[0]=()=>r("choose"))},null,8,["icon"])]),_:1})])]),default:t(({$index:l,row:n})=>[e(s,{text:"",type:"primary",size:"small",onClick:()=>r("delete",l)},{default:t(()=>[p("\u5220\u9664")]),_:2},1032,["onClick"])]),_:1}))]),_:1},8,["data"])}}});export{N as _};
