import{B as I,C as R,G as U,H as M,D as h}from"./element-plus.ae8e286c.js";import{P as L}from"./index.a9e38e26.js";import{r as i}from"./index.71fc8348.js";import"./lodash.e92d81a1.js";import{d as F,s as _,r as O,b as P,_ as v,o as m,c as b,T as t,K as r,u as S,U as T,a6 as j,J as G}from"./@vue.108c970a.js";function $(a){return i.get({url:"/device.monitor_alarm/lists",params:a})}function H(a){return i.post({url:"/device.monitor_alarm/add",params:a})}function J(a){return i.post({url:"/device.monitor_alarm/edit",params:a})}function ee(a){return i.post({url:"/device.monitor_alarm/delete",params:a})}function K(a){return i.get({url:"/device.monitor_alarm/detail",params:a})}const N={class:"edit-popup"},z=F({name:"monitorAlarmEdit"}),ue=F({...z,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(a,{expose:D,emit:c}){const B=_(),d=_(),p=O("add"),g=P(()=>p.value=="edit"?"\u76D1\u6D4B\u62A5\u8B66\u6570\u636E":"\u65B0\u589E\u76D1\u6D4B\u62A5\u8B66"),u=v({id:"",device_id:"",type:"",content:"",value:"",solution:""}),E=v({device_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BBE\u5907ID",trigger:["blur"]}],type:[{required:!0,message:"\u8BF7\u9009\u62E9\u76D1\u6D4B\u7C7B\u578B",trigger:["blur"]}],content:[{required:!0,message:"\u8BF7\u8F93\u5165\u62A5\u8B66\u5185\u5BB9",trigger:["blur"]}],value:[{required:!0,message:"\u8BF7\u8F93\u5165\u62A5\u8B66\u6570\u503C",trigger:["blur"]}],solution:[{required:!0,message:"\u8BF7\u8F93\u5165\u89E3\u51B3\u65B9\u6848",trigger:["blur"]}]}),f=async o=>{for(const e in u)o[e]!=null&&o[e]!=null&&(u[e]=o[e])},y=async o=>{const e=await K({id:o.id});f(e)},V=async()=>{var e,n;await((e=B.value)==null?void 0:e.validate());const o={...u};p.value=="edit"?await J(o):await H(o),(n=d.value)==null||n.close(),c("success")},A=(o="add")=>{var e;p.value=o,(e=d.value)==null||e.open()},C=()=>{c("close")};return D({open:A,setFormData:f,getDetail:y}),(o,e)=>{const n=I,s=R,w=U,x=M,k=h;return m(),b("div",N,[t(L,{ref_key:"popupRef",ref:d,title:S(g),async:!0,width:"550px",onConfirm:V,onClose:C},{default:r(()=>[t(k,{ref_key:"formRef",ref:B,model:u,"label-width":"90px",rules:E},{default:r(()=>[t(s,{label:"\u8BBE\u5907ID",prop:"device_id"},{default:r(()=>[t(n,{modelValue:u.device_id,"onUpdate:modelValue":e[0]||(e[0]=l=>u.device_id=l),clearable:"",disabled:"",placeholder:"\u8BF7\u8F93\u5165\u8BBE\u5907ID"},null,8,["modelValue"])]),_:1}),t(s,{label:"\u76D1\u6D4B\u7C7B\u578B",prop:"type"},{default:r(()=>[t(x,{class:"flex-1",modelValue:u.type,"onUpdate:modelValue":e[1]||(e[1]=l=>u.type=l),disabled:"",clearable:"",placeholder:"\u8BF7\u9009\u62E9\u76D1\u6D4B\u7C7B\u578B"},{default:r(()=>[(m(!0),b(T,null,j(a.dictData.alarm_type,(l,q)=>(m(),G(w,{key:q,label:l.name,value:parseInt(l.value)},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(s,{label:"\u62A5\u8B66\u5185\u5BB9",prop:"content"},{default:r(()=>[t(n,{class:"flex-1",modelValue:u.content,"onUpdate:modelValue":e[2]||(e[2]=l=>u.content=l),type:"textarea",rows:"4",disabled:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u62A5\u8B66\u5185\u5BB9"},null,8,["modelValue"])]),_:1}),t(s,{label:"\u62A5\u8B66\u6570\u503C",prop:"value"},{default:r(()=>[t(n,{modelValue:u.value,"onUpdate:modelValue":e[3]||(e[3]=l=>u.value=l),disabled:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u62A5\u8B66\u6570\u503C"},null,8,["modelValue"])]),_:1}),t(s,{label:"\u89E3\u51B3\u65B9\u6848",prop:"solution"},{default:r(()=>[t(n,{class:"flex-1",modelValue:u.solution,"onUpdate:modelValue":e[4]||(e[4]=l=>u.solution=l),type:"textarea",rows:"4",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u89E3\u51B3\u65B9\u6848"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{ue as _,$ as a,ee as b};
