物管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
3.4 KiB

import{i as z,L as k,e as C}from"./index-Csvj-veb.js";import{c as M}from"./cloneDeep-C6NKQlMO.js";import{d as B,Y as I,t as L,Q as _,v as $,x as A,p as D,o as R,b as W,k as G}from"./index-bVOhw2NF.js";import"./_initCloneObject-K-Y0ueWp.js";import"./_getTag-BJ2nhJXz.js";const j=B({name:"EsScrollBarOne",components:{},props:{options:{type:Object,default:()=>({})},datasets:{type:[Array,Object,String],default:()=>[]},eventData:{type:[String,Boolean,Number],default:""},element:{type:Object,default:()=>({})}},setup(n){const o=[{category:"安徽省",data1:239},{category:"河南省",data1:181},{category:"湖北省",data1:154},{category:"贵州省",data1:144},{category:"四川省",data1:135},{category:"云南省",data1:117},{category:"湖南省",data1:74},{category:"广东省",data1:72},{category:"广西壮族自治区",data1:67},{category:"海南省",data1:55}];let s=null;const a=I(null),u=(r,l)=>{const{grid:y,title:h,legend:g,tooltip:d,codeConfig:b,renderMode:x,enableScroll:v,countPerPage:m,barWidth:f}=l,p=document.querySelector(`.chart-${n.element.id}`);if(p){a.value||(a.value=z(p,null,{renderer:x}));const i=r||o,c=[],V=Math.max(...i.map(t=>t.data1));for(let t=0;t<o.length;t++)c.push(V);const w=[{name:"total",type:"bar",barGap:"-100%",barWidth:"15px",data:c.map(t=>({value:t,barGap:"-100%",itemStyle:{color:"#00123500",barBorderRadius:10},label:{show:!0,position:"right",color:"#eee",distance:20,formatter:O=>o[O.dataIndex].data1}})),legendHoverLink:!1},{name:"值",type:"bar",zlevel:1,itemStyle:{normal:{barBorderRadius:30,color:new k(0,0,1,0,[{offset:0,color:"rgb(57,89,255,1)"},{offset:1,color:"rgb(46,200,207,1)"}])}},barWidth:f,data:o.map(t=>t.data1)},{name:"背景",type:"bar",barWidth:f,barGap:"-100%",data:c,itemStyle:{normal:{color:"rgba(24,31,68,1)",barBorderRadius:30}}}],S={text:"交通方式",top:"48%",textAlign:"center",left:"49%",textStyle:{color:"#fff",fontSize:22,fontWeight:"400"},...g,data:i.map(t=>t.category)},Z={grid:y,title:h,tooltip:{...d,borderColor:d.backgroundColor,textStyle:{...d.textStyle,align:"left"}},legend:S,dataZoom:[{type:"slider",show:!1,yAxisIndex:0,zoomLock:!0,width:10,height:"80%",handleSize:0,showDetail:!1,startValue:0,endValue:m},{type:"inside",id:"insideY",yAxisIndex:0,startValue:0,endValue:m,zoomOnMouseWheel:!1,moveOnMouseMove:!0,moveOnMouseWheel:!0}],xAxis:{show:!1,type:"value"},yAxis:[{type:"category",inverse:!0,axisLabel:{show:!0,textStyle:{color:"#fff"}},splitLine:{show:!1},axisTick:{show:!1},axisLine:{show:!1},data:o.map(t=>t.category)}],series:w},e=new Function("option","datas","instance","echarts",b)(M(Z),i,a.value,C);a.value.setOption(e),v&&(s=setInterval(()=>{e.dataZoom[0].endValue===o.length-1?(e.dataZoom[0].endValue=4,e.dataZoom[0].startValue=0,e.dataZoom[1].endValue=4,e.dataZoom[1].startValue=0):(e.dataZoom[0].endValue=e.dataZoom[0].endValue+1,e.dataZoom[0].startValue=e.dataZoom[0].startValue+1,e.dataZoom[1].endValue=e.dataZoom[1].endValue+1,e.dataZoom[1].startValue=e.dataZoom[1].startValue+1),a.value.setOption(e,!0)},2e3))}};return L([()=>n.datasets,()=>n.options],([r,l])=>{r&&(clearInterval(s),_(()=>{u(r,l)}))},{immediate:!0,deep:!0}),$(()=>{const r=new ResizeObserver(()=>{a.value.resize()}),l=document.querySelector(`.chart-${n.element.id}`);l&&r.observe(l)}),A(()=>{clearInterval(s)}),{myChart:a}}});function q(n,o,s,a,u,r){return R(),W("div",{class:G(`chart-${n.element.id}`),width:"100%",height:"100%"},null,2)}const N=D(j,[["render",q]]);export{N as default};