import{u as C}from"./countryInfo.Df1X6FZ-.js";import{g as S}from"./useTagColor.B-JXlmrE.js";import{K as D}from"./elementPlus.CqHltQSO.js";import{_ as E}from"./index.vue_vue_type_script_setup_true_lang.DfUMpYc_.js";import{u as G}from"./useResponse.DqThFJSa.js";import{r as m}from"./index.DoJnwA7v.js";import{d as I,ai as f,o,c as n,u as t,U as a,O as i,J as q,T as c,aG as B,S as _}from"./vue.1RczIYhx.js";const v="/api/choice/listings/";function W(r){return m({url:v,method:"GET",params:r})}function X(){return m({url:"/api/choice/marketplace_shops/select",method:"GET"})}function R(r){return m({url:"/api/choice/goods/",method:"GET",params:r})}function Y(r){return m({url:v+"export_data/",method:"GET",params:r,responseType:"blob"})}const A={class:"font-medium"},F={key:0},N={key:1},O={key:2},U={key:3},V={key:4},z={key:5},J={key:6},K={key:7},Z=I({__name:"DataTableSlot",props:{row:{},field:{}},setup(r){const b=B(),k=r,{row:e,field:s}=k,h=C(),d=h.Countries.find(l=>l.code==e.country_code),y=d?d.color:"#3875F6",g=h.Region.find(l=>l.code==e.shop.region);async function T(){const l={asin:e.asin,country_code:e.country_code},p=await G(R,l),u=b.resolve({path:"/product/comment",query:{asin:p.data[0].asin,title:p.data[0].title,img:p.data[0].img,url:p.data[0].url}});window.open(u.href,"_blank")}return(l,p)=>{const u=f("el-tag"),w=f("el-icon"),x=f("el-tooltip");return o(),n("div",A,[t(s)==="region"?(o(),n("div",F,[a(u,{"disable-transitions":!0,type:t(S)(t(e).shop.region)},{default:i(()=>[_(c(t(g)?t(g).name:"-"),1)]),_:1},8,["type"])])):t(s)==="country_code"?(o(),n("div",N,[a(u,{"disable-transitions":!0,style:q({color:t(y),borderColor:t(y)}),effect:"plain",round:""},{default:i(()=>[_(c(t(d)?t(d).name:"-"),1)]),_:1},8,["style"])])):t(s)==="platform_number"?(o(),n("div",O,c(t(e).shop.platform_number),1)):t(s)==="shop_name"?(o(),n("div",U,c(t(e).shop.name),1)):t(s)==="fulfillment_channel"?(o(),n("div",V,[a(u,{"disable-transitions":!0,type:t(e).fulfillment_channel==="FBM"?"primary":"warning"},{default:i(()=>[_(c(t(e).fulfillment_channel),1)]),_:1},8,["type"])])):t(s)==="status"?(o(),n("div",z,[a(u,{"disable-transitions":!0,type:t(e).status==="Active"?"success":t(e).status==="Inactive"?"danger":"info"},{default:i(()=>[_(c(t(e).status==="Active"?"在售":t(e).status==="Inactive"?"不在售":"不完整"),1)]),_:1},8,["type"])])):t(s)==="operate"?(o(),n("div",J,[a(x,{enterable:!1,"show-arrow":!1,content:"评论详情","hide-after":"0",placement:"top","popper-class":"custom-btn-tooltip"},{default:i(()=>[a(E,{circle:"",plain:"",type:"success",onClick:T},{default:i(()=>[a(w,null,{default:i(()=>[a(t(D))]),_:1})]),_:1})]),_:1})])):(o(),n("div",K,c(t(e)[t(s)]||"-"),1))])}}});export{Z as _,X as a,Y as e,W as g};
