import{s as S,a as q}from"./index.382339dd.js";import{x as w,a3 as k,y as j,r as s,a4 as B,o as _,a as g,b as l,d as a,e as t,t as N,Q as U,C as v,g as W}from"./vendor.475775fc.js";import"./index.e07f9e9c.js";const A={class:"padding-lr"},D=N("div",{class:"solid-bottom padding-tb margin-bottom text-bold"},"\u57FA\u672C\u914D\u7F6E",-1),I={__name:"alarmWareConfiguration",setup(P){const{proxy:d}=W(),n=w(!1),f=k({form:{volume:6,comValue:0,song:0},rules:{comValue:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E32\u53E3",trigger:"blur"}],song:[{required:!0,message:"\u8BF7\u586B\u5199\u8BED\u97F3\u7F16\u53F7",trigger:"blur"}],volume:[{required:!0,message:"\u8BF7\u586B\u5199\u97F3\u91CF\u5927\u5C0F",trigger:"blur"}]}}),{form:e,rules:V}=j(f),b=()=>{if((e.value.song+"").length){n.value=!0;let u={com:e.value.comValue==0?"/dev/ttyS2":"/dev/ttyS1",song:e.value.song};S(u).then(o=>{console.log(o),d.$modal.msgSuccess("\u4E0B\u53D1\u6210\u529F"),n.value=!1})}},y=()=>{if((e.value.volume+"").length){n.value=!0;let u={com:e.value.comValue==0?"/dev/ttyS2":"/dev/ttyS1",volume:e.value.volume};q(u).then(o=>{console.log(o),d.$modal.msgSuccess("\u8BBE\u7F6E\u6210\u529F"),n.value=!1})}};return(u,o)=>{const c=s("el-option"),x=s("el-select"),m=s("el-form-item"),i=s("el-input"),p=s("el-button"),h=s("el-form"),C=B("loading");return _(),g("div",A,[D,l(h,{ref:"gpsRef",model:t(e),rules:t(V),"label-width":"120px"},{default:a(()=>[U((_(),g("div",null,[l(m,{label:"\u4E32\u53E3",prop:"comValue"},{default:a(()=>[l(x,{modelValue:t(e).comValue,"onUpdate:modelValue":o[0]||(o[0]=r=>t(e).comValue=r),placeholder:"\u9009\u62E9\u4E32\u53E3"},{default:a(()=>[l(c,{label:"485",value:0}),l(c,{label:"232",value:1})]),_:1},8,["modelValue"])]),_:1}),l(m,{label:"\u8BED\u97F3\u7F16\u53F7",prop:"song"},{default:a(()=>[l(i,{style:{width:"214px"},modelValue:t(e).song,"onUpdate:modelValue":o[1]||(o[1]=r=>t(e).song=r),type:"number",min:"0",placeholder:"\u8BF7\u8F93\u5165\u97F3\u91CF\u5927\u5C0F"},null,8,["modelValue"]),l(p,{type:"success",class:"margin-left-sm",onClick:b},{default:a(()=>[v("\u4E0B\u53D1\u6D4B\u8BD5")]),_:1})]),_:1}),l(m,{label:"\u97F3\u91CF\u5927\u5C0F",prop:"volume"},{default:a(()=>[l(i,{style:{width:"214px"},modelValue:t(e).volume,"onUpdate:modelValue":o[2]||(o[2]=r=>t(e).volume=r),type:"number",min:"1",max:"30",placeholder:"\u8BF7\u8F93\u5165\u97F3\u91CF\u5927\u5C0F"},null,8,["modelValue"]),l(p,{type:"primary",class:"margin-left-sm",onClick:y},{default:a(()=>[v("\u4FDD\u5B58\u914D\u7F6E")]),_:1})]),_:1})])),[[C,t(n)]])]),_:1},8,["model","rules"])])}}};export{I as default};
