Agriculture-front-end/dist/assets/EchartsMJ.c9f3d8c1.js

2 lines
2.7 KiB
JavaScript

import"./index.2809c208.js";import{_ as e,r as a,a2 as t,a7 as o,x as s,ad as i,a4 as n,o as r,c as l,q as c,s as d,l as f}from"./index.e5c8b0d6.js";import{ai as x,aj as m}from"./linkSeriesData.e74eae00.js";const h={class:"EchartsBox"},p=[(e=>(c("data-v-f50ade16"),e=e(),d(),e))((()=>f("div",{id:"myChart"},null,-1)))],u=e({__name:"EchartsMJ",props:{mj:{type:Object,default:()=>[]}},setup(e){const c=e;let d=a([]),f=a([]);return t((()=>c.mj),((e,a)=>{d.value=e.map(((e,a)=>e.subregionName)),f.value=e.map(((e,a)=>e.nonFarm)),function(){var e,a=document.getElementById("myChart"),t=x(a);window.addEventListener("resize",(function(){t.resize()}));let o=d.value,s=f.value;for(let i=0;i<s.length;i++);e={title:{text:"",subtext:""},tooltip:{trigger:"axis",formatter:function(e){return e[0].name+"<br/><span style='display:inline-block;width:8px;height:8px;background:#aee7be;border-radius: 4px;margin-right: 6px;'></span>面积:"+e[0].value+" (亩)"},textStyle:{fontSize:14}},xAxis:{data:o,axisLabel:{inside:!1,color:"#aaa"},axisTick:{show:!1},axisLine:{show:!1},z:10},yAxis:{name:"面积(亩)",axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:"#999"}},dataZoom:[{type:"inside"}],series:[{type:"bar",showBackground:!0,itemStyle:{color:new m(0,0,0,1,[{offset:0,color:"#aee7be"},{offset:.5,color:"#c2ebcf"},{offset:1,color:"#d6f0e1"}])},emphasis:{itemStyle:{color:new m(0,0,0,1,[{offset:0,color:"#8cd8a1"},{offset:.7,color:"#a1dcb2"},{offset:1,color:"#caefd5"}])}},data:s}]},t.on("click",(function(e){t.dispatchAction({type:"dataZoom",startValue:o[Math.max(e.dataIndex-3,0)],endValue:o[Math.min(e.dataIndex+3,s.length-1)]})})),e&&t.setOption(e)}()})),o((()=>{})),s((()=>{var e,a=document.getElementById("myChart"),t=x(a);window.addEventListener("resize",(function(){t.resize()}));let o=d.value,s=f.value;for(let i=0;i<s.length;i++);e={title:{text:"",subtext:""},tooltip:{show:!0,trigger:"axis"},xAxis:{data:o,axisLabel:{inside:!0,color:"#fff"},axisTick:{show:!1},axisLine:{show:!1},z:10},yAxis:{name:"面积(亩)",axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:"#999"}},dataZoom:[{type:"inside"}],series:[{type:"bar",showBackground:!0,itemStyle:{color:new m(0,0,0,1,[{offset:0,color:"#aee7be"},{offset:.5,color:"#c2ebcf"},{offset:1,color:"#d6f0e1"}])},emphasis:{itemStyle:{color:new m(0,0,0,1,[{offset:0,color:"#8cd8a1"},{offset:.7,color:"#a1dcb2"},{offset:1,color:"#caefd5"}])}},data:s}]};t.on("click",(function(e){t.dispatchAction({type:"dataZoom",startValue:o[Math.max(e.dataIndex-3,0)],endValue:o[Math.min(e.dataIndex+3,s.length-1)]})})),e&&t.setOption(e)})),i((()=>{})),n((()=>{window.removeEventListener("resize",(()=>{}))})),(e,a)=>(r(),l("div",h,p))}},[["__scopeId","data-v-f50ade16"]]);export{u as default};