import{a as k}from"./api._G-kxOoH.js";import{H as z}from"./Columns.Cvg5C6vI.js";import{u as D,a as H}from"./useTableData.DHj98pR6.js";import d from"./ChangeValue.DywXBhO-.js";import{d as V,r as B,Z as N,j as R,ai as r,o as u,M as m,O as t,U as n,a as M,u as l,S as f,T as _,R as O,K as U}from"./vue.1RczIYhx.js";import{_ as q}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.DoJnwA7v.js";import"./elementPlus.CqHltQSO.js";const L=V({__name:"DataTable",props:{asin:String,country:String},setup(b){const v=b,{asin:C,country:y}=v,{tableOptions:s,handlePageChange:x}=D(p),g=B(),a=N({id:"historical-detail-table",keepSource:!0,size:"small",border:!1,round:!0,stripe:!0,currentRowHighLight:!0,height:800,customConfig:{storage:!0},rowConfig:{isHover:!0},columnConfig:{resizable:!0},pagerConfig:{total:s.value.total,page:s.value.page,limit:s.value.limit},loading:!1,loadingConfig:{icon:"vxe-icon-indicator roll",text:"正在拼命加载中..."},columns:"",data:""}),c={price:{label:"价格",color:"primary"},discount:{label:"折扣",color:"primary"},coupon:{label:"优惠券",color:"primary"},imgs:{label:"图片",color:"warning"},title:{label:"标题",color:"warning"},bullet_point:{label:"五点信息",color:"warning"},all_score:{label:"综合评分",color:"warning"},badge:{label:"限时处理",color:"danger"},variants:{label:"变体",color:"danger"},score:{label:"子asin评分",color:"success"},reviews:{label:"子asin评论数",color:"success"}};R(()=>{setTimeout(()=>{p()},300)});async function p(){var o,i;a.data=[],a.columns=[],await H(k,{asin:C,country_code:y},a),a&&((o=a.data)!=null&&o.length)&&await g.value.loadColumn(z),a.showHeader=!!((i=a.data)!=null&&i.length)}return(h,o)=>{const i=r("el-empty"),w=r("vxe-pager"),P=r("el-tag"),S=r("vxe-grid"),T=r("el-card");return u(),m(T,{class:"border-none my-5"},{default:t(()=>[n(S,U({ref_key:"gridRef",ref:g},l(a)),{top:t(()=>o[2]||(o[2]=[M("div",{class:"mb-2"},null,-1)])),empty:t(()=>[n(i,{description:"暂无数据"})]),pager:t(()=>[n(w,{currentPage:l(a).pagerConfig.page,"onUpdate:currentPage":o[0]||(o[0]=e=>l(a).pagerConfig.page=e),pageSize:l(a).pagerConfig.limit,"onUpdate:pageSize":o[1]||(o[1]=e=>l(a).pagerConfig.limit=e),total:l(a).pagerConfig.total,class:"mt-1.5",onPageChange:l(x)},null,8,["currentPage","pageSize","total","onPageChange"])]),create_datetime:t(({row:e})=>[f(_(e.create_datetime||"--"),1)]),field:t(({row:e})=>[c[e.field]?(u(),m(P,{key:0,type:c[e.field].color,effect:"plain"},{default:t(()=>[f(_(c[e.field].label),1)]),_:2},1032,["type"])):O("",!0)]),old_val:t(({row:e})=>[n(d,{field:e.field,value:e.old_val},null,8,["field","value"])]),new_val:t(({row:e})=>[n(d,{field:e.field,value:e.new_val},null,8,["field","value"])]),_:1},16)]),_:1})}}}),J=q(L,[["__scopeId","data-v-726e5482"]]);export{J as default};
