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-ByX9XNkE.js";import{B as V}from"./index-XZKTTfG1.js";import{b as G}from"./depart.api-DHG2p2Yd.js";import{o as B,u as N}from"./depart.data-DDyAushI.js";import{u as $,B as q}from"./useForm-Dx3lJ3DG.js";import{a8 as z}from"./index-CLZzJyTP.js";import"./componentMap-DpsJvoqz.js";import"./antd-vue-vendor-CahNzUUa.js";import"./useFormItem-IOFWTdED.js";import"./index-DS3utcig.js";import"./index-BZbg0EjM.js";import"./index-DvqyyN77.js";import"./index-CrdW4fN1.js";import"./useTimeout-KpZCXEcl.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./BasicModal-B8XmAOm7.js";import"./ModalHeader-DIFQSP_0.js";import"./useWindowSizeFn-D9PllI8g.js";import"./download-DopMSmFN.js";import"./base64Conver-24EVOS6V.js";import"./index-CDa2_aYE.js";import"./index-D0jTtUNS.js";import"./useCountdown-BpP55PQ2.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-CfAGgHjD.js";import"./props-BtZrRNiI.js";import"./JSelectBiz-CLnJTMe2.js";import"./JAddInput-B36c3B5x.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-C7yPiS0L.js";import"./index-44tRnyoF.js";import"./bem-DT3DdmOs.js";import"./props-CG-jAkbI.js";import"./useContextMenu-BGU2vdqV.js";import"./JImageUpload-BFwNYdm5.js";import"./JDictSelectTag-CfF54ALX.js";import"./JSelectDept-CaEHrQp6.js";import"./JPopup-BvqhHpPl.js";import"./JEllipsis-C_gT_vEQ.js";import"./JUpload-DgDEmizw.js";import"./index-Bn2zmO2L.js";import"./index-CEznvAVZ.js";import"./index-CfAukas3.js";import"./JAreaLinkage-M9TGy8nY.js";import"./JCodeEditor-CR57XeIe.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CWOTSpxK.js";const Eo=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{Eo as default};
