import{C as V,D as x,F as R}from"./element-plus.bccb9376.js";import{M as h}from"./picker.24e47292.js";import{P}from"./index.8f1b3064.js";import{a as U,b as q,c as I}from"./bank.00617f73.js";import"./lodash.466e9fe4.js";import{d as F,s as f,r as M,b as j,Z as _,o as A,c as L,U as u,L as s,u as o}from"./@vue.18505fe0.js";const N={class:"edit-popup"},O=F({name:"bankEdit"}),K=F({...O,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(S,{expose:C,emit:g}){const m=g,p=f(),n=f(),r=M("add"),b=j(()=>r.value=="edit"?"\u7F16\u8F91\u94F6\u884C\u5217\u8868":"\u65B0\u589E\u94F6\u884C\u5217\u8868"),t=_({id:"",name:"",image:""}),k=_({name:[{required:!0,message:"\u8BF7\u8F93\u5165\u94F6\u884C\u540D\u79F0",trigger:["blur"]}],image:[{required:!0,message:"\u8BF7\u8F93\u5165\u94F6\u884C\u56FE\u7247",trigger:["blur"]}]}),c=async a=>{for(const e in t)a[e]!=null&&a[e]!=null&&(t[e]=a[e])},v=async a=>{const e=await U({id:a.id});c(e)},y=async()=>{var e,l;await((e=p.value)==null?void 0:e.validate());const a={...t};r.value=="edit"?await q(a):await I(a),(l=n.value)==null||l.close(),m("success")},B=(a="add")=>{var e;r.value=a,(e=n.value)==null||e.open()},D=()=>{m("close")};return C({open:B,setFormData:c,getDetail:v}),(a,e)=>{const l=V,d=x,E=h,w=R;return A(),L("div",N,[u(P,{ref_key:"popupRef",ref:n,title:o(b),async:!0,width:"550px",onConfirm:y,onClose:D},{default:s(()=>[u(w,{ref_key:"formRef",ref:p,model:o(t),"label-width":"90px",rules:o(k)},{default:s(()=>[u(d,{label:"\u94F6\u884C\u540D\u79F0",prop:"name"},{default:s(()=>[u(l,{modelValue:o(t).name,"onUpdate:modelValue":e[0]||(e[0]=i=>o(t).name=i),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u94F6\u884C\u540D\u79F0",readonly:!1},null,8,["modelValue"])]),_:1}),u(d,{label:"\u94F6\u884C\u56FE\u7247",prop:"image"},{default:s(()=>[u(E,{modelValue:o(t).image,"onUpdate:modelValue":e[1]||(e[1]=i=>o(t).image=i)},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{K as _};
