mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-06 00:18:51 +08:00
2 lines
2.1 KiB
JavaScript
2 lines
2.1 KiB
JavaScript
var d=(n,c,a)=>new Promise((s,o)=>{var p=t=>{try{i(a.next(t))}catch(r){o(r)}},l=t=>{try{i(a.throw(t))}catch(r){o(r)}},i=t=>t.done?s(t.value):Promise.resolve(t.value).then(p,l);i((a=a.apply(n,c)).next())});import{r as g,a as m,m as z,f as C,aZ as T,bp as P,J as f,aF as R,h as Y}from"./index-DMqaFtX4.js";import{a as w}from"./system-rA6lrtqS.js";import{u as D}from"./hooks-BE0p9dqE.js";function k(n){const c=g({module:"",status:"",operatingTime:""}),a=m([]),s=m(!0),o=m(0),{tagStyle:p}=D(),l=g({total:0,pageSize:10,currentPage:1,background:!0}),i=[{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:y})=>C(Y("el-tag"),{size:y.size,style:p.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 r(e){}function h(e){o.value=e.length,n.value.setAdaptive()}function b(){o.value=0,n.value.getTableRef().clearSelection()}function v(){const e=n.value.getTableRef().getSelectionRows();f(`已删除序号为 ${R(e,"id")} 的数据`,{type:"success"}),n.value.getTableRef().clearSelection(),u()}function S(){f("已删除所有日志数据",{type:"success"}),u()}function u(){return d(this,null,function*(){s.value=!0;const{data:e}=yield w(P(c));a.value=e.list,l.total=e.total,l.pageSize=e.pageSize,l.currentPage=e.currentPage,setTimeout(()=>{s.value=!1},500)})}const W=e=>{e&&(e.resetFields(),u())};return z(()=>{u()}),{form:c,loading:s,columns:i,dataList:a,pagination:l,selectedNum:o,onSearch:u,clearAll:S,resetForm:W,onbatchDel:v,handleSizeChange:t,onSelectionCancel:b,handleCurrentChange:r,handleSelectionChange:h}}export{k as useRole};
|