var S=Object.defineProperty;var F=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var j=(a,o,t)=>o in a?S(a,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[o]=t,b=(a,o)=>{for(var t in o||(o={}))V.call(o,t)&&j(a,t,o[t]);if(F)for(var t of F(o))N.call(o,t)&&j(a,t,o[t]);return a};var m=(a,o,t)=>new Promise((u,r)=>{var n=i=>{try{s(t.next(i))}catch(p){r(p)}},d=i=>{try{s(t.throw(i))}catch(p){r(p)}},s=i=>i.done?u(i.value):Promise.resolve(i.value).then(n,d);s((t=t.apply(a,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-BkgeZpOO.js";import{b as $}from"./depart.api-C9T5xfw6.js";import{o as O,u as q}from"./depart.data-DDyAushI.js";import{C as E}from"./index-CYriLmQo.js";import{u as H,B as J}from"./useForm-8o5KRzWo.js";import"./componentMap-7D1QIeNI.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./useFormItem-CWa0w7fA.js";import"./index-CF_FJn6P.js";import"./BasicModal-BBgVjypv.js";import"./ModalHeader-jGKMr-DQ.js";import"./useTimeout-DC8132dd.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./index-CxQILSKV.js";import"./useWindowSizeFn-BxrEMPtP.js";import"./index-BRTtls-l.js";import"./index-DOuVMe-q.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.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 K={class:"j-box-bottom-button offset-20",style:{"margin-top":"30px"}},Jt=R({__name:"DepartFormTab",props:{data:{type:Object,default:()=>({})},rootTreeData:{type:Array,default:()=>[]}},emits:["success"],setup(a,{emit:o}){const{prefixCls:t}=E("j-depart-form-content"),u=o,r=a,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=r==null?void 0:r.data)!=null&&e.parentId?O.child:O.root});A(()=>{f([{field:"parentId",componentProps:{disabled:!0}},{field:"orgCode",componentProps:{disabled:!0}}]),y(()=>r.data,()=>m(this,null,function*(){let e=l(r.data);typeof e!="object"&&(e={}),s.value=e,yield p(),yield C(b({},e))}),{deep:!0,immediate:!0}),y(()=>r.rootTreeData,()=>m(this,null,function*(){f([{field:"parentId",componentProps:{treeData:r.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{Jt as default};
