import{P as U,u as $}from"./index.a44de264.js";import{P as q}from"./index.f84801a7.js";import{a as C,b as I,c as S,d as z,e as N}from"./auth.a54adaef.js";import{_ as T}from"./index.b32171ca.js";import{d as j,r as R,q as M,o as G,a as n,aa as H,b as _,c as V,f as e,w as l,ab as J,j as k,F as K,l as O,e as g,m}from"./vendor.d574ef89.js";const Q=j({components:{Pagination:U,Popup:q},setup(){const a=R({username:"",nickname:"",role:""}),s=M([]),{pager:b,requestApi:u,resetParams:v,resetPage:D}=$({callback:C,params:a}),p=o=>{I({id:o.id,username:o.username,nickname:o.nickname,role:o.role,isDisable:o.isDisable,multipoint_login:o.multipoint_login}).finally(()=>{u()})},r=async(o,h)=>{await S({isDisable:o,id:h}),u()},c=o=>{z({id:o}).then(()=>{u()})},f=()=>{N({page_type:1}).then(o=>{s.value=o.lists})};return G(()=>{u(),f()}),{formData:a,roleList:s,pager:b,requestApi:u,resetParams:v,resetPage:D,adminLists:C,changeStatus:p,handleDelete:c,handleStatusChange:r}}}),W={class:"admin"},X={class:"m-l-20"},Y=m("\u67E5\u8BE2"),Z=m("\u91CD\u7F6E"),x=m("\u65B0\u589E\u7BA1\u7406\u5458"),ee={class:"m-t-15"},ae=m("\u7F16\u8F91"),le=m("\u5220\u9664"),te={class:"flex row-right"};function oe(a,s,b,u,v,D){const p=n("el-input"),r=n("el-form-item"),c=n("el-option"),f=n("el-select"),o=n("el-button"),h=n("el-form"),F=n("el-card"),w=n("router-link"),i=n("el-table-column"),y=n("el-avatar"),B=n("el-switch"),A=n("popup"),P=n("el-table"),E=n("pagination"),L=H("loading");return _(),V("div",W,[e(F,{shadow:"never"},{default:l(()=>[e(h,{class:"ls-form",model:a.formData,"label-width":"80px",size:"small",inline:""},{default:l(()=>[e(r,{label:"\u8D26\u53F7\uFF1A"},{default:l(()=>[e(p,{modelValue:a.formData.username,"onUpdate:modelValue":s[0]||(s[0]=t=>a.formData.username=t),class:"ls-input"},null,8,["modelValue"])]),_:1}),e(r,{label:"\u540D\u79F0\uFF1A"},{default:l(()=>[e(p,{modelValue:a.formData.nickname,"onUpdate:modelValue":s[1]||(s[1]=t=>a.formData.nickname=t),class:"ls-input"},null,8,["modelValue"])]),_:1}),e(r,{label:"\u89D2\u8272\uFF1A"},{default:l(()=>[e(f,{modelValue:a.formData.role,"onUpdate:modelValue":s[2]||(s[2]=t=>a.formData.role=t),placeholder:"\u5168\u90E8"},{default:l(()=>[(_(!0),V(K,null,O(a.roleList,(t,d)=>(_(),k(c,{key:d,label:t.name,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(r,null,{default:l(()=>[g("div",X,[e(o,{type:"primary",onClick:a.resetPage},{default:l(()=>[Y]),_:1},8,["onClick"]),e(o,{onClick:a.resetParams},{default:l(()=>[Z]),_:1},8,["onClick"])])]),_:1})]),_:1},8,["model"])]),_:1}),J((_(),k(F,{class:"m-t-15",shadow:"never"},{default:l(()=>[e(w,{to:"/permission/admin/edit"},{default:l(()=>[e(o,{type:"primary",size:"small"},{default:l(()=>[x]),_:1})]),_:1}),g("div",ee,[e(P,{data:a.pager.lists},{default:l(()=>[e(i,{label:"ID",prop:"id","min-width":"60"}),e(i,{label:"\u5934\u50CF","min-width":"100"},{default:l(({row:t})=>[e(y,{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:l(t=>[e(B,{modelValue:t.row.isDisable,"onUpdate:modelValue":d=>t.row.isDisable=d,"active-value":0,"inactive-value":1,onChange:d=>a.handleStatusChange(d,t.row.id)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),e(i,{label:"\u64CD\u4F5C",width:"150",fixed:"right"},{default:l(({row:t})=>[e(w,{class:"m-r-10",to:{path:"/permission/admin/edit",query:{id:t.id}}},{default:l(()=>[e(o,{type:"text"},{default:l(()=>[ae]),_:1})]),_:2},1032,["to"]),e(A,{class:"m-r-10 inline",onConfirm:d=>a.handleDelete(t.id)},{trigger:l(()=>[e(o,{type:"text"},{default:l(()=>[le]),_:1})]),_:2},1032,["onConfirm"])]),_:1})]),_:1},8,["data"])]),g("div",te,[e(E,{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})),[[L,a.pager.loading]])])}var de=T(Q,[["render",oe],["__scopeId","data-v-d0fc7a52"]]);export{de as default};
