2 lines
8.0 KiB
JavaScript
2 lines
8.0 KiB
JavaScript
import{Q as e,G as l,r as a,I as o,U as t,d as n,T as u,o as r,c as s,K as d,M as p,f as i,e as c,w as m,j as f,V as g,W as b,k as _,J as v,n as h,l as y,A as w,m as V,v as x}from"./index.e5c8b0d6.js";const k={class:"app-container"},T={key:0},C={key:1},N={class:"dialog-footer"},S=l({name:"Operlog"}),U=Object.assign(S,{setup(l){const{proxy:S}=x(),{sys_oper_type:U,sys_common_status:D}=S.useDict("sys_oper_type","sys_common_status"),q=a([]),R=a(!1),I=a(!0),M=a(!0),$=a([]);a(!0);const K=a(!0),P=a(0);a("");const j=a([]),Y=a({prop:"operTime",order:"descending"}),z=o({form:{},queryParams:{pageNum:1,pageSize:10,title:void 0,operName:void 0,businessType:void 0,status:void 0}}),{queryParams:A,form:L}=t(z);function O(){var l;I.value=!0,(l=S.addDateRange(A.value,j.value),e({url:"/monitor/operlog/list",method:"get",params:l})).then((e=>{q.value=e.rows,P.value=e.total,I.value=!1}))}function Q(){A.value.pageNum=1,O()}function B(){j.value=[],S.resetForm("queryRef"),A.value.pageNum=1,S.$refs.operlogRef.sort(Y.value.prop,Y.value.order)}function F(e){$.value=e.map((e=>e.operId)),K.value=!e.length}function G(e,l,a){A.value.orderByColumn=e.prop,A.value.isAsc=e.order,O()}function J(l){const a=l.operId||$.value;S.$modal.confirm('是否确认删除日志编号为"'+a+'"的数据项?').then((function(){return e({url:"/monitor/operlog/"+a,method:"delete"})})).then((()=>{O(),S.$modal.msgSuccess("删除成功")})).catch((()=>{}))}function W(){S.$modal.confirm("是否确认清空所有操作日志数据项?").then((function(){return e({url:"/monitor/operlog/clean",method:"delete"})})).then((()=>{O(),S.$modal.msgSuccess("清空成功")})).catch((()=>{}))}function E(){S.download("monitor/operlog/export",{...A.value},`config_${(new Date).getTime()}.xlsx`)}return O(),(e,l)=>{const a=n("el-input"),o=n("el-form-item"),t=n("el-option"),x=n("el-select"),$=n("el-date-picker"),z=n("el-button"),H=n("el-form"),X=n("el-col"),Z=n("right-toolbar"),ee=n("el-row"),le=n("el-table-column"),ae=n("dict-tag"),oe=n("el-table"),te=n("pagination"),ne=n("el-dialog"),ue=u("hasPermi"),re=u("loading");return r(),s("div",k,[d(c(H,{model:i(A),ref:"queryRef",inline:!0,"label-width":"68px"},{default:m((()=>[c(o,{label:"系统模块",prop:"title"},{default:m((()=>[c(a,{modelValue:i(A).title,"onUpdate:modelValue":l[0]||(l[0]=e=>i(A).title=e),placeholder:"请输入系统模块",clearable:"",style:{width:"240px"},onKeyup:f(Q,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),c(o,{label:"操作人员",prop:"operName"},{default:m((()=>[c(a,{modelValue:i(A).operName,"onUpdate:modelValue":l[1]||(l[1]=e=>i(A).operName=e),placeholder:"请输入操作人员",clearable:"",style:{width:"240px"},onKeyup:f(Q,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),c(o,{label:"类型",prop:"businessType"},{default:m((()=>[c(x,{modelValue:i(A).businessType,"onUpdate:modelValue":l[2]||(l[2]=e=>i(A).businessType=e),placeholder:"操作类型",clearable:"",style:{width:"240px"}},{default:m((()=>[(r(!0),s(g,null,b(i(U),(e=>(r(),_(t,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),c(o,{label:"状态",prop:"status"},{default:m((()=>[c(x,{modelValue:i(A).status,"onUpdate:modelValue":l[3]||(l[3]=e=>i(A).status=e),placeholder:"操作状态",clearable:"",style:{width:"240px"}},{default:m((()=>[(r(!0),s(g,null,b(i(D),(e=>(r(),_(t,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),c(o,{label:"操作时间",style:{width:"308px"}},{default:m((()=>[c($,{modelValue:i(j),"onUpdate:modelValue":l[4]||(l[4]=e=>v(j)?j.value=e:null),"value-format":"YYYY-MM-DD",type:"daterange","range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期"},null,8,["modelValue"])])),_:1}),c(o,null,{default:m((()=>[c(z,{type:"primary",icon:"Search",onClick:Q},{default:m((()=>[h("搜索")])),_:1}),c(z,{icon:"Refresh",onClick:B},{default:m((()=>[h("重置")])),_:1})])),_:1})])),_:1},8,["model"]),[[p,i(M)]]),c(ee,{gutter:10,class:"mb8"},{default:m((()=>[c(X,{span:1.5},{default:m((()=>[d((r(),_(z,{type:"danger",plain:"",icon:"Delete",disabled:i(K),onClick:J},{default:m((()=>[h("删除")])),_:1},8,["disabled"])),[[ue,["monitor:operlog:remove"]]])])),_:1},8,["span"]),c(X,{span:1.5},{default:m((()=>[d((r(),_(z,{type:"danger",plain:"",icon:"Delete",onClick:W},{default:m((()=>[h("清空")])),_:1})),[[ue,["monitor:operlog:remove"]]])])),_:1},8,["span"]),c(X,{span:1.5},{default:m((()=>[d((r(),_(z,{type:"warning",plain:"",icon:"Download",onClick:E},{default:m((()=>[h("导出")])),_:1})),[[ue,["monitor:operlog:export"]]])])),_:1},8,["span"]),c(Z,{showSearch:i(M),"onUpdate:showSearch":l[5]||(l[5]=e=>v(M)?M.value=e:null),onQueryTable:O},null,8,["showSearch"])])),_:1}),d((r(),_(oe,{ref:"operlogRef",data:i(q),onSelectionChange:F,"default-sort":i(Y),onSortChange:G},{default:m((()=>[c(le,{type:"selection",width:"55",align:"center"}),c(le,{label:"日志编号",align:"center",prop:"operId"}),c(le,{label:"系统模块",align:"center",prop:"title"}),c(le,{label:"操作类型",align:"center",prop:"businessType"},{default:m((e=>[c(ae,{options:i(U),value:e.row.businessType},null,8,["options","value"])])),_:1}),c(le,{label:"请求方式",align:"center",prop:"requestMethod"}),c(le,{label:"操作人员",align:"center",prop:"operName","show-overflow-tooltip":!0,sortable:"custom","sort-orders":["descending","ascending"],width:"100"}),c(le,{label:"主机",align:"center",prop:"operIp",width:"130","show-overflow-tooltip":!0}),c(le,{label:"操作状态",align:"center",prop:"status"},{default:m((e=>[c(ae,{options:i(D),value:e.row.status},null,8,["options","value"])])),_:1}),c(le,{label:"操作日期",align:"center",prop:"operTime",sortable:"custom","sort-orders":["descending","ascending"],width:"180"},{default:m((l=>[y("span",null,w(e.parseTime(l.row.operTime)),1)])),_:1}),c(le,{label:"操作",align:"center","class-name":"small-padding fixed-width"},{default:m((e=>[d((r(),_(z,{link:"",type:"primary",icon:"View",onClick:l=>{return a=e.row,e.index,R.value=!0,void(L.value=a);var a}},{default:m((()=>[h("详细")])),_:2},1032,["onClick"])),[[ue,["monitor:operlog:query"]]])])),_:1})])),_:1},8,["data","default-sort"])),[[re,i(I)]]),d(c(te,{total:i(P),page:i(A).pageNum,"onUpdate:page":l[6]||(l[6]=e=>i(A).pageNum=e),limit:i(A).pageSize,"onUpdate:limit":l[7]||(l[7]=e=>i(A).pageSize=e),onPagination:O},null,8,["total","page","limit"]),[[p,i(P)>0]]),c(ne,{title:"操作日志详细",modelValue:i(R),"onUpdate:modelValue":l[9]||(l[9]=e=>v(R)?R.value=e:null),width:"700px","append-to-body":""},{footer:m((()=>[y("div",N,[c(z,{onClick:l[8]||(l[8]=e=>R.value=!1)},{default:m((()=>[h("关 闭")])),_:1})])])),default:m((()=>[c(H,{model:i(L),"label-width":"100px"},{default:m((()=>[c(ee,null,{default:m((()=>[c(X,{span:12},{default:m((()=>[c(o,{label:"操作模块:"},{default:m((()=>{return[h(w(i(L).title)+" / "+w((e=i(L),S.selectDictLabel(U.value,e.businessType))),1)];var e})),_:1}),c(o,{label:"登录信息:"},{default:m((()=>[h(w(i(L).operName)+" / "+w(i(L).operIp)+" / "+w(i(L).operLocation),1)])),_:1})])),_:1}),c(X,{span:12},{default:m((()=>[c(o,{label:"请求地址:"},{default:m((()=>[h(w(i(L).operUrl),1)])),_:1}),c(o,{label:"请求方式:"},{default:m((()=>[h(w(i(L).requestMethod),1)])),_:1})])),_:1}),c(X,{span:24},{default:m((()=>[c(o,{label:"操作方法:"},{default:m((()=>[h(w(i(L).method),1)])),_:1})])),_:1}),c(X,{span:24},{default:m((()=>[c(o,{label:"请求参数:"},{default:m((()=>[h(w(i(L).operParam),1)])),_:1})])),_:1}),c(X,{span:24},{default:m((()=>[c(o,{label:"返回参数:"},{default:m((()=>[h(w(i(L).jsonResult),1)])),_:1})])),_:1}),c(X,{span:12},{default:m((()=>[c(o,{label:"操作状态:"},{default:m((()=>[0===i(L).status?(r(),s("div",T,"正常")):1===i(L).status?(r(),s("div",C,"失败")):V("",!0)])),_:1})])),_:1}),c(X,{span:12},{default:m((()=>[c(o,{label:"操作时间:"},{default:m((()=>[h(w(e.parseTime(i(L).operTime)),1)])),_:1})])),_:1}),c(X,{span:24},{default:m((()=>[1===i(L).status?(r(),_(o,{key:0,label:"异常信息:"},{default:m((()=>[h(w(i(L).errorMsg),1)])),_:1})):V("",!0)])),_:1})])),_:1})])),_:1},8,["model"])])),_:1},8,["modelValue"])])}}});export{U as default};
|