import{r as d}from"./index.17037962789732.js";import"./index.170379627897318.js";import"./index.170379627897319.js";import{_ as v}from"./index.17037962789739.js";import{d as m,s as g,k,o as a,x,b as o,a as i,u as r,c as C,B as E}from"./vue.1703796278973.js";import{u as S}from"./scene.1703796278973.js";import B from"./AddModal.1703796278973.js";import y from"./AddButton.1703796278973.js";import b from"./Title.17037962789732.js";import{_ as w}from"./Terms.vue_vue_type_script_setup_true_name_Terms_lang.1703796278973.js";import{E as D,D as T}from"./util.17037962789736.js";const $={class:"device"},j=m({name:"SceneSaveDevice"}),H=m({...j,setup(A){const l=S(),{data:t}=g(l),n=k(!1),c=[{validator(s,e){return e?Promise.resolve():Promise.reject(new Error("请配置设备触发规则"))}}],p=(s,e)=>{t.value.trigger.device=s,t.value.options.trigger=e,n.value=!1,D.emit(T,s)};return(s,e)=>{const _=v,u=d;return a(),x("div",$,[o(u,{rules:c,name:["trigger","device"]},{label:i(()=>[o(_,{data:"触发规则",style:{"font-size":"14px"}})]),default:i(()=>[o(y,{style:{width:"100%"},onClick:e[0]||(e[0]=f=>n.value=!0)},{default:i(()=>[o(b,{options:r(t).options.trigger},null,8,["options"])]),_:1}),r(n)?(a(),C(B,{key:0,onCancel:e[1]||(e[1]=f=>n.value=!1),onSave:p,value:r(t).trigger.device,options:r(t).options.trigger},null,8,["value","options"])):E("",!0)]),_:1}),o(r(w))])}}});export{H as _};
