import{d as B,a,b as e,f as b,u as x,j as f,x as k,F as w,r as S,l as M,m as v,p as h,v as T,h as m,t as r,n as C,s as p,k as D,o as n}from"./index-C5t0nGiQ.js";import{D as $}from"./download-hBwFRgUo.js";import{P as L}from"./plus-BfKzmzQH.js";import{I as N}from"./info-DbTQmklK.js";import{X as R}from"./x-Cy9cTPf9.js";const U={class:"p-6"},H={class:"mb-6"},X={class:"flex items-center justify-between mb-2"},q={class:"flex items-center gap-3"},J={class:"px-4 py-2 rounded flex items-center gap-2",style:{border:"1px solid #D9D9D9",color:"rgba(0,0,0,0.85)"}},K={class:"mb-6 p-4 rounded-lg flex items-start gap-3",style:{"background-color":"#E6FFFB",border:"1px solid #87E8DE"}},O={class:"bg-white rounded-lg mb-6",style:{"box-shadow":"0 1px 2px rgba(0,0,0,0.05)"}},Q={class:"overflow-x-auto"},W={class:"w-full"},Y={class:"px-6 py-4",style:{color:"#4a7c59"}},Z={class:"px-6 py-4"},ee={class:"px-6 py-4 text-sm",style:{color:"rgba(0,0,0,0.65)","max-width":"200px"}},te={class:"px-6 py-4",style:{color:"rgba(0,0,0,0.65)"}},se={class:"px-6 py-4",style:{color:"rgba(0,0,0,0.65)"}},oe={class:"px-6 py-4"},le={class:"px-6 py-4"},re={class:"flex items-center gap-3"},de={key:0,class:"text-sm",style:{color:"#52C41A"}},ae={key:1,class:"text-sm",style:{color:"#FF4D4F"}},ne={class:"bg-white w-[640px] h-full flex flex-col",style:{"box-shadow":"-4px 0 12px rgba(0,0,0,0.1)"}},ue={class:"flex items-center justify-between p-5 border-b",style:{"border-color":"#F0F0F0"}},ie={class:"flex-1 overflow-y-auto p-6"},pe={class:"grid grid-cols-2 gap-4 mb-6"},ce={key:0},be={class:"flex items-center justify-between mb-3"},xe={class:"flex items-center gap-2"},me={class:"text-xs",style:{color:"rgba(0,0,0,0.45)"}},ge={class:"w-full text-sm"},ye={class:"px-3 py-2"},fe=["checked","onChange"],ve={class:"px-3 py-2"},De={class:"flex items-center justify-end gap-3 p-5 border-t",style:{"border-color":"#F0F0F0"}},Fe=["disabled"],Ie=B({__name:"LicenseManagement",setup(ke){const u=p(!1),d=p("GD-10 Supreme"),g=p("永久"),F=p(""),i=[{name:"1D SP",gd10:!0,gd20:!0,gd30:!0},{name:"2D SP",gd10:!0,gd20:!0,gd30:!0},{name:"3D SP",gd10:!1,gd20:!0,gd30:!0},{name:"1D VES",gd10:!0,gd20:!0,gd30:!0},{name:"2D ERT",gd10:!0,gd20:!0,gd30:!0},{name:"3D ERT",gd10:!1,gd20:!0,gd30:!0},{name:"1D IP",gd10:!0,gd20:!0,gd30:!0},{name:"2D IP",gd10:!0,gd20:!0,gd30:!0},{name:"3D IP",gd10:!1,gd20:!0,gd30:!0},{name:"跨孔(Cross-Hole)",gd10:!1,gd20:!0,gd30:!0},{name:"水上(Marine)",gd10:!1,gd20:!0,gd30:!0}],l=p(new Set),_=D(()=>i.map(s=>{let t=!1;return d.value==="GD-10 Supreme"?t=s.gd10:d.value==="GD-20 Supreme"?t=s.gd20:t=s.gd30,{...s,preset:t}})),c=D(()=>l.value.size),G=D(()=>i.length),I=s=>{l.value.has(s)?l.value.delete(s):l.value.add(s)},A=()=>{i.forEach(s=>l.value.add(s.name))},E=()=>{l.value.clear()},P=()=>{l.value.clear(),i.forEach(s=>{let t=!1;d.value==="GD-10 Supreme"?t=s.gd10:d.value==="GD-20 Supreme"?t=s.gd20:t=s.gd30,t&&l.value.add(s.name)}),u.value=!0},V=()=>{l.value.clear(),i.forEach(s=>{let t=!1;d.value==="GD-10 Supreme"?t=s.gd10:d.value==="GD-20 Supreme"?t=s.gd20:t=s.gd30,t&&l.value.add(s.name)})},j=[{licenseId:"LIC-GD10-Supreme-v1.0",model:"GD-10 Supreme",status:"已发布",modules:"1D SP, 2D SP, 1D VES, 2D ERT, 1D IP, 2D IP",expiry:"永久",createdDate:"2025-02-01"},{licenseId:"LIC-GD20-Supreme-v1.0",model:"GD-20 Supreme",status:"已发布",modules:"全部模块",expiry:"永久",createdDate:"2025-02-05"},{licenseId:"LIC-GD30-Supreme-v1.0",model:"GD-30 Supreme",status:"草稿",modules:"全部模块(不含水上)",expiry:"1年",createdDate:"2025-02-08"}],z=s=>s==="已发布"?{backgroundColor:"#F6FFED",color:"#52C41A",border:"1px solid #B7EB8F"}:s==="草稿"?{backgroundColor:"#FFFBE6",color:"#FAAD14",border:"1px solid #FFE58F"}:{backgroundColor:"#FAFAFA",color:"rgba(0,0,0,0.45)",border:"1px solid #D9D9D9"};return(s,t)=>(n(),a("div",U,[e("div",H,[e("div",X,[t[10]||(t[10]=e("h2",{class:"text-2xl font-semibold"},"授权管理",-1)),e("div",q,[e("button",J,[b(x($),{size:16}),t[8]||(t[8]=f(" 导出 ",-1))]),e("button",{class:"px-4 py-2 rounded text-white flex items-center gap-2",style:{"background-color":"#4a7c59"},onClick:P},[b(x(L),{size:16}),t[9]||(t[9]=f(" 选择授权项生成 ",-1))])])]),t[11]||(t[11]=e("p",{class:"text-sm",style:{color:"rgba(0,0,0,0.45)"}},"管理设备授权文件",-1))]),e("div",K,[b(x(N),{size:20,style:{color:"#13C2C2","flex-shrink":"0","margin-top":"2px"}}),t[12]||(t[12]=e("div",{style:{color:"#006D75"}},[e("div",{class:"font-medium mb-1"},"授权说明"),e("div",{class:"text-sm"},'授权文件按设备型号管理,每个型号对应一套授权模块配置。点击"选择授权项生成"可按型号勾选功能模块并生成授权文件,设备在APP激活时自动下载对应型号的授权文件。')],-1))]),t[24]||(t[24]=k('
',1)),e("div",O,[e("div",Q,[e("table",W,[t[15]||(t[15]=e("thead",{style:{"background-color":"#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)"}},"授权文件ID"),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)"}},"创建日期"),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,[(n(),a(w,null,S(j,(o,y)=>e("tr",{key:y,class:"border-b",style:{"border-color":"#F0F0F0"}},[e("td",Y,r(o.licenseId),1),e("td",Z,r(o.model),1),e("td",ee,r(o.modules),1),e("td",te,r(o.expiry),1),e("td",se,r(o.createdDate),1),e("td",oe,[e("span",{class:"px-2 py-1 rounded text-xs",style:C(z(o.status))},r(o.status),5)]),e("td",le,[e("div",re,[t[13]||(t[13]=e("button",{class:"text-sm",style:{color:"#4a7c59"}},"详情",-1)),t[14]||(t[14]=e("button",{class:"text-sm",style:{color:"#4a7c59"}},"下载",-1)),o.status==="草稿"?(n(),a("button",de,"发布")):m("",!0),o.status==="已发布"?(n(),a("button",ae,"停用")):m("",!0)])])])),64))])])])]),t[25]||(t[25]=k('显示 1-10 / 共 156 条
',1)),u.value?(n(),a("div",{key:0,class:"fixed inset-0 z-50 flex justify-end",style:{"background-color":"rgba(0,0,0,0.45)"},onClick:t[7]||(t[7]=M(o=>u.value=!1,["self"]))},[e("div",ne,[e("div",ue,[t[16]||(t[16]=e("h3",{class:"text-lg font-semibold"},"选择授权项生成",-1)),e("button",{onClick:t[0]||(t[0]=o=>u.value=!1),class:"p-1 rounded hover:bg-gray-100",style:{color:"rgba(0,0,0,0.45)"}},[b(x(R),{size:18})])]),e("div",ie,[e("div",pe,[e("div",null,[t[18]||(t[18]=e("label",{class:"block text-sm mb-2",style:{color:"rgba(0,0,0,0.85)"}},[f("设备型号 "),e("span",{style:{color:"#FF4D4F"}},"*")],-1)),v(e("select",{"onUpdate:modelValue":t[1]||(t[1]=o=>d.value=o),class:"w-full px-3 py-2 border rounded text-sm",style:{"border-color":"#D9D9D9","background-color":"#fff"},onChange:t[2]||(t[2]=o=>V())},[...t[17]||(t[17]=[e("option",null,"GD-10 Supreme",-1),e("option",null,"GD-20 Supreme",-1),e("option",null,"GD-30 Supreme",-1)])],544),[[h,d.value]])]),e("div",null,[t[20]||(t[20]=e("label",{class:"block text-sm mb-2",style:{color:"rgba(0,0,0,0.85)"}},"授权有效期",-1)),v(e("select",{"onUpdate:modelValue":t[3]||(t[3]=o=>g.value=o),class:"w-full px-3 py-2 border rounded text-sm",style:{"border-color":"#D9D9D9","background-color":"#fff"}},[...t[19]||(t[19]=[e("option",null,"永久",-1),e("option",null,"1年",-1),e("option",null,"2年",-1),e("option",null,"自定义",-1)])],512),[[h,g.value]])]),g.value==="自定义"?(n(),a("div",ce,[t[21]||(t[21]=e("label",{class:"block text-sm mb-2",style:{color:"rgba(0,0,0,0.85)"}},"到期日期",-1)),v(e("input",{type:"date","onUpdate:modelValue":t[4]||(t[4]=o=>F.value=o),class:"w-full px-3 py-2 border rounded text-sm",style:{"border-color":"#D9D9D9"}},null,512),[[T,F.value]])])):m("",!0)]),e("div",be,[e("div",xe,[t[22]||(t[22]=e("span",{class:"text-sm font-medium"},"功能授权项",-1)),e("span",me,"已选 "+r(c.value)+" / "+r(G.value)+" 项",1)]),e("div",{class:"flex items-center gap-3"},[e("button",{class:"text-xs",style:{color:"#4a7c59"},onClick:A},"全选"),e("button",{class:"text-xs",style:{color:"rgba(0,0,0,0.45)"},onClick:E},"清空")])]),e("table",ge,[t[23]||(t[23]=e("thead",{style:{"background-color":"#FAFAFA"}},[e("tr",null,[e("th",{class:"px-3 py-2 text-left",style:{width:"36px"}}),e("th",{class:"px-3 py-2 text-left"},"功能授权项名称")])],-1)),e("tbody",null,[(n(!0),a(w,null,S(_.value,(o,y)=>(n(),a("tr",{key:y,class:"border-b",style:{"border-color":"#F0F0F0"}},[e("td",ye,[e("input",{type:"checkbox",class:"w-3.5 h-3.5",style:{"accent-color":"#4a7c59"},checked:l.value.has(o.name),onChange:we=>I(o.name)},null,40,fe)]),e("td",ve,r(o.name),1)]))),128))])])]),e("div",De,[e("button",{class:"px-4 py-2 rounded text-sm",style:{border:"1px solid #D9D9D9",color:"rgba(0,0,0,0.85)"},onClick:t[5]||(t[5]=o=>u.value=!1)},"取消"),e("button",{class:"px-4 py-2 rounded text-white text-sm",style:C({backgroundColor:c.value>0?"#52C41A":"#D9D9D9"}),disabled:c.value===0,onClick:t[6]||(t[6]=o=>u.value=!1)},"生成授权文件("+r(c.value)+"项)",13,Fe)])])])):m("",!0)]))}});export{Ie as default};