import{aG as k,b1 as z,aC as M,aF as t,bB as e,bb as p,a2 as T,b3 as V,x as B,a6 as D,az as d,bj as c,u as N,aa as S,ab as I,ad as P,aE as w,$ as j,av as _,al as A}from"./index-DrvLDslf.js";/* empty css             *//* empty css                *//* empty css                     *//* empty css                  */import"./el-tooltip-l0sNRNKZ.js";/* empty css                    *//* empty css                        *//* empty css                    *//* empty css               *//* empty css               *//* empty css                     */import{l as F,a as G}from"./projection-CizY2UtH.js";import{l as R}from"./ops-CZkWvMAR.js";import"./reflection-Dr3WM5Rz.js";const $={class:"muted"},q=k({__name:"MonitorDashboardView",setup(H){const n=p([]),m=p([]),i=p([]),b=_(()=>n.value.filter(l=>l.state!=="offline").length),C=_(()=>m.value.filter(l=>l.status==="running").length),x=_(()=>n.value.filter(l=>l.state==="fault").length);function E(l){switch(l){case"running":return"success";case"idle":return"info";case"charging":return"warning";case"paused":return"warning";case"fault":return"danger";case"offline":return"info";default:return"info"}}return z(async()=>{[n.value,m.value,i.value]=await Promise.all([F(),G(),R()])}),(l,r)=>{const u=D,o=B,f=T,a=I,g=P,y=j,v=S,h=N;return V(),M("div",null,[t(f,{gutter:14,class:"kpi-row"},{default:e(()=>[t(o,{span:6},{default:e(()=>[t(u,{title:"车辆在线",value:b.value},{suffix:e(()=>[d("span",$,"/ "+c(n.value.length),1)]),_:1},8,["value"])]),_:1}),t(o,{span:6},{default:e(()=>[t(u,{title:"任务进行中",value:C.value},null,8,["value"])]),_:1}),t(o,{span:6},{default:e(()=>[t(u,{title:"故障车辆",value:x.value},null,8,["value"])]),_:1}),t(o,{span:6},{default:e(()=>[t(u,{title:"今日运维动作",value:i.value.length},null,8,["value"])]),_:1})]),_:1}),t(f,{gutter:14,style:{"margin-top":"14px"}},{default:e(()=>[t(o,{span:14},{default:e(()=>[t(h,{shadow:"never"},{header:e(()=>[...r[0]||(r[0]=[d("span",null,"实时车辆",-1)])]),default:e(()=>[t(v,{data:n.value,size:"small","max-height":"360",stripe:""},{default:e(()=>[t(a,{prop:"name",label:"名称",width:"100"}),t(a,{prop:"state",label:"状态",width:"90"},{default:e(s=>[t(g,{size:"small",type:E(s.row.state)},{default:e(()=>[w(c(s.row.state),1)]),_:2},1032,["type"])]),_:1}),t(a,{prop:"group",label:"分组",width:"100"}),t(a,{label:"电量",width:"160"},{default:e(s=>[t(y,{percentage:Math.round(s.row.batterySoc*100),"stroke-width":8},null,8,["percentage"])]),_:1}),t(a,{prop:"missionId",label:"当前任务"})]),_:1},8,["data"])]),_:1})]),_:1}),t(o,{span:10},{default:e(()=>[t(h,{shadow:"never"},{header:e(()=>[...r[1]||(r[1]=[d("span",null,"最近运维动作",-1)])]),default:e(()=>[t(v,{data:i.value,size:"small","max-height":"360",stripe:""},{default:e(()=>[t(a,{prop:"ts",label:"时间",width:"180"}),t(a,{prop:"opCode",label:"动作"}),t(a,{prop:"target",label:"目标",width:"100"}),t(a,{prop:"result",label:"结果",width:"80"},{default:e(s=>[t(g,{size:"small",type:s.row.result==="ok"?"success":"danger"},{default:e(()=>[w(c(s.row.result),1)]),_:2},1032,["type"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1})]),_:1})])}}}),ot=A(q,[["__scopeId","data-v-d6b33cf6"]]);export{ot as default};
