var M=Object.defineProperty;var d=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var m=(t,o,e)=>o in t?M(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,f=(t,o)=>{for(var e in o||(o={}))_.call(o,e)&&m(t,e,o[e]);if(d)for(var e of d(o))v.call(o,e)&&m(t,e,o[e]);return t};var p=(t,o,e)=>new Promise((n,s)=>{var c=a=>{try{r(e.next(a))}catch(u){s(u)}},i=a=>{try{r(e.throw(a))}catch(u){s(u)}},r=a=>a.done?n(a.value):Promise.resolve(a.value).then(c,i);r((e=e.apply(t,o)).next())});import{B as P,a as D}from"./index.c05f9254.js";import{B as C}from"./BasicForm.d11b68fd.js";import{u as I}from"./useForm.868c8e81.js";import{bM as N,a as S,r as k,k as b,f as w,aP as y,aQ as g,o as T,aR as R,p as x,j as $,aU as A}from"./index.0d073eaa.js";import{T as q}from"./index.e317a008.js";import{a as L}from"./system.d37449cd.js";const X=[{title:"\u90E8\u95E8\u540D\u79F0",dataIndex:"deptName",width:160,align:"left"},{title:"\u6392\u5E8F",dataIndex:"orderNo",width:50},{title:"\u72B6\u6001",dataIndex:"status",width:80,customRender:({record:t})=>{const e=~~t.status===0,n=e?"green":"red",s=e?"\u542F\u7528":"\u505C\u7528";return N(q,{color:n},()=>s)}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createTime",width:180},{title:"\u5907\u6CE8",dataIndex:"remark"}],Y=[{field:"deptName",label:"\u90E8\u95E8\u540D\u79F0",component:"Input",colProps:{span:8}},{field:"status",label:"\u72B6\u6001",component:"Select",componentProps:{options:[{label:"\u542F\u7528",value:"0"},{label:"\u505C\u7528",value:"1"}]},colProps:{span:8}}],O=[{field:"deptName",label:"\u90E8\u95E8\u540D\u79F0",component:"Input",required:!0},{field:"parentDept",label:"\u4E0A\u7EA7\u90E8\u95E8",component:"TreeSelect",componentProps:{fieldNames:{label:"deptName",key:"id",value:"id"},getPopupContainer:()=>document.body},required:!0},{field:"orderNo",label:"\u6392\u5E8F",component:"InputNumber",required:!0},{field:"status",label:"\u72B6\u6001",component:"RadioButtonGroup",defaultValue:"0",componentProps:{options:[{label:"\u542F\u7528",value:"0"},{label:"\u505C\u7528",value:"1"}]},required:!0},{label:"\u5907\u6CE8",field:"remark",component:"InputTextArea"}],j=S({name:"DeptModal",components:{BasicModal:P,BasicForm:C},emits:["success","register"],setup(t,{emit:o}){const e=k(!0),[n,{resetFields:s,setFieldsValue:c,updateSchema:i,validate:r}]=I({labelWidth:100,baseColProps:{span:24},schemas:O,showActionButtonGroup:!1}),[a,{setModalProps:u,closeModal:F}]=D(l=>p(this,null,function*(){s(),u({confirmLoading:!1}),e.value=!!(l!=null&&l.isUpdate),b(e)&&c(f({},l.record));const h=yield L();i({field:"parentDept",componentProps:{treeData:h}})})),E=w(()=>b(e)?"\u7F16\u8F91\u90E8\u95E8":"\u65B0\u589E\u90E8\u95E8");function B(){return p(this,null,function*(){try{const l=yield r();u({confirmLoading:!0}),console.log(l),F(),o("success")}finally{u({confirmLoading:!1})}})}return{registerModal:a,registerForm:n,getTitle:E,handleSubmit:B}}});function U(t,o,e,n,s,c){const i=g("BasicForm"),r=g("BasicModal");return T(),R(r,A(t.$attrs,{onRegister:t.registerModal,title:t.getTitle,onOk:t.handleSubmit}),{default:x(()=>[$(i,{onRegister:t.registerForm},null,8,["onRegister"])]),_:1},16,["onRegister","title","onOk"])}var V=y(j,[["render",U]]),Z=Object.freeze(Object.defineProperty({__proto__:null,default:V},Symbol.toStringTag,{value:"Module"}));export{V as D,Z as a,X as c,Y as s};
