7 lines
6.4 KiB
JavaScript
7 lines
6.4 KiB
JavaScript
import{c as F,d as _,a as i,b as o,f as r,u as l,j as n,x as u,F as x,r as G,t as e,y as C,k as y,o as d,n as S,h as V,s as m}from"./index-C5t0nGiQ.js";import{D as h}from"./download-hBwFRgUo.js";import{P as z}from"./plus-BfKzmzQH.js";import{S as B}from"./search-BFqPyJ5C.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 N=F("circle-stop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]),T={class:"p-6"},j={class:"mb-6"},E={class:"flex items-center justify-between mb-2"},L={class:"flex items-center gap-3"},I={class:"px-4 py-2 rounded flex items-center gap-2",style:{border:"1px solid #D9D9D9",color:"rgba(0, 0, 0, 0.85)"}},M={class:"bg-white p-6 rounded-lg mb-6",style:{"box-shadow":"0 1px 2px rgba(0, 0, 0, 0.05)"}},P={class:"grid grid-cols-5 gap-4"},A={class:"flex items-end"},$={class:"w-full px-4 py-2 rounded text-white flex items-center justify-center gap-2",style:{"background-color":"#4a7c59"}},O={class:"space-y-4 mb-6"},R={class:"flex items-start justify-between mb-4"},X={class:"flex-1 grid grid-cols-5 gap-4"},q={class:"font-medium"},H={style:{color:"rgba(0, 0, 0, 0.65)"}},J={class:"flex items-center gap-3 pt-4 border-t",style:{"border-color":"#F0F0F0"}},K=["onClick"],Q={class:"text-sm flex items-center gap-1",style:{color:"#FF4D4F"}},U={class:"bg-white p-4 rounded-lg flex items-center justify-between",style:{"box-shadow":"0 1px 2px rgba(0, 0, 0, 0.05)"}},W={class:"text-sm",style:{color:"rgba(0, 0, 0, 0.65)"}},g=5234,lo=_({__name:"DeviceList",setup(Y){const a=C(),c=m(1),b=m(10),f=[{sn:"GD30-20240308-001",model:"GD30 高密度电法仪",status:"已激活",firmwareVersion:"v2.3.5",registrationDate:"2024-03-08 14:30"},{sn:"GT20-20240307-045",model:"GT20 瞬变电磁仪",status:"已出厂",firmwareVersion:"v1.8.2",registrationDate:"2024-03-07 10:15"},{sn:"GD30-20240308-002",model:"GD30 高密度电法仪",status:"装配中",firmwareVersion:"v2.3.4",registrationDate:"2024-03-08 16:20"}];function D(p){switch(p){case"已激活":return{backgroundColor:"#F6FFED",color:"#52C41A",border:"1px solid #B7EB8F"};case"已出厂":return{backgroundColor:"#FFF7E6",color:"#FA8C16",border:"1px solid #FFD591"};case"装配中":return{backgroundColor:"#eef5f0",color:"#4a7c59",border:"1px solid #a3c4ad"}}}const v=y(()=>(c.value-1)*b.value+1),k=y(()=>Math.min(c.value*b.value,g));return(p,t)=>(d(),i("div",T,[o("div",j,[o("div",E,[t[3]||(t[3]=o("h2",{class:"text-2xl font-semibold"},"设备列表",-1)),o("div",L,[o("button",I,[r(l(h),{size:16}),t[1]||(t[1]=n(" 导出 ",-1))]),o("button",{class:"px-4 py-2 rounded text-white flex items-center gap-2",style:{"background-color":"#4a7c59"},onClick:t[0]||(t[0]=s=>l(a).push("/registration"))},[r(l(z),{size:16}),t[2]||(t[2]=n(" 登记设备 ",-1))])])]),t[4]||(t[4]=o("p",{class:"text-sm",style:{color:"rgba(0, 0, 0, 0.45)"}},"管理所有设备信息",-1))]),o("div",M,[o("div",P,[t[6]||(t[6]=u('<div><label class="block text-sm mb-2" style="color:rgba(0, 0, 0, 0.65);">设备型号</label><select class="w-full px-3 py-2 border rounded" style="border-color:#D9D9D9;background-color:#fff;"><option>全部</option><option>GD30 高密度电法仪</option><option>GT20 瞬变电磁仪</option><option>GM10 大地电磁仪</option></select></div><div><label class="block text-sm mb-2" style="color:rgba(0, 0, 0, 0.65);">设备状态</label><select class="w-full px-3 py-2 border rounded" style="border-color:#D9D9D9;background-color:#fff;"><option>全部</option><option>已激活</option><option>已出厂</option><option>装配中</option></select></div><div><label class="block text-sm mb-2" style="color:rgba(0, 0, 0, 0.65);">生产日期</label><input type="date" class="w-full px-3 py-2 border rounded" style="border-color:#D9D9D9;"></div><div><label class="block text-sm mb-2" style="color:rgba(0, 0, 0, 0.65);">产品型号</label><select class="w-full px-3 py-2 border rounded" style="border-color:#D9D9D9;background-color:#fff;"><option>全部</option><option>GD30-2024</option><option>GT20-2023</option><option>GTXD-2022</option></select></div>',4)),o("div",A,[o("button",$,[r(l(B),{size:16}),t[5]||(t[5]=n(" 搜索 ",-1))])])])]),o("div",O,[(d(),i(x,null,G(f,(s,w)=>o("div",{key:w,class:"bg-white rounded-lg p-6",style:{"box-shadow":"0 1px 2px rgba(0, 0, 0, 0.05)"}},[o("div",R,[o("div",X,[o("div",null,[t[7]||(t[7]=o("div",{class:"text-xs mb-1",style:{color:"rgba(0, 0, 0, 0.45)"}},"设备SN号",-1)),o("div",q,e(s.sn),1)]),o("div",null,[t[8]||(t[8]=o("div",{class:"text-xs mb-1",style:{color:"rgba(0, 0, 0, 0.45)"}},"型号",-1)),o("div",null,e(s.model),1)]),o("div",null,[t[9]||(t[9]=o("div",{class:"text-xs mb-1",style:{color:"rgba(0, 0, 0, 0.45)"}},"状态",-1)),o("span",{class:"inline-block px-2 py-1 rounded text-xs",style:S(D(s.status))},e(s.status),5)]),o("div",null,[t[10]||(t[10]=o("div",{class:"text-xs mb-1",style:{color:"rgba(0, 0, 0, 0.45)"}},"固件版本",-1)),o("div",null,e(s.firmwareVersion),1)]),o("div",null,[t[11]||(t[11]=o("div",{class:"text-xs mb-1",style:{color:"rgba(0, 0, 0, 0.45)"}},"生产日期",-1)),o("div",H,e(s.registrationDate),1)])])]),o("div",J,[o("button",{class:"text-sm",style:{color:"#4a7c59"},onClick:Z=>l(a).push("/devices/"+s.sn)},"详情",8,K),t[14]||(t[14]=o("button",{class:"text-sm",style:{color:"#4a7c59"}},"BOM",-1)),s.status==="已激活"?(d(),i(x,{key:0},[t[13]||(t[13]=o("span",{style:{color:"#D9D9D9"}},"|",-1)),o("button",Q,[r(l(N),{size:14}),t[12]||(t[12]=n(" 下线 ",-1))])],64)):V("",!0)])])),64))]),o("div",U,[o("div",W," 显示 "+e(v.value)+"-"+e(k.value)+" / 共 "+e(g.toLocaleString())+" 台 ",1),t[15]||(t[15]=u('<div class="flex items-center gap-2"><button class="px-3 py-1 rounded border" style="border-color:#D9D9D9;color:rgba(0, 0, 0, 0.45);" disabled> 上一页 </button><button class="px-3 py-1 rounded" style="background-color:#4a7c59;color:#fff;">1</button><button class="px-3 py-1 rounded border" style="border-color:#D9D9D9;color:rgba(0, 0, 0, 0.85);">2</button><button class="px-3 py-1 rounded border" style="border-color:#D9D9D9;color:rgba(0, 0, 0, 0.85);">3</button><span style="color:rgba(0, 0, 0, 0.45);">...</span><button class="px-3 py-1 rounded border" style="border-color:#D9D9D9;color:rgba(0, 0, 0, 0.85);">524</button><button class="px-3 py-1 rounded border" style="border-color:#D9D9D9;color:rgba(0, 0, 0, 0.85);">下一页</button></div>',1))])]))}});export{lo as default};
|