var S=Object.defineProperty;var F=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var j=(r,o,t)=>o in r?S(r,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[o]=t,b=(r,o)=>{for(var t in o||(o={}))V.call(o,t)&&j(r,t,o[t]);if(F)for(var t of F(o))N.call(o,t)&&j(r,t,o[t]);return r};var m=(r,o,t)=>new Promise((u,a)=>{var n=i=>{try{s(t.next(i))}catch(p){a(p)}},d=i=>{try{s(t.throw(i))}catch(p){a(p)}},s=i=>i.done?u(i.value):Promise.resolve(i.value).then(n,d);s((t=t.apply(r,o)).next())});import{d as R,f as g,e as U,o as A,w as y,u as l,U as B,a2 as G,ad as z,af as v,k as _,a4 as D,a6 as M,G as h}from"./vue-vendor-CxLCUzY4.js";import"./index-ByX9XNkE.js";import{b as $}from"./depart.api-DHG2p2Yd.js";import{o as O,u as q}from"./depart.data-DDyAushI.js";import{C as E}from"./index-CLZzJyTP.js";import{u as H,B as J}from"./useForm-Dx3lJ3DG.js";import"./componentMap-DpsJvoqz.js";import"./antd-vue-vendor-CahNzUUa.js";import"./useFormItem-IOFWTdED.js";import"./index-XZKTTfG1.js";import"./BasicModal-B8XmAOm7.js";import"./ModalHeader-DIFQSP_0.js";import"./useTimeout-KpZCXEcl.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-DvqyyN77.js";import"./useWindowSizeFn-D9PllI8g.js";import"./index-DS3utcig.js";import"./index-BZbg0EjM.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.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 K={class:"j-box-bottom-button offset-20",style:{"margin-top":"30px"}},Kt=R({__name:"DepartFormTab",props:{data:{type:Object,default:()=>({})},rootTreeData:{type:Array,default:()=>[]}},emits:["success"],setup(r,{emit:o}){const{prefixCls:t}=E("j-depart-form-content"),u=o,a=r,n=g(!1),d=g(!0),s=g({}),[i,{resetFields:p,setFieldsValue:C,validate:k,updateSchema:f}]=H({schemas:q().basicFormSchema,showActionButtonGroup:!1}),w=U(()=>{var e;return(e=a==null?void 0:a.data)!=null&&e.parentId?O.child:O.root});A(()=>{f([{field:"parentId",componentProps:{disabled:!0}},{field:"orgCode",componentProps:{disabled:!0}}]),y(()=>a.data,()=>m(this,null,function*(){let e=l(a.data);typeof e!="object"&&(e={}),s.value=e,yield p(),yield C(b({},e))}),{deep:!0,immediate:!0}),y(()=>a.rootTreeData,()=>m(this,null,function*(){f([{field:"parentId",componentProps:{treeData:a.rootTreeData}}])}),{deep:!0,immediate:!0}),y(w,()=>m(this,null,function*(){f([{field:"orgCategory",componentProps:{options:w.value}}])}),{immediate:!0})});function I(){return m(this,null,function*(){yield p(),yield C(b({},s.value))})}function T(){return m(this,null,function*(){try{n.value=!0;let e=yield k();e=Object.assign({},s.value,e),yield $(e,d.value),u("success"),Object.assign(s.value,e)}finally{n.value=!1}})}return(e,c)=>{const x=B("a-button"),P=B("a-spin");return G(),z(P,{spinning:n.value},{default:v(()=>[_(l(J),{onRegister:l(i)},null,8,["onRegister"]),D("div",K,[D("div",{class:M(["j-box-bottom-button-float",[`${l(t)}`]])},[_(x,{preIcon:"ant-design:sync-outlined",onClick:I},{default:v(()=>c[0]||(c[0]=[h("重置")])),_:1}),_(x,{type:"primary",preIcon:"ant-design:save-filled",onClick:T},{default:v(()=>c[1]||(c[1]=[h("保存")])),_:1})],2)])]),_:1},8,["spinning"])}}});export{Kt as default};
