1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,37727,e=>{"use strict";let i=(0,e.i(75254).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",()=>i],37727)},7233,e=>{"use strict";let i=(0,e.i(75254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>i],7233)},52571,e=>{"use strict";let i=(0,e.i(75254).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["Info",()=>i],52571)},90060,e=>{"use strict";var i=e.i(43476),t=e.i(71645),o=e.i(18566),r=e.i(7233),d=e.i(37727),n=e.i(52571),s=e.i(75254);let l=(0,s.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),a=(0,s.default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),c=[{id:1,name:"GD-30 Supreme",code:"GD30",status:"在产",boardCount:12,deviceCount:156,description:"高端三维电法仪",createDate:"2023-06-01"},{id:2,name:"GD-20",code:"GD20",status:"在产",boardCount:8,deviceCount:89,description:"中端二维电法仪",createDate:"2023-08-15"},{id:3,name:"GD-10 Supreme",code:"GD10",status:"停产",boardCount:6,deviceCount:234,description:"入门级电法仪",createDate:"2022-03-10"}],p={GD30:[{id:1,name:"主协板安装检查",required:!0},{id:2,name:"采集板安装检查(×6)",required:!0},{id:3,name:"发射板安装检查",required:!0},{id:4,name:"升压板安装检查",required:!0},{id:5,name:"线缆连接检查",required:!0},{id:6,name:"整机通电测试",required:!0},{id:7,name:"通信功能测试",required:!0},{id:8,name:"采集通道校准",required:!0},{id:9,name:"外观检查",required:!1},{id:10,name:"包装检查",required:!1}],GD20:[{id:1,name:"主协板安装检查",required:!0},{id:2,name:"采集板安装检查(×4)",required:!0},{id:3,name:"发射板安装检查",required:!0},{id:4,name:"线缆连接检查",required:!0},{id:5,name:"整机通电测试",required:!0},{id:6,name:"通信功能测试",required:!0},{id:7,name:"采集通道校准",required:!0},{id:8,name:"外观检查",required:!1}],GD10:[{id:1,name:"主协板安装检查",required:!0},{id:2,name:"采集板安装检查(×2)",required:!0},{id:3,name:"线缆连接检查",required:!0},{id:4,name:"整机通电测试",required:!0},{id:5,name:"通信功能测试",required:!0},{id:6,name:"外观检查",required:!1}]};function x(){(0,o.useRouter)();let[e,s]=(0,t.useState)(!1),[x,u]=(0,t.useState)(!1),[g,h]=(0,t.useState)("GD30"),[f,b]=(0,t.useState)({name:"",code:"",status:"在产"}),[y,m]=(0,t.useState)({model:"GD30",items:[{name:"",required:!0}]}),j=(e,i,t)=>{let o=[...y.items];o[e]={...o[e],[i]:t},m({...y,items:o})};return(0,i.jsxs)("div",{style:{padding:24},children:[(0,i.jsxs)("div",{style:{marginBottom:24},children:[(0,i.jsx)("h2",{style:{fontSize:20,fontWeight:600,margin:0},children:"设备型号管理"}),(0,i.jsx)("p",{style:{fontSize:14,color:"rgba(0,0,0,0.45)",margin:"4px 0 0"},children:"管理设备型号、装配清单模板"})]}),(0,i.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:12,padding:16,backgroundColor:"#eef5f0",borderRadius:8,marginBottom:24,border:"1px solid #a3c4ad"},children:[(0,i.jsx)(n.Info,{size:18,style:{color:"#4a7c59",flexShrink:0,marginTop:2}}),(0,i.jsx)("div",{style:{fontSize:14,color:"#4a7c59",lineHeight:1.6},children:"设备型号管理是生产管理的核心枢纽。每个型号定义了设备的板卡组成、装配流程和检测标准。新增型号后,请及时配置对应的装配清单模板。"})]}),(0,i.jsxs)("div",{style:{backgroundColor:"#fff",borderRadius:8,boxShadow:"0 1px 2px rgba(0,0,0,0.05)",overflow:"hidden",marginBottom:32},children:[(0,i.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 20px",borderBottom:"1px solid #F0F0F0"},children:[(0,i.jsx)("h3",{style:{fontSize:16,fontWeight:600,margin:0},children:"设备型号列表"}),(0,i.jsxs)("button",{onClick:()=>s(!0),style:{display:"flex",alignItems:"center",gap:6,padding:"8px 16px",border:"none",borderRadius:6,backgroundColor:"#4a7c59",color:"#fff",cursor:"pointer",fontSize:14},children:[(0,i.jsx)(r.Plus,{size:16}),"新增型号"]})]}),(0,i.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse"},children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{style:{backgroundColor:"#FAFAFA"},children:["型号名称","型号代码","描述","板卡数","设备数","状态","创建日期"].map(e=>(0,i.jsx)("th",{style:{padding:"12px 16px",textAlign:"left",fontSize:14,fontWeight:600,color:"rgba(0,0,0,0.85)",borderBottom:"1px solid #F0F0F0"},children:e},e))})}),(0,i.jsx)("tbody",{children:c.map(e=>(0,i.jsxs)("tr",{style:{borderBottom:"1px solid #F0F0F0"},children:[(0,i.jsx)("td",{style:{padding:"12px 16px",fontSize:14,fontWeight:500},children:e.name}),(0,i.jsx)("td",{style:{padding:"12px 16px",fontSize:14,color:"rgba(0,0,0,0.65)"},children:e.code}),(0,i.jsx)("td",{style:{padding:"12px 16px",fontSize:14,color:"rgba(0,0,0,0.65)"},children:e.description}),(0,i.jsx)("td",{style:{padding:"12px 16px",fontSize:14},children:e.boardCount}),(0,i.jsx)("td",{style:{padding:"12px 16px",fontSize:14},children:e.deviceCount}),(0,i.jsx)("td",{style:{padding:"12px 16px"},children:(0,i.jsx)("span",{style:{...function(e){switch(e){case"在产":return{backgroundColor:"#eef5f0",color:"#4a7c59",border:"1px solid #a3c4ad"};case"停产":return{backgroundColor:"#FFFBE6",color:"#FAAD14",border:"1px solid #FFE58F"};default:return{backgroundColor:"#FAFAFA",color:"rgba(0,0,0,0.45)",border:"1px solid #D9D9D9"}}}(e.status),padding:"2px 8px",borderRadius:4,fontSize:12},children:e.status})}),(0,i.jsx)("td",{style:{padding:"12px 16px",fontSize:14,color:"rgba(0,0,0,0.65)"},children:e.createDate})]},e.id))})]})]}),(0,i.jsxs)("div",{style:{backgroundColor:"#fff",borderRadius:8,boxShadow:"0 1px 2px rgba(0,0,0,0.05)",overflow:"hidden"},children:[(0,i.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 20px",borderBottom:"1px solid #F0F0F0"},children:[(0,i.jsx)("h3",{style:{fontSize:16,fontWeight:600,margin:0},children:"装配 Checklist 模板"}),(0,i.jsxs)("button",{onClick:()=>u(!0),style:{display:"flex",alignItems:"center",gap:6,padding:"8px 16px",border:"none",borderRadius:6,backgroundColor:"#4a7c59",color:"#fff",cursor:"pointer",fontSize:14},children:[(0,i.jsx)(r.Plus,{size:16}),"新增模板"]})]}),(0,i.jsx)("div",{style:{display:"flex",borderBottom:"1px solid #F0F0F0"},children:Object.keys(p).map(e=>(0,i.jsx)("button",{onClick:()=>h(e),style:{padding:"10px 20px",fontSize:14,cursor:"pointer",border:"none",backgroundColor:"transparent",borderBottom:g===e?"2px solid #4a7c59":"2px solid transparent",color:g===e?"#4a7c59":"rgba(0,0,0,0.65)",fontWeight:g===e?600:400},children:e},e))}),(0,i.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse"},children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{style:{backgroundColor:"#FAFAFA"},children:[(0,i.jsx)("th",{style:{padding:"12px 16px",textAlign:"left",fontSize:14,fontWeight:600,color:"rgba(0,0,0,0.85)",borderBottom:"1px solid #F0F0F0",width:60},children:"序号"}),(0,i.jsx)("th",{style:{padding:"12px 16px",textAlign:"left",fontSize:14,fontWeight:600,color:"rgba(0,0,0,0.85)",borderBottom:"1px solid #F0F0F0"},children:"项目名称"}),(0,i.jsx)("th",{style:{padding:"12px 16px",textAlign:"left",fontSize:14,fontWeight:600,color:"rgba(0,0,0,0.85)",borderBottom:"1px solid #F0F0F0",width:80},children:"必填"})]})}),(0,i.jsx)("tbody",{children:(p[g]||[]).map((e,t)=>(0,i.jsxs)("tr",{style:{borderBottom:"1px solid #F0F0F0"},children:[(0,i.jsx)("td",{style:{padding:"10px 16px",fontSize:14,color:"rgba(0,0,0,0.45)"},children:(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,i.jsx)(l,{size:14,style:{color:"rgba(0,0,0,0.25)",cursor:"grab"}}),t+1]})}),(0,i.jsx)("td",{style:{padding:"10px 16px",fontSize:14},children:e.name}),(0,i.jsx)("td",{style:{padding:"10px 16px"},children:e.required&&(0,i.jsx)("span",{style:{fontSize:12,color:"#FF4D4F"},children:"必填"})})]},e.id))})]})]}),e&&(0,i.jsxs)("div",{style:{position:"fixed",inset:0,zIndex:50},children:[(0,i.jsx)("div",{onClick:()=>s(!1),style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.45)"}}),(0,i.jsxs)("div",{style:{position:"absolute",right:0,top:0,bottom:0,width:480,backgroundColor:"#fff",boxShadow:"-2px 0 8px rgba(0,0,0,0.15)",display:"flex",flexDirection:"column"},children:[(0,i.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 24px",borderBottom:"1px solid #F0F0F0"},children:[(0,i.jsx)("h3",{style:{fontSize:16,fontWeight:600,margin:0},children:"新增设备型号"}),(0,i.jsx)("button",{onClick:()=>s(!1),style:{border:"none",background:"none",cursor:"pointer",padding:4},children:(0,i.jsx)(d.X,{size:20})})]}),(0,i.jsxs)("div",{style:{flex:1,overflow:"auto",padding:24},children:[(0,i.jsxs)("div",{style:{marginBottom:20},children:[(0,i.jsxs)("label",{style:{display:"block",fontSize:14,fontWeight:500,marginBottom:8},children:[(0,i.jsx)("span",{style:{color:"#FF4D4F"},children:"*"})," 型号名称"]}),(0,i.jsx)("input",{value:f.name,onChange:e=>b({...f,name:e.target.value}),placeholder:"如 GD-30 Supreme",style:{width:"100%",padding:"8px 12px",border:"1px solid #D9D9D9",borderRadius:6,fontSize:14,boxSizing:"border-box"}})]}),(0,i.jsxs)("div",{style:{marginBottom:20},children:[(0,i.jsxs)("label",{style:{display:"block",fontSize:14,fontWeight:500,marginBottom:8},children:[(0,i.jsx)("span",{style:{color:"#FF4D4F"},children:"*"})," 型号编码"]}),(0,i.jsx)("input",{value:f.code,onChange:e=>b({...f,code:e.target.value}),placeholder:"如 GD30",style:{width:"100%",padding:"8px 12px",border:"1px solid #D9D9D9",borderRadius:6,fontSize:14,boxSizing:"border-box"}})]}),(0,i.jsxs)("div",{style:{marginBottom:20},children:[(0,i.jsx)("label",{style:{display:"block",fontSize:14,fontWeight:500,marginBottom:8},children:"状态"}),(0,i.jsx)("div",{style:{display:"flex",gap:12},children:["在产","停产"].map(e=>(0,i.jsx)("button",{onClick:()=>b({...f,status:e}),style:{padding:"6px 20px",borderRadius:6,fontSize:14,cursor:"pointer",border:f.status===e?"1px solid #4a7c59":"1px solid #D9D9D9",backgroundColor:f.status===e?"#eef5f0":"#fff",color:f.status===e?"#4a7c59":"rgba(0,0,0,0.65)"},children:e},e))})]})]}),(0,i.jsxs)("div",{style:{padding:"16px 24px",borderTop:"1px solid #F0F0F0",display:"flex",justifyContent:"flex-end",gap:12},children:[(0,i.jsx)("button",{onClick:()=>s(!1),style:{padding:"8px 20px",border:"1px solid #D9D9D9",borderRadius:6,backgroundColor:"#fff",cursor:"pointer",fontSize:14},children:"取消"}),(0,i.jsx)("button",{onClick:()=>s(!1),style:{padding:"8px 20px",border:"none",borderRadius:6,backgroundColor:"#4a7c59",color:"#fff",cursor:"pointer",fontSize:14},children:"保存"})]})]})]}),x&&(0,i.jsxs)("div",{style:{position:"fixed",inset:0,zIndex:50},children:[(0,i.jsx)("div",{onClick:()=>u(!1),style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.45)"}}),(0,i.jsxs)("div",{style:{position:"absolute",right:0,top:0,bottom:0,width:480,backgroundColor:"#fff",boxShadow:"-2px 0 8px rgba(0,0,0,0.15)",display:"flex",flexDirection:"column"},children:[(0,i.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 24px",borderBottom:"1px solid #F0F0F0"},children:[(0,i.jsx)("h3",{style:{fontSize:16,fontWeight:600,margin:0},children:"新增 Checklist 模板"}),(0,i.jsx)("button",{onClick:()=>u(!1),style:{border:"none",background:"none",cursor:"pointer",padding:4},children:(0,i.jsx)(d.X,{size:20})})]}),(0,i.jsxs)("div",{style:{flex:1,overflow:"auto",padding:24},children:[(0,i.jsxs)("div",{style:{marginBottom:20},children:[(0,i.jsxs)("label",{style:{display:"block",fontSize:14,fontWeight:500,marginBottom:8},children:[(0,i.jsx)("span",{style:{color:"#FF4D4F"},children:"*"})," 设备型号"]}),(0,i.jsx)("select",{value:y.model,onChange:e=>m({...y,model:e.target.value}),style:{width:"100%",padding:"8px 12px",border:"1px solid #D9D9D9",borderRadius:6,fontSize:14},children:Object.keys(p).map(e=>(0,i.jsx)("option",{value:e,children:e},e))})]}),(0,i.jsxs)("div",{style:{marginBottom:12},children:[(0,i.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[(0,i.jsx)("label",{style:{fontSize:14,fontWeight:500},children:"检查项列表"}),(0,i.jsxs)("button",{onClick:()=>{m({...y,items:[...y.items,{name:"",required:!0}]})},style:{display:"flex",alignItems:"center",gap:4,padding:"4px 12px",border:"1px solid #4a7c59",borderRadius:6,backgroundColor:"#fff",color:"#4a7c59",cursor:"pointer",fontSize:13},children:[(0,i.jsx)(r.Plus,{size:14}),"添加"]})]}),y.items.map((e,t)=>(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,i.jsx)("input",{value:e.name,onChange:e=>j(t,"name",e.target.value),placeholder:`检查项 ${t+1}`,style:{flex:1,padding:"6px 10px",border:"1px solid #D9D9D9",borderRadius:6,fontSize:13,boxSizing:"border-box"}}),(0,i.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:4,fontSize:13,flexShrink:0},children:[(0,i.jsx)("input",{type:"checkbox",checked:e.required,onChange:e=>j(t,"required",e.target.checked)}),"必填"]}),(0,i.jsx)("button",{onClick:()=>{m({...y,items:y.items.filter((e,i)=>i!==t)})},style:{border:"none",background:"none",cursor:"pointer",padding:4,color:"#FF4D4F"},children:(0,i.jsx)(a,{size:14})})]},t))]})]}),(0,i.jsxs)("div",{style:{padding:"16px 24px",borderTop:"1px solid #F0F0F0",display:"flex",justifyContent:"flex-end",gap:12},children:[(0,i.jsx)("button",{onClick:()=>u(!1),style:{padding:"8px 20px",border:"1px solid #D9D9D9",borderRadius:6,backgroundColor:"#fff",cursor:"pointer",fontSize:14},children:"取消"}),(0,i.jsx)("button",{onClick:()=>u(!1),style:{padding:"8px 20px",border:"none",borderRadius:6,backgroundColor:"#4a7c59",color:"#fff",cursor:"pointer",fontSize:14},children:"保存"})]})]})]})]})}e.s(["default",()=>x],90060)}]); |