import{s as c,E as p}from"./index.1704421723665.js";import{J as y,f as V,a1 as B,a as v,Y as a,R as s,a5 as l,o as f,b as _,Q as C,V as U,X as N,W as g}from"./vue.1704421723665.js";function k(){return{getWarnSetPage:r=>c({url:"/api/gasThreshold/list",method:"post",data:r}),handelWarnSet:r=>c({url:"/api/gasThreshold/update",method:"post",data:r})}}const x={class:"system-add-gas-container"},O={class:"dialog-footer"},J=g("\u53D6 \u6D88"),R=g("\u786E \u5B9A"),z=y({name:"setDialog",emits:["getSetData"],setup(r,{expose:h,emit:u}){const i=V(),e=B({title:"",isShowUserDialog:!1,disabled:!1,setForm:{id:"",name:"",threshold:0},setFormRules:{threshold:[{required:!0,message:"\u8BF7\u586B\u5199\u8FDE\u7EED\u8D85\u8FC7\u9608\u503C\u70B9\u6570",trigger:"blur"}]}}),D=(d,t)=>{e.isShowUserDialog=!0,d==="\u67E5\u770B"?(e.disabled=!0,e.title="\u67E5\u770B",e.setForm=JSON.parse(JSON.stringify(t))):(e.disabled=!1,e.title="\u4FEE\u6539",e.setForm=JSON.parse(JSON.stringify(t)))},S=async()=>{if(e.title=="\u4FEE\u6539"){if(i.value.validate()){const t={id:e.setForm.id,threshold:e.setForm.threshold};let o=await k().handelWarnSet(t);o.data.code==100?p({type:"success",message:"\u4FEE\u6539\u6210\u529F"}):p({type:"error",message:o.data.msg})}i.value.clearValidate(),e.isShowUserDialog=!1,u("getSetData")}else e.isShowUserDialog=!1,u("getSetData")},F=()=>{i.value.clearValidate(),e.isShowUserDialog=!1,u("getSetData")};return h({openDialog:D}),(d,t)=>{const o=l("el-form-item"),E=l("el-input"),b=l("el-form"),m=l("el-button"),w=l("el-dialog");return f(),v("div",x,[a(w,{title:e.title,modelValue:e.isShowUserDialog,"onUpdate:modelValue":t[1]||(t[1]=n=>e.isShowUserDialog=n),width:"550px"},{footer:s(()=>[_("span",O,[e.disabled?U("",!0):(f(),C(m,{key:0,onClick:F,size:"default"},{default:s(()=>[J]),_:1})),a(m,{type:"primary",onClick:S,size:"default"},{default:s(()=>[R]),_:1})])]),default:s(()=>[a(b,{model:e.setForm,size:"default",ref_key:"gasRef",ref:i,rules:e.title=="\u4FEE\u6539"?e.setFormRules:"","label-width":"150px"},{default:s(()=>[a(o,{label:"\u9884\u8B66\u540D\u79F0:",prop:"name"},{default:s(()=>[_("span",null,N(e.setForm.name),1)]),_:1}),a(o,{label:"\u8FDE\u7EED\u8D85\u8FC7\u9608\u503C\u70B9\u6570:",prop:"threshold"},{default:s(()=>[a(E,{modelValue:e.setForm.threshold,"onUpdate:modelValue":t[0]||(t[0]=n=>e.setForm.threshold=n),modelModifiers:{trim:!0},disabled:e.disabled},null,8,["modelValue","disabled"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title","modelValue"])])}}});var M=Object.freeze(Object.defineProperty({__proto__:null,default:z},Symbol.toStringTag,{value:"Module"}));export{z as _,M as s,k as w};
|