import{r as e,o as t,f as a,w as l,G as n,K as o,L as r,H as i,c as s,j as d,v as u,b as p,e as g,m as c,t as h,g as f,l as y,F as m,i as b,a as w}from"./index-NbYmstuU.js";import{_ as x,r as C}from"./uni-app.es.B5W9hTUb.js";import{_,a as S}from"./content.KvZyBFQ0.js";const P=x({name:"column-helper",props:{fixed:{default:!1}},data:()=>({prop:"",label:"",width:"180",align:"center"})},[["render",function(i,s,d,u,p,g){const c=e("el-table-column");return t(),a(c,{prop:p.prop,label:i.labelID,width:p.width,align:p.align,fixed:d.fixed},{default:l((e=>[n(i.$slots,"default",o(r(e)),void 0,!0)])),_:3},8,["prop","label","width","align","fixed"])}],["__scopeId","data-v-300111ac"]]);const $=x({name:"table-helper",props:{tableData:{type:Array,default:()=>[]},emptyText:{type:String,default:i.$("No Data")},border:{type:Boolean,default:!1},stripe:{type:Boolean,default:!0},showIndex:{type:Boolean,default:!1},useSelection:{type:Boolean,default:!1},highlightCurrentRow:{type:Boolean,default:!1},tableStyle:{type:Object,default:()=>({})},pageSize:{type:Number,default:15},total:{type:Number,default:0},currentPage:{type:Number,default:1},rowKey:{type:String,default:"id"},hideOnSinglePage:{type:Boolean,default:!1}},data(){return{currentPageCopy:this.currentPage,selectedRows:[]}},mounted(){},methods:{resetPage(){this.currentPageCopy=1},currentChange:function(e){this.currentPageCopy=e,this.$emit("currentChange",e)},getRowKeys(e){return e[this.rowKey]},setCellClass(e){if(this.showIndex)return 0==e.columnIndex?"el-index":""},indexMethod(e){return e+1+(this.currentPage-1)*this.pageSize},handleSelectionChange(e){this.selectedRows=e,this.$emit("selection-change",e)}}},[["render",function(o,r,i,w,x,C){const _=e("Filter"),S=e("el-icon"),P=e("el-tag"),$=b,D=e("el-table-column"),R=e("el-table"),k=e("el-pagination");return t(),s(m,null,[d(p($,{style:{"margin-left":"10px"}},{default:l((()=>[p(P,{size:"large"},{default:l((()=>[p(S,null,{default:l((()=>[p(_)])),_:1}),g(" 已选择 "),c("span",{style:{"font-weight":"bold"}},h(x.selectedRows.length),1),g(" 行，"),c("span",{onClick:r[0]||(r[0]=e=>{x.selectedRows=[]}),style:{color:"red",cursor:"pointer"}},"点击这里清除全部选择")])),_:1})])),_:1},512),[[u,0!=x.selectedRows.length]]),p(R,{"row-key":C.getRowKeys,"empty-text":i.emptyText,"cell-class-name":C.setCellClass,data:i.tableData,border:i.border,stripe:i.stripe,"highlight-current-row":i.highlightCurrentRow,style:y(i.tableStyle),onSelectionChange:C.handleSelectionChange},{default:l((()=>[i.showIndex?(t(),a(D,{key:0,fixed:!0,type:"index",align:"center",label:"序号",index:C.indexMethod,width:"60"},null,8,["index"])):f("",!0),i.useSelection?(t(),a(D,{key:1,"reserve-selection":!0,type:"selection"})):f("",!0),n(o.$slots,"default",{},void 0,!0)])),_:3},8,["row-key","empty-text","cell-class-name","data","border","stripe","highlight-current-row","style","onSelectionChange"]),p($,{style:{display:"grid","place-items":"center",margin:"20px 0"}},{default:l((()=>[p(k,{"hide-on-single-page":i.hideOnSinglePage,"current-page":x.currentPageCopy,total:i.total,"page-size":i.pageSize,background:"",layout:"prev, pager, next",onCurrentChange:C.currentChange},null,8,["hide-on-single-page","current-page","total","page-size","onCurrentChange"]),p($,{style:{color:"#ffffff","margin-top":"10px"}},{default:l((()=>[g(h(o.lang.$("Total of"))+" ",1),c("b",null,h(i.total),1),g(" "+h(o.lang.$("Records")),1)])),_:1})])),_:1})],64)}],["__scopeId","data-v-767396e4"]]);const D=x({data:()=>({logData:{},input:""}),mounted(){this.util.runPeriodicTask(200,this.fetchMainData)},methods:{fetchMainData(){return new Promise(((e,t)=>{let a=this;a.util.request({url:"/log/query",data:{},success:t=>{a.logData=t.data.filter((e=>e.content.includes(this.input))),e()},fail:()=>{t()}})}))}}},[["render",function(n,o,r,i,s,d){const u=b,c=e("el-input"),f=C(w("column-helper"),P),y=C(w("table-helper"),$),m=C(w("card"),_),x=C(w("content"),S);return t(),a(x,{group:n.lang.$("Log"),title:n.lang.$("Log List")},{default:l((()=>[p(m,{title:n.lang.$("Log List"),icon:"Postcard"},{default:l((()=>[p(u,{style:{"margin-top":"-28px"}}),p(c,{"prefix-icon":"Filter",modelValue:s.input,"onUpdate:modelValue":o[0]||(o[0]=e=>s.input=e),style:{width:"300px"},placeholder:n.lang.$("Log filter, please enter keywords")},null,8,["modelValue","placeholder"]),p(u,{style:{"margin-top":"5px"}}),p(y,{tableData:s.logData,total:s.logData.length},{default:l((()=>[p(f,{label:n.lang.$("Time"),width:"200px"},{default:l((e=>[g(h(e.row.time),1)])),_:1},8,["label"]),p(f,{label:n.lang.$("Content"),align:"left",width:""},{default:l((e=>[g(h(e.row.content),1)])),_:1},8,["label"])])),_:1},8,["tableData","total"])])),_:1},8,["title"])])),_:1},8,["group","title"])}]]);export{D as default};
