vue-pure-admin/static/js/hook-D2bEFIXI.js

2 lines
3.2 KiB
JavaScript

var g=(n,o,i)=>new Promise((s,l)=>{var m=t=>{try{a(i.next(t))}catch(r){l(r)}},p=t=>{try{a(i.throw(t))}catch(r){l(r)}},a=t=>t.done?s(t.value):Promise.resolve(t.value).then(m,p);a((i=i.apply(n,o)).next())});import{a1 as x,k as R,e as A,g as _,r as v,a as f,eX as B,m as j,f as h,a_ as q,bq as F,H as d,aG as I,aj as L,j as b,z as M,A as N,h as S}from"./index-CVG9UGE1.js";import{_ as P}from"./detail.vue_vue_type_script_setup_true_lang-D8o_ZS-Z.js";import{b as V,c as Y}from"./system-CFp-je_y.js";import"./vue-json-pretty-fL3C3YQp.js";const H={viewBox:"0 0 24 24",width:"1em",height:"1em"};function $(n,o){return A(),R("svg",H,[...o[0]||(o[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"},null,-1)])])}const E=x({name:"ri-question-line",render:$});function Q(n){const o=v({module:"",requestTime:""}),i=f([]),s=f(!0),l=f(0),{copied:m,update:p}=B(),a=v({total:0,pageSize:10,currentPage:1,background:!0}),t=[{label:"勾选列",type:"selection",fixed:"left",reserveSelection:!0},{label:"ID",prop:"id",minWidth:90},{label:"所属模块",prop:"module",minWidth:100},{headerRenderer:()=>h("span",{class:"flex-c"},[b("请求接口"),M(h(S("iconifyIconOffline"),{icon:E,class:"ml-1 cursor-help"},null),[[N("tippy"),{content:"双击下面请求接口进行拷贝"}]])]),prop:"url",minWidth:140},{label:"请求方法",prop:"method",minWidth:140},{label:"IP 地址",prop:"ip",minWidth:100},{label:"地点",prop:"address",minWidth:140},{label:"操作系统",prop:"system",minWidth:100},{label:"浏览器类型",prop:"browser",minWidth:100},{label:"请求耗时",prop:"takesTime",minWidth:100,cellRenderer:({row:e,props:u})=>h(S("el-tag"),{size:u.size,type:e.takesTime<1e3?"success":"warning",effect:"plain"},{default:()=>[e.takesTime,b(" ms")]})},{label:"请求时间",prop:"requestTime",minWidth:180,formatter:({requestTime:e})=>q(e).format("YYYY-MM-DD HH:mm:ss")},{label:"操作",fixed:"right",slot:"operation"}];function r(e){}function y(e){}function C(e){l.value=e.length,n.value.setAdaptive()}function D(){l.value=0,n.value.getTableRef().clearSelection()}function T({url:e},{property:u}){u==="url"&&(p(e),m.value?d(`${e} 已拷贝`,{type:"success"}):d("拷贝失败",{type:"warning"}))}function W(){const e=n.value.getTableRef().getSelectionRows();d(`已删除序号为 ${I(e,"id")} 的数据`,{type:"success"}),n.value.getTableRef().clearSelection(),c()}function k(){d("已删除所有日志数据",{type:"success"}),c()}function w(e){Y({id:e.id}).then(u=>{L({title:"系统日志详情",fullscreen:!0,hideFooter:!0,contentRenderer:()=>P,props:{data:[u]}})})}function c(){return g(this,null,function*(){s.value=!0;const{data:e}=yield V(F(o));i.value=e.list,a.total=e.total,a.pageSize=e.pageSize,a.currentPage=e.currentPage,setTimeout(()=>{s.value=!1},500)})}const z=e=>{e&&(e.resetFields(),c())};return j(()=>{c()}),{form:o,loading:s,columns:t,dataList:i,pagination:a,selectedNum:l,onSearch:c,onDetail:w,clearAll:k,resetForm:z,onbatchDel:W,handleSizeChange:r,onSelectionCancel:D,handleCellDblclick:T,handleCurrentChange:y,handleSelectionChange:C}}export{Q as useRole};