var d=(e,a,u)=>new Promise((t,i)=>{var o=n=>{try{l(u.next(n))}catch(s){i(s)}},r=n=>{try{l(u.throw(n))}catch(s){i(s)}},l=n=>n.done?t(n.value):Promise.resolve(n.value).then(o,r);l((u=u.apply(e,a)).next())});import{b1 as c,dq as m,d0 as f,dr as b,cQ as h}from"./index.600742c0.js";import{message as p,Switch as F,Tag as w}from"ant-design-vue";const C=[{title:"\u7528\u6237\u540D",dataIndex:"username",width:180},{title:"\u6635\u79F0",dataIndex:"name",width:180},{title:"\u7535\u8BDD",dataIndex:"phone",width:180,customRender:({text:e})=>e||"-"},{title:"\u90E8\u95E8",dataIndex:"department",width:180,customRender:({text:e})=>e||"-"},{title:"\u662F\u5426\u542F\u7528",dataIndex:"is_enable",width:180,customRender:({record:e})=>(Reflect.has(e,"pendingStatus")||(e.pendingStatus=!1),c(F,{checked:e.is_enable==1,checkedChildren:"\u6B63\u5E38",unCheckedChildren:"\u7981\u7528",loading:e.pendingStatus,onChange:a=>{e.pendingStatus=!0,m(e.id).then(()=>{e.is_enable=a?1:0,p.success("\u72B6\u6001\u4FEE\u6539\u6210\u529F")}).catch(({msg:u})=>{p.error(u)}).finally(()=>{e.pendingStatus=!1})}}))},{title:"\u72B6\u6001",dataIndex:"status",width:180,customRender:({record:e})=>{var r,l;const a=e.status,t=[{value:1,color:"green",label:"\u5728\u804C"},{value:2,color:"pink",label:"\u79BB\u804C"},{value:3,color:"orange",label:"\u4F11\u5047"}].find(n=>n.value===a),i=(r=t==null?void 0:t.color)!=null?r:"red",o=(l=t==null?void 0:t.label)!=null?l:a;return c(w,{color:i},()=>o)}},{width:180,title:"\u64CD\u4F5C",dataIndex:"action",align:"center",fixed:void 0}],E=[],S=[{field:"id",label:"\u7528\u6237ID",required:!1,dynamicDisabled:!0,component:"Input",ifShow:({values:e})=>!!e.id},{field:"username",label:"\u7528\u6237\u540D",required:!0,component:"Input"},{field:"password",label:"\u5BC6\u7801",required:!0,component:"InputPassword",ifShow:({values:e})=>!e.id},{field:"name",label:"\u59D3\u540D",required:!0,component:"Input"},{field:"role_id",label:"\u89D2\u8272\u9009\u62E9",required:!0,component:"ApiSelect",componentProps:{api:()=>d(void 0,null,function*(){const{data:e}=yield f({});return e}),labelField:"name",valueField:"id"}},{field:"status",label:"\u72B6\u6001",required:!0,component:"RadioGroup",componentProps:{options:[{label:"\u5728\u804C",value:1},{label:"\u79BB\u804C",value:2},{label:"\u4F11\u5047",value:3}]}},{field:"department",label:"\u90E8\u95E8",required:!1,component:"Input"},{field:"phone",label:"\u624B\u673A\u53F7",component:"Input",componentProps:{type:"number"},rules:[{required:!1,message:"\u8BF7\u8F93\u5165"},{validator(e,a){return new Promise((u,t)=>{if(!a||b(a))return u();t("\u624B\u673A\u53F7\u683C\u5F0F\u4E0D\u6B63\u786E")})}}]},{field:"base_ids",label:"\u57FA\u5730\u6570\u636E",required:!1,component:"ApiSelect",componentProps:{api:()=>d(void 0,null,function*(){const{data:e}=yield h();return e}),labelField:"name",valueField:"id",mode:"multiple"}}],q=[{field:"password",label:"\u5BC6\u7801",required:!0,component:"InputPassword"},{field:"password_confirmation",label:"\u786E\u8BA4\u5BC6\u7801",required:!0,component:"InputPassword"}];export{S as a,C as c,q as p,E as s};