2 lines
5.9 KiB
JavaScript
2 lines
5.9 KiB
JavaScript
import{d as j,n as z,r as x,h as r,c as _,e as n,w as o,a as g,u as a,N as t,i as p,t as s,y as I,I as h,R,B as y,a8 as C,W as S,X as M,E as W,Y as X,ah as Y,aw as q,aj as A,at as G,$ as H,a0 as J}from"./index-4dcc0234.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css */import"./el-form-item-4ed993c7.js";import{_ as K}from"./member_head-a897263d.js";import{l as O,u as Q}from"./site-ac963391.js";import{g as Z}from"./user-1e1ca1a9.js";import{_ as ee}from"./edit-user.vue_vue_type_script_setup_true_lang-238de6d3.js";/* empty css *//* empty css */import"./index-742b412a.js";/* empty css */import"./index.vue_vue_type_style_index_0_lang-5c6c00d9.js";import"./attachment-c69dd9fd.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index.vue_vue_type_script_setup_true_lang-9285296e.js";/* empty css */import"./sys-8ead7f22.js";/* empty css */const te={class:"main-container"},ae={class:"flex justify-between items-center"},le={class:"w-[35px] h-[35px] flex items-center justify-center"},oe=["src"],ne={key:1,src:K,class:"w-[35px] rounded-full"},ie={key:0},se={key:1},re={key:0},me={key:1},pe={class:"mt-[16px] flex justify-end"},He=j({__name:"user",setup(ce){const l=z({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{seach:"",user_type:""}}),k=x(),E=m=>{m&&(m.resetFields(),c())},c=(m=1)=>{l.loading=!0,l.page=m,Z({page:l.page,limit:l.limit,username:l.searchParam.seach,user_type:l.searchParam.user_type}).then(i=>{l.loading=!1,l.data=i.data.data,l.total=i.data.total}).catch(()=>{l.loading=!1})};c();const f=x(null),T=()=>{f.value.setFormData(),f.value.showDialog=!0},U=m=>{f.value.setFormData(m),f.value.showDialog=!0},B=m=>{C.confirm(t("userLockTips"),t("warning"),{confirmButtonText:t("confirm"),cancelButtonText:t("cancel"),type:"warning"}).then(()=>{O(m).then(()=>{c()}).catch(()=>{})})},D=m=>{C.confirm(t("userUnlockTips"),t("warning"),{confirmButtonText:t("confirm"),cancelButtonText:t("cancel"),type:"warning"}).then(()=>{Q(m).then(()=>{c()}).catch(()=>{})})};return(m,i)=>{const N=S,b=M,u=W,P=X,d=Y,v=q,$=A,F=G,L=H,V=J;return r(),_("div",te,[n(L,{class:"box-card !border-none",shadow:"never"},{default:o(()=>[g("div",ae,[n(P,{inline:!0,model:l.searchParam,ref_key:"searchFormRef",ref:k},{default:o(()=>[n(b,{label:a(t)("accountNumber"),prop:"seach"},{default:o(()=>[n(N,{modelValue:l.searchParam.seach,"onUpdate:modelValue":i[0]||(i[0]=e=>l.searchParam.seach=e),class:"input-width",placeholder:a(t)("accountNumberPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),n(b,null,{default:o(()=>[n(u,{type:"primary",onClick:i[1]||(i[1]=e=>c())},{default:o(()=>[p(s(a(t)("search")),1)]),_:1}),n(u,{onClick:i[2]||(i[2]=e=>E(k.value))},{default:o(()=>[p(s(a(t)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"]),n(u,{type:"primary",class:"w-[100px] self-start",onClick:T},{default:o(()=>[p(s(a(t)("addUser")),1)]),_:1})]),g("div",null,[I((r(),h($,{data:l.data,size:"large"},{empty:o(()=>[g("span",null,s(l.loading?"":a(t)("emptyData")),1)]),default:o(()=>[n(d,{label:a(t)("headImg"),width:"100",align:"left"},{default:o(({row:e})=>[g("div",le,[e.head_img?(r(),_("img",{key:0,src:a(R)(e.head_img),class:"w-[35px] rounded-full"},null,8,oe)):(r(),_("img",ne))])]),_:1},8,["label"]),n(d,{prop:"username",label:a(t)("accountNumber"),"min-width":"120","show-overflow-tooltip":""},null,8,["label"]),n(d,{prop:"real_name",label:a(t)("userRealName"),"min-width":"120","show-overflow-tooltip":""},null,8,["label"]),n(d,{label:a(t)("userRoleName"),"min-width":"120","show-overflow-tooltip":""},{default:o(({row:e})=>[e.is_admin?(r(),_("span",ie,s(a(t)("administrator")),1)):e.role_array.length?(r(),_("span",se,s(e.role_array.join(" | ")),1)):y("",!0)]),_:1},8,["label"]),n(d,{label:a(t)("status"),"min-width":"90",align:"center"},{default:o(({row:e})=>[e.status==1?(r(),h(v,{key:0,class:"ml-2",type:"success"},{default:o(()=>[p(s(a(t)("statusUnlock")),1)]),_:1})):y("",!0),e.status==0?(r(),h(v,{key:1,class:"ml-2",type:"error"},{default:o(()=>[p(s(a(t)("statusLock")),1)]),_:1})):y("",!0)]),_:1},8,["label"]),n(d,{prop:"last_time",label:a(t)("lastLoginTime"),"min-width":"180",align:"center"},{default:o(({row:e})=>[p(s(e.last_time||""),1)]),_:1},8,["label"]),n(d,{label:a(t)("lastLoginIP"),"min-width":"180",align:"center"},{default:o(({row:e})=>[p(s(e.last_ip||""),1)]),_:1},8,["label"]),n(d,{label:a(t)("operation"),align:"right",fixed:"right",width:"160"},{default:o(({row:e})=>[e.is_admin!=1?(r(),_("div",re,[n(u,{type:"primary",link:"",onClick:w=>U(e)},{default:o(()=>[p(s(a(t)("edit")),1)]),_:2},1032,["onClick"]),e.status?(r(),h(u,{key:0,type:"primary",link:"",onClick:w=>B(e.uid)},{default:o(()=>[p(s(a(t)("lock")),1)]),_:2},1032,["onClick"])):(r(),h(u,{key:1,type:"primary",link:"",onClick:w=>D(e.uid)},{default:o(()=>[p(s(a(t)("unlock")),1)]),_:2},1032,["onClick"]))])):(r(),_("div",me,[n(u,{link:"",disabled:""},{default:o(()=>[p(s(a(t)("adminDisabled")),1)]),_:1})]))]),_:1},8,["label"])]),_:1},8,["data"])),[[V,l.loading]]),g("div",pe,[n(F,{"current-page":l.page,"onUpdate:current-page":i[3]||(i[3]=e=>l.page=e),"page-size":l.limit,"onUpdate:page-size":i[4]||(i[4]=e=>l.limit=e),layout:"total, sizes, prev, pager, next, jumper",total:l.total,onSizeChange:i[5]||(i[5]=e=>c()),onCurrentChange:c},null,8,["current-page","page-size","total"])])]),n(ee,{ref_key:"editUserDialog",ref:f,onComplete:i[6]||(i[6]=e=>c())},null,512)]),_:1})])}}});export{He as default};
|