enterprise-saa-s-dashboard-.../dist/assets/Dashboard-CLuwGZTT.js

37 lines
7.2 KiB
JavaScript

import{c as n,d as _,a as o,b as e,F as c,r as d,o as s,t as l,n as r,e as u,u as v,f as y,g as f,h as F}from"./index-C436_g8x.js";import{S as w}from"./server-Del2gqI5.js";import{C}from"./clock-gKlC1TlO.js";import{U as S}from"./upload-DdEqBuGd.js";/**
* @license lucide-vue-next v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const D=n("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
* @license lucide-vue-next v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const N=n("package-check",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]);/**
* @license lucide-vue-next v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const z=n("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
* @license lucide-vue-next v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const A=n("trending-down",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
* @license lucide-vue-next v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const V=n("trending-up",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
* @license lucide-vue-next v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const M=n("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
* @license lucide-vue-next v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const j=n("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]),B={class:"p-6"},L={class:"grid grid-cols-4 gap-6 mb-6"},T={class:"flex items-start justify-between"},U={class:"flex-1"},W={class:"text-sm mb-2",style:{color:"rgba(0, 0, 0, 0.65)"}},E={class:"text-3xl font-semibold mb-2"},G={class:"text-sm"},I={class:"bg-white p-6 rounded-lg mb-6",style:{"box-shadow":"0 1px 2px rgba(0, 0, 0, 0.05)"}},P={style:{display:"flex","flex-direction":"column",gap:"16px"}},R={style:{width:"60px","text-align":"right","font-size":"14px",color:"rgba(0,0,0,0.65)","flex-shrink":"0"}},q={style:{flex:"1","background-color":"#F5F5F5","border-radius":"4px",height:"24px",overflow:"hidden"}},H={style:{width:"40px","font-size":"14px",color:"rgba(0,0,0,0.85)"}},J={class:"bg-white p-6 rounded-lg",style:{"box-shadow":"0 1px 2px rgba(0, 0, 0, 0.05)"}},K={class:"grid grid-cols-2 gap-6"},O={class:"flex items-center justify-between mb-4"},Q={class:"text-base font-medium"},X={class:"px-2 py-1 rounded text-xs",style:{"background-color":"#F0F2F5",color:"rgba(0, 0, 0, 0.65)"}},Y={class:"flex-1"},Z={class:"text-sm mb-1"},$={class:"text-sm",style:{color:"rgba(0, 0, 0, 0.45)"}},ee={class:"flex items-center gap-3"},te={key:0,class:"text-xs",style:{color:"rgba(0, 0, 0, 0.45)"}},se={key:0,class:"w-full mt-3 text-center text-sm",style:{color:"#1890FF"}},ce=_({__name:"Dashboard",setup(le){const b=[{label:"设备总数",value:"5,234",trend:"up",trendValue:"+5.2%",color:"#1890FF",icon:w},{label:"装配中",value:"4,856",trend:"up",trendValue:"+2.8%",color:"#52C41A",icon:M},{label:"已激活",value:"4,912",trend:"up",trendValue:"+1.5%",color:"#1890FF",icon:D},{label:"有新版本",value:"156",color:"#722ED1",icon:N},{label:"维修中",value:"23",trend:"down",trendValue:"-12.3%",color:"#FF4D4F",icon:j},{label:"报废",value:"56",color:"#FA8C16",icon:z},{label:"授权即将到期",value:"45",color:"#FAAD14",icon:C},{label:"升级中",value:"8",color:"#13C2C2",icon:S}],x=[{name:"已装配",value:45,color:"#52C41A"},{name:"已出厂",value:378,color:"#FF4D4F"},{name:"已激活",value:286,color:"#FAAD14"},{name:"报废",value:7,color:"#8C8C8C"}],m=F(()=>Math.max(...x.map(h=>h.value))),g=[{title:"固件升级通知",count:8,tasks:[{deviceSN:"SN2024030710",description:"固件版本v2.3.5可用",time:"1天前"},{deviceSN:"SN2024030711",description:"固件版本v2.3.5可用",time:"1天前"}]},{title:"维修工单",count:5,tasks:[{deviceSN:"SN2024030530",description:"设备故障报修",time:"4小时前"},{deviceSN:"SN2024030531",description:"电池故障",time:"6小时前"}]}];return(h,a)=>(s(),o("div",B,[a[3]||(a[3]=e("div",{class:"mb-6"},[e("h2",{class:"text-2xl font-semibold mb-1"},"首页"),e("p",{class:"text-sm",style:{color:"rgba(0, 0, 0, 0.45)"}},"设备管理数据总览")],-1)),e("div",L,[(s(),o(c,null,d(b,(t,p)=>e("div",{key:p,class:"bg-white p-6 rounded-lg",style:{"box-shadow":"0 1px 2px rgba(0, 0, 0, 0.05)"}},[e("div",T,[e("div",U,[e("div",W,l(t.label),1),e("div",E,l(t.value),1),t.trend&&t.trendValue?(s(),o("div",{key:0,class:"flex items-center gap-1",style:r({color:t.trend==="up"?"#52C41A":"#FF4D4F"})},[t.trend==="up"?(s(),u(v(V),{key:0,size:14})):(s(),u(v(A),{key:1,size:14})),e("span",G,l(t.trendValue),1)],4)):y("",!0)]),e("div",{class:"w-12 h-12 rounded-lg flex items-center justify-center",style:r({backgroundColor:t.color+"15"})},[(s(),u(f(t.icon),{size:24,style:r({color:t.color})},null,8,["style"]))],4)])])),64))]),e("div",I,[a[0]||(a[0]=e("h3",{class:"text-lg font-semibold mb-6"},"设备状态分布",-1)),e("div",P,[(s(),o(c,null,d(x,t=>e("div",{key:t.name,style:{display:"flex","align-items":"center",gap:"12px"}},[e("div",R,l(t.name),1),e("div",q,[e("div",{style:r({width:t.value/m.value*100+"%",height:"100%",backgroundColor:t.color,borderRadius:"0 4px 4px 0",transition:"width 0.3s ease",minWidth:t.value>0?"2px":"0"})},null,4)]),e("div",H,l(t.value),1)])),64))])]),e("div",J,[a[2]||(a[2]=e("h3",{class:"text-lg font-semibold mb-6"},"待处理任务",-1)),e("div",K,[(s(),o(c,null,d(g,(t,p)=>e("div",{key:p},[e("div",O,[e("h4",Q,l(t.title),1),e("span",X,l(t.count),1)]),e("div",null,[(s(!0),o(c,null,d(t.tasks,(i,k)=>(s(),o("div",{key:k,class:"flex items-start justify-between py-3",style:{"border-bottom":"1px solid #F0F0F0"}},[e("div",Y,[e("div",Z,l(i.deviceSN),1),e("div",$,l(i.description),1)]),e("div",ee,[i.time?(s(),o("span",te,l(i.time),1)):y("",!0),a[1]||(a[1]=e("button",{class:"text-sm",style:{color:"#1890FF"}},"处理",-1))])]))),128))]),t.tasks.length<t.count?(s(),o("button",se," 查看全部 "+l(t.count)+" 项 ",1)):y("",!0)])),64))])])]))}});export{ce as default};