import{c as e,r as a,o as t,q as s,n as o,v as r,x as d,e as l,B as i,z as m,y as u,C as c,D as p,G as n,ab as f,a9 as _}from"./base-lib.js?v=1761009159";import{B as j}from"./index400.js?v=1761009159";import{b as y,_ as v}from"./utils-lib.js?v=1761009159";import{h as x,i as b}from"./validator.js?v=1761009159";import{batchPhpEdate as D,setModulesEtimeMultiple as g,setEdate as h}from"./site.js?v=1761009159";import{o as q}from"./useController6.js?v=1761009159";import{u as w}from"./useStore4.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";import"./column.js?v=1761009159";const C={class:"p-2rem"},Y={class:"flex items-center"},k={key:0,class:"text-[#888] mt-[8px] ml-10rem"},T=v(e({__name:"index",props:{compData:{default:()=>{}}},emits:["close"],setup(e,{expose:v,emit:T}){const V=y(),A=e,{rowData:B,siteType:H}=A.compData,M=!!Array.isArray(B),{isRefreshList:P}=w(),R=T,S=a(),z=t({edate:B.edate||""}),G={edate:[{required:!0,message:"请选择到期时间",trigger:"blur"}]},I=e=>e.getTime()<Date.now()-864e5,L=()=>{z.edate="",U(),F()},U=()=>{const e=document.querySelector(".date .el-input__inner");e&&(e.value="永久")},E=e=>{},F=async e=>{try{if(M){const{enable:e,exclude:a}=A.compData.config,t=x(B,a,e,{params:{edate:z.edate?z.edate:"0000-00-00",project_type:"PHP"}}),s=await D(t),{data:o}=b(s.data);q({title:"批量设置到期时间",resultTitle:"设置到期时间",resultData:o}),P.value=!0,R("close")}else{let e,a=V.load("正在设置到期时间，请稍后...");if(H){const e=await g({sites_id:B.id,edate:z.edate?z.edate:"0000-00-00"});e.data.status?(V.request(e),P.value=!0):V.error(e.data.msg)}else e=await h({id:B.id,edate:z.edate?z.edate:"0000-00-00"}),V.request(e),e.status&&(P.value=!0);a.close(),R("close")}}catch(a){}};return v({onConfirm:F}),s(()=>{"0000-00-00"===B.edate&&(z.edate="",o(()=>{U()}))}),(e,a)=>{const t=j,s=n,o=f,y=_;return r(),d("div",C,[l(y,{ref_key:"formRef",ref:S,model:u(z),rules:G},{default:i(()=>[l(o,{label:"到期时间",prop:"edate"},{default:i(()=>[m("div",Y,[l(t,{modelValue:u(z).edate,"onUpdate:modelValue":a[0]||(a[0]=e=>u(z).edate=e),"value-format":"YYYY-MM-DD","disabled-date":I,class:"date",onChange:E,type:"date",placeholder:"选择日期"},null,8,["modelValue"]),l(s,{type:"default",class:"!ml-[.4rem]",onClick:L},{default:i(()=>a[1]||(a[1]=[c(" 设为永久 ",-1)])),_:1,__:[1]})])]),_:1})]),_:1},8,["model"]),u(z).edate?(r(),d("div",k,"* 到期当天24点后过期")):p("",!0)])}}}),[["__scopeId","data-v-26d5d260"]]);export{T as default};
