Files
vue-pure-admin/static/js/hook-BjGjWpjk.js

2 lines
2.1 KiB
JavaScript

var g=(n,p,a)=>new Promise((i,o)=>{var m=t=>{try{r(a.next(t))}catch(c){o(c)}},l=t=>{try{r(a.throw(t))}catch(c){o(c)}},r=t=>t.done?i(t.value):Promise.resolve(t.value).then(m,l);r((a=a.apply(n,p)).next())});import{r as f,a as d,m as z,g as C,a_ as T,bq as P,I as h,aG as R,b as Y}from"./index-DXWDxfUH.js";import{a as w}from"./system-DHEKTbs7.js";import{u as A}from"./hooks-uJpoFO3Q.js";function k(n){const p=f({module:"",status:"",operatingTime:""}),a=d([]),i=d(!0),o=d(0),{tagStyle:m}=A(),l=f({total:0,pageSize:10,currentPage:1,background:!0}),r=[{label:"勾选列",type:"selection",fixed:"left",reserveSelection:!0},{label:"序号",prop:"id",minWidth:90},{label:"操作人员",prop:"username",minWidth:100},{label:"所属模块",prop:"module",minWidth:140},{label:"操作概要",prop:"summary",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:"status",minWidth:100,cellRenderer:({row:e,props:s})=>C(Y("el-tag"),{size:s.size,style:m.value(e.status)},{default:()=>[e.status===1?"成功":"失败"]})},{label:"操作时间",prop:"operatingTime",minWidth:180,formatter:({operatingTime:e})=>T(e).format("YYYY-MM-DD HH:mm:ss")}];function t(e){}function c(e){}function b(e){o.value=e.length,n.value.setAdaptive()}function v(){o.value=0,n.value.getTableRef().clearSelection()}function S(){const e=n.value.getTableRef().getSelectionRows();h(`已删除序号为 ${R(e,"id")} 的数据`,{type:"success"}),n.value.getTableRef().clearSelection(),u()}function W(){h("已删除所有日志数据",{type:"success"}),u()}function u(){return g(this,null,function*(){i.value=!0;const{code:e,data:s}=yield w(P(p));e===0&&(a.value=s.list,l.total=s.total,l.pageSize=s.pageSize,l.currentPage=s.currentPage),setTimeout(()=>{i.value=!1},500)})}const y=e=>{e&&(e.resetFields(),u())};return z(()=>{u()}),{form:p,loading:i,columns:r,dataList:a,pagination:l,selectedNum:o,onSearch:u,clearAll:W,resetForm:y,onbatchDel:S,handleSizeChange:t,onSelectionCancel:v,handleCurrentChange:c,handleSelectionChange:b}}export{k as useRole};