1 line
4.4 KiB
JavaScript
1 line
4.4 KiB
JavaScript
"use strict";(self["webpackChunkx_php_admin"]=self["webpackChunkx_php_admin"]||[]).push([[485],{485:function(e,t,a){a.r(t),a.d(t,{default:function(){return g}});var l=a(6252),n=a(3577);const i={class:"left-panel"},r={class:"right-panel"},o={class:"right-panel-search"};function c(e,t,a,c,s,u){const p=(0,l.up)("x-page-header"),h=(0,l.up)("x-menu-item"),d=(0,l.up)("el-aside"),m=(0,l.up)("el-date-picker"),f=(0,l.up)("el-input"),g=(0,l.up)("el-button"),w=(0,l.up)("el-header"),y=(0,l.up)("xEcharts"),b=(0,l.up)("el-table-column"),k=(0,l.up)("xTable"),C=(0,l.up)("el-main"),x=(0,l.up)("el-container"),_=(0,l.up)("info"),W=(0,l.up)("el-drawer");return(0,l.wg)(),(0,l.iD)(l.HY,null,[(0,l.Wm)(x,null,{default:(0,l.w5)((()=>[(0,l.Wm)(d,{width:"210px"},{default:(0,l.w5)((()=>[(0,l.Wm)(p,{title:"日志",icon:"el-icon-Calendar",style:{padding:"10px 16px"}}),((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(s.typeList,((e,t)=>((0,l.wg)(),(0,l.j4)(h,{key:t,label:e.label,num:e.num,icon:e.icon,"icon-color":e.color,select:s.search.type==e.value,onClick:t=>u.sideClick(e)},null,8,["label","num","icon","icon-color","select","onClick"])))),128))])),_:1}),(0,l.Wm)(x,{style:{padding:"10px 10px 6px 10px"}},{default:(0,l.w5)((()=>[(0,l.Wm)(C,{class:"nopadding"},{default:(0,l.w5)((()=>[(0,l.Wm)(x,{class:"container"},{default:(0,l.w5)((()=>[(0,l.Wm)(w,null,{default:(0,l.w5)((()=>[(0,l._)("div",i,[(0,l.Wm)(m,{modelValue:s.date,"onUpdate:modelValue":t[0]||(t[0]=e=>s.date=e),type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},null,8,["modelValue"])]),(0,l._)("div",r,[(0,l._)("div",o,[(0,l.Wm)(f,{modelValue:s.search.keyword,"onUpdate:modelValue":t[1]||(t[1]=e=>s.search.keyword=e),placeholder:"输入关键词",clearable:""},null,8,["modelValue"]),(0,l.Wm)(g,{type:"primary",icon:"el-icon-search",onClick:u.upsearch},null,8,["onClick"])])])])),_:1}),"object"===typeof s.chartoption&&Object.keys(s.chartoption).length>0?((0,l.wg)(),(0,l.j4)(w,{key:0,style:{height:"120px"}},{default:(0,l.w5)((()=>[(0,l.Wm)(y,{height:"100%",option:s.chartoption},null,8,["option"])])),_:1})):(0,l.kq)("",!0),(0,l.Wm)(C,{class:"nopadding"},{default:(0,l.w5)((()=>[(0,l.Wm)(k,{ref:"table",api:s.api,params:s.search,tableColumn:s.tableColumn,stripe:"",highlightCurrentRow:"",onRowClick:u.rowClick},{default:(0,l.w5)((()=>[(0,l.Wm)(b,{type:"index",width:"60",align:"center"},{default:(0,l.w5)((e=>[(0,l._)("span",null,(0,n.zw)(e.$index+(s.currentPage-1)*s.limit+1),1)])),_:1})])),_:1},8,["api","params","tableColumn","onRowClick"])])),_:1})])),_:1})])),_:1})])),_:1})])),_:1}),(0,l.Wm)(W,{modelValue:s.infoDrawer,"onUpdate:modelValue":t[2]||(t[2]=e=>s.infoDrawer=e),title:"日志详情",size:700,"destroy-on-close":""},{default:(0,l.w5)((()=>[(0,l.Wm)(_,{ref:"info"},null,512)])),_:1},8,["modelValue"])],64)}var s=a(6359),u=a(7015),p=a(8492),h=a(8046),d={name:"log",components:{info:s["default"],columnItem:p.Z,xMenuItem:h.Z,xEcharts:u.Z},data(){return{infoDrawer:!1,chartoption:{},typeList:[],date:[],data:[],search:{},api:"",current:"",config:{},tableColumn:{},column:"default",currentPage:1,limit:20}},mounted(){this.getType()},watch:{current(){this.search.type=this.current,this.getCurrent()}},methods:{sideClick(e){this.info=e,this.search.type=e.value,this.current=e.value,this.column=e.column||"column"},changeURLArg(e,t,a){var l=t+"=([^&]*)";if(""===a)return e=e.replace(new RegExp("&?"+l,"gi"),""),e=e.replace(new RegExp("\\??"+l+"&?","gi"),"?"),e;var n=t+"="+a;if(e.match(l)){var i="("+t+"=)([^&]*)";return i=e.replace(new RegExp(i,"gi"),n),i}return e.match("[?]")?e+"&"+n:e+"?"+n},nodeClick(e){if(e.disabled)return!1;this.current=e.label,this.column=e.column||"column"},getType(){this.$http.get("log/admin/types",{type:this.$route.query.type},{cacheparameters:!0}).then((e=>{if(200==e.code){Object.assign(this.$data,e.data);for(const e in this.search)Object.prototype.hasOwnProperty.call(this.$route.query,e)&&(this.search[e]=this.$route.query[e])}}))},getCurrent(){this.tableColumn=this.config[this.column]||this.config.default,this.api||(this.api="log/admin/lists"),this.$refs.table.reload(this.search);let e=window.location.href;for(const[t,a]of Object.entries(this.search))e=this.changeURLArg(e,t,a);history.replaceState(Object.assign({},window.history.state,{url:e}),"null",e)},upsearch(){this.getCurrent()},rowClick(e){this.infoDrawer=!0,this.$nextTick((()=>{this.$refs.info.setData(e)}))}}},m=a(3744);const f=(0,m.Z)(d,[["render",c],["__scopeId","data-v-0d7cfddc"]]);var g=f}}]); |