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-BN26Feep.js";import{b as $}from"./depart.api-B8q8MC-j.js";import{o as O,u as q}from"./depart.data-DDyAushI.js";import{C as E}from"./index-Cy4uayzW.js";import{u as H,B as J}from"./useForm-DfoT2G6J.js";import"./componentMap-0iK4HQBq.js";import"./antd-vue-vendor-CahNzUUa.js";import"./useFormItem-IOFWTdED.js";import"./index-zKZnG1QC.js";import"./BasicModal-sKcs_9Ir.js";import"./ModalHeader-ByCVDoqO.js";import"./useTimeout-gJpgadD6.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-Bdn0r8CG.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-Bn4f3tzD.js";import"./base64Conver-24EVOS6V.js";import"./index-D6H6KsT6.js";import"./index-CLxBW_h0.js";import"./useCountdown-2P9HvnfJ.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-B98pRPrS.js";import"./props-CtlWAg-s.js";import"./JSelectBiz-vYDBA0SK.js";import"./JAddInput-DP4caUmw.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-tDBMxW9-.js";import"./index-CNQBnF3P.js";import"./bem-IZKqD41e.js";import"./props-CG-jAkbI.js";import"./useContextMenu-Q6J5bB_u.js";import"./JImageUpload-C5OCTlCG.js";import"./JDictSelectTag-CalJXNVe.js";import"./JSelectDept-D-TUaHvK.js";import"./JPopup-CVHkQZFq.js";import"./JEllipsis-TuDc52fh.js";import"./JUpload-DSWoDwh2.js";import"./index-B4vNk56t.js";import"./index-Dc7Jr5-j.js";import"./index-Dm1rPBfc.js";import"./JAreaLinkage-CTMEfTuh.js";import"./JCodeEditor-U9QIstNN.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CZdChTcP.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};
