var D=Object.defineProperty;var y=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var C=(e,r,o)=>r in e?D(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o,v=(e,r)=>{for(var o in r||(r={}))x.call(r,o)&&C(e,o,r[o]);if(y)for(var o of y(r))P.call(r,o)&&C(e,o,r[o]);return e};var d=(e,r,o)=>new Promise((c,f)=>{var m=i=>{try{a(o.next(i))}catch(l){f(l)}},u=i=>{try{a(o.throw(i))}catch(l){f(l)}},a=i=>i.done?c(i.value):Promise.resolve(i.value).then(m,u);a((o=o.apply(e,r)).next())});import{d as R,c as j,f as w,e as S,u as s,a2 as U,ad as A,af as I,k as L,ag as T}from"./vue-vendor-CxLCUzY4.js";import"./index-BkgeZpOO.js";import{B as V}from"./index-CF_FJn6P.js";import{b as G}from"./depart.api-C9T5xfw6.js";import{o as B,u as N}from"./depart.data-DDyAushI.js";import{u as $,B as q}from"./useForm-8o5KRzWo.js";import{a8 as z}from"./index-CYriLmQo.js";import"./componentMap-7D1QIeNI.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./useFormItem-CWa0w7fA.js";import"./index-BRTtls-l.js";import"./index-DOuVMe-q.js";import"./index-CxQILSKV.js";import"./index-ByLO0zSl.js";import"./useTimeout-DC8132dd.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./BasicModal-BBgVjypv.js";import"./ModalHeader-jGKMr-DQ.js";import"./useWindowSizeFn-BxrEMPtP.js";import"./download-CkbK5et1.js";import"./base64Conver-24EVOS6V.js";import"./index-QMJkXEyl.js";import"./index-Bb_NRLur.js";import"./useCountdown-C3-PRPLY.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-nVFm3ao2.js";import"./props-DoGpHXAD.js";import"./JSelectBiz-BW6f3e--.js";import"./JAddInput-CXT54-j9.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-BTSd5ebC.js";import"./index-BTAl55Kt.js";import"./bem-2ra1afoV.js";import"./props-BLY2qIO5.js";import"./useContextMenu-DYyhcDf7.js";import"./JDictSelectTag-Jqy9TBcS.js";import"./JSelectDept-DorRVguN.js";import"./JPopup-KP1kIsae.js";import"./JEllipsis-287cEHxd.js";import"./JUpload-pyrTRFCz.js";import"./index-Bx9Mnn3N.js";import"./index-B1-pj6uh.js";import"./index-isxCPgHp.js";import"./JAreaLinkage-DFTeDmm8.js";import"./JCodeEditor-_KZ8XnNK.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-XK54XB3r.js";const zo=R({__name:"DepartFormModal",props:{rootTreeData:{type:Array,default:()=>[]}},emits:["success","register"],setup(e,{emit:r}){const o=r,c=e,f=j("prefixCls"),m=w(!1),u=w({}),a=S(()=>m.value?"编辑":"新增"),[i,{resetFields:l,setFieldsValue:F,validate:O,updateSchema:M}]=$({schemas:N().basicFormSchema,showActionButtonGroup:!1}),[_,{setModalProps:g,closeModal:b}]=z(t=>d(this,null,function*(){yield l(),m.value=s(t==null?void 0:t.isUpdate);let n=s(t==null?void 0:t.isChild),h=n?B.child:B.root;M([{field:"parentId",show:n,componentProps:{disabled:n,treeData:c.rootTreeData}},{field:"orgCode",show:!1},{field:"orgCategory",componentProps:{options:h}}]);let p=s(t==null?void 0:t.record);typeof p!="object"&&(p={}),p=Object.assign({departOrder:0,orgCategory:h[0].value},p),u.value=p,yield F(v({},p))}));function k(){return d(this,null,function*(){try{g({confirmLoading:!0});let t=yield O();yield G(t,m.value),b(),o("success")}finally{g({confirmLoading:!1})}})}return(t,n)=>(U(),A(s(V),T({title:a.value,width:800},t.$attrs,{onOk:k,onRegister:s(_)}),{default:I(()=>[L(s(q),{onRegister:s(i)},null,8,["onRegister"])]),_:1},16,["title","onRegister"]))}});export{zo as default};
