var D=Object.defineProperty,M=Object.defineProperties;var P=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var B=(o,t,e)=>t in o?D(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,d=(o,t)=>{for(var e in t||(t={}))_.call(t,e)&&B(o,e,t[e]);if(g)for(var e of g(t))E.call(t,e)&&B(o,e,t[e]);return o},F=(o,t)=>M(o,P(t));var f=(o,t,e)=>new Promise((u,s)=>{var l=r=>{try{a(e.next(r))}catch(p){s(p)}},n=r=>{try{a(e.throw(r))}catch(p){s(p)}},a=r=>r.done?u(r.value):Promise.resolve(r.value).then(l,n);a((e=e.apply(o,t)).next())});import{B as k,a as I}from"./index.c05f9254.js";import{B as S}from"./BasicForm.d11b68fd.js";import{u as q}from"./useForm.868c8e81.js";import{i as y,b as R,a as L}from"./system.d37449cd.js";import{aP as $,a as N,r as b,k as m,f as T,aQ as h,o as U,aR as O,p as V,j,aU as x}from"./index.0d073eaa.js";import"./useWindowSizeFn.ef20ece8.js";import"./FullscreenOutlined.401a7bcd.js";/* empty css              *//* empty css              */import"./index.0fb15725.js";import"./index.965098be.js";import"./Checkbox.476f6e92.js";import"./index.1491cab6.js";import"./index.e317a008.js";import"./index.7075e2b7.js";import"./index.04f7e044.js";import"./index.e8daa066.js";import"./get.49a42f2e.js";import"./index.e8b360cf.js";import"./eagerComputed.156e81ff.js";import"./index.2b5ea4f6.js";import"./_baseIteratee.3919e7cf.js";import"./DeleteOutlined.247d1f35.js";import"./index.a8c197b8.js";import"./useRefs.e81831e2.js";import"./Form.48352728.js";import"./Col.a2eadc78.js";import"./useFlexGapSupport.474c31b7.js";import"./useSize.bb4e5ce5.js";import"./index.81899e8a.js";import"./index.ffb8ac7d.js";import"./index.dd1f987c.js";import"./uuid.2b29000c.js";import"./download.bb4c9304.js";import"./base64Conver.08b9f4ec.js";import"./index.31930d74.js";import"./index.1d29734e.js";import"./uniqBy.ac0f9c38.js";const G=[{field:"account",label:"\u7528\u6237\u540D",component:"Input",helpMessage:["\u672C\u5B57\u6BB5\u6F14\u793A\u5F02\u6B65\u9A8C\u8BC1","\u4E0D\u80FD\u8F93\u5165\u5E26\u6709admin\u7684\u7528\u6237\u540D"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7528\u6237\u540D"},{validator(o,t){return new Promise((e,u)=>{y(t).then(()=>e()).catch(s=>{u(s.message||"\u9A8C\u8BC1\u5931\u8D25")})})}}]},{field:"pwd",label:"\u5BC6\u7801",component:"InputPassword",required:!0,ifShow:!1},{label:"\u89D2\u8272",field:"role",component:"ApiSelect",componentProps:{api:R,labelField:"roleName",valueField:"roleValue"},required:!0},{field:"dept",label:"\u6240\u5C5E\u90E8\u95E8",component:"TreeSelect",componentProps:{fieldNames:{label:"deptName",key:"id",value:"id"},getPopupContainer:()=>document.body},required:!0},{field:"nickname",label:"\u6635\u79F0",component:"Input",required:!0},{label:"\u90AE\u7BB1",field:"email",component:"Input",required:!0},{label:"\u5907\u6CE8",field:"remark",component:"InputTextArea"}],Q=N({name:"AccountModal",components:{BasicModal:k,BasicForm:S},emits:["success","register"],setup(o,{emit:t}){const e=b(!0),u=b(""),[s,{setFieldsValue:l,updateSchema:n,resetFields:a,validate:r}]=q({labelWidth:100,baseColProps:{span:24},schemas:G,showActionButtonGroup:!1,actionColOptions:{span:23}}),[p,{setModalProps:c,closeModal:C}]=I(i=>f(this,null,function*(){a(),c({confirmLoading:!1}),e.value=!!(i!=null&&i.isUpdate),m(e)&&(u.value=i.record.id,l(d({},i.record)));const A=yield L();n([{field:"pwd",show:!m(e)},{field:"dept",componentProps:{treeData:A}}])})),v=T(()=>m(e)?"\u7F16\u8F91\u8D26\u53F7":"\u65B0\u589E\u8D26\u53F7");function w(){return f(this,null,function*(){try{const i=yield r();c({confirmLoading:!0}),console.log(i),C(),t("success",{isUpdate:m(e),values:F(d({},i),{id:u.value})})}finally{c({confirmLoading:!1})}})}return{registerModal:p,registerForm:s,getTitle:v,handleSubmit:w}}});function W(o,t,e,u,s,l){const n=h("BasicForm"),a=h("BasicModal");return U(),O(a,x(o.$attrs,{onRegister:o.registerModal,title:o.getTitle,onOk:o.handleSubmit}),{default:V(()=>[j(n,{onRegister:o.registerForm},null,8,["onRegister"])]),_:1},16,["onRegister","title","onOk"])}var qe=$(Q,[["render",W]]);export{qe as default};
