import{a5 as D,bL as y,b as I,r as _,w as T,e as $,aA as B,$ as w,o as n,c as r,v as l,x as c,aH as C,aI as z,p as a,q as u,n as R,t as k,P as V,ay as G,ak as P,cp as W,cq as q,br as F,bH as M,_ as O}from"./index.8d733f79.js";import{E as U}from"./el-empty.a60dbc90.js";import{H as j}from"./highcharts-more.b3429ac1.js";import{i as J}from"./image-empty.129cb598.js";const K={class:"radar-card"},Q={class:"radar-card__header"},X=["title"],Y={class:"radar-card__info"},Z={class:"radar-card__info-item"},ee={class:"radar-card__info-item"},ae={class:"radar-card__chart-container"},te=["id"],le={key:1,class:"radar-card__no-data"},oe={key:0,class:"radar-card__table-container"},se={key:1,style:{height:"80px"}},ne={class:"radar-card__footer"},re={key:0,class:"radar-card__update-time"},ce={class:"calc-time"},ie=D({__name:"deviceRadarCard",props:{device:null},emits:["view-original"],setup(t,{emit:E}){const d=t;j(y),I();const o=_(!1),s=_([]),m=_(null),h=_(!1),g=async()=>{o.value=!0;try{s.value=d.device.groupHealths||[],console.log(s.value.length),console.log(s.value.length>=3),s.value.length>=3?(h.value=!0,G(()=>{S()})):h.value=!1}catch(e){console.error(e),h.value=!1}finally{o.value=!1}},S=()=>{const e="radar-"+d.device.id,b=s.value.map(i=>i.deviceHealthGroupName),p=s.value.map(i=>i.healthScore),v={chart:{polar:!0,type:"area",backgroundColor:"transparent"},title:{text:""},pane:{size:"80%"},xAxis:{gridLineColor:"#16AEEA",categories:b,tickmarkPlacement:"on",lineWidth:0,gridLineWidth:1,labels:{style:{color:"#BAD5FD",fontSize:"11px"}}},yAxis:{gridLineColor:"#16AEEA",gridLineInterpolation:"polygon",lineWidth:0,tickInterval:25,min:0,max:100,labels:{enabled:!1}},tooltip:{enabled:!1},credits:{enabled:!1},legend:{enabled:!1},exporting:{enabled:!1},series:[{type:"area",data:p,pointPlacement:"on",color:"rgba(251,216,78,0.5)",dataLabels:{enabled:!0,format:"{y}",style:{color:"#BAD5FD",textOutline:"none"}}}]};m.value=y.chart(e,v)},x=()=>{E("view-original",{device:d.device,healthData:s.value})};return T(()=>d.device.id,()=>{g()}),$(()=>{g()}),B(()=>{m.value&&m.value.destroy()}),(e,b)=>{const p=w("Search"),v=P,i=U,f=W,L=q,H=F,N=w("Timer"),A=M;return n(),r("div",K,[l("div",Q,[l("div",{class:"radar-card__device-name",title:t.device.deviceName},c(t.device.deviceName),9,X),C(l("div",{class:"radar-card__view-icon",onClick:x},[a(v,null,{default:u(()=>[a(p)]),_:1})],512),[[z,t.device.groupHealths.length>=1]])]),a(H,{class:"radar-card__main"},{default:u(()=>[l("div",Y,[l("div",Z,c(e.$t("healthLevel"))+": "+c(t.device.healthLevelName||"-"),1),l("div",ee,c(e.$t("healthScore"))+": "+c(t.device.healthScore||"-"),1)]),C((n(),r("div",ae,[!o.value&&h.value?(n(),r("div",{key:0,id:"radar-"+t.device.id,class:"radar-card__chart-content"},null,8,te)):o.value?k("",!0):(n(),r("div",le,[a(i,{"image-size":70,image:R(J),description:e.$t("noRadarChart")},null,8,["image","description"])]))])),[[A,o.value]]),o.value?(n(),r("div",se)):(n(),r("div",oe,[a(L,{data:t.device.groupHealths,style:{width:"100%"},size:"small"},{default:u(()=>[a(f,{label:e.$t("healthGroup"),"show-overflow-tooltip":"",prop:"deviceHealthGroupName"},null,8,["label"]),a(f,{label:e.$t("healthLevel"),prop:"healthLevelName","show-overflow-tooltip":""},null,8,["label"]),a(f,{label:e.$t("healthScore"),prop:"healthScore",align:"center"},null,8,["label"])]),_:1},8,["data"])]))]),_:1}),l("div",ne,[o.value?k("",!0):(n(),r("div",re,[a(v,{style:{"margin-right":"4px"}},{default:u(()=>[a(N)]),_:1}),V(" "+c(e.$t("deviceUpdateTime"))+": ",1),l("span",ce,c(t.device.calcTime||"-"),1)]))])])}}});const ue=O(ie,[["__scopeId","data-v-db3f9697"]]);export{ue as default};
