import{C as h,D as w,F as U}from"./element-plus.4a7d92a3.js";import{P as x}from"./index.a19e7573.js";import{b as A,c as R,d as k}from"./user_ship.b0d248cc.js";import"./lodash.9dc701ad.js";import{d as _,s as f,r as S,b as q,Z as F,o as I,c as P,U as o,L as r,u as l}from"./@vue.18505fe0.js";const j={class:"edit-popup"},L=_({name:"userShipEdit"}),H=_({...L,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(N,{expose:D,emit:b}){const p=b,m=f(),i=f(),n=S("add"),B=q(()=>n.value=="edit"?"\u7F16\u8F91\u4F1A\u5458\u7C7B\u578B":"\u65B0\u589E\u4F1A\u5458\u7C7B\u578B"),t=F({id:"",title:"",limit:"",sort:""}),E=F({title:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F1A\u5458\u540D\u79F0",trigger:["blur"]}],limit:[{required:!0,message:"\u8BF7\u8F93\u5165\u5145\u503C\u91D1\u989D",trigger:["blur"]}],sort:[{required:!0,message:"\u8BF7\u8F93\u5165\u6392\u5E8F\u5012\u5E8F",trigger:["blur"]}]}),c=async u=>{for(const e in t)u[e]!=null&&u[e]!=null&&(t[e]=u[e])},y=async u=>{const e=await A({id:u.id});c(e)},C=async()=>{var e,a;await((e=m.value)==null?void 0:e.validate());const u={...t};n.value=="edit"?await R(u):await k(u),(a=i.value)==null||a.close(),p("success")},g=(u="add")=>{var e;n.value=u,(e=i.value)==null||e.open()},v=()=>{p("close")};return D({open:g,setFormData:c,getDetail:y}),(u,e)=>{const a=h,d=w,V=U;return I(),P("div",j,[o(x,{ref_key:"popupRef",ref:i,title:l(B),async:!0,width:"550px",onConfirm:C,onClose:v},{default:r(()=>[o(V,{ref_key:"formRef",ref:m,model:l(t),"label-width":"90px",rules:l(E)},{default:r(()=>[o(d,{label:"\u4F1A\u5458\u540D\u79F0",prop:"title"},{default:r(()=>[o(a,{modelValue:l(t).title,"onUpdate:modelValue":e[0]||(e[0]=s=>l(t).title=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4F1A\u5458\u540D\u79F0",readonly:!1},null,8,["modelValue"])]),_:1}),o(d,{label:"\u5145\u503C\u91D1\u989D",prop:"limit"},{default:r(()=>[o(a,{modelValue:l(t).limit,"onUpdate:modelValue":e[1]||(e[1]=s=>l(t).limit=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5145\u503C\u91D1\u989D",readonly:!1},null,8,["modelValue"])]),_:1}),o(d,{label:"\u6392\u5E8F\u5012\u5E8F",prop:"sort"},{default:r(()=>[o(a,{modelValue:l(t).sort,"onUpdate:modelValue":e[2]||(e[2]=s=>l(t).sort=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6392\u5E8F\u5012\u5E8F",readonly:!1},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{H as _};
