import{c as e,r as l,o as a,q as s,v as n,x as o,e as t,B as i,z as u,y as m,Q as r,I as v,J as d,P as p,ab as c,a9 as f}from"./base-lib.js?v=1761009159";import{B as b}from"./index420.js?v=1761009159";import{ax as _}from"./utils-lib.js?v=1761009159";import{g as x}from"./useStore.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./config.js?v=1761009159";const g={class:"p-20px"},j={class:"flex items-center"},w={class:"ml-10px flex items-center"},V=e({__name:"time-config",setup(e,{expose:V}){const{refs:{panelConfig:C},saveConfig:h}=x(),y=l(),k=a({time:5}),B=l([{num:43200,label:"12小时",value:"12小时"},{num:86400,label:"24小时",value:"24小时"},{num:259200,label:"72小时",value:"72小时"},{num:604800,label:"7天",value:"7天"},{num:2592e3,label:"30天",value:"30天"},{num:0,label:"自定义",value:"自定义"}]),U=e=>{if(y.value=e,"自定义"===e)k.time=5;else{const l=B.value.find(l=>l.label===e)||{num:86400};k.time=Number(l.num)/60}};return s(()=>{var e;e=C.value.session_timeout,B.value.filter(e=>"自定义"!==e.label).map(e=>e.label).includes(e)?y.value=C.value.session_timeout:(y.value="自定义",k.time=C.value.session_timeout_source/60)}),V({onConfirm:async e=>{var l;let a=0;a="自定义"===y.value?60*k.time:null==(l=B.value.find(e=>e.label===y.value))?void 0:l.num,await h("正在设置超时时间，请稍候...",{session_timeout:a}),e()}}),(e,l)=>{const a=_,s=b,x=c,V=f;return n(),o("div",g,[t(V,null,{default:i(()=>[t(x,{label:"超时时间"},{default:i(()=>[u("div",j,[t(a,{modelValue:m(y),"onUpdate:modelValue":l[0]||(l[0]=e=>r(y)?y.value=e:null),options:m(B),class:"!w-[14rem]",onChange:U},null,8,["modelValue","options"]),v(u("div",w,[t(s,{class:"!w-[10rem]",modelValue:m(k).time,"onUpdate:modelValue":l[1]||(l[1]=e=>m(k).time=e),"controls-position":"right",min:5,step:1,onKeyup:l[2]||(l[2]=p(e=>{return l=e,a=window.event?l.keyCode:l.which,void([189,190,109,110].includes(a)&&(l.target.value=""));var l,a},["native"]))},null,8,["modelValue"]),l[3]||(l[3]=u("span",{class:"ml-10px inline-block"},"分钟",-1))],512),[[d,"自定义"==m(y)]])])]),_:1})]),_:1}),l[4]||(l[4]=u("div",{class:"mt-20px text-danger"},"注意：超时时间超过一天可能存在安全风险。",-1))])}}});export{V as default};
