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 s=(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",()=>s],37727)},7233,e=>{"use strict";let s=(0,e.i(75254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>s],7233)},40160,e=>{"use strict";let s=(0,e.i(75254).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["Download",()=>s],40160)},52571,e=>{"use strict";let s=(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",()=>s],52571)},55436,73375,63059,e=>{"use strict";var s=e.i(75254);let l=(0,s.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",()=>l],55436);let t=(0,s.default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],73375);let d=(0,s.default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>d],63059)},50589,e=>{"use strict";var s=e.i(43476),l=e.i(71645),t=e.i(18566),d=e.i(40160),a=e.i(7233),r=e.i(55436),o=e.i(52571),i=e.i(73375),c=e.i(63059),n=e.i(37727);let x=(0,e.i(75254).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),m=[{id:"1D_SP",name:"1D SP",description:"一维自然电位法"},{id:"2D_SP",name:"2D SP",description:"二维自然电位法"},{id:"3D_SP",name:"3D SP",description:"三维自然电位法"},{id:"1D_VES",name:"1D VES",description:"一维垂向电测深"},{id:"2D_ERT",name:"2D ERT",description:"二维电阻率成像"},{id:"3D_ERT",name:"3D ERT",description:"三维电阻率成像"},{id:"1D_IP",name:"1D IP",description:"一维激发极化法"},{id:"2D_IP",name:"2D IP",description:"二维激发极化法"},{id:"3D_IP",name:"3D IP",description:"三维激发极化法"},{id:"CROSS",name:"跨孔",description:"跨孔电阻率成像"},{id:"WATER",name:"水上",description:"水上电法探测"}],p={"GD-10":["1D_SP","2D_SP","1D_VES","2D_ERT","1D_IP","2D_IP"],"GD-20":["1D_SP","2D_SP","3D_SP","1D_VES","2D_ERT","3D_ERT","1D_IP","2D_IP","3D_IP"],"GD-30":["1D_SP","2D_SP","3D_SP","1D_VES","2D_ERT","3D_ERT","1D_IP","2D_IP","3D_IP","CROSS","WATER"]},h=[{id:1,model:"GD-30",modules:"2D ERT, 3D ERT, 1D IP, 2D IP, 3D IP, 跨孔, 水上",expiry:"2025-12-31",date:"2025-01-15",status:"生效"},{id:2,model:"GD-20",modules:"2D ERT, 3D ERT, 1D IP, 2D IP",expiry:"2025-06-30",date:"2024-07-01",status:"生效"},{id:3,model:"GD-10",modules:"1D SP, 2D SP, 1D VES, 2D ERT",expiry:"2024-12-31",date:"2024-01-10",status:"已停用"},{id:4,model:"GD-30",modules:"全部模块",expiry:"2026-06-30",date:"2025-03-20",status:"生效"},{id:5,model:"GD-20",modules:"2D ERT, 1D IP, 2D IP",expiry:"2025-09-15",date:"2025-02-10",status:"生效"},{id:6,model:"GD-10",modules:"1D SP, 2D SP",expiry:"2024-06-30",date:"2023-07-01",status:"已停用"},{id:7,model:"GD-30",modules:"3D ERT, 3D IP, 跨孔",expiry:"2025-08-20",date:"2025-01-05",status:"生效"},{id:8,model:"GD-20",modules:"1D VES, 2D ERT, 1D IP",expiry:"2025-11-30",date:"2025-04-01",status:"草稿"}];function u(){(0,t.useRouter)();let[e,u]=(0,l.useState)(""),[D,y]=(0,l.useState)(""),[b,j]=(0,l.useState)(1),[f,g]=(0,l.useState)(!1),[v,F]=(0,l.useState)(""),[N,k]=(0,l.useState)("1year"),[P,S]=(0,l.useState)(""),[C,w]=(0,l.useState)([]),E=h.filter(s=>(!e||s.model===e)&&(!D||s.status===D)),_=Math.ceil(E.length/5),R=E.slice((b-1)*5,5*b);return(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-2xl font-semibold mb-1",children:"授权管理"}),(0,s.jsx)("p",{className:"text-sm",style:{color:"rgba(0,0,0,0.45)"},children:"管理设备授权许可"})]}),(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsxs)("button",{className:"flex items-center gap-2 px-4 py-2 rounded-lg text-sm",style:{border:"1px solid #D9D9D9",backgroundColor:"#fff",color:"rgba(0,0,0,0.65)"},children:[(0,s.jsx)(d.Download,{size:16}),"导出"]}),(0,s.jsxs)("button",{onClick:()=>{g(!0),F(""),w([]),k("1year"),S("")},className:"flex items-center gap-2 px-4 py-2 rounded-lg text-sm text-white",style:{backgroundColor:"#4a7c59"},children:[(0,s.jsx)(a.Plus,{size:16}),"选择授权项"]})]})]}),(0,s.jsxs)("div",{className:"flex items-start gap-3 p-4 rounded-lg mb-6",style:{backgroundColor:"#E6FFFB",border:"1px solid #87E8DE"},children:[(0,s.jsx)(o.Info,{size:16,style:{color:"#13C2C2",marginTop:2,flexShrink:0}}),(0,s.jsx)("div",{className:"text-sm",style:{color:"rgba(0,0,0,0.65)"},children:"授权管理用于控制设备可使用的功能模块。每台设备需要有效的授权才能使用对应的测量方法。授权到期前30天系统会自动提醒。"})]}),(0,s.jsx)("div",{className:"bg-white rounded-lg p-4 mb-6",style:{boxShadow:"0 1px 2px rgba(0,0,0,0.05)"},children:(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm",style:{color:"rgba(0,0,0,0.65)"},children:"设备型号"}),(0,s.jsxs)("select",{value:e,onChange:e=>u(e.target.value),className:"px-3 py-1.5 rounded text-sm",style:{border:"1px solid #D9D9D9",minWidth:140},children:[(0,s.jsx)("option",{value:"",children:"全部型号"}),(0,s.jsx)("option",{value:"GD-10",children:"GD-10"}),(0,s.jsx)("option",{value:"GD-20",children:"GD-20"}),(0,s.jsx)("option",{value:"GD-30",children:"GD-30"})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm",style:{color:"rgba(0,0,0,0.65)"},children:"状态"}),(0,s.jsxs)("select",{value:D,onChange:e=>y(e.target.value),className:"px-3 py-1.5 rounded text-sm",style:{border:"1px solid #D9D9D9",minWidth:120},children:[(0,s.jsx)("option",{value:"",children:"全部状态"}),(0,s.jsx)("option",{value:"生效",children:"生效"}),(0,s.jsx)("option",{value:"草稿",children:"草稿"}),(0,s.jsx)("option",{value:"已停用",children:"已停用"})]})]}),(0,s.jsxs)("button",{onClick:()=>j(1),className:"flex items-center gap-1 px-4 py-1.5 rounded text-sm text-white",style:{backgroundColor:"#4a7c59"},children:[(0,s.jsx)(r.Search,{size:14}),"查询"]})]})}),(0,s.jsxs)("div",{className:"bg-white rounded-lg overflow-hidden",style:{boxShadow:"0 1px 2px rgba(0,0,0,0.05)"},children:[(0,s.jsxs)("table",{className:"w-full",children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{style:{backgroundColor:"#FAFAFA"},children:["设备型号","授权模块","到期时间","创建日期","状态","操作"].map(e=>(0,s.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium",style:{color:"rgba(0,0,0,0.85)",borderBottom:"1px solid #F0F0F0"},children:e},e))})}),(0,s.jsx)("tbody",{children:R.map(e=>(0,s.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,s.jsx)("td",{className:"px-4 py-3 text-sm",style:{borderBottom:"1px solid #F0F0F0"},children:e.model}),(0,s.jsx)("td",{className:"px-4 py-3 text-sm",style:{borderBottom:"1px solid #F0F0F0",maxWidth:300},children:(0,s.jsx)("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.modules})}),(0,s.jsx)("td",{className:"px-4 py-3 text-sm",style:{borderBottom:"1px solid #F0F0F0"},children:e.expiry}),(0,s.jsx)("td",{className:"px-4 py-3 text-sm",style:{borderBottom:"1px solid #F0F0F0"},children:e.date}),(0,s.jsx)("td",{className:"px-4 py-3 text-sm",style:{borderBottom:"1px solid #F0F0F0"},children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded text-xs",style:(e=>{switch(e){case"生效":return{backgroundColor:"#F6FFED",color:"#52C41A",border:"1px solid #B7EB8F"};case"草稿":return{backgroundColor:"#FFFBE6",color:"#FAAD14",border:"1px solid #FFE58F"};case"已停用":return{backgroundColor:"#FAFAFA",color:"rgba(0,0,0,0.45)",border:"1px solid #D9D9D9"};default:return{}}})(e.status),children:e.status})}),(0,s.jsx)("td",{className:"px-4 py-3 text-sm",style:{borderBottom:"1px solid #F0F0F0"},children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{className:"text-sm",style:{color:"#4a7c59"},children:"编辑"}),(0,s.jsx)("button",{className:"text-sm",style:{color:"已停用"===e.status?"rgba(0,0,0,0.25)":"#FF4D4F"},disabled:"已停用"===e.status,children:"停用"})]})})]},e.id))})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3",style:{borderTop:"1px solid #F0F0F0"},children:[(0,s.jsxs)("span",{className:"text-sm",style:{color:"rgba(0,0,0,0.45)"},children:["共 ",E.length," 条"]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:()=>j(e=>Math.max(1,e-1)),disabled:1===b,className:"p-1 rounded",style:{border:"1px solid #D9D9D9",opacity:1===b?.4:1},children:(0,s.jsx)(i.ChevronLeft,{size:16})}),Array.from({length:_},(e,l)=>(0,s.jsx)("button",{onClick:()=>j(l+1),className:"w-8 h-8 rounded text-sm",style:{border:b===l+1?"1px solid #4a7c59":"1px solid #D9D9D9",color:b===l+1?"#4a7c59":"rgba(0,0,0,0.65)",backgroundColor:b===l+1?"#eef5f0":"#fff"},children:l+1},l)),(0,s.jsx)("button",{onClick:()=>j(e=>Math.min(_,e+1)),disabled:b===_,className:"p-1 rounded",style:{border:"1px solid #D9D9D9",opacity:b===_?.4:1},children:(0,s.jsx)(c.ChevronRight,{size:16})})]})]})]}),f&&(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex",children:[(0,s.jsx)("div",{className:"flex-1",style:{backgroundColor:"rgba(0,0,0,0.45)"},onClick:()=>g(!1)}),(0,s.jsxs)("div",{className:"h-full overflow-y-auto",style:{width:640,backgroundColor:"#fff"},children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-6 py-4",style:{borderBottom:"1px solid #F0F0F0"},children:[(0,s.jsx)("h3",{className:"text-lg font-semibold",children:"选择授权项"}),(0,s.jsx)("button",{onClick:()=>g(!1),children:(0,s.jsx)(n.X,{size:20,style:{color:"rgba(0,0,0,0.45)"}})})]}),(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{className:"block text-sm mb-2",style:{color:"rgba(0,0,0,0.85)"},children:"设备型号"}),(0,s.jsxs)("select",{value:v,onChange:e=>{var s;F(s=e.target.value),p[s]?w([...p[s]]):w([])},className:"w-full px-3 py-2 rounded text-sm",style:{border:"1px solid #D9D9D9"},children:[(0,s.jsx)("option",{value:"",children:"请选择型号"}),(0,s.jsx)("option",{value:"GD-10",children:"GD-10"}),(0,s.jsx)("option",{value:"GD-20",children:"GD-20"}),(0,s.jsx)("option",{value:"GD-30",children:"GD-30"})]})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{className:"block text-sm mb-2",style:{color:"rgba(0,0,0,0.85)"},children:"授权期限"}),(0,s.jsxs)("select",{value:N,onChange:e=>k(e.target.value),className:"w-full px-3 py-2 rounded text-sm",style:{border:"1px solid #D9D9D9"},children:[(0,s.jsx)("option",{value:"1year",children:"1年"}),(0,s.jsx)("option",{value:"2year",children:"2年"}),(0,s.jsx)("option",{value:"3year",children:"3年"}),(0,s.jsx)("option",{value:"permanent",children:"永久"}),(0,s.jsx)("option",{value:"custom",children:"自定义"})]})]}),"custom"===N&&(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{className:"block text-sm mb-2",style:{color:"rgba(0,0,0,0.85)"},children:"自定义到期日期"}),(0,s.jsx)("input",{type:"date",value:P,onChange:e=>S(e.target.value),className:"w-full px-3 py-2 rounded text-sm",style:{border:"1px solid #D9D9D9"}})]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsx)("label",{className:"text-sm font-medium",style:{color:"rgba(0,0,0,0.85)"},children:"授权项目"}),(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)("button",{onClick:()=>w(m.map(e=>e.id)),className:"text-sm",style:{color:"#4a7c59"},children:"全选"}),(0,s.jsx)("button",{onClick:()=>w([]),className:"text-sm",style:{color:"rgba(0,0,0,0.45)"},children:"清空"})]})]}),(0,s.jsxs)("table",{className:"w-full",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{style:{backgroundColor:"#FAFAFA"},children:[(0,s.jsx)("th",{className:"text-left px-3 py-2 text-sm font-medium",style:{color:"rgba(0,0,0,0.85)",borderBottom:"1px solid #F0F0F0",width:50},children:"选择"}),(0,s.jsx)("th",{className:"text-left px-3 py-2 text-sm font-medium",style:{color:"rgba(0,0,0,0.85)",borderBottom:"1px solid #F0F0F0"},children:"名称"}),(0,s.jsx)("th",{className:"text-left px-3 py-2 text-sm font-medium",style:{color:"rgba(0,0,0,0.85)",borderBottom:"1px solid #F0F0F0"},children:"说明"})]})}),(0,s.jsx)("tbody",{children:m.map(e=>(0,s.jsxs)("tr",{className:"hover:bg-gray-50 cursor-pointer",onClick:()=>{var s;return s=e.id,void w(e=>e.includes(s)?e.filter(e=>e!==s):[...e,s])},children:[(0,s.jsx)("td",{className:"px-3 py-2",style:{borderBottom:"1px solid #F0F0F0"},children:(0,s.jsx)("div",{className:"w-4 h-4 rounded flex items-center justify-center",style:{border:C.includes(e.id)?"none":"1px solid #D9D9D9",backgroundColor:C.includes(e.id)?"#4a7c59":"#fff"},children:C.includes(e.id)&&(0,s.jsx)(x,{size:12,color:"#fff"})})}),(0,s.jsx)("td",{className:"px-3 py-2 text-sm",style:{borderBottom:"1px solid #F0F0F0"},children:e.name}),(0,s.jsx)("td",{className:"px-3 py-2 text-sm",style:{borderBottom:"1px solid #F0F0F0",color:"rgba(0,0,0,0.45)"},children:e.description})]},e.id))})]})]}),(0,s.jsxs)("div",{className:"text-sm mb-6",style:{color:"rgba(0,0,0,0.45)"},children:["已选择 ",C.length," 项"]}),(0,s.jsx)("button",{onClick:()=>g(!1),className:"w-full py-2 rounded-lg text-sm text-white",style:{backgroundColor:"#4a7c59"},children:"保存"})]})]})]})]})}e.s(["default",()=>u],50589)}]); |