import{C as e,E as t,M as n,St as r,X as i,lt as a,q as o,t as s,vt as c}from"./_plugin-vue_export-helper-9JxOV_6y.js";import{i as l}from"./vue-router-DunO2xT0.js";import{n as u}from"./request-D0ipHUJ7.js";import{t as d}from"./echarts-DfhiEwHl.js";var f=e=>u({url:`/zxl_pm/product/productstat.svc?cmd=statMonth`,method:`get`,params:{zxlPrdId:e}}),p=e=>u({url:`/zxl_pm/product/productstat.svc?cmd=statDay`,method:`get`,params:{zxlPrdId:e}}),m={class:`index-container`},h=s(n({__name:`index`,setup(n){let s=l(),u=r({}),h=null,g=null,_=r({}),v=null,y=null,b=async()=>{let e=await f(s.query.productId);e.series=e.series.map(e=>e={type:`line`,itemStyle:{normal:{label:{show:!0}}},...e}),h=document.querySelector(`.month-echart`),g=c(d(h)),u.value={color:[`#4472C5`,`#ED7C30`,`#80FF80`,`#FF8096`,`#800080`,`#FFC000`,`#00B050`,`#0070C0`,`#703FDD`,`#FF00FF`,`#00FFFF`,`#FFFF00`,`#C00000`,`#008000`,`#0000FF`,`#808080`],title:{text:`累计需求变化情况`,bottom:`2%`,right:`center`},tooltip:{trigger:`axis`},legend:{},toolbox:{show:!0,feature:{}},xAxis:{type:`category`,name:`时间`,boundaryGap:!1,data:e.XAxis},yAxis:{type:`value`,name:`数量`,axisLabel:{formatter:`{value}`}},series:e.series},u.value&&g.setOption(u.value)},x=async()=>{let e=await p(s.query.productId);e.series=e.series.map(e=>e={type:`line`,itemStyle:{normal:{label:{show:!0}}},...e}),v=document.querySelector(`.day-echart`),y=c(d(v)),_.value={color:[`#4472C5`,`#ED7C30`,`#80FF80`,`#FF8096`,`#800080`,`#FFC000`,`#00B050`,`#0070C0`,`#703FDD`,`#FF00FF`,`#00FFFF`,`#FFFF00`,`#C00000`,`#008000`,`#0000FF`,`#808080`],title:{text:`每日需求变化情况`,bottom:`2%`,right:`center`},tooltip:{trigger:`axis`},legend:{},toolbox:{show:!0,feature:{}},xAxis:{type:`category`,name:`时间`,boundaryGap:!1,data:e.XAxis},yAxis:{type:`value`,name:`数量`,axisLabel:{formatter:`{value}`}},series:e.series},_.value&&y.setOption(_.value)};return a(()=>u.value,e=>{e&&(u.value&&g.setOption(u.value),g?.resize())}),a(()=>_.value,e=>{e&&(_.value&&y.setOption(_.value),y?.resize())}),o(()=>{b(),x()}),(n,r)=>(i(),t(`div`,m,[...r[0]||=[e(`div`,{class:`main`},[e(`div`,{class:`month-echart`}),e(`div`,{class:`day-echart`})],-1)]]))}}),[[`__scopeId`,`data-v-133addcb`]]);export{h as default};