import{B as L,C as U,G as O,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"./land.24df685b.js";import"./lodash.e92d81a1.js";import{d as B,s as F,r as b,b as J,_ as E,o as p,c as v,T as a,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=B({name:"landEdit"}),te=B({...Q,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(W,{expose:C,emit:c}){const i=F(),n=F(),m=b("add"),V=J(()=>m.value="\u7ED1\u5B9A\u4EA7\u54C1"),t=E({id:"",title:"",product_id:""}),g=E({product_id:[{required:!0,message:"\u8BF7\u9009\u62E9\u7ED1\u5B9A\u4EA7\u54C1",trigger:["blur"]}]}),k=async o=>{for(const e in t)o[e]!=null&&o[e]!=null&&(t[e]=o[e])},{optionsData:f}=j({product:{api:_}}),d=b(!1),w=async o=>{d.value=!0;const e=await _({name:o!=null?o:""});f.product=e,d.value=!1},y=async()=>{var e,s;await((e=i.value)==null?void 0:e.validate());const o={...t};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:k,setProduct:async o=>{console.log(o)}}),(o,e)=>{const s=L,r=U,P=O,R=S,x=T;return p(),v("div",M,[a(G,{ref_key:"popupRef",ref:n,title:D(V),async:!0,width:"650px",onConfirm:y,onClose:h},{default:u(()=>[a(x,{ref_key:"formRef",ref:i,model:t,"label-width":"120px",rules:g},{default:u(()=>[a(r,{label:"\u571F\u5730ID",prop:"id"},{default:u(()=>[a(s,{modelValue:t.id,"onUpdate:modelValue":e[0]||(e[0]=l=>t.id=l),disabled:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u571F\u5730ID"},null,8,["modelValue"])]),_:1}),a(r,{label:"\u571F\u5730\u540D\u79F0",prop:"title"},{default:u(()=>[a(s,{modelValue:t.title,"onUpdate:modelValue":e[1]||(e[1]=l=>t.title=l),disabled:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u571F\u5730\u540D\u79F0"},null,8,["modelValue"])]),_:1}),a(r,{label:"\u7ED1\u5B9A\u4EA7\u54C1",prop:"product_id"},{default:u(()=>[a(R,{modelValue:t.product_id,"onUpdate:modelValue":e[2]||(e[2]=l=>t.product_id=l),remote:"",filterable:"",placeholder:"\u8BF7\u8F93\u5165\u4EA7\u54C1\u4FE1\u606F","remote-method":w,loading:d.value},{default:u(()=>[(p(!0),v(K,null,N(D(f).product,(l,I)=>(p(),z(P,{key:I,label:l.productinfo,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{te as _};
