"use strict";const e=require("vue"),O=require("echarts"),s=require("../Shared/base-iCmnU-fv.js"),v=require("../Shared/index-Ul6uY51t.js"),L=require("../Shared/resize-COkswDOq.js"),_=require("../Shared/Ing-D_cd5IxY.js");function j(c){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const n in c)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(c,n);Object.defineProperty(l,n,o.get?o:{enumerable:!0,get:()=>c[n]})}}return l.default=c,Object.freeze(l)}const p=j(O),w=["#2ec7c9","#b6a2de","#5ab1ef","#ffb980","#d87a80","#8d98b3","#e5cf0d","#97b552","#95706d","#dc69aa","#07a2a4","#9a7fd1","#588dd5","#f5994e","#c05050","#59678c","#c9ab00","#7eb00a","#6f5553","#c14089"],x={color:w,title:{textStyle:{fontWeight:"normal",color:"#008acd"}},visualMap:{itemWidth:15,color:["#5ab1ef","#e0ffff"]},tooltip:{backgroundColor:"rgba(50,50,50,0.5)",axisPointer:{type:"line",lineStyle:{color:"#008acd"},crossStyle:{color:"#008acd"},shadowStyle:{color:"rgba(200,200,200,0.2)"}}},dataZoom:{dataBackgroundColor:"#efefff",fillerColor:"rgba(182,162,222,0.2)",handleColor:"#008acd"},grid:{borderColor:"#eee"},categoryAxis:{axisLine:{lineStyle:{color:"#008acd"}},splitLine:{lineStyle:{color:["#eee"]}}},valueAxis:{axisLine:{lineStyle:{color:"#008acd"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.1)","rgba(200,200,200,0.1)"]}},splitLine:{lineStyle:{color:["#eee"]}}},timeline:{lineStyle:{color:"#008acd"},controlStyle:{color:"#008acd",borderColor:"#008acd"},symbol:"emptyCircle",symbolSize:3},line:{smooth:!0,symbol:"emptyCircle",symbolSize:3},candlestick:{itemStyle:{color:"#d87a80",color0:"#2ec7c9"},lineStyle:{width:1,color:"#d87a80",color0:"#2ec7c9"},areaStyle:{color:"#2ec7c9",color0:"#b6a2de"}},scatter:{symbol:"circle",symbolSize:4},map:{itemStyle:{color:"#2ec7c9"},label:{color:"#000000"}},graph:{itemStyle:{color:"#d87a80"},linkStyle:{color:"#2ec7c9"}},gauge:{axisLine:{lineStyle:{color:[[.2,"#2ec7c9"],[.8,"#5ab1ef"],[1,"#d87a80"]],width:10}},axisTick:{splitNumber:10,length:15,lineStyle:{color:"auto"}},splitLine:{length:22,lineStyle:{color:"auto"}},pointer:{width:5}}},k=e.defineComponent({name:"ClEcharts",__name:"Index",props:{chartOption:Object,className:String,height:{type:[Number,String],default:400},isRunLoad:{type:Boolean,default:!1}},emits:["onInitFirst","onHideResize"],setup(c,{expose:l,emit:n}){p.registerTheme("macarons",x);const o=c,h=n,m=e.ref(null),r=e.reactive({isShowLoad:o.isRunLoad,isEmptyData:!1}),a={resizeEvent:null,chartObject:null},f=e.computed(()=>{const t={"chart-loading":r.isShowLoad||r.isEmptyData};return o.className&&!s.CommonBase.isEmpty(o.className)&&o.className.split(" ").forEach(i=>{s.CommonBase.isEmpty(i)||(t[i]=!0)}),t}),b=e.computed(()=>{const t={};return(r.isShowLoad||r.isEmptyData)&&(t.height="100%"),t}),g=e.computed(()=>{const t={},{height:i}=o;if(!s.CommonBase.isEmpty(i)){const y=i;t.height=s.CommonBase.isString(y)?y:`${i}px`}return t}),S=()=>{h("onHideResize")},C=()=>{h("onInitFirst")},d=()=>{a.chartObject&&a.chartObject.resize()},u=t=>{const i=s.CommonBase.isEmpty(t);r.isEmptyData=i,i||(a.chartObject||(a.chartObject=p.init(m.value,"macarons"),setTimeout(()=>{C()},50)),a.chartObject.setOption(t,!0),d())},E=()=>{a.chartObject&&(v.CommonElement.isHiddenParent(m.value)?S():d())},z=()=>{s.CommonBase.isEmpty(o.chartOption)||u(o.chartOption)};return e.onMounted(()=>{a.resizeEvent=new L.Resize({callback:()=>{E()}}),e.nextTick(()=>{z()})}),e.onBeforeUnmount(()=>{a.resizeEvent&&a.resizeEvent.destroy()}),e.watch(()=>o.isRunLoad,t=>{r.isShowLoad=t}),e.watch(()=>o.chartOption,t=>{u(t)}),l({getChartObject:()=>a.chartObject,getChartElement:()=>m.value,resize:()=>{d()}}),(t,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(f.value),style:e.normalizeStyle(b.value)},[e.renderSlot(t.$slots,"chartHead"),e.createElementVNode("div",{ref_key:"refElChart",ref:m,style:e.normalizeStyle(g.value)},null,4),e.createVNode(_.ClLoadIng,{isLoadIng:r.isShowLoad,isEmpty:r.isEmptyData},{nothingData:e.withCtx(()=>[e.renderSlot(t.$slots,"nothingData")]),_:3},8,["isLoadIng","isEmpty"])],6))}});module.exports=k;
//# sourceMappingURL=ClEcharts.cjs.map
