2 lines
3.8 KiB
JavaScript
2 lines
3.8 KiB
JavaScript
import{d as D,n as E,r as h,h as v,c as L,e as l,w as n,a as u,u as o,N as r,i as c,t as m,y as F,I as U,W as $,X as z,E as B,Y as T,ah as j,aj as N,at as I,$ as S,a0 as R}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{a as W}from"./site-ac963391.js";import{_ as X}from"./user-log-detail.vue_vue_type_script_setup_true_lang-10441c85.js";/* empty css *//* empty css */const Y={class:"main-container"},q={class:"flex justify-between items-center"},A={class:"mt-[16px] flex justify-end"},ge=D({__name:"log",setup(G){const e=E({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{ip:"",username:"",url:""}}),b=h(),y=i=>{i&&(i.resetFields(),s())},s=(i=1)=>{e.loading=!0,e.page=i,W({page:e.page,limit:e.limit,...e.searchParam}).then(a=>{e.loading=!1,e.data=a.data.data,e.total=a.data.total}).catch(()=>{e.loading=!1})};s();const g=h(null),P=i=>{g.value.setFormData(i),g.value.showDialog=!0};return(i,a)=>{const _=$,d=z,f=B,w=T,p=j,C=N,V=I,k=S,x=R;return v(),L("div",Y,[l(k,{class:"box-card !border-none",shadow:"never"},{default:n(()=>[u("div",q,[l(w,{inline:!0,model:e.searchParam,ref_key:"searchFormRef",ref:b},{default:n(()=>[l(d,{label:o(r)("ip"),prop:"ip"},{default:n(()=>[l(_,{modelValue:e.searchParam.ip,"onUpdate:modelValue":a[0]||(a[0]=t=>e.searchParam.ip=t),placeholder:o(r)("ipPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(d,{label:o(r)("username"),prop:"username"},{default:n(()=>[l(_,{modelValue:e.searchParam.username,"onUpdate:modelValue":a[1]||(a[1]=t=>e.searchParam.username=t),placeholder:o(r)("usernamePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(d,{label:o(r)("url"),prop:"url"},{default:n(()=>[l(_,{modelValue:e.searchParam.url,"onUpdate:modelValue":a[2]||(a[2]=t=>e.searchParam.url=t),placeholder:o(r)("urlPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(d,null,{default:n(()=>[l(f,{type:"primary",onClick:a[3]||(a[3]=t=>s())},{default:n(()=>[c(m(o(r)("search")),1)]),_:1}),l(f,{onClick:a[4]||(a[4]=t=>y(b.value))},{default:n(()=>[c(m(o(r)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),u("div",null,[F((v(),U(C,{data:e.data,size:"large"},{empty:n(()=>[u("span",null,m(e.loading?"":o(r)("emptyData")),1)]),default:n(()=>[l(p,{prop:"username",label:o(r)("username"),"min-width":"120"},null,8,["label"]),l(p,{prop:"ip",label:o(r)("ip"),"min-width":"100",align:"left"},null,8,["label"]),l(p,{prop:"url",label:o(r)("url"),"min-width":"180"},null,8,["label"]),l(p,{prop:"type",label:o(r)("type"),"min-width":"100",align:"center"},null,8,["label"]),l(p,{label:o(r)("createTime"),"min-width":"180",align:"center"},{default:n(({row:t})=>[c(m(t.create_time||""),1)]),_:1},8,["label"]),l(p,{label:o(r)("operation"),align:"right",fixed:"right",width:"130"},{default:n(({row:t})=>[l(f,{type:"primary",link:"",onClick:H=>P(t)},{default:n(()=>[c(m(o(r)("detail")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[x,e.loading]]),u("div",A,[l(V,{"current-page":e.page,"onUpdate:current-page":a[5]||(a[5]=t=>e.page=t),"page-size":e.limit,"onUpdate:page-size":a[6]||(a[6]=t=>e.limit=t),layout:"total, sizes, prev, pager, next, jumper",total:e.total,onSizeChange:a[7]||(a[7]=t=>s()),onCurrentChange:s},null,8,["current-page","page-size","total"])]),l(X,{ref_key:"userLogDetailDialog",ref:g,onComplete:a[8]||(a[8]=t=>s())},null,512)])]),_:1})])}}});export{ge as default};
|