import{r as N,ah as w,o as y,y as E,q as t,v as F,p as s,P as f,x as c,n,s as k,S as C,j as M,k as R,m as B,l as D,bv as x,D as I}from"./index.8d733f79.js";import{b as P}from"./deviceModel.43e61fe5.js";const S={class:"dialog-footer"},T={__name:"editModelName",emits:["refesh"],setup(U,{expose:p,emit:_}){const{proxy:d}=I(),a=N(!1),l=w({name:""});let i;function g(e){a.value=!0,i=e,l.name=e.name}function h(){!d.$refs.setFormRef||d.$refs.setFormRef.validate(e=>{e?(P({...i,name:l.name}).then(o=>{C.success(o.msg),_("refesh")}),r()):console.log("error submit!")})}function r(){a.value=!1}return p({showModal:g}),(e,o)=>{const V=M,v=R,$=B,u=D,b=x;return y(),E(b,{title:e.$t("edit"),modelValue:n(a),"onUpdate:modelValue":o[1]||(o[1]=m=>k(a)?a.value=m:null),width:"400px","align-center":!0,onClose:r},{footer:t(()=>[F("div",S,[s(u,{onClick:r},{default:t(()=>[f(c(e.$t("cancel")),1)]),_:1}),s(u,{type:"primary",onClick:h},{default:t(()=>[f(c(e.$t("confirm")),1)]),_:1})])]),default:t(()=>[s($,{ref:"setFormRef",model:n(l)},{default:t(()=>[s(v,{label:e.$t("modelName"),prop:"name",rules:[{required:!0,message:e.$t("modelNameP")}]},{default:t(()=>[s(V,{modelValue:n(l).name,"onUpdate:modelValue":o[0]||(o[0]=m=>n(l).name=m),placeholder:e.$t("modelNameP"),maxlength:"50",style:{width:"236px"}},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])}}};export{T as default};
