2 lines
3.5 KiB
JavaScript
2 lines
3.5 KiB
JavaScript
var d=(e,u,t)=>new Promise((a,r)=>{var i=n=>{try{l(t.next(n))}catch(o){r(o)}},s=n=>{try{l(t.throw(n))}catch(o){r(o)}},l=n=>n.done?a(n.value):Promise.resolve(n.value).then(i,s);l((t=t.apply(e,u)).next())});import{bV as c,f_ as m,cu as p,cI as f,fv as b,f$ as h,fc as F}from"./index.203f4f59.js";import{T as w}from"./index.f088aa20.js";import{S as I}from"./index.7d012f39.js";const D=[{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,auth:"endpoint.admin_users.enable",customRender:({record:e})=>(Reflect.has(e,"pendingStatus")||(e.pendingStatus=!1),c(I,{checked:e.is_enable==1,checkedChildren:"\u6B63\u5E38",unCheckedChildren:"\u7981\u7528",loading:e.pendingStatus,onChange:u=>{e.pendingStatus=!0,m(e.id).then(()=>{e.is_enable=u?1:0,p.success("\u72B6\u6001\u4FEE\u6539\u6210\u529F")}).catch(({msg:t})=>{p.error(t)}).finally(()=>{e.pendingStatus=!1})}}))},{title:"\u72B6\u6001",dataIndex:"status",width:180,customRender:({record:e})=>{var s,l;const u=e.status,a=[{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===u),r=(s=a==null?void 0:a.color)!=null?s:"red",i=(l=a==null?void 0:a.label)!=null?l:u;return c(w,{color:r},()=>i)}},{width:180,title:"\u5C01\u7981\u65F6\u95F4",dataIndex:"banned_at",format(e){return e?f(e).format("YYYY-MM-DD HH:mm:ss"):"-"}},{width:220,title:"\u64CD\u4F5C",dataIndex:"action",align:"center",fixed:void 0}],E=[{field:"name",label:"\u7528\u6237\u540D",component:"Input",colProps:{span:8}}],_=[{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 b({});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,u){return new Promise((t,a)=>{if(!u||h(u))return t();a("\u624B\u673A\u53F7\u683C\u5F0F\u4E0D\u6B63\u786E")})}}]},{field:"view_all_bases",label:"\u5168\u90E8\u57FA\u5730",component:"Checkbox",defaultValue:!0,componentProps:{}},{field:"base_ids",label:"\u57FA\u5730\u6570\u636E",required:!1,component:"ApiSelect",ifShow:({values:e})=>!e.view_all_bases,componentProps:{api:()=>d(void 0,null,function*(){const{data:e}=yield F();return e}),labelField:"name",valueField:"id",mode:"multiple",filterOption:(e,u)=>u==null?void 0:u.label.includes(e)}}],v=[{field:"password",label:"\u5BC6\u7801",required:!0,component:"InputPassword"},{field:"password_confirmation",label:"\u786E\u8BA4\u5BC6\u7801",required:!0,component:"InputPassword"}];export{_ as a,D as c,v as p,E as s};
|