import{r as d,ah as h,o as E,y as F,q as l,v as k,p as n,P as p,x as f,n as r,s as y,S as w,k as B,m as D,l as N,bv as R,D as q}from"./index.8d733f79.js";import{E as M}from"./el-input-number.60463ef8.js";import{q as P,r as S}from"./setValue.1d09ba51.js";import"./index.28f6da25.js";const x={class:"dialog-footer"},G={__name:"setInterval",setup(U,{expose:v}){const{proxy:m}=q(),o=d(!1),s=d(""),a=h({interval:null});function _(e){o.value=!0,s.value=e.pointId,I()}const I=()=>{P({point:s.value}).then(e=>{a.interval=e.data.moreCollectInterval||4})};function g(){!m.$refs.setFormRef||m.$refs.setFormRef.validate(e=>{e?(S({pointId:s.value,interval:a.interval}).then(t=>{w.success(t.msg)}),i()):console.log("error submit!")})}function i(){o.value=!1}return v({showModal:_}),(e,t)=>{const b=M,V=B,C=D,c=N,$=R;return E(),F($,{title:e.$t("setInterval"),modelValue:r(o),"onUpdate:modelValue":t[1]||(t[1]=u=>y(o)?o.value=u:null),width:"400px","align-center":!0,onClose:i},{footer:l(()=>[k("div",x,[n(c,{onClick:i},{default:l(()=>[p(f(e.$t("cancel")),1)]),_:1}),n(c,{type:"primary",onClick:g},{default:l(()=>[p(f(e.$t("confirm")),1)]),_:1})])]),default:l(()=>[n(C,{ref:"setFormRef",model:r(a)},{default:l(()=>[n(V,{label:e.$t("collectInterval"),prop:"interval",rules:[{required:!0,message:e.$t("collectIntervalP")}]},{default:l(()=>[n(b,{class:"input-number",modelValue:r(a).interval,"onUpdate:modelValue":t[0]||(t[0]=u=>r(a).interval=u),placeholder:e.$t("collectIntervalP"),precision:0,min:1,max:99999,controls:!1},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])}}};export{G as default};
