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-ARbUvvsq.js";import{B as V}from"./index-D2AmS0aU.js";import{b as G}from"./depart.api-0qTriT9h.js";import{o as B,u as N}from"./depart.data-DDyAushI.js";import{u as $,B as q}from"./useForm-CcjrODHR.js";import{a8 as z}from"./index-B_2CoVdl.js";import"./componentMap-CzCGDP7x.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./useFormItem-CWa0w7fA.js";import"./index-Dz2zbQB_.js";import"./index-exs4VcBw.js";import"./index-DAURrYyA.js";import"./index-ByLO0zSl.js";import"./useTimeout-CB9F1PLu.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./BasicModal-D3g2CFhF.js";import"./ModalHeader-C-C0dUi_.js";import"./useWindowSizeFn-C3WExEpc.js";import"./download-2tYEzlDW.js";import"./base64Conver-24EVOS6V.js";import"./index-Cgt544dC.js";import"./index-BZ9ST2iq.js";import"./useCountdown-ImUE7YaG.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-BQIJUcBR.js";import"./props-BCVPj-bG.js";import"./JSelectBiz-CJyWq5s2.js";import"./JAddInput-YFlAniYT.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-CkL00Q0a.js";import"./index-BKs2x_To.js";import"./bem-C6eT35UB.js";import"./props-BLY2qIO5.js";import"./useContextMenu-CSt5a1-F.js";import"./JDictSelectTag-CxpDdimB.js";import"./JSelectDept-wKz_Qtmc.js";import"./JPopup-BJBYqoWe.js";import"./JEllipsis-Cn7GCKHR.js";import"./JUpload-DzM-D4DX.js";import"./index-khU3p_On.js";import"./index-DPEnuI0R.js";import"./index-Cnb8BkwG.js";import"./JAreaLinkage-CSgDAlrn.js";import"./JCodeEditor-esTLnfS3.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-DclSHT47.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};
