enterprise-saa-s-dashboard-.../.next/server/chunks/ssr/_a6d3cc7c._.js

3 lines
14 KiB
JavaScript

module.exports=[33508,a=>{"use strict";let b=(0,a.i(70106).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);a.s(["X",()=>b],33508)},15618,a=>{"use strict";let b=(0,a.i(70106).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);a.s(["Plus",()=>b],15618)},84505,a=>{"use strict";let b=(0,a.i(70106).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"}]]);a.s(["Download",()=>b],84505)},97063,a=>{"use strict";let b=(0,a.i(70106).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"}]]);a.s(["Info",()=>b],97063)},87532,13749,50522,a=>{"use strict";var b=a.i(70106);let c=(0,b.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);a.s(["Search",()=>c],87532);let d=(0,b.default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);a.s(["ChevronLeft",()=>d],13749);let e=(0,b.default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);a.s(["ChevronRight",()=>e],50522)},97929,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(84505),f=a.i(15618),g=a.i(87532),h=a.i(97063),i=a.i(13749),j=a.i(50522),k=a.i(33508);let l=(0,a.i(70106).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:"水上电法探测"}],n={"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"]},o=[{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 p(){(0,d.useRouter)();let[a,p]=(0,c.useState)(""),[q,r]=(0,c.useState)(""),[s,t]=(0,c.useState)(1),[u,v]=(0,c.useState)(!1),[w,x]=(0,c.useState)(""),[y,z]=(0,c.useState)("1year"),[A,B]=(0,c.useState)(""),[C,D]=(0,c.useState)([]),E=o.filter(b=>(!a||b.model===a)&&(!q||b.status===q)),F=Math.ceil(E.length/5),G=E.slice((s-1)*5,5*s);return(0,b.jsxs)("div",{className:"p-6",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-2xl font-semibold mb-1",children:"授权管理"}),(0,b.jsx)("p",{className:"text-sm",style:{color:"rgba(0,0,0,0.45)"},children:"管理设备授权许可"})]}),(0,b.jsxs)("div",{className:"flex gap-3",children:[(0,b.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,b.jsx)(e.Download,{size:16}),"导出"]}),(0,b.jsxs)("button",{onClick:()=>{v(!0),x(""),D([]),z("1year"),B("")},className:"flex items-center gap-2 px-4 py-2 rounded-lg text-sm text-white",style:{backgroundColor:"#4a7c59"},children:[(0,b.jsx)(f.Plus,{size:16}),"选择授权项"]})]})]}),(0,b.jsxs)("div",{className:"flex items-start gap-3 p-4 rounded-lg mb-6",style:{backgroundColor:"#E6FFFB",border:"1px solid #87E8DE"},children:[(0,b.jsx)(h.Info,{size:16,style:{color:"#13C2C2",marginTop:2,flexShrink:0}}),(0,b.jsx)("div",{className:"text-sm",style:{color:"rgba(0,0,0,0.65)"},children:"授权管理用于控制设备可使用的功能模块。每台设备需要有效的授权才能使用对应的测量方法。授权到期前30天系统会自动提醒。"})]}),(0,b.jsx)("div",{className:"bg-white rounded-lg p-4 mb-6",style:{boxShadow:"0 1px 2px rgba(0,0,0,0.05)"},children:(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-sm",style:{color:"rgba(0,0,0,0.65)"},children:"设备型号"}),(0,b.jsxs)("select",{value:a,onChange:a=>p(a.target.value),className:"px-3 py-1.5 rounded text-sm",style:{border:"1px solid #D9D9D9",minWidth:140},children:[(0,b.jsx)("option",{value:"",children:"全部型号"}),(0,b.jsx)("option",{value:"GD-10",children:"GD-10"}),(0,b.jsx)("option",{value:"GD-20",children:"GD-20"}),(0,b.jsx)("option",{value:"GD-30",children:"GD-30"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-sm",style:{color:"rgba(0,0,0,0.65)"},children:"状态"}),(0,b.jsxs)("select",{value:q,onChange:a=>r(a.target.value),className:"px-3 py-1.5 rounded text-sm",style:{border:"1px solid #D9D9D9",minWidth:120},children:[(0,b.jsx)("option",{value:"",children:"全部状态"}),(0,b.jsx)("option",{value:"生效",children:"生效"}),(0,b.jsx)("option",{value:"草稿",children:"草稿"}),(0,b.jsx)("option",{value:"已停用",children:"已停用"})]})]}),(0,b.jsxs)("button",{onClick:()=>t(1),className:"flex items-center gap-1 px-4 py-1.5 rounded text-sm text-white",style:{backgroundColor:"#4a7c59"},children:[(0,b.jsx)(g.Search,{size:14}),"查询"]})]})}),(0,b.jsxs)("div",{className:"bg-white rounded-lg overflow-hidden",style:{boxShadow:"0 1px 2px rgba(0,0,0,0.05)"},children:[(0,b.jsxs)("table",{className:"w-full",children:[(0,b.jsx)("thead",{children:(0,b.jsx)("tr",{style:{backgroundColor:"#FAFAFA"},children:["设备型号","授权模块","到期时间","创建日期","状态","操作"].map(a=>(0,b.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:a},a))})}),(0,b.jsx)("tbody",{children:G.map(a=>(0,b.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,b.jsx)("td",{className:"px-4 py-3 text-sm",style:{borderBottom:"1px solid #F0F0F0"},children:a.model}),(0,b.jsx)("td",{className:"px-4 py-3 text-sm",style:{borderBottom:"1px solid #F0F0F0",maxWidth:300},children:(0,b.jsx)("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.modules})}),(0,b.jsx)("td",{className:"px-4 py-3 text-sm",style:{borderBottom:"1px solid #F0F0F0"},children:a.expiry}),(0,b.jsx)("td",{className:"px-4 py-3 text-sm",style:{borderBottom:"1px solid #F0F0F0"},children:a.date}),(0,b.jsx)("td",{className:"px-4 py-3 text-sm",style:{borderBottom:"1px solid #F0F0F0"},children:(0,b.jsx)("span",{className:"px-2 py-0.5 rounded text-xs",style:(a=>{switch(a){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{}}})(a.status),children:a.status})}),(0,b.jsx)("td",{className:"px-4 py-3 text-sm",style:{borderBottom:"1px solid #F0F0F0"},children:(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("button",{className:"text-sm",style:{color:"#4a7c59"},children:"编辑"}),(0,b.jsx)("button",{className:"text-sm",style:{color:"已停用"===a.status?"rgba(0,0,0,0.25)":"#FF4D4F"},disabled:"已停用"===a.status,children:"停用"})]})})]},a.id))})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-3",style:{borderTop:"1px solid #F0F0F0"},children:[(0,b.jsxs)("span",{className:"text-sm",style:{color:"rgba(0,0,0,0.45)"},children:["共 ",E.length," 条"]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("button",{onClick:()=>t(a=>Math.max(1,a-1)),disabled:1===s,className:"p-1 rounded",style:{border:"1px solid #D9D9D9",opacity:1===s?.4:1},children:(0,b.jsx)(i.ChevronLeft,{size:16})}),Array.from({length:F},(a,c)=>(0,b.jsx)("button",{onClick:()=>t(c+1),className:"w-8 h-8 rounded text-sm",style:{border:s===c+1?"1px solid #4a7c59":"1px solid #D9D9D9",color:s===c+1?"#4a7c59":"rgba(0,0,0,0.65)",backgroundColor:s===c+1?"#eef5f0":"#fff"},children:c+1},c)),(0,b.jsx)("button",{onClick:()=>t(a=>Math.min(F,a+1)),disabled:s===F,className:"p-1 rounded",style:{border:"1px solid #D9D9D9",opacity:s===F?.4:1},children:(0,b.jsx)(j.ChevronRight,{size:16})})]})]})]}),u&&(0,b.jsxs)("div",{className:"fixed inset-0 z-50 flex",children:[(0,b.jsx)("div",{className:"flex-1",style:{backgroundColor:"rgba(0,0,0,0.45)"},onClick:()=>v(!1)}),(0,b.jsxs)("div",{className:"h-full overflow-y-auto",style:{width:640,backgroundColor:"#fff"},children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-6 py-4",style:{borderBottom:"1px solid #F0F0F0"},children:[(0,b.jsx)("h3",{className:"text-lg font-semibold",children:"选择授权项"}),(0,b.jsx)("button",{onClick:()=>v(!1),children:(0,b.jsx)(k.X,{size:20,style:{color:"rgba(0,0,0,0.45)"}})})]}),(0,b.jsxs)("div",{className:"p-6",children:[(0,b.jsxs)("div",{className:"mb-6",children:[(0,b.jsx)("label",{className:"block text-sm mb-2",style:{color:"rgba(0,0,0,0.85)"},children:"设备型号"}),(0,b.jsxs)("select",{value:w,onChange:a=>{var b;x(b=a.target.value),n[b]?D([...n[b]]):D([])},className:"w-full px-3 py-2 rounded text-sm",style:{border:"1px solid #D9D9D9"},children:[(0,b.jsx)("option",{value:"",children:"请选择型号"}),(0,b.jsx)("option",{value:"GD-10",children:"GD-10"}),(0,b.jsx)("option",{value:"GD-20",children:"GD-20"}),(0,b.jsx)("option",{value:"GD-30",children:"GD-30"})]})]}),(0,b.jsxs)("div",{className:"mb-6",children:[(0,b.jsx)("label",{className:"block text-sm mb-2",style:{color:"rgba(0,0,0,0.85)"},children:"授权期限"}),(0,b.jsxs)("select",{value:y,onChange:a=>z(a.target.value),className:"w-full px-3 py-2 rounded text-sm",style:{border:"1px solid #D9D9D9"},children:[(0,b.jsx)("option",{value:"1year",children:"1年"}),(0,b.jsx)("option",{value:"2year",children:"2年"}),(0,b.jsx)("option",{value:"3year",children:"3年"}),(0,b.jsx)("option",{value:"permanent",children:"永久"}),(0,b.jsx)("option",{value:"custom",children:"自定义"})]})]}),"custom"===y&&(0,b.jsxs)("div",{className:"mb-6",children:[(0,b.jsx)("label",{className:"block text-sm mb-2",style:{color:"rgba(0,0,0,0.85)"},children:"自定义到期日期"}),(0,b.jsx)("input",{type:"date",value:A,onChange:a=>B(a.target.value),className:"w-full px-3 py-2 rounded text-sm",style:{border:"1px solid #D9D9D9"}})]}),(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("label",{className:"text-sm font-medium",style:{color:"rgba(0,0,0,0.85)"},children:"授权项目"}),(0,b.jsxs)("div",{className:"flex gap-3",children:[(0,b.jsx)("button",{onClick:()=>D(m.map(a=>a.id)),className:"text-sm",style:{color:"#4a7c59"},children:"全选"}),(0,b.jsx)("button",{onClick:()=>D([]),className:"text-sm",style:{color:"rgba(0,0,0,0.45)"},children:"清空"})]})]}),(0,b.jsxs)("table",{className:"w-full",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{style:{backgroundColor:"#FAFAFA"},children:[(0,b.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,b.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,b.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,b.jsx)("tbody",{children:m.map(a=>(0,b.jsxs)("tr",{className:"hover:bg-gray-50 cursor-pointer",onClick:()=>{var b;return b=a.id,void D(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])},children:[(0,b.jsx)("td",{className:"px-3 py-2",style:{borderBottom:"1px solid #F0F0F0"},children:(0,b.jsx)("div",{className:"w-4 h-4 rounded flex items-center justify-center",style:{border:C.includes(a.id)?"none":"1px solid #D9D9D9",backgroundColor:C.includes(a.id)?"#4a7c59":"#fff"},children:C.includes(a.id)&&(0,b.jsx)(l,{size:12,color:"#fff"})})}),(0,b.jsx)("td",{className:"px-3 py-2 text-sm",style:{borderBottom:"1px solid #F0F0F0"},children:a.name}),(0,b.jsx)("td",{className:"px-3 py-2 text-sm",style:{borderBottom:"1px solid #F0F0F0",color:"rgba(0,0,0,0.45)"},children:a.description})]},a.id))})]})]}),(0,b.jsxs)("div",{className:"text-sm mb-6",style:{color:"rgba(0,0,0,0.45)"},children:["已选择 ",C.length," 项"]}),(0,b.jsx)("button",{onClick:()=>v(!1),className:"w-full py-2 rounded-lg text-sm text-white",style:{backgroundColor:"#4a7c59"},children:"保存"})]})]})]})]})}a.s(["default",()=>p],97929)}];
//# sourceMappingURL=_a6d3cc7c._.js.map