import{s as e,j as a,r as t,g as s,o as l,n as u,c as n,q as o,a6 as i,v as r,x as d,e as c,B as m,K as p,y as v,Q as y,F as f,N as _,D as h,L as b,b9 as g,ab as D,a9 as w}from"./base-lib.js?v=1761009159";import{_ as F}from"./validator.js?v=1761009159";import{V,P as k,ag as j,_ as M}from"./utils-lib.js?v=1761009159";import{F as P,u as T,r as C,t as I}from"./useStore8.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";import"./column.js?v=1761009159";const x=a("FTP_PWD_VALIDITY_PERIOD",()=>{const a=P(),{rowData:n}=e(a),o=t(),i=t(),r=t(!1),d=t();s(()=>n.value.id);const c=s(()=>n.value.end_time),m=l({disabledDate:e=>e.getTime()<Date.now(),shortcuts:[{text:"永久",value:()=>{(new Date).setTime(0),p.value=0,d.value=0,u(()=>{E()})}}]}),p=t(V(new Date,"yyyy-MM-dd")),v=t({status:"1",channel:[]}),y=s(()=>p.value===V(new Date,"yyyy-MM-dd")?"0"===c.value:0==Number(d.value)||p.value===V(new Date,"yyyy-MM-dd"));return{pickerRef:o,rowData:n,updateFtpInfo:i,ftpForm:v,isTime:y,pickerOptions:m,datePicker:p,isChange:r,selectValue:d}}),q=()=>e(x()),{rowData:N,isRefreshFtpList:R}=T(),{updateFtpInfo:S,ftpForm:Y,datePicker:O,isChange:L,selectValue:U}=q(),B=[{label:"仅发送通知",value:"1"},{label:"停用当前FTP账号",value:"2"},{label:"自动修改FTP密码并发送",value:"3"},{label:"不触发",value:"0"}],z={channel:[{required:!0,message:"请选择告警方式",trigger:"blur"}]},A=e=>{L.value=!0,U.value=e},E=()=>{const e=document.querySelector(".date .el-input__inner");e&&(e.value="永久")},H=async()=>{Y.value.channel=Y.value.channel.filter(e=>""!==e),await S.value.validate();const e={id:JSON.stringify([N.value.id]),end_time:!L.value&&!Number(N.value.end_time)||0==U.value?0:new Date(O.value).getTime()/1e3,push_action:Y.value.status,channel:Y.value.channel.join(",")},a=await k({loading:"正在设置到期密码配置，请稍候...",request:C(e),data:{status:Boolean},message:!0});return R.value=!0,a.status},J=async()=>{await(async(e={id:N.value.id})=>{const a=await k({loading:"正在设置到期密码配置，请稍候...",request:I(e),data:{channel:String,push_action:String}});Y.value.channel=""===a.channel?[]:a.channel.split(","),Y.value.status=a.push_action})(),"0"===N.value.end_time?E():O.value=V(Number(N.value.end_time),"yyyy-MM-dd")},K=()=>{N.value={},Y.value={status:"1",channel:[]}},Q={class:"container-dialog"},W=M(n({__name:"index",setup(e,{expose:a}){const{updateFtpInfo:t,ftpForm:s,isTime:l,pickerOptions:u,datePicker:n,pickerRef:V}=q();return a({onConfirm:H}),o(J),i(K),(e,a)=>{const o=g,i=D,k=j,M=F,P=w;return r(),d("div",Q,[c(P,{ref_key:"updateFtpInfo",ref:t,rules:v(z),model:v(s),class:p(v(l)?"btCustomForm":"btCustomForm bt-custom-form1"),style:b("0"==v(s).status||v(l)?"":"padding-left: 1rem")},{default:m(()=>[c(i,{label:"密码有效期",class:p(v(l)?"typeClass":"")},{default:m(()=>[c(o,{ref_key:"pickerRef",ref:V,modelValue:v(n),"onUpdate:modelValue":a[0]||(a[0]=e=>y(n)?n.value=e:null),type:"date",class:"date",placeholder:"选择日期","value-format":"YYYY-MM-DD","disabled-date":v(u).disabledDate,shortcuts:v(u).shortcuts,onChange:v(A)},null,8,["modelValue","disabled-date","shortcuts","onChange"])]),_:1},8,["class"]),v(l)?h("",!0):(r(),d(f,{key:0},[c(i,{label:"到期动作"},{default:m(()=>[c(k,{modelValue:v(s).status,"onUpdate:modelValue":a[1]||(a[1]=e=>v(s).status=e),options:v(B),size:"small",style:{gap:"0.8rem"}},null,8,["modelValue","options"])]),_:1}),"0"!==v(s).status?(r(),_(i,{key:0,label:"告警方式",prop:"channel"},{default:m(()=>[c(M,{modelValue:v(s).channel,"onUpdate:modelValue":a[2]||(a[2]=e=>v(s).channel=e),class:"!w-[22rem]",limit:["wx_account","sms"]},null,8,["modelValue"])]),_:1})):h("",!0)],64))]),_:1},8,["rules","model","class","style"])])}}}),[["__scopeId","data-v-930043e8"]]);export{W as default};
