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-ARbUvvsq.js";import{b as $}from"./depart.api-0qTriT9h.js";import{o as O,u as q}from"./depart.data-DDyAushI.js";import{C as E}from"./index-B_2CoVdl.js";import{u as H,B as J}from"./useForm-CcjrODHR.js";import"./componentMap-CzCGDP7x.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./useFormItem-CWa0w7fA.js";import"./index-D2AmS0aU.js";import"./BasicModal-D3g2CFhF.js";import"./ModalHeader-C-C0dUi_.js";import"./useTimeout-CB9F1PLu.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./index-DAURrYyA.js";import"./useWindowSizeFn-C3WExEpc.js";import"./index-Dz2zbQB_.js";import"./index-exs4VcBw.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.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 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};
