enterprise-saa-s-dashboard-.../dist/assets/DeviceRegistration-3e5bX3Mj.js

12 lines
11 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{c as h,d as A,a as r,b as e,j as c,w,v as B,l as M,i as a,u as d,F as y,r as m,t as s,k as F,h as g,o as l,n as i,e as S,f as b}from"./index-C436_g8x.js";import{C as E}from"./circle-check-Ddc7xHK2.js";import{T as f}from"./triangle-alert-DZ0A_5xH.js";import{U as G}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 v=h("camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
* @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=h("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),V={class:"p-6"},N={class:"bg-white p-6 rounded-lg mb-6",style:{boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"}},z={class:"grid grid-cols-3 gap-6"},q={class:"mb-4 p-4 rounded-lg flex items-start gap-3",style:{backgroundColor:"#F6FFED",border:"1px solid #B7EB8F"}},P={class:"mb-6 p-4 rounded-lg flex items-start gap-3",style:{backgroundColor:"#FFFBE6",border:"1px solid #FFE58F",display:"none"}},j={class:"bg-white rounded-lg mb-6",style:{boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"}},X={class:"p-6 border-b",style:{borderColor:"#F0F0F0"}},L={class:"flex items-center justify-between"},R={class:"px-4 py-2 rounded flex items-center gap-2",style:{border:"1px solid #D9D9D9",color:"rgba(0, 0, 0, 0.85)"}},I={class:"overflow-x-auto"},O={class:"w-full"},U={class:"px-6 py-4",style:{color:"rgba(0, 0, 0, 0.65)"}},W={class:"px-6 py-4"},$={class:"px-6 py-4"},H={class:"px-6 py-4",style:{color:"rgba(0, 0, 0, 0.65)"}},J={class:"px-6 py-4"},K={class:"px-6 py-4"},Q={class:"bg-white rounded-lg mb-6",style:{boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"}},Y={class:"p-6 border-b",style:{borderColor:"#F0F0F0"}},Z={class:"flex items-center justify-between"},ee={class:"flex items-center gap-2"},te={class:"text-sm font-semibold",style:{color:"#1890FF"}},oe={class:"p-6"},se={class:"space-y-3"},le=["onClick"],re={class:"flex-1"},de={class:"flex items-center gap-2"},ae={key:0,class:"px-2 py-1 rounded text-xs flex items-center gap-1",style:{backgroundColor:"#FFF1F0",color:"#FF4D4F",border:"1px solid #FFCCC7"}},ne={class:"flex items-center gap-2"},ce={key:0,class:"px-3 py-1 rounded text-xs flex items-center gap-1",style:{backgroundColor:"#E6F7FF",color:"#1890FF"}},ie={key:1,class:"px-3 py-1 rounded text-xs flex items-center gap-1",style:{backgroundColor:"#1890FF",color:"#fff"}},me=A({__name:"DeviceRegistration",setup(pe){const u=F("GD30"),n=F([{id:1,text:"主板安装及固定",completed:!0,photos:3,needPhoto:!0,versionCheck:!0,versionMatch:!0},{id:2,text:"采集板连接",completed:!0,photos:2,needPhoto:!0,versionCheck:!0,versionMatch:!0},{id:3,text:"测控板安装",completed:!0,photos:2,needPhoto:!0,versionCheck:!0,versionMatch:!1},{id:4,text:"电源线连接检查",completed:!1,photos:0,needPhoto:!0,versionCheck:!1,versionMatch:!0},{id:5,text:"外壳密封性检测",completed:!1,photos:0,needPhoto:!0,versionCheck:!1,versionMatch:!0}]),D=[{code:"MB-2024-001",name:"主控板",sn:"MB20240308001",spec:"GD30-MB-V2.3",calibration:"无需校准",quantity:1},{code:"RX-2024-002",name:"采集板",sn:"RX20240308002",spec:"GD30-RX-V1.8",calibration:"已校准",quantity:2},{code:"MC-2024-003",name:"测控板",sn:"MC20240308003",spec:"GD30-MC-V1.5",calibration:"无需校准",quantity:1},{code:"TX-2024-003",name:"发射板",sn:"TX20240308003",spec:"GD30-TX-V1.5",calibration:"无需校准",quantity:1},{code:"BO-2024-004",name:"升压板",sn:"BO20240308004",spec:"BP600",calibration:"无需校准",quantity:1},{code:"CS-2024-005",name:"外壳机箱",sn:"-",spec:"AL6061-T6",calibration:"无需校准",quantity:1}],k=g(()=>n.value.filter(p=>p.completed).length),C=g(()=>n.value.length),_=p=>{n.value=n.value.map(t=>t.id===p?{...t,completed:!t.completed}:t)};return(p,t)=>(l(),r("div",V,[t[16]||(t[16]=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",N,[t[4]||(t[4]=e("h3",{class:"text-lg font-semibold mb-6"},"装机信息",-1)),e("div",z,[e("div",null,[t[2]||(t[2]=e("label",{class:"block text-sm mb-2",style:{color:"rgba(0, 0, 0, 0.85)"}},[c(" 设备型号 "),e("span",{style:{color:"#FF4D4F"}},"*")],-1)),w(e("select",{"onUpdate:modelValue":t[0]||(t[0]=o=>u.value=o),class:"w-full px-3 py-2 border rounded",style:{borderColor:"#D9D9D9",backgroundColor:"#fff"}},[...t[1]||(t[1]=[e("option",{value:"GD30"},"GD30 高密度电法仪",-1),e("option",{value:"GT20"},"GT20 瞬变电磁仪",-1),e("option",{value:"GTXD"},"GM10 大地电磁仪",-1)])],512),[[B,u.value]])]),t[3]||(t[3]=M('<div><label class="block text-sm mb-2" style="color:rgba(0, 0, 0, 0.85);"> 主机SN号 <span style="color:#FF4D4F;">*</span></label><input type="text" class="w-full px-3 py-2 border rounded" style="border-color:#D9D9D9;" placeholder="请输入主机SN号" value="GD30-20240308-001"></div><div><label class="block text-sm mb-2" style="color:rgba(0, 0, 0, 0.85);"> 主板SN号 <span style="color:#FF4D4F;">*</span></label><div class="flex items-center gap-2"><input type="text" class="flex-1 px-3 py-2 border rounded" style="border-color:#D9D9D9;" placeholder="请输入主板SN号" value="MB20240308001"><span class="px-2 py-1 rounded text-xs whitespace-nowrap" style="background-color:#F6FFED;color:#52C41A;border:1px solid #B7EB8F;"> 已绑定 </span></div></div><div><label class="block text-sm mb-2" style="color:rgba(0, 0, 0, 0.85);"> 装机测试状态 </label><div class="flex items-center gap-2 px-3 py-2 border rounded" style="border-color:#D9D9D9;background-color:#FAFAFA;"><select><option><span style="color:#52C41A;">测试通过</span></option><option><span style="color:#c41a1aff;">测试不通过</span></option></select></div></div><div><label class="block text-sm mb-2" style="color:rgba(0, 0, 0, 0.85);"> 生产日期 </label><input type="date" class="w-full px-3 py-2 border rounded" style="border-color:#D9D9D9;" value="2024-03-08"></div><div><label class="block text-sm mb-2" style="color:rgba(0, 0, 0, 0.85);"> 登记人 </label><input type="text" class="w-full px-3 py-2 border rounded" style="border-color:#D9D9D9;background-color:#FAFAFA;" value="张工程师" readonly></div>',5))])]),e("div",q,[a(d(E),{size:20,style:{color:"#52C41A",flexShrink:0,marginTop:"2px"}}),t[5]||(t[5]=e("div",null,[e("div",{style:{color:"#389E0D",fontWeight:500}},"型号已匹配GD30"),e("div",{class:"text-sm mt-1",style:{color:"#52C41A"}}," 授权文件auth_gd30_v2.3.lic | 配置文件config_gd30_v1.5.json | 固件版本v2.3.5 ")],-1))]),e("div",P,[a(d(f),{size:20,style:{color:"#FAAD14",flexShrink:0,marginTop:"2px"}}),t[6]||(t[6]=e("div",null,[e("div",{style:{color:"#D46B08",fontWeight:500}},"未匹配到型号关联信息"),e("div",{class:"text-sm mt-1",style:{color:"#FAAD14"}}," 请先在型号管理中配置该型号的授权文件、配置文件和固件版本 ")],-1))]),e("div",j,[e("div",X,[e("div",L,[t[8]||(t[8]=e("h3",{class:"text-lg font-semibold"},"设备BOM清单",-1)),e("button",R,[a(d(G),{size:16}),t[7]||(t[7]=c(" 导入 ",-1))])])]),e("div",I,[e("table",O,[t[10]||(t[10]=e("thead",{style:{backgroundColor:"#FAFAFA"}},[e("tr",null,[e("th",{class:"px-6 py-3 text-left text-sm font-medium",style:{color:"rgba(0, 0, 0, 0.85)"}},"物料编码"),e("th",{class:"px-6 py-3 text-left text-sm font-medium",style:{color:"rgba(0, 0, 0, 0.85)"}},"物料名称"),e("th",{class:"px-6 py-3 text-left text-sm font-medium",style:{color:"rgba(0, 0, 0, 0.85)"}},"SN号"),e("th",{class:"px-6 py-3 text-left text-sm font-medium",style:{color:"rgba(0, 0, 0, 0.85)"}},"规格型号"),e("th",{class:"px-6 py-3 text-left text-sm font-medium",style:{color:"rgba(0, 0, 0, 0.85)"}},"校准状态"),e("th",{class:"px-6 py-3 text-left text-sm font-medium",style:{color:"rgba(0, 0, 0, 0.85)"}},"数量"),e("th",{class:"px-6 py-3 text-left text-sm font-medium",style:{color:"rgba(0, 0, 0, 0.85)"}},"操作")])],-1)),e("tbody",null,[(l(),r(y,null,m(D,(o,x)=>e("tr",{key:x,class:"border-b",style:{borderColor:"#F0F0F0"}},[e("td",U,s(o.code),1),e("td",W,s(o.name),1),e("td",$,s(o.sn),1),e("td",H,s(o.spec),1),e("td",J,[e("span",{class:"px-2 py-1 rounded text-xs",style:i({backgroundColor:o.calibration==="已校准"?"#F6FFED":"#F0F2F5",color:o.calibration==="已校准"?"#52C41A":"rgba(0, 0, 0, 0.65)",border:`1px solid ${o.calibration==="已校准"?"#B7EB8F":"#D9D9D9"}`})},s(o.calibration),5)]),e("td",K,s(o.quantity),1),t[9]||(t[9]=e("td",{class:"px-6 py-4"},[e("div",{class:"flex items-center gap-3"},[e("button",{class:"text-sm",style:{color:"#1890FF"}},"编辑"),e("button",{class:"text-sm",style:{color:"#FF4D4F"}},"删除")])],-1))])),64))])])]),t[11]||(t[11]=e("div",{class:"p-4 border-t",style:{borderColor:"#F0F0F0"}},[e("button",{class:"text-sm",style:{color:"#1890FF"}},"+ 添加物料")],-1))]),e("div",Q,[e("div",Y,[e("div",Z,[t[13]||(t[13]=e("h3",{class:"text-lg font-semibold"},"装配Checklist",-1)),e("div",ee,[t[12]||(t[12]=e("span",{class:"text-sm",style:{color:"rgba(0, 0, 0, 0.65)"}},"完成进度",-1)),e("span",te,s(k.value)+"/"+s(C.value),1)])])]),e("div",oe,[e("div",se,[(l(!0),r(y,null,m(n.value,o=>(l(),r("div",{key:o.id,class:"flex items-center gap-4 p-4 rounded border",style:i({backgroundColor:o.completed?"#F6FFED":"#FAFAFA",borderColor:o.completed?"#B7EB8F":"#F0F0F0"})},[e("button",{onClick:x=>_(o.id),class:"w-6 h-6 rounded border flex items-center justify-center flex-shrink-0 transition-colors",style:i({borderColor:o.completed?"#52C41A":"#D9D9D9",backgroundColor:o.completed?"#52C41A":"#fff"})},[o.completed?(l(),S(d(T),{key:0,size:16,color:"#fff"})):b("",!0)],12,le),e("div",{class:"w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0",style:i({backgroundColor:o.completed?"#52C41A":"#D9D9D9",color:"white"})},s(o.id),5),e("div",re,[e("div",de,[e("span",{style:i({color:o.completed?"rgba(0, 0, 0, 0.85)":"rgba(0, 0, 0, 0.65)"})},s(o.text),5),o.versionCheck&&!o.versionMatch?(l(),r("span",ae,[a(d(f),{size:12}),t[14]||(t[14]=c(" 版本不一致! ",-1))])):b("",!0)])]),e("div",ne,[o.needPhoto&&o.completed&&o.photos>0?(l(),r("span",ce,[a(d(v),{size:12}),c(" 已上传 "+s(o.photos)+"张 ",1)])):b("",!0),o.needPhoto&&!o.completed?(l(),r("button",ie,[a(d(v),{size:12}),t[15]||(t[15]=c(" 拍照上传 ",-1))])):b("",!0)])],4))),128))])])]),t[17]||(t[17]=e("div",{class:"flex items-center justify-end gap-3 p-4 bg-white rounded-lg sticky bottom-0",style:{boxShadow:"0 -2px 8px rgba(0, 0, 0, 0.05)"}},[e("button",{class:"px-6 py-2 rounded",style:{border:"1px solid #D9D9D9",color:"rgba(0, 0, 0, 0.85)"}}," 取消 "),e("button",{class:"px-6 py-2 rounded",style:{border:"1px solid #D9D9D9",color:"rgba(0, 0, 0, 0.85)"}}," 更新 "),e("button",{class:"px-6 py-2 rounded text-white",style:{backgroundColor:"#1890FF"}}," 提交 ")],-1))]))}});export{me as default};