import{P as z}from"./index.58a42f0f.js";import{P as q}from"./index.f48a7db7.js";import{_ as N,z as B,c as T,B as j,C as M,a as R,y as X}from"./index.195d4b6e.js";import{u as Y}from"./pages.de166038.js";import{d as Z,X as G,y as H,A as J,r as n,Y as E,a as p,i as e,w as o,Z as h,b as _,E as A,o as u,F as K,h as O,f as g,k as c,p as Q,j as W}from"./vendor.26ab8f26.js";const x=Z({components:{Pagination:z,Popup:q},setup(){const a=G({username:"",nickname:"",role:""}),s=H([]),{pager:y,requestApi:d,resetParams:k,resetPage:w}=Y({callback:B,params:a}),f=l=>{T({id:l.id,username:l.username,nickname:l.nickname,role:l.role,isDisable:l.isDisable,multipoint_login:l.multipoint_login}).finally(()=>{d()})},r=async(l,D)=>{await j({isDisable:l,id:D}),d(),A({type:"success",message:"\u64CD\u4F5C\u6210\u529F"})},v=l=>{M({id:l}).then(()=>{d(),A({type:"success",message:"\u5220\u9664\u6210\u529F"})})},b=()=>{R({page_type:1}).then(l=>{s.value=l.lists})};return J(()=>{d(),b()}),{formData:a,roleList:s,pager:y,requestApi:d,resetParams:k,resetPage:w,adminLists:B,changeStatus:f,handleDelete:v,handleStatusChange:r}}}),ee=a=>(Q("data-v-464199f4"),a=a(),W(),a),ae={class:"admin"},te={class:"m-l-20"},oe=c("\u67E5\u8BE2"),le=c("\u91CD\u7F6E"),ne=c(" \u65B0\u589E\u7BA1\u7406\u5458 "),se={class:"m-t-15"},ie={key:0},ue=ee(()=>g("img",{class:"default-avatar",src:X},null,-1)),de=[ue],re={key:1},me=c("\u7F16\u8F91"),pe={key:0},_e=c("\u5220\u9664"),ce={class:"flex row-right"};function fe(a,s,y,d,k,w){const f=n("el-input"),r=n("el-form-item"),v=n("el-option"),b=n("el-select"),l=n("el-button"),D=n("el-form"),C=n("el-card"),V=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=E("perm"),$=E("loading");return u(),p("div",ae,[e(C,{shadow:"never"},{default:o(()=>[e(D,{class:"ls-form",model:a.formData,"label-width":"80px",size:"small",inline:""},{default:o(()=>[e(r,{label:"\u8D26\u53F7\uFF1A"},{default:o(()=>[e(f,{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:o(()=>[e(f,{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: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),p(K,null,O(a.roleList,(t,m)=>(u(),_(v,{key:m,label:t.name,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(r,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(),_(C,{class:"m-t-15",shadow:"never"},{default:o(()=>[e(V,{to:"/permission/admin/edit"},{default:o(()=>[h((u(),_(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(),p("div",ie,de)):(u(),p("div",re,[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:"\u90E8\u95E8",prop:"dept","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(),_(V,{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"]]]),t.id==1?(u(),p("div",pe)):h((u(),_(I,{key:1,class:"m-r-10 inline",onConfirm:m=>a.handleDelete(t.id)},{trigger:o(()=>[e(l,{type:"text"},{default:o(()=>[_e]),_:1})]),_:2},1032,["onConfirm"])),[[F,["system:admin:del"]]])]),_:1})]),_:1},8,["data"])]),g("div",ce,[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 Fe=N(x,[["render",fe],["__scopeId","data-v-464199f4"]]);export{Fe as default};
