import{P as z,u as q}from"./index.30bf9322.js";import{P as N}from"./index.e0ac4867.js";import{_ as T,y as B,c as j,z as M,B as R,a as W}from"./index.13ae9900.js";import{_ as X}from"./avatar.b64ff0bc.js";import{d as G,V as H,v as J,y as K,r as n,W as A,a as f,i as e,w as o,X as h,b as p,E,o as u,F as O,h as Q,f as g,j as _,a7 as Y,a8 as Z}from"./vendor.bbaa8c82.js";const x=G({components:{Pagination:z,Popup:N},setup(){const a=H({username:"",nickname:"",role:""}),s=J([]),{pager:y,requestApi:r,resetParams:w,resetPage:C}=q({callback:B,params:a}),c=l=>{j({id:l.id,username:l.username,nickname:l.nickname,role:l.role,isDisable:l.isDisable,multipoint_login:l.multipoint_login}).finally(()=>{r()})},d=async(l,D)=>{await M({isDisable:l,id:D}),r(),E({type:"success",message:"\u64CD\u4F5C\u6210\u529F"})},v=l=>{R({id:l}).then(()=>{r(),E({type:"success",message:"\u5220\u9664\u6210\u529F"})})},b=()=>{W({page_type:1}).then(l=>{s.value=l.lists})};return K(()=>{r(),b()}),{formData:a,roleList:s,pager:y,requestApi:r,resetParams:w,resetPage:C,adminLists:B,changeStatus:c,handleDelete:v,handleStatusChange:d}}}),ee=a=>(Y("data-v-b1f4a4f8"),a=a(),Z(),a),ae={class:"admin"},te={class:"m-l-20"},oe=_("\u67E5\u8BE2"),le=_("\u91CD\u7F6E"),ne=_("\u65B0\u589E\u7BA1\u7406\u5458"),se={class:"m-t-15"},ie={key:0},ue=ee(()=>g("img",{class:"default-avatar",src:X},null,-1)),re=[ue],de={key:1},me=_("\u7F16\u8F91"),pe=_("\u5220\u9664"),_e={class:"flex row-right"};function ce(a,s,y,r,w,C){const c=n("el-input"),d=n("el-form-item"),v=n("el-option"),b=n("el-select"),l=n("el-button"),D=n("el-form"),V=n("el-card"),k=n("router-link"),i=n("el-table-column"),P=n("el-avatar"),L=n("el-switch"),I=n("popup"),S=n("el-table"),U=n("pagination"),F=A("perm"),$=A("loading");return u(),f("div",ae,[e(V,{shadow:"never"},{default:o(()=>[e(D,{class:"ls-form",model:a.formData,"label-width":"80px",size:"small",inline:""},{default:o(()=>[e(d,{label:"\u8D26\u53F7\uFF1A"},{default:o(()=>[e(c,{modelValue:a.formData.username,"onUpdate:modelValue":s[0]||(s[0]=t=>a.formData.username=t),class:"ls-input"},null,8,["modelValue"])]),_:1}),e(d,{label:"\u540D\u79F0\uFF1A"},{default:o(()=>[e(c,{modelValue:a.formData.nickname,"onUpdate:modelValue":s[1]||(s[1]=t=>a.formData.nickname=t),class:"ls-input"},null,8,["modelValue"])]),_:1}),e(d,{label:"\u89D2\u8272\uFF1A"},{default:o(()=>[e(b,{modelValue:a.formData.role,"onUpdate:modelValue":s[2]||(s[2]=t=>a.formData.role=t),placeholder:"\u5168\u90E8"},{default:o(()=>[(u(!0),f(O,null,Q(a.roleList,(t,m)=>(u(),p(v,{key:m,label:t.name,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(d,null,{default:o(()=>[g("div",te,[e(l,{type:"primary",onClick:a.resetPage},{default:o(()=>[oe]),_:1},8,["onClick"]),e(l,{onClick:a.resetParams},{default:o(()=>[le]),_:1},8,["onClick"])])]),_:1})]),_:1},8,["model"])]),_:1}),h((u(),p(V,{class:"m-t-15",shadow:"never"},{default:o(()=>[e(k,{to:"/permission/admin/edit"},{default:o(()=>[h((u(),p(l,{type:"primary",size:"small"},{default:o(()=>[ne]),_:1})),[[F,["system:admin:add"]]])]),_:1}),g("div",se,[e(S,{data:a.pager.lists},{default:o(()=>[e(i,{label:"ID",prop:"id","min-width":"60"}),e(i,{label:"\u5934\u50CF","min-width":"100"},{default:o(({row:t})=>[t.avatar==""?(u(),f("div",ie,re)):(u(),f("div",de,[e(P,{size:50,src:t.avatar},null,8,["src"])]))]),_:1}),e(i,{label:"\u8D26\u53F7",prop:"username","min-width":"100"}),e(i,{label:"\u540D\u79F0",prop:"nickname","min-width":"100"}),e(i,{label:"\u89D2\u8272",prop:"role","min-width":"100"}),e(i,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime","min-width":"150"}),e(i,{label:"\u6700\u8FD1\u767B\u5F55\u65F6\u95F4",prop:"lastLoginTime","min-width":"150"}),e(i,{label:"\u6700\u8FD1\u767B\u5F55IP",prop:"lastLoginIp","min-width":"100"}),e(i,{label:"\u72B6\u6001","min-width":"100"},{default:o(t=>[e(L,{modelValue:t.row.isDisable,"onUpdate:modelValue":m=>t.row.isDisable=m,"active-value":0,"inactive-value":1,onChange:m=>a.handleStatusChange(m,t.row.id)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),e(i,{label:"\u64CD\u4F5C",width:"150",fixed:"right"},{default:o(({row:t})=>[h((u(),p(k,{class:"m-r-10",to:{path:"/permission/admin/edit",query:{id:t.id}}},{default:o(()=>[e(l,{type:"text"},{default:o(()=>[me]),_:1})]),_:2},1032,["to"])),[[F,["system:admin:edit"]]]),h((u(),p(I,{class:"m-r-10 inline",onConfirm:m=>a.handleDelete(t.id)},{trigger:o(()=>[e(l,{type:"text"},{default:o(()=>[pe]),_:1})]),_:2},1032,["onConfirm"])),[[F,["system:admin:del"]]])]),_:1})]),_:1},8,["data"])]),g("div",_e,[e(U,{modelValue:a.pager,"onUpdate:modelValue":s[3]||(s[3]=t=>a.pager=t),layout:"total, prev, pager, next, jumper",onChange:a.requestApi},null,8,["modelValue","onChange"])])]),_:1})),[[$,a.pager.loading]])])}var De=T(x,[["render",ce],["__scopeId","data-v-b1f4a4f8"]]);export{De as default};
