import{v as D}from"./elementPlus.4833989a.js";import{f as M}from"./api.64766491.js";import V from"./ExchangeProduct.cb9f9a2e.js";import{e as _}from"./emitter.233282e9.js";import{d as C,B as S,r as c,k,w as F,j as K,A as $,ai as i,aq as j,P as q,o as f,c as h,U as o,O as p,a as t,u as E,J as Q,T as s,aF as R,aG as z}from"./vue.adf17aba.js";import{_ as G}from"./_plugin-vue_export-helper.c27b6911.js";import"./index.34b03be2.js";import"./echarts.72dc8373.js";const r=d=>(R("data-v-e0691322"),d=d(),z(),d),J={class:"top-parent-asin"},O={class:"product-card"},H={class:"product-image"},L=["src"],W={key:1},X={class:"image-slot"},Y={class:"product-info"},Z={style:{position:"relative"}},ee={class:"product-title"},te={class:"product-detail"},ae=r(()=>t("span",{class:"product-detail__label"}," 父ASIN: ",-1)),se=r(()=>t("span",{class:"product-detail__label ml-6"}," SKU: ",-1)),oe=r(()=>t("span",{class:"product-detail__label ml-6"}," FBA库存: ",-1)),le={class:"product-brand"},ne={class:"product-price"},ce=r(()=>t("div",{class:"product-price__label"},"价格",-1)),ie={class:"product-price__content"},re={class:"product-stars"},de=r(()=>t("div",{class:"product-price__label"},"星级评分",-1)),ue=C({__name:"TopParentAsin",setup(d){const I=S("profile"),b=S("dateRange"),v=c(!1),e=c({}),u=c(""),m=c(""),g=c("");_.on("useSelectItem-clickParentAsinBtn",a=>{u.value=a.selectedParentAsin,n()}),_.on("useSelectItem-clickAsinBtn",a=>{u.value=a.selectedParentAsin,m.value=a.selectedAsin,n()}),_.on("useSelectItem-clickSkuItem",a=>{u.value=a.selectedParentAsin,m.value=a.selectedAsin,g.value=a.selectedSku,n()});async function n(){v.value=!0;const a={profileId:I.value.profile_id,parentAsin:u.value,childAsin:m.value,sku:g.value};try{const l=await M(a);e.value=l.data}catch(l){console.log("error:",l)}finally{v.value=!1}}const A=k(()=>e.value.Asin?"ASIN":e.value.sku?"SKU":"父ASIN"),y=k(()=>{switch(A.value){case"ASIN":return{backgroundImage:"linear-gradient(to right bottom, #ffffff, #6759f6)"};case"SKU":return{backgroundImage:"linear-gradient(to right bottom, #ffffff, #91cc69)"};default:return{backgroundImage:"linear-gradient(to right bottom, #ffffff, #478cf7)"}}});return F(b,()=>{n()}),K(()=>{n()}),$(()=>{_.all.clear()}),(a,l)=>{const x=i("el-icon"),B=i("el-image"),N=i("el-tooltip"),P=i("el-rate"),w=i("el-card"),T=j("loading");return q((f(),h("div",J,[o(w,{"body-style":"padding: 8px;"},{default:p(()=>[t("div",O,[t("div",H,[e.value.Image?(f(),h("img",{key:0,src:e.value.Image,class:"img"},null,8,L)):(f(),h("div",W,[o(B,null,{error:p(()=>[t("div",X,[o(x,null,{default:p(()=>[o(E(D))]),_:1})])]),_:1})]))]),t("div",Y,[t("div",null,[o(V),t("div",Z,[t("div",{class:"classification-title",style:Q(y.value)},s(A.value),5)])]),o(N,{effect:"dark",content:e.value.Title,placement:"top-start"},{default:p(()=>[t("div",ee,s(e.value.Title?e.value.Title:"--"),1)]),_:1},8,["content"]),t("div",te,[ae,t("span",null,s(e.value.parentAsin?e.value.parentAsin:"--"),1),se,t("span",null,s(e.value.skuNumbers?e.value.skuNumbers:"--"),1),oe,t("span",null,s(e.value.FBAQuantity?e.value.FBAQuantity:"--"),1)]),t("div",le,[t("span",null,s(e.value.brandName),1)])]),t("div",ne,[ce,t("div",ie,[t("div",null,"$"+s(e.value.priceMin?e.value.priceMin:"--")+" ~ $"+s(e.value.priceMax?e.value.priceMax:"--"),1)])]),t("div",re,[de,o(P,{modelValue:e.value.allScore,"onUpdate:modelValue":l[0]||(l[0]=U=>e.value.allScore=U),disabled:"","show-score":"","text-color":"#1d2129","score-template":`${e.value.allScore?e.value.allScore:"0.0"}`},null,8,["modelValue","score-template"])])])]),_:1})])),[[T,v.value]])}}});const Se=G(ue,[["__scopeId","data-v-e0691322"]]);export{Se as default};