import{t as A,v as D,w as U}from"./elementPlus.CXoFsoPv.js";import{_ as E}from"./index.vue_vue_type_script_setup_true_lang.DKtMKa0b.js";import{h as J}from"./useCopyText.DjRNgLW4.js";import{u as M}from"./countryInfo.Df1X6FZ-.js";import{d as O,k as b,ai as a,o,c as n,u as e,U as s,O as l,J as R,a as c,T as r,M as f,S as w,F as q,R as G}from"./vue.1RczIYhx.js";const H={class:"font-semibold"},K={key:0},L={key:1},P={class:"flex justify-center gap-2"},Q={key:2},W={key:3},X={class:"flex justify-start items-center font-medium"},Y={key:0,style:{width:"60px",height:"60px","margin-right":"5px"}},Z={class:"image-slot"},ee={class:"text-left"},te={class:"line-clamp-2 text-ellipsis whitespace-normal"},oe={class:"flex"},ne={class:"font-semibold italic ml-1",style:{color:"#1d2129"}},se={key:4},le={key:1},ce={key:1},ie={key:5},ae={key:6},me=O({__name:"DataTableSlot",props:{row:{},field:{}},emits:["show-detail"],setup(C,{emit:F}){const S=C,{row:t,field:i}=S,V=F,h=M(),_=h.Countries.find(u=>u.code==t.country_code),y=_?_.color:"#3875F6",k=h.endpoints.find(u=>u.code==t.country_code),$=k?k.endpoint:null,I=b(()=>`https://${$}/dp/${t.asin}`),g=b(()=>t.ncx_count!=null&&t.order_count!=null&&t.order_count>0?(t.ncx_count/t.order_count*100).toFixed(2):null);function N(){V("show-detail",t)}return(u,d)=>{const j=a("el-tag"),x=a("el-icon"),p=a("el-image"),m=a("el-tooltip"),z=a("el-link"),B=a("el-button"),T=a("el-rate");return o(),n("div",H,[e(i)==="country_code"?(o(),n("div",K,[s(j,{"disable-transitions":!0,style:R({color:e(y),borderColor:e(y)}),effect:"plain",round:""},{default:l(()=>[w(r(e(_)?e(_).name:"-"),1)]),_:1},8,["style"])])):e(i)==="operate"?(o(),n("div",L,[c("div",P,[c("div",null,[s(E,{circle:"",plain:"",type:"success",onClick:N},{default:l(()=>[s(x,null,{default:l(()=>[s(e(D))]),_:1})]),_:1})])])])):e(i)==="ncx_rate"?(o(),n("div",Q,r(e(g)?e(g)+"%":"-"),1)):e(i)==="product_info"?(o(),n("div",W,[c("div",X,[e(t).img?(o(),n("div",Y,[s(m,{effect:"light",placement:"right-start"},{content:l(()=>[s(p,{src:`https://d1ge0kk1l5kms0.cloudfront.net/images/I/${e(t).img}.jpg`,style:{width:"250px"}},null,8,["src"])]),default:l(()=>[s(p,{src:`https://d1ge0kk1l5kms0.cloudfront.net/images/I/${e(t).img}.jpg`,fit:"scale-down",lazy:"",style:{width:"60px",height:"60px","margin-right":"5px"}},null,8,["src"])]),_:1})])):(o(),f(p,{key:1,lazy:"",style:{"min-width":"60px","margin-right":"5px","font-size":"2.7rem"}},{error:l(()=>[c("div",Z,[s(x,null,{default:l(()=>[s(e(U))]),_:1})])]),_:1})),c("div",ee,[s(m,{content:e(t).product_name,disabled:!e(t).product_name,effect:"dark",placement:"top-start","show-after":"350"},{default:l(()=>[s(z,{disabled:!e(t).product_name,href:e(I),underline:!1,target:"_blank",type:"primary"},{default:l(()=>[c("span",te,r(e(t).product_name||"--"),1)]),_:1},8,["disabled","href"])]),_:1},8,["content","disabled"]),c("div",null,[c("div",oe,[d[2]||(d[2]=w(" ASIN: ")),c("span",ne,r(e(t).asin||"--"),1),s(B,{disabled:!e(t).asin,icon:e(A),class:"ml-1 cursor-pointer",link:"",onClick:d[0]||(d[0]=v=>e(J)(e(t).asin||""))},null,8,["disabled","icon"])])])])])])):e(i)==="all_score"?(o(),n("div",se,[e(t).all_score!==null&&e(t).all_score!==void 0&&e(t).all_score!==""?(o(),n(q,{key:0},[e(t).all_score>0?(o(),f(m,{key:0,content:e(t).all_score,effect:"dark",placement:"top","show-after":"350"},{default:l(()=>[e(t).all_score>0?(o(),f(T,{key:0,modelValue:e(t).all_score,"onUpdate:modelValue":d[1]||(d[1]=v=>e(t).all_score=v),colors:["#FF0000","#FF9900","#67C23A"],disabled:"","text-color":"#1e293b"},null,8,["modelValue"])):G("",!0)]),_:1},8,["content"])):(o(),n("span",le,r(e(t).all_score),1))],64)):(o(),n("span",ce,"-"))])):e(i)==="return_record_rate"?(o(),n("div",ie,r((e(t).return_record_rate*100).toFixed(2)+"%"||"-"),1)):(o(),n("div",ae,r(e(t)[e(i)]||"-"),1))])}}});export{me as _};
