2023-10-23 17:13:34 +08:00

2 lines
6.9 KiB
JavaScript

import{d as j,R as I,r as w,e as s,f as h,y as l,x as a,g as f,B as n,u as o,A as p,Q as S,v as _,H as C}from"./base-06478700.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{E as A}from"./index-0d58768e.js";import"./el-tooltip-58212670.js";/* empty css *//* empty css *//* empty css */import{a as H,E as M}from"./el-form-item-314d006d.js";/* empty css */import{t}from"./index-e5b4f072.js";import{d as Q,l as q,u as G}from"./user-e54bb3bb.js";import{_ as J}from"./edit-user.vue_vue_type_script_setup_true_lang-b95bd0b7.js";import{d as K}from"./common-92a35870.js";import{u as O}from"./vue-router-d09a2c28.js";import{E as T}from"./index-01f6e375.js";import{E as W}from"./index-c2f001d3.js";import{E as X}from"./index-b68e8463.js";import{E as Y}from"./index-e10fccde.js";import{a as Z,E as tt}from"./index-4bec4464.js";import{E as et}from"./index-34d55b7e.js";import{E as at}from"./index-137757c0.js";import{v as ot}from"./directive-cb2d3366.js";import"./event-10eba222.js";import"./index-2fcd1254.js";import"./index-adb89d14.js";import"./el-main-9a0960e7.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./index-6b67c4ac.js";import"./el-overlay-42a687c6.js";import"./index-9fe5de95.js";import"./focus-trap-3e826cdc.js";import"./index-f27d6ce0.js";import"./index-818c0ce2.js";import"./index-b52d0f2a.js";import"./index-2a269c7c.js";import"./index-e4abfaa5.js";import"./index-9ee9102c.js";/* empty css */import"./index-d312949b.js";/* empty css */import"./index.vue_vue_type_style_index_0_lang-53d85138.js";import"./attachment-27789be1.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index-a0c6fc63.js";import"./index-41a974fa.js";import"./index-c17093ae.js";import"./index-543fb162.js";import"./index-b6a184ba.js";import"./debounce-1db848fd.js";import"./position-c3bcd0be.js";import"./index-b56195b5.js";import"./index-40e21e72.js";import"./isEqual-42d4b10f.js";import"./index-35e821cc.js";import"./strings-fe930bc4.js";import"./index-5a0d60aa.js";import"./validator-6e9db238.js";import"./index-6290cf08.js";import"./_isIterateeCall-1dc0e2ff.js";const lt="/admin/assets/default_headimg-1e927329.png",rt={class:"main-container"},it={class:"flex justify-between items-center"},nt={class:"text-[20px]"},st=f("img",{src:lt},null,-1),mt={key:0},pt={key:1},ct={key:0},dt={key:1},ut={class:"mt-[16px] flex justify-end"},Ne=j({__name:"user",setup(_t){const U=O().meta.title,r=I({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{seach:""}}),k=w(),B=m=>{m&&(m.resetFields(),c())},c=(m=1)=>{r.loading=!0,r.page=m,Q({page:r.page,limit:r.limit,username:r.searchParam.seach}).then(i=>{r.loading=!1,r.data=i.data.data,r.total=i.data.total}).catch(()=>{r.loading=!1})};c();const g=w(null),D=()=>{g.value.setFormData(),g.value.showDialog=!0},N=m=>{g.value.setFormData(m),g.value.showDialog=!0},P=m=>{T.confirm(t("userLockTips"),t("warning"),{confirmButtonText:t("confirm"),cancelButtonText:t("cancel"),type:"warning"}).then(()=>{q(m).then(()=>{c()}).catch(()=>{})})},F=m=>{T.confirm(t("userUnlockTips"),t("warning"),{confirmButtonText:t("confirm"),cancelButtonText:t("cancel"),type:"warning"}).then(()=>{G(m).then(()=>{c()}).catch(()=>{})})};return(m,i)=>{const u=W,$=X,v=H,L=M,b=Y,y=A,d=Z,E=et,V=tt,z=at,R=ot;return s(),h("div",rt,[l(b,{class:"box-card !border-none",shadow:"never"},{default:a(()=>[f("div",it,[f("span",nt,n(o(U)),1),l(u,{type:"primary",class:"w-[100px]",onClick:D},{default:a(()=>[p(n(o(t)("addUser")),1)]),_:1})]),l(b,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:a(()=>[l(L,{inline:!0,model:r.searchParam,ref_key:"searchFormRef",ref:k},{default:a(()=>[l(v,{label:o(t)("accountNumber"),prop:"seach"},{default:a(()=>[l($,{modelValue:r.searchParam.seach,"onUpdate:modelValue":i[0]||(i[0]=e=>r.searchParam.seach=e),class:"w-[240px]",placeholder:o(t)("accountNumberPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(v,null,{default:a(()=>[l(u,{type:"primary",onClick:i[1]||(i[1]=e=>c())},{default:a(()=>[p(n(o(t)("search")),1)]),_:1}),l(u,{onClick:i[2]||(i[2]=e=>B(k.value))},{default:a(()=>[p(n(o(t)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),f("div",null,[S((s(),_(V,{data:r.data,size:"large"},{empty:a(()=>[f("span",null,n(r.loading?"":o(t)("emptyData")),1)]),default:a(()=>[l(d,{label:o(t)("headImg"),width:"100",align:"left"},{default:a(({row:e})=>[e.head_img?(s(),_(y,{key:0,src:o(K)(e.head_img)},null,8,["src"])):(s(),_(y,{key:1},{default:a(()=>[st]),_:1}))]),_:1},8,["label"]),l(d,{prop:"username",label:o(t)("accountNumber"),"min-width":"120","show-overflow-tooltip":""},null,8,["label"]),l(d,{prop:"real_name",label:o(t)("userRealName"),"min-width":"120","show-overflow-tooltip":""},null,8,["label"]),l(d,{label:o(t)("userRoleName"),"min-width":"120","show-overflow-tooltip":""},{default:a(({row:e})=>[e.is_admin?(s(),h("span",mt,n(o(t)("administrator")),1)):(s(),h("span",pt,n(e.role_data.join(" | ")),1))]),_:1},8,["label"]),l(d,{label:o(t)("status"),"min-width":"120",align:"center"},{default:a(({row:e})=>[e.status==1?(s(),_(E,{key:0,class:"ml-2",type:"success"},{default:a(()=>[p(n(o(t)("statusUnlock")),1)]),_:1})):C("",!0),e.status==0?(s(),_(E,{key:1,class:"ml-2",type:"error"},{default:a(()=>[p(n(o(t)("statusLock")),1)]),_:1})):C("",!0)]),_:1},8,["label"]),l(d,{prop:"last_time",label:o(t)("lastLoginTime"),"min-width":"180",align:"center"},{default:a(({row:e})=>[p(n(e.last_time||""),1)]),_:1},8,["label"]),l(d,{label:o(t)("lastLoginIP"),"min-width":"180",align:"center"},{default:a(({row:e})=>[p(n(e.last_ip||""),1)]),_:1},8,["label"]),l(d,{label:o(t)("operation"),fixed:"right",align:"right",width:"160"},{default:a(({row:e})=>[e.is_admin!=1?(s(),h("div",ct,[l(u,{type:"primary",link:"",onClick:x=>N(e)},{default:a(()=>[p(n(o(t)("edit")),1)]),_:2},1032,["onClick"]),e.status==1?(s(),_(u,{key:0,type:"primary",link:"",onClick:x=>P(e.uid)},{default:a(()=>[p(n(o(t)("lock")),1)]),_:2},1032,["onClick"])):(s(),_(u,{key:1,type:"primary",link:"",onClick:x=>F(e.uid)},{default:a(()=>[p(n(o(t)("unlock")),1)]),_:2},1032,["onClick"]))])):(s(),h("div",dt,[l(u,{link:"",disabled:""},{default:a(()=>[p(n(o(t)("adminDisabled")),1)]),_:1})]))]),_:1},8,["label"])]),_:1},8,["data"])),[[R,r.loading]]),f("div",ut,[l(z,{"current-page":r.page,"onUpdate:currentPage":i[3]||(i[3]=e=>r.page=e),"page-size":r.limit,"onUpdate:pageSize":i[4]||(i[4]=e=>r.limit=e),layout:"total, sizes, prev, pager, next, jumper",total:r.total,onSizeChange:i[5]||(i[5]=e=>c()),onCurrentChange:c},null,8,["current-page","page-size","total"])])]),l(J,{ref_key:"editUserDialog",ref:g,onComplete:i[6]||(i[6]=e=>c())},null,512)]),_:1})])}}});export{Ne as default};