enterprise-saa-s-dashboard-.../dist/assets/LicenseGenerate-CsoTS0Do.js

2 lines
5.3 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{d as S,a as i,b as e,u as a,f,j as A,m,p as D,v as I,h as P,t as u,F as V,r as _,n as E,y as G,s as n,k as v,o as b}from"./index-C5t0nGiQ.js";import{A as T}from"./arrow-left-De7UcLOo.js";import{I as $}from"./info-DbTQmklK.js";const M={class:"p-6"},N={class:"mb-6"},j={class:"flex items-center gap-4 mb-2"},z={class:"mb-6 p-4 rounded-lg flex items-start gap-3",style:{"background-color":"#eef5f0",border:"1px solid #a3c4ad"}},B={class:"bg-white p-6 rounded-lg mb-6",style:{"box-shadow":"0 1px 2px rgba(0,0,0,0.05)"}},L={class:"grid grid-cols-3 gap-6"},R={key:0},U={class:"bg-white rounded-lg mb-6",style:{"box-shadow":"0 1px 2px rgba(0,0,0,0.05)"}},H={class:"p-6 border-b flex items-center justify-between",style:{"border-color":"#F0F0F0"}},q={class:"flex items-center gap-3"},J={class:"text-sm",style:{color:"rgba(0,0,0,0.45)"}},K={class:"overflow-x-auto"},O={class:"w-full"},Q={class:"px-6 py-3"},W=["checked","disabled","onChange"],X={class:"px-6 py-3 text-sm"},Y={class:"flex items-center justify-end gap-3 p-4 bg-white rounded-lg sticky bottom-0",style:{"box-shadow":"0 -2px 8px rgba(0,0,0,0.05)"}},Z=["disabled"],ae=S({__name:"LicenseGenerate",setup(ee){const p=G(),x=n("GD-10 Supreme"),c=n("永久"),y=n(""),k=n([{name:"1D SP"},{name:"2D SP"},{name:"3D SP"},{name:"1D VES"},{name:"2D ERT"},{name:"3D ERT"},{name:"1D IP"},{name:"2D IP"},{name:"3D IP"},{name:"跨孔Cross-Hole"},{name:"水上Marine"}]),r=v(()=>k.value.map(t=>({...t,available:!1}))),o=n(new Set),w=t=>{o.value.has(t)?o.value.delete(t):o.value.add(t)},h=()=>{r.value.forEach(t=>{t.available&&o.value.add(t.name)})},g=()=>{o.value.clear()},d=v(()=>r.value.filter(t=>t.available&&o.value.has(t.name)).length),C=v(()=>r.value.filter(t=>t.available).length);return(t,l)=>(b(),i("div",M,[e("div",N,[e("div",j,[e("button",{onClick:l[0]||(l[0]=s=>a(p).go(-1)),class:"p-2 rounded hover:bg-gray-100 transition-colors",style:{color:"rgba(0,0,0,0.65)"}},[f(a(T),{size:20})]),l[7]||(l[7]=e("h2",{class:"text-2xl font-semibold"},"选择授权项生成",-1))]),l[8]||(l[8]=e("p",{class:"text-sm ml-12",style:{color:"rgba(0,0,0,0.45)"}},"选择设备型号和授权功能模块,生成授权文件",-1))]),e("div",z,[f(a($),{size:20,style:{color:"#4a7c59","flex-shrink":"0","margin-top":"2px"}}),l[9]||(l[9]=e("div",{style:{color:"#2d5a3d"}},[e("div",{class:"text-sm"}," 不同设备型号支持不同的授权功能模块。选择型号后下方表格会显示该型号可用的授权项。生成的授权文件将在设备APP激活时自动下载到对应设备。 ")],-1))]),e("div",B,[l[15]||(l[15]=e("h3",{class:"text-lg font-semibold mb-6"},"基本信息",-1)),e("div",L,[e("div",null,[l[11]||(l[11]=e("label",{class:"block text-sm mb-2",style:{color:"rgba(0,0,0,0.85)"}},[A("设备型号 "),e("span",{style:{color:"#FF4D4F"}},"*")],-1)),m(e("select",{"onUpdate:modelValue":l[1]||(l[1]=s=>x.value=s),class:"w-full px-3 py-2 border rounded",style:{"border-color":"#D9D9D9","background-color":"#fff"},onChange:l[2]||(l[2]=s=>g())},[...l[10]||(l[10]=[e("option",null,"GD-10 Supreme",-1),e("option",null,"GD-20 Supreme",-1),e("option",null,"GD-30 Supreme",-1)])],544),[[D,x.value]])]),e("div",null,[l[13]||(l[13]=e("label",{class:"block text-sm mb-2",style:{color:"rgba(0,0,0,0.85)"}},"授权有效期",-1)),m(e("select",{"onUpdate:modelValue":l[3]||(l[3]=s=>c.value=s),class:"w-full px-3 py-2 border rounded",style:{"border-color":"#D9D9D9","background-color":"#fff"}},[...l[12]||(l[12]=[e("option",null,"永久",-1),e("option",null,"1年",-1),e("option",null,"2年",-1),e("option",null,"自定义",-1)])],512),[[D,c.value]])]),c.value==="自定义"?(b(),i("div",R,[l[14]||(l[14]=e("label",{class:"block text-sm mb-2",style:{color:"rgba(0,0,0,0.85)"}},"到期日期",-1)),m(e("input",{type:"date","onUpdate:modelValue":l[4]||(l[4]=s=>y.value=s),class:"w-full px-3 py-2 border rounded",style:{"border-color":"#D9D9D9"}},null,512),[[I,y.value]])])):P("",!0)])]),e("div",U,[e("div",H,[e("div",q,[l[16]||(l[16]=e("h3",{class:"text-lg font-semibold"},"功能授权项选择",-1)),e("span",J,"已选 "+u(d.value)+" / "+u(C.value)+" 项",1)]),e("div",{class:"flex items-center gap-3"},[e("button",{class:"text-sm",style:{color:"#4a7c59"},onClick:h},"全选可用项"),e("button",{class:"text-sm",style:{color:"rgba(0,0,0,0.45)"},onClick:g},"清空")])]),e("div",K,[e("table",O,[l[17]||(l[17]=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)",width:"150px"}},"选择"),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,[(b(!0),i(V,null,_(r.value,(s,F)=>(b(),i("tr",{key:F,class:"border-b",style:{"border-color":"#F0F0F0"}},[e("td",Q,[e("input",{type:"checkbox",class:"w-4 h-4",style:{"accent-color":"#4a7c59"},checked:o.value.has(s.name),disabled:!s.available,onChange:le=>w(s.name)},null,40,W)]),e("td",X,u(s.name),1)]))),128))])])])]),e("div",Y,[e("button",{class:"px-6 py-2 rounded",style:{border:"1px solid #D9D9D9",color:"rgba(0,0,0,0.85)"},onClick:l[5]||(l[5]=s=>a(p).go(-1))},"取消"),e("button",{class:"px-6 py-2 rounded text-white",style:E({backgroundColor:d.value>0?"#52C41A":"#D9D9D9"}),disabled:d.value===0,onClick:l[6]||(l[6]=s=>a(p).push("/licenses"))}," 生成授权文件("+u(d.value)+"项) ",13,Z)])]))}});export{ae as default};