1 line
4.5 KiB
JavaScript
1 line
4.5 KiB
JavaScript
"use strict";(self["webpackChunkx_php_admin"]=self["webpackChunkx_php_admin"]||[]).push([[537],{1537:function(e,t,l){l.r(t),l.d(t,{default:function(){return g}});var a=l(6808),n=l(9511);const i={class:"left-panel"},r={class:"right-panel"},o={class:"right-panel-search"};function c(e,t,l,c,u,s){const p=(0,a.up)("x-page-header"),h=(0,a.up)("el-header"),d=(0,a.up)("x-menu-item"),m=(0,a.up)("el-main"),f=(0,a.up)("el-container"),g=(0,a.up)("el-aside"),w=(0,a.up)("el-date-picker"),y=(0,a.up)("el-input"),b=(0,a.up)("el-button"),_=(0,a.up)("xEcharts"),k=(0,a.up)("el-table-column"),C=(0,a.up)("xTable"),x=(0,a.up)("info"),W=(0,a.up)("el-drawer");return(0,a.wg)(),(0,a.iD)(a.HY,null,[(0,a.Wm)(f,null,{default:(0,a.w5)((()=>[(0,a.Wm)(g,{width:"210px"},{default:(0,a.w5)((()=>[(0,a.Wm)(f,null,{default:(0,a.w5)((()=>[(0,a.Wm)(h,null,{default:(0,a.w5)((()=>[(0,a.Wm)(p,{title:"日志",icon:"el-icon-Calendar"})])),_:1}),(0,a.Wm)(m,{style:{padding:"0"}},{default:(0,a.w5)((()=>[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(u.typeList,((e,t)=>((0,a.wg)(),(0,a.j4)(d,{key:t,label:e.label,num:e.num,icon:e.icon,"icon-color":e.color,select:u.search.type==e.value,onClick:t=>s.sideClick(e)},null,8,["label","num","icon","icon-color","select","onClick"])))),128))])),_:1})])),_:1})])),_:1}),(0,a.Wm)(f,{style:{padding:"10px 10px 6px 10px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(m,{class:"nopadding"},{default:(0,a.w5)((()=>[(0,a.Wm)(f,{class:"container"},{default:(0,a.w5)((()=>[(0,a.Wm)(h,null,{default:(0,a.w5)((()=>[(0,a._)("div",i,[(0,a.Wm)(w,{modelValue:u.date,"onUpdate:modelValue":t[0]||(t[0]=e=>u.date=e),type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},null,8,["modelValue"])]),(0,a._)("div",r,[(0,a._)("div",o,[(0,a.Wm)(y,{modelValue:u.search.keyword,"onUpdate:modelValue":t[1]||(t[1]=e=>u.search.keyword=e),placeholder:"输入关键词",clearable:""},null,8,["modelValue"]),(0,a.Wm)(b,{type:"primary",icon:"el-icon-search",onClick:s.upsearch},null,8,["onClick"])])])])),_:1}),"object"===typeof u.chartoption&&Object.keys(u.chartoption).length>0?((0,a.wg)(),(0,a.j4)(h,{key:0,style:{height:"120px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(_,{height:"100%",option:u.chartoption},null,8,["option"])])),_:1})):(0,a.kq)("",!0),(0,a.Wm)(m,{class:"nopadding"},{default:(0,a.w5)((()=>[(0,a.Wm)(C,{ref:"table",api:u.api,params:u.search,tableColumn:u.tableColumn,stripe:"",highlightCurrentRow:"",onRowClick:s.rowClick},{default:(0,a.w5)((()=>[(0,a.Wm)(k,{type:"index",width:"60",align:"center"},{default:(0,a.w5)((e=>[(0,a._)("span",null,(0,n.zw)(e.$index+(u.currentPage-1)*u.limit+1),1)])),_:1})])),_:1},8,["api","params","tableColumn","onRowClick"])])),_:1})])),_:1})])),_:1})])),_:1})])),_:1}),(0,a.Wm)(W,{modelValue:u.infoDrawer,"onUpdate:modelValue":t[2]||(t[2]=e=>u.infoDrawer=e),title:"日志详情",size:700,"destroy-on-close":""},{default:(0,a.w5)((()=>[(0,a.Wm)(x,{ref:"info"},null,512)])),_:1},8,["modelValue"])],64)}var u=l(328),s=l(7844),p=l(4751),h=l(1843),d={name:"log",components:{info:u["default"],columnItem:p.Z,xMenuItem:h.Z,xEcharts:s.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,l){var a=t+"=([^&]*)";if(""===l)return e=e.replace(new RegExp("&?"+a,"gi"),""),e=e.replace(new RegExp("\\??"+a+"&?","gi"),"?"),e;var n=t+"="+l;if(e.match(a)){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,l]of Object.entries(this.search))e=this.changeURLArg(e,t,l);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=l(8700);const f=(0,m.Z)(d,[["render",c],["__scopeId","data-v-79c6f9d2"]]);var g=f}}]); |