import{c as n,d as F,a as i,b as e,F as c,r,o as s,e as S,f as h,w as y,t as l,n as d,g as p,u as b,h as m,i as N,W as D,j as f,k as A}from"./index-C5t0nGiQ.js";import{S as V}from"./server-hSQBXLWa.js";import{C as z}from"./clock-CMNFmLxx.js";import{U as M}from"./upload-Cl9qkJl5.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 W=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 j=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 B=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 G=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 T=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 L=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"}]]),U={class:"p-6"},E={class:"grid grid-cols-4 gap-6 mb-6"},O={class:"flex items-start justify-between"},I={class:"flex-1"},P={class:"text-sm mb-2",style:{color:"rgba(0, 0, 0, 0.65)"}},R={class:"text-3xl font-semibold mb-2"},q={class:"text-sm"},H={class:"bg-white p-6 rounded-lg mb-6",style:{"box-shadow":"0 1px 2px rgba(0, 0, 0, 0.05)"}},J={style:{display:"flex","flex-direction":"column",gap:"16px"}},K={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"}},X={style:{width:"40px","font-size":"14px",color:"rgba(0,0,0,0.85)"}},Y={class:"bg-white p-6 rounded-lg",style:{"box-shadow":"0 1px 2px rgba(0, 0, 0, 0.05)"}},Z={class:"grid grid-cols-2 gap-6"},$={class:"flex items-center justify-between mb-4"},ee={class:"text-base font-medium"},te={class:"px-2 py-1 rounded text-xs",style:{"background-color":"#F0F2F5",color:"rgba(0, 0, 0, 0.65)"}},se={class:"flex-1"},le={class:"text-sm mb-1"},oe={class:"text-sm",style:{color:"rgba(0, 0, 0, 0.45)"}},ie={class:"flex items-center gap-3"},ne={key:0,class:"text-xs",style:{color:"rgba(0, 0, 0, 0.45)"}},ue=F({__name:"Dashboard",setup(ae){const _=[{label:"设备总数",value:"5,234",trend:"up",trendValue:"+5.2%",color:"#4a7c59",icon:V,link:"/devices"},{label:"装配中",value:"4,856",trend:"up",trendValue:"+2.8%",color:"#52C41A",icon:L,link:"/devices"},{label:"已激活",value:"4,912",trend:"up",trendValue:"+1.5%",color:"#4a7c59",icon:W,link:"/activation"},{label:"有新版本",value:"156",color:"#722ED1",icon:j,link:"/firmware"},{label:"维修中",value:"23",trend:"down",trendValue:"-12.3%",color:"#FF4D4F",icon:D,link:"/repair"},{label:"报废",value:"56",color:"#FA8C16",icon:B,link:"/scrap"},{label:"授权即将到期",value:"45",color:"#FAAD14",icon:z,link:"/licenses"},{label:"升级中",value:"8",color:"#13C2C2",icon:M,link:"/firmware"}],v=[{name:"已装配",value:45,color:"#52C41A"},{name:"已出厂",value:378,color:"#FF4D4F"},{name:"已激活",value:286,color:"#FAAD14"},{name:"报废",value:7,color:"#8C8C8C"}],g=A(()=>Math.max(...v.map(x=>x.value))),w=[{title:"待校准设备",count:23,link:"/calibration",tasks:[{deviceSN:"AC20240308005",description:"采集板校准即将到期",time:"3天后到期",link:"/calibration"},{deviceSN:"AC20240308006",description:"新采集板待校准",time:"今天",link:"/calibration"}]},{title:"维修工单",count:5,link:"/repair",tasks:[{deviceSN:"GD30-2024-000056",description:"板卡故障，待处理",time:"4小时前",link:"/repair/WO-2024-0001"},{deviceSN:"GD30-2024-000078",description:"固件异常",time:"6小时前",link:"/repair/WO-2024-0002"}]},{title:"固件升级通知",count:8,link:"/firmware",tasks:[{deviceSN:"SN2024030710",description:"固件版本v2.3.5可用",time:"1天前",link:"/firmware"},{deviceSN:"SN2024030711",description:"固件版本v2.3.5可用",time:"1天前",link:"/firmware"}]},{title:"授权即将到期",count:45,link:"/licenses",tasks:[{deviceSN:"GD30-2025-000001",description:"授权将于30天后到期",time:"30天",link:"/licenses"},{deviceSN:"GT20-2025-000045",description:"授权将于15天后到期",time:"15天",link:"/licenses"}]}];return(x,o)=>{const u=S("router-link");return s(),i("div",U,[o[3]||(o[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",E,[(s(),i(c,null,r(_,(t,k)=>h(u,{key:k,to:t.link,class:"bg-white p-6 rounded-lg block hover:shadow-md transition-shadow",style:{"box-shadow":"0 1px 2px rgba(0, 0, 0, 0.05)"}},{default:y(()=>[e("div",O,[e("div",I,[e("div",P,l(t.label),1),e("div",R,l(t.value),1),t.trend&&t.trendValue?(s(),i("div",{key:0,class:"flex items-center gap-1",style:d({color:t.trend==="up"?"#52C41A":"#FF4D4F"})},[t.trend==="up"?(s(),p(b(T),{key:0,size:14})):(s(),p(b(G),{key:1,size:14})),e("span",q,l(t.trendValue),1)],4)):m("",!0)]),e("div",{class:"w-12 h-12 rounded-lg flex items-center justify-center",style:d({backgroundColor:t.color+"15"})},[(s(),p(N(t.icon),{size:24,style:d({color:t.color})},null,8,["style"]))],4)])]),_:2},1032,["to"])),64))]),e("div",H,[o[0]||(o[0]=e("h3",{class:"text-lg font-semibold mb-6"},"设备状态分布",-1)),e("div",J,[(s(),i(c,null,r(v,t=>e("div",{key:t.name,style:{display:"flex","align-items":"center",gap:"12px"}},[e("div",K,l(t.name),1),e("div",Q,[e("div",{style:d({width:t.value/g.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",X,l(t.value),1)])),64))])]),e("div",Y,[o[2]||(o[2]=e("h3",{class:"text-lg font-semibold mb-6"},"待处理任务",-1)),e("div",Z,[(s(),i(c,null,r(w,(t,k)=>e("div",{key:k},[e("div",$,[e("h4",ee,l(t.title),1),e("span",te,l(t.count),1)]),e("div",null,[(s(!0),i(c,null,r(t.tasks,(a,C)=>(s(),i("div",{key:C,class:"flex items-start justify-between py-3",style:{"border-bottom":"1px solid #F0F0F0"}},[e("div",se,[e("div",le,l(a.deviceSN),1),e("div",oe,l(a.description),1)]),e("div",ie,[a.time?(s(),i("span",ne,l(a.time),1)):m("",!0),h(u,{to:a.link,class:"text-sm",style:{color:"#4a7c59"}},{default:y(()=>[...o[1]||(o[1]=[f("处理",-1)])]),_:1},8,["to"])])]))),128))]),t.tasks.length<t.count?(s(),p(u,{key:0,to:t.link,class:"block w-full mt-3 text-center text-sm",style:{color:"#4a7c59"}},{default:y(()=>[f(" 查看全部 "+l(t.count)+" 项 ",1)]),_:2},1032,["to"])):m("",!0)])),64))])])])}}});export{ue as default};
