var m=(o,c,a)=>new Promise((f,i)=>{var p=t=>{try{e(a.next(t))}catch(s){i(s)}},l=t=>{try{e(a.throw(t))}catch(s){i(s)}},e=t=>t.done?f(t.value):Promise.resolve(t.value).then(p,l);e((a=a.apply(o,c)).next())});import{t as _}from"./other.90f932e6.js";import{u as b}from"./useECharts.e8e78988.js";import g from"./Box.5a9a1fd5.js";import{a as w,fh as B,v as C,w as k,bq as D,L as j,k as v,aG as L,o as O,j as $,z as E,i as u,aH as S}from"./index.6439bb26.js";import{a as N,c as P}from"./colors.35198826.js";const A=w({components:{Box:g},props:{data:{type:Object},index:{type:Number}},setup(o){const c=B(()=>o.data),a=C(null),{setOptions:f}=b(a),i=k({list:[]});function p(){return m(this,null,function*(){const{id:e}=v(o.data);if(!e)return;const t=yield _({crop_id:e}),s=[];for(const d in t)if(Object.prototype.hasOwnProperty.call(t,d)){const r=t[d];s.push({name:r.name,list:Object.keys(r.list).map(n=>r.list[n]),axis:Object.keys(r.list).map(n=>n)})}i.list=s,l()})}function l(){var r;const e={legendData:[],series:[]},t=Number(o.index)%2,s=t==1?N:P,d=t==1?"bar":"line";i.list.forEach(({name:n,list:h},x)=>{const y=s[x%s.length];e.legendData.push(n),e.series.push({name:n,data:h,type:d,itemStyle:{color:y.itemColor}})}),f({grid:{left:"2%",right:"2%",top:"10%",bottom:"2%",containLabel:!0},legend:{show:!1,data:e.legendData,top:"0%",right:"0",textStyle:{color:"#ffffff"}},tooltip:{trigger:"axis",axisPointer:{lineStyle:{width:1,color:"#019680"}}},xAxis:{type:"category",data:(r=i.list[0])==null?void 0:r.axis,axisTick:{show:!1},axisLine:{show:!1},axisLabel:{color:"#fff"}},yAxis:[{type:"value",axisTick:{show:!1},splitLine:{lineStyle:{type:"solid",color:"#8EEEFF",opacity:.3}},axisLabel:{color:"#fff"}}],series:e.series})}return D(()=>{p()}),{propsData:c,chartRef:a}}}),F={class:"h-full flex flex-col w-full"},R={class:"flex-1",ref:"chartRef"};function T(o,c,a,f,i,p){const l=L("Box");return O(),$(l,S({title:o.propsData.name},o.$attrs),{default:E(()=>[u("div",F,[u("div",R,null,512)])]),_:1},16,["title"])}var Q=j(A,[["render",T]]);export{Q as default};