vue-pure-admin/static/js/hook-0ZZHZNJf.js

2 lines
3.2 KiB
JavaScript

var g=(n,i,o)=>new Promise((s,l)=>{var p=t=>{try{a(o.next(t))}catch(r){l(r)}},m=t=>{try{a(o.throw(t))}catch(r){l(r)}},a=t=>t.done?s(t.value):Promise.resolve(t.value).then(p,m);a((o=o.apply(n,i)).next())});import{a1 as x,k as R,e as A,g as B,r as v,a as f,gG as F,m as I,f as h,aZ as _,bp as L,J as d,aF as M,ai as N,j as b,z as P,A as V,h as S}from"./index-DMqaFtX4.js";import{_ as Y}from"./detail.vue_vue_type_script_setup_true_lang-7Ek8g3vA.js";import{b as q,c as j}from"./system-rA6lrtqS.js";import"./vue-json-pretty-CprP0Obx.js";const H={viewBox:"0 0 24 24",width:"1em",height:"1em"};function $(n,i){return A(),R("svg",H,i[0]||(i[0]=[B("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 i=v({module:"",requestTime:""}),o=f([]),s=f(!0),l=f(0),{copied:p,update:m}=F(),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("请求接口"),P(h(S("iconifyIconOffline"),{icon:E,class:"ml-1 cursor-help"},null),[[V("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})=>_(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"&&(m(e),p.value?d(`${e} 已拷贝`,{type:"success"}):d("拷贝失败",{type:"warning"}))}function W(){const e=n.value.getTableRef().getSelectionRows();d(`已删除序号为 ${M(e,"id")} 的数据`,{type:"success"}),n.value.getTableRef().clearSelection(),c()}function k(){d("已删除所有日志数据",{type:"success"}),c()}function w(e){j({id:e.id}).then(u=>{N({title:"系统日志详情",fullscreen:!0,hideFooter:!0,contentRenderer:()=>Y,props:{data:[u]}})})}function c(){return g(this,null,function*(){s.value=!0;const{data:e}=yield q(L(i));o.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 I(()=>{c()}),{form:i,loading:s,columns:t,dataList:o,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};