monthlyComparativeData.506d1cc8.js 2.3 KB

1
  1. import{a as z,u as E}from"./columns.2d432cfb.js";import{d as N,r as i,Q as I,w as C,j as k,a8 as h,o as O,E as P,G as c,a as v,L as u,M as j,K as w,B,ab as H}from"./vue.95e072e2.js";import{_ as M}from"./_plugin-vue_export-helper.c27b6911.js";import"./index.44889c0b.js";import"./elementPlus.12aff58e.js";import"./echarts.2703a7ac.js";const W={class:"font-semibold"},A={class:"font-semibold",style:{color:"#0097f8"}},G=N({__name:"monthlyComparativeData",props:{taskIds:Object,monthCurrentDate:Object},setup(y){const n=y,g=i([]),d=i([]),p=i(null),_=i(null),t=I({border:"inner",height:900,align:null,round:!0,loading:!1,columnConfig:{resizable:!0},rowConfig:{isHover:!0},pagerConfig:{enabled:!0,total:20,currentPage:1,pageSize:20,pageSizes:[10,20,30]},toolbarConfig:{custom:!0,zoom:{iconIn:"vxe-icon-fullscreen",iconOut:"vxe-icon-minimize"}},columns:g,data:d});C(()=>n.monthCurrentDate,e=>{e&&(p.value=e.startDate,_.value=e.endDate,f(n.taskIds))});const b={pageChange({currentPage:e,pageSize:r}){t.pagerConfig&&(t.pagerConfig.currentPage=e,t.pagerConfig.pageSize=r,f(n.taskIds))}};async function f(e,r=!1){r&&(t.pagerConfig.currentPage=1);try{t.loading=!0;const a=await z({page:t.pagerConfig.currentPage,limit:t.pagerConfig.pageSize,task_ids:e,month_start_date:p.value,month_end_date:_.value});if(a.data&&a.data.length>0){d.value=a.data,t.pagerConfig.total=a.total;const s=new Set;a.data.forEach(l=>{Object.keys(l).forEach(m=>{(m.includes("的销售额")||m.includes("的周销售额"))&&s.add(m)})});const o=Array.from(s).map(l=>({field:l,title:l,minWidth:97,align:"center",formatter:x}));g.value=[...E,...o]}else d.value=[],t.pagerConfig.total=0}catch(a){console.error("Error fetching data:",a)}finally{t.loading=!1}}C(()=>n.taskIds,e=>{f(e,!0)});function x({cellValue:e}){return e==null||e===""?"--":e}const D=()=>({fontSize:"12px",fontWeight:"500"}),S=()=>({fontSize:"12px"});return k(()=>{}),(e,r)=>{const a=h("el-tag"),s=h("vxe-grid");return O(),P(s,B(t,H(b),{"header-cell-style":S,"cell-style":D}),{platformNumber_default:c(({row:o})=>[v("div",W,u(o.platformNumber),1)]),platformName_default:c(({row:o})=>[v("div",A,u(o.platformName),1)]),currencyCode_default:c(({row:o})=>[j(a,{color:"#fef9c3",style:{color:"#f59e0b","border-color":"#fbbf24"}},{default:c(()=>[w(u(o.currencyCode),1)]),_:2},1024)]),_:1},16)}}});const J=M(G,[["__scopeId","data-v-1af9d47e"]]);export{J as default};