import{b as V,r as p,o as x,y as R,q as u,P as a,x as i,v as y,p as r,C as b,S as d,l as w,bv as M}from"./index.8d733f79.js";import{E as B}from"./el-input-number.60463ef8.js";import{f as D}from"./deviceRunTime.517fd825.js";import"./index.28f6da25.js";const E={style:{"margin-bottom":"16px"}},$={class:"dialog-footer"},S={__name:"editRunTime",emits:["regetList"],setup(k,{expose:c,emit:_}){const{t:l}=V(),s=p(!1),o=p({day:"",hour:"",id:""});function g(e){e.beforeRunTime&&e.beforeRunTime.indexOf(l("day"))!==-1&&(o.value.day=e.beforeRunTime.substring(0,e.beforeRunTime.indexOf(l("day"))),o.value.hour=e.beforeRunTime.substring(e.beforeRunTime.indexOf(l("day"))+1,e.beforeRunTime.indexOf(l("hour")))),o.value.id=e.id,s.value=!0}function T(){if(!o.value.day&&o.value.day!==0){d.error(l("dayP"));return}if(!o.value.hour&&o.value.hour!==0){d.error(l("hourP"));return}const e={id:o.value.id,beforeTime:o.value.day*24*60*60+o.value.hour*60*60};D(e).then(t=>{d.success(t.msg),_("regetList"),m()}).catch(()=>{})}function m(){setTimeout(()=>{s.value=!1},0)}return c({showModal:g}),(e,t)=>{const f=B,v=w,h=M;return x(),R(h,{modelValue:s.value,"onUpdate:modelValue":t[4]||(t[4]=n=>s.value=n),width:"480","align-center":""},{header:u(()=>[a(i(e.$t("beforeRunTime")),1)]),footer:u(()=>[y("span",$,[r(v,{onClick:m},{default:u(()=>[a(i(e.$t("cancel")),1)]),_:1}),r(v,{type:"primary",onClick:T},{default:u(()=>[a(i(e.$t("confirm")),1)]),_:1})])]),default:u(()=>[y("div",E,[r(f,{modelValue:o.value.day,"onUpdate:modelValue":t[0]||(t[0]=n=>o.value.day=n),precision:0,onMousewheel:t[1]||(t[1]=b(()=>{},["prevent"])),max:9999,min:0,controls:!1,style:{"text-align":"left"}},null,8,["modelValue"]),a(" "+i(e.$t("day"))+" ",1),r(f,{modelValue:o.value.hour,"onUpdate:modelValue":t[2]||(t[2]=n=>o.value.hour=n),precision:0,onMousewheel:t[3]||(t[3]=b(()=>{},["prevent"])),max:23,min:0,controls:!1,style:{"text-align":"left"}},null,8,["modelValue"]),a(" "+i(e.$t("hour")),1)])]),_:1},8,["modelValue"])}}};export{S as default};
