import{a as C,u as D,r as F,ah as S,J as B,o as m,y as p,q as s,v as N,p as a,P as f,x as _,n,c as P,F as A,A as O,s as U,c$ as q,E as x,i as J,k as j,j as L,m as M,l as T,bv as z,D as G}from"./index.8d733f79.js";const H={class:"dialog-footer"},Q={__name:"closeAlarm",props:{status:{type:String,default:""}},emits:["handleReslove"],setup(g,{expose:R,emit:y}){const h=g,{proxy:u}=G();C(),D();const r=F(!1),t=S({alarmId:"",closeReason:"",closeIllustration:""}),$=B.session.getJSON("enums").closeReason.filter(e=>e.key!=="fault_closed"&&e.key!=="alarm_hosting"&&e.key!=="system_integration");function b(e){r.value=!0,t.alarmId=e.alarmId}const k=async()=>{!u.$refs.formRef||await u.$refs.formRef.validate((e,l)=>{e?q({...t,status:h.status}).then(c=>{c.code===200&&(u.$modal.msgSuccess(c.msg),r.value=!1,y("handleReslove"))}):console.log("error submit!",l)})},v=()=>{u.$refs.formRef.resetFields()};return R({showDialog:b}),(e,l)=>{const c=x,V=J,d=j,I=L,w=M,i=T,E=z;return m(),p(E,{title:e.$t("closeAlarm"),modelValue:n(r),"onUpdate:modelValue":l[3]||(l[3]=o=>U(r)?r.value=o:null),width:"500px","align-center":!0,onClosed:v,"append-to-body":""},{footer:s(()=>[N("div",H,[a(i,{onClick:l[2]||(l[2]=o=>r.value=!1)},{default:s(()=>[f(_(e.$t("cancel")),1)]),_:1}),a(i,{type:"primary",onClick:k},{default:s(()=>[f(_(e.$t("confirm")),1)]),_:1})])]),default:s(()=>[a(w,{ref:"formRef",model:n(t),"label-position":"top",class:"content-wrap"},{default:s(()=>[a(d,{label:e.$t("closeReason"),prop:"closeReason",rules:[{required:!0,message:e.$t("closeReasonP"),trigger:"change"}]},{default:s(()=>[a(V,{modelValue:n(t).closeReason,"onUpdate:modelValue":l[0]||(l[0]=o=>n(t).closeReason=o),placeholder:e.$t("closeReasonP"),teleported:!1},{default:s(()=>[(m(!0),P(A,null,O(n($),o=>(m(),p(c,{key:o.key,label:o.desc,value:o.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),a(d,{label:e.$t("handleDesc"),prop:"closeIllustration",style:{height:"auto","margin-bottom":"20px"}},{default:s(()=>[a(I,{modelValue:n(t).closeIllustration,"onUpdate:modelValue":l[1]||(l[1]=o=>n(t).closeIllustration=o),maxlength:"2000",rows:"3","show-word-limit":"",type:"textarea",placeholder:e.$t("handleDescP")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])}}};export{Q as default};
