import{Q as x}from"./QPage-Cbwj6EO4.js";import{e as $,g as I}from"./axios-2C-KJX3t.js";import{u as m}from"./use-quasar-f8m-PZpx.js";import{aK as v,a as d,r as _,w as C,o as g,e as w,a2 as u,a3 as k,aI as y,ab as h,a7 as q,at as p,a5 as D,ao as b}from"./index-DC_W_xoa.js";import{i as z}from"./install-y9MVQaGf.js";import{aR as B,dR as S,dS as T,dQ as E,dT as H}from"./install-DogX_3Yh.js";const L={__name:"TreeMap",props:{title:{type:String,default:"Treemap Chart"},seriesData:{type:Array,required:!0},chartHeight:{type:Number,required:!0}},setup(c){B([z,S,T,E]);const a=c,l=m(),s=d(()=>l.dark.isActive),i=_(null);let e=null;const r=()=>{if(!i.value)return;e||(e=H(i.value));const n={title:{text:a.title,left:"center",textStyle:{color:s.value?"#ffffff":"#000000"}},tooltip:{formatter:t=>{const f=t.value||0;return`${t.name}: ${f}`}},series:[{type:"treemap",data:a.seriesData,label:{show:!0,formatter:"{b}",color:s.value?"#ffffff":"#000000"},itemStyle:{borderColor:s.value?"#ffffff":"#000000",borderWidth:1}}]};e.setOption(n)};C(()=>[a.seriesData,s.value],()=>{r()},{deep:!0}),g(()=>{r(),window.addEventListener("resize",o)}),w(()=>{e&&(e.dispose(),e=null),window.removeEventListener("resize",o)});const o=()=>{e&&e.resize()};return(n,t)=>(u(),k("div",{ref_key:"chart",ref:i,style:y({width:"100%",height:`${c.chartHeight}px`})},null,4))}},M=v(L,[["__scopeId","data-v-95d517ca"]]),Q={class:"col-12 q-pa-md"},N={__name:"PIDCharts",setup(c){const a=m(),l=d(()=>a.screen.height*.8),s=d(()=>a.screen.width*.825),i=l.value;let e=null;const r=_({title:"",series_list:[]});function o(){I({url:"core/server/pidcharts/"}).then(t=>{r.value=t.pid_data}).catch(t=>{a.notify({type:"error",message:t}),a.loading.hide()})}g(()=>{n(),o(),e=setInterval(()=>{o()},6e4)}),w(()=>{e&&clearInterval(e)});function n(){$.on("needLogin",t=>{t&&console.log("needLogin")})}return(t,f)=>(u(),h(x,{class:"flex flex-col q-pa-md"},{default:q(()=>[p("div",{class:"row full-width",style:y({height:`${l.value}px`})},[p("div",Q,[r.value.series_list.length?(u(),h(M,{key:0,title:r.value.title,"series-data":r.value.series_list,"show-legend":!0,"chart-height":D(i),"chart-width":s.value},null,8,["title","series-data","chart-height","chart-width"])):b("",!0)])],4)]),_:1}))}},O=v(N,[["__scopeId","data-v-8334edd3"]]);export{O as default};
