2 lines
2.7 KiB
JavaScript
2 lines
2.7 KiB
JavaScript
import{bT as i,fd as c,cN as r,eK as p,fe as m,eD as f}from"./index.867f48c0.js";import{T as b}from"./index.0a1c386f.js";import{S as h}from"./index.68c934d6.js";const g=[{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),i(h,{checked:e.is_enable==1,checkedChildren:"\u6B63\u5E38",unCheckedChildren:"\u7981\u7528",loading:e.pendingStatus,onChange:t=>{e.pendingStatus=!0,c(e.id).then(()=>{e.is_enable=t?1:0,r.success("\u72B6\u6001\u4FEE\u6539\u6210\u529F")}).catch(({msg:a})=>{r.error(a)}).finally(()=>{e.pendingStatus=!1})}}))},{title:"\u72B6\u6001",dataIndex:"status",width:180,customRender:({record:e})=>{var n,l;const t=e.status,u=[{value:1,color:"green",label:"\u5728\u804C"},{value:2,color:"pink",label:"\u79BB\u804C"},{value:3,color:"orange",label:"\u4F11\u5047"}].find(d=>d.value===t),o=(n=u==null?void 0:u.color)!=null?n:"red",s=(l=u==null?void 0:u.label)!=null?l:t;return i(b,{color:o},()=>s)}},{width:180,title:"\u64CD\u4F5C",dataIndex:"action",align:"center",fixed:void 0}],I=[],C=[{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:p,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,t){return new Promise((a,u)=>{if(!t||m(t))return a();u("\u624B\u673A\u53F7\u683C\u5F0F\u4E0D\u6B63\u786E")})}}]},{field:"base_ids",label:"\u57FA\u5730\u6570\u636E",required:!1,component:"ApiSelect",componentProps:{api:f,labelField:"name",valueField:"id",mode:"multiple"}}],S=[{field:"password",label:"\u5BC6\u7801",required:!0,component:"InputPassword"},{field:"password_confirmation",label:"\u786E\u8BA4\u5BC6\u7801",required:!0,component:"InputPassword"}];export{C as a,g as c,S as p,I as s};
|