import{B as L,C as O,G as P,H as S,D as T}from"./element-plus.ae8e286c.js";import{a as j}from"./useDictOptions.40b26c73.js";import{P as G}from"./index.a9e38e26.js";import{a as _,b as H}from"./product.ad2ff5ef.js";import"./lodash.e92d81a1.js";import{d as F,s as v,r as B,b as J,_ as E,o as r,c as b,T as t,K as u,u as D,U as K,a6 as N,J as z}from"./@vue.108c970a.js";const M={class:"edit-popup"},Q=F({name:"landEdit"}),oe=F({...Q,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(W,{expose:C,emit:c}){const p=v(),n=v(),m=B("add"),V=J(()=>m.value="\u7ED1\u5B9A\u8BBE\u5907"),l=E({id:"",name:"",device_id:""}),k=E({device_id:[{required:!0,message:"\u8BF7\u9009\u62E9\u7ED1\u5B9A\u8BBE\u5907",trigger:["blur"]}]}),w=async o=>{for(const e in l)o[e]!=null&&o[e]!=null&&(l[e]=o[e])},{optionsData:f}=j({device:{api:_}}),d=B(!1),g=async o=>{d.value=!0;const e=await _({name:o!=null?o:""});f.device=e,d.value=!1},y=async()=>{var e,s;await((e=p.value)==null?void 0:e.validate());const o={...l};await H(o),(s=n.value)==null||s.close(),c("success")},A=(o="add")=>{var e;m.value=o,(e=n.value)==null||e.open()},h=()=>{c("close")};return C({open:A,setFormData:w}),(o,e)=>{const s=L,i=O,R=P,x=S,I=T;return r(),b("div",M,[t(G,{ref_key:"popupRef",ref:n,title:D(V),async:!0,width:"650px",onConfirm:y,onClose:h},{default:u(()=>[t(I,{ref_key:"formRef",ref:p,model:l,"label-width":"120px",rules:k},{default:u(()=>[t(i,{label:"\u4EA7\u54C1ID",prop:"id"},{default:u(()=>[t(s,{modelValue:l.id,"onUpdate:modelValue":e[0]||(e[0]=a=>l.id=a),disabled:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4EA7\u54C1ID"},null,8,["modelValue"])]),_:1}),t(i,{label:"\u4EA7\u54C1\u540D\u79F0",prop:"name"},{default:u(()=>[t(s,{modelValue:l.name,"onUpdate:modelValue":e[1]||(e[1]=a=>l.name=a),disabled:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4EA7\u54C1\u540D\u79F0"},null,8,["modelValue"])]),_:1}),t(i,{label:"\u7ED1\u5B9A\u8BBE\u5907",prop:"device_id"},{default:u(()=>[t(x,{modelValue:l.device_id,"onUpdate:modelValue":e[2]||(e[2]=a=>l.device_id=a),filterable:"",multiple:"",remote:"","reserve-keyword":"",placeholder:"\u8BF7\u8F93\u5165\u8BBE\u5907\u4FE1\u606F","remote-method":g,loading:d.value},{default:u(()=>[(r(!0),b(K,null,N(D(f).device,(a,U)=>(r(),z(R,{key:U,label:a.deviceinfo,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{oe as _};
