更新stat, 增加drawer, dialog查看方式

This commit is contained in:
小陌 2024-01-08 17:16:10 +08:00
parent cb64ceb81b
commit c8e7c5e6da
19 changed files with 272 additions and 155 deletions

2
dist/index.html vendored
View File

@ -1,4 +1,4 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/><meta content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=0" name="viewport"/><link rel="icon" href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/x-Admin/favicon.ico"><title>X-PHP</title><script>document.write("<script src='config.js'><\/script>");</script><script defer="defer" src="https://ansnid.oss-cn-shenzhen.aliyuncs.com/x-Admin/static/js/echarts.49558cc4.js"></script><script defer="defer" src="https://ansnid.oss-cn-shenzhen.aliyuncs.com/x-Admin/static/js/elicons.4bccae06.js"></script><script defer="defer" src="https://ansnid.oss-cn-shenzhen.aliyuncs.com/x-Admin/static/js/modules.af2834df.js"></script><script defer="defer" src="https://ansnid.oss-cn-shenzhen.aliyuncs.com/x-Admin/static/js/app.62cc22b5.js"></script><link href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/x-Admin/static/css/modules.34563575.css" rel="stylesheet"><link href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/x-Admin/static/css/app.e110d068.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but X-PHP doesn't work properly without JavaScript enabled.</strong></noscript><div id="app" class="aminui"><div class="app-loading"><div class="app-loading__logo"></div><div class="app-loading__loader"></div></div></div></body><div id="versionCheck" class="versionCheck"><h2>当前浏览器内核版本过低</h2><p>当前版本:<span id="versionCheck-type">--</span> <span id="versionCheck-version">--</span></p><p>最低版本要求Chrome 71+、Firefox 65+、Safari 12+、Edge 97+。</p><p>请升级浏览器版本,或更换现代浏览器,如果你使用的是双核浏览器,请切换到极速/高速模式。</p></div><style>.app-loading {
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/><meta content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=0" name="viewport"/><link rel="icon" href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/x-Admin/favicon.ico"><title>X-PHP</title><script>document.write("<script src='config.js'><\/script>");</script><script defer="defer" src="https://ansnid.oss-cn-shenzhen.aliyuncs.com/x-Admin/static/js/echarts.49558cc4.js"></script><script defer="defer" src="https://ansnid.oss-cn-shenzhen.aliyuncs.com/x-Admin/static/js/elicons.4bccae06.js"></script><script defer="defer" src="https://ansnid.oss-cn-shenzhen.aliyuncs.com/x-Admin/static/js/modules.af2834df.js"></script><script defer="defer" src="https://ansnid.oss-cn-shenzhen.aliyuncs.com/x-Admin/static/js/app.ef56ee00.js"></script><link href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/x-Admin/static/css/modules.34563575.css" rel="stylesheet"><link href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/x-Admin/static/css/app.9d15ee10.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but X-PHP doesn't work properly without JavaScript enabled.</strong></noscript><div id="app" class="aminui"><div class="app-loading"><div class="app-loading__logo"></div><div class="app-loading__loader"></div></div></div></body><div id="versionCheck" class="versionCheck"><h2>当前浏览器内核版本过低</h2><p>当前版本:<span id="versionCheck-type">--</span> <span id="versionCheck-version">--</span></p><p>最低版本要求Chrome 71+、Firefox 65+、Safari 12+、Edge 97+。</p><p>请升级浏览器版本,或更换现代浏览器,如果你使用的是双核浏览器,请切换到极速/高速模式。</p></div><style>.app-loading {
position: absolute;
top:0px;
left:0px;

4
dist/report.html vendored

File diff suppressed because one or more lines are too long

1
dist/static/css/app.9d15ee10.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
"use strict";(self["webpackChunkx_php_admin"]=self["webpackChunkx_php_admin"]||[]).push([[251],{251:function(e,t,a){a.r(t),a.d(t,{default:function(){return m}});var r=a(6808),l=a(9511);const n={class:"left-panel"},i={class:"right-panel"},s={class:"right-panel-search"};function c(e,t,a,c,o,u){const h=(0,r.up)("el-date-picker"),p=(0,r.up)("el-input"),d=(0,r.up)("el-button"),m=(0,r.up)("el-header"),g=(0,r.up)("el-table-column"),f=(0,r.up)("xTable"),w=(0,r.up)("el-main"),b=(0,r.up)("el-container");return(0,r.wg)(),(0,r.j4)(b,{class:"container"},{default:(0,r.w5)((()=>[(0,r.Wm)(m,null,{default:(0,r.w5)((()=>[(0,r._)("div",n,[(0,r.Wm)(h,{modelValue:o.date,"onUpdate:modelValue":t[0]||(t[0]=e=>o.date=e),type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},null,8,["modelValue"])]),(0,r._)("div",i,[(0,r._)("div",s,[(0,r.Wm)(p,{modelValue:o.search.keyword,"onUpdate:modelValue":t[1]||(t[1]=e=>o.search.keyword=e),placeholder:"输入关键词",clearable:""},null,8,["modelValue"]),(0,r.Wm)(d,{type:"primary",icon:"el-icon-search",onClick:u.upsearch},null,8,["onClick"])])])])),_:1}),(0,r.Wm)(w,{class:"nopadding"},{default:(0,r.w5)((()=>[(0,r.Wm)(f,{ref:"table",api:o.api,params:o.search,tableColumn:o.tableColumn,stripe:"",highlightCurrentRow:"",onRowClick:u.rowClick},{default:(0,r.w5)((()=>[(0,r.Wm)(g,{type:"index",width:"60",align:"center"},{default:(0,r.w5)((e=>[(0,r._)("span",null,(0,l.zw)(e.$index+(o.currentPage-1)*o.limit+1),1)])),_:1})])),_:1},8,["api","params","tableColumn","onRowClick"])])),_:1})])),_:1})}var o=a(9379),u=a(1843),h={name:"log",components:{columnItem:o.Z,xMenuItem: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 r=t+"=([^&]*)";if(""===a)return e=e.replace(new RegExp("&?"+r,"gi"),""),e=e.replace(new RegExp("\\??"+r+"&?","gi"),"?"),e;var l=t+"="+a;if(e.match(r)){var n="("+t+"=)([^&]*)";return n=e.replace(new RegExp(n,"gi"),l),n}return e.match("[?]")?e+"&"+l:e+"?"+l},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)}))}}},p=a(8700);const d=(0,p.Z)(h,[["render",c],["__scopeId","data-v-eba8b6d4"]]);var m=d}}]);
"use strict";(self["webpackChunkx_php_admin"]=self["webpackChunkx_php_admin"]||[]).push([[251],{251:function(e,t,a){a.r(t),a.d(t,{default:function(){return m}});var r=a(6808),l=a(9511);const n={class:"left-panel"},i={class:"right-panel"},s={class:"right-panel-search"};function c(e,t,a,c,o,u){const h=(0,r.up)("el-date-picker"),p=(0,r.up)("el-input"),d=(0,r.up)("el-button"),m=(0,r.up)("el-header"),g=(0,r.up)("el-table-column"),f=(0,r.up)("xTable"),w=(0,r.up)("el-main"),b=(0,r.up)("el-container");return(0,r.wg)(),(0,r.j4)(b,{class:"container"},{default:(0,r.w5)((()=>[(0,r.Wm)(m,null,{default:(0,r.w5)((()=>[(0,r._)("div",n,[(0,r.Wm)(h,{modelValue:o.date,"onUpdate:modelValue":t[0]||(t[0]=e=>o.date=e),type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},null,8,["modelValue"])]),(0,r._)("div",i,[(0,r._)("div",s,[(0,r.Wm)(p,{modelValue:o.search.keyword,"onUpdate:modelValue":t[1]||(t[1]=e=>o.search.keyword=e),placeholder:"输入关键词",clearable:""},null,8,["modelValue"]),(0,r.Wm)(d,{type:"primary",icon:"el-icon-search",onClick:u.upsearch},null,8,["onClick"])])])])),_:1}),(0,r.Wm)(w,{class:"nopadding"},{default:(0,r.w5)((()=>[(0,r.Wm)(f,{ref:"table",api:o.api,params:o.search,tableColumn:o.tableColumn,stripe:"",highlightCurrentRow:"",onRowClick:u.rowClick},{default:(0,r.w5)((()=>[(0,r.Wm)(g,{type:"index",width:"60",align:"center"},{default:(0,r.w5)((e=>[(0,r._)("span",null,(0,l.zw)(e.$index+(o.currentPage-1)*o.limit+1),1)])),_:1})])),_:1},8,["api","params","tableColumn","onRowClick"])])),_:1})])),_:1})}var o=a(9374),u=a(1843),h={name:"log",components:{columnItem:o.Z,xMenuItem: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 r=t+"=([^&]*)";if(""===a)return e=e.replace(new RegExp("&?"+r,"gi"),""),e=e.replace(new RegExp("\\??"+r+"&?","gi"),"?"),e;var l=t+"="+a;if(e.match(r)){var n="("+t+"=)([^&]*)";return n=e.replace(new RegExp(n,"gi"),l),n}return e.match("[?]")?e+"&"+l:e+"?"+l},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)}))}}},p=a(8700);const d=(0,p.Z)(h,[["render",c],["__scopeId","data-v-eba8b6d4"]]);var m=d}}]);

1
dist/static/js/49.5fe21ac0.js vendored Normal file
View File

@ -0,0 +1 @@
"use strict";(self["webpackChunkx_php_admin"]=self["webpackChunkx_php_admin"]||[]).push([[49],{5049:function(t,e,n){n.r(e),n.d(e,{default:function(){return o}});var a=n(6808);function s(t,e,n,s,r,u){const m=(0,a.up)("x-stat");return(0,a.wg)(),(0,a.j4)(m,{name:r.statName,ref:"stat"},null,8,["name"])}var r={name:"stat",components:{},data(){return{statName:this.$route.meta.tablename}},mounted(){var t=Object.assign({},this.$route.meta);delete t.type,delete t.breadcrumb,this.$refs.stat.getComponentType("containe").setConfig(t)}},u=n(8700);const m=(0,u.Z)(r,[["render",s]]);var o=m}}]);

View File

@ -1 +0,0 @@
"use strict";(self["webpackChunkx_php_admin"]=self["webpackChunkx_php_admin"]||[]).push([[49],{5596:function(e,t,n){n.r(t),n.d(t,{default:function(){return p}});var i=n(6808),a=n(9511),r=n(1441);function h(e,t,n,h,l,o){return(0,i.wg)(),(0,i.iD)("div",{class:"x-code-editor",style:(0,a.j5)({height:o._height})},[(0,i.wy)((0,i._)("textarea",{ref:"textarea","onUpdate:modelValue":t[0]||(t[0]=e=>l.contentValue=e)},null,512),[[r.nr,l.contentValue]])],4)}var l=n(3839),o=n(3322),u=n.n(o),s=(n(5935),n(8881),n(2876),{props:{modelValue:{type:String,default:""},mode:{type:String,default:"javascript"},height:{type:[String,Number],default:300},options:{type:Object,default:()=>{}},theme:{type:String,default:"idea"},readOnly:{type:Boolean,default:!1}},data(){return{contentValue:this.modelValue,coder:null,opt:{theme:this.theme,styleActiveLine:!0,lineNumbers:!0,lineWrapping:!1,tabSize:4,indentUnit:4,indentWithTabs:!0,mode:this.mode,readOnly:this.readOnly,...this.options}}},computed:{_height(){return Number(this.height)?Number(this.height)+"px":this.height}},watch:{modelValue(e){this.contentValue=e,e!==this.coder.getValue()&&this.coder.setValue(e)}},mounted(){this.init()},methods:{init(){this.coder=(0,l.Xl)(u().fromTextArea(this.$refs.textarea,this.opt)),this.coder.on("change",(e=>{this.contentValue=e.getValue(),this.$emit("update:modelValue",this.contentValue)}))},formatStrInJson(e){return JSON.stringify(JSON.parse(e),null,4)}}}),d=n(8700);const c=(0,d.Z)(s,[["render",h],["__scopeId","data-v-1c04bc3c"]]);var p=c}}]);

View File

@ -1 +1 @@
"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(9379),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}}]);
"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(9374),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}}]);

1
dist/static/js/601.d15eb049.js vendored Normal file
View File

@ -0,0 +1 @@
"use strict";(self["webpackChunkx_php_admin"]=self["webpackChunkx_php_admin"]||[]).push([[601],{5596:function(e,t,n){n.r(t),n.d(t,{default:function(){return p}});var i=n(6808),a=n(9511),r=n(1441);function h(e,t,n,h,l,o){return(0,i.wg)(),(0,i.iD)("div",{class:"x-code-editor",style:(0,a.j5)({height:o._height})},[(0,i.wy)((0,i._)("textarea",{ref:"textarea","onUpdate:modelValue":t[0]||(t[0]=e=>l.contentValue=e)},null,512),[[r.nr,l.contentValue]])],4)}var l=n(3839),o=n(3322),u=n.n(o),s=(n(5935),n(8881),n(2876),{props:{modelValue:{type:String,default:""},mode:{type:String,default:"javascript"},height:{type:[String,Number],default:300},options:{type:Object,default:()=>{}},theme:{type:String,default:"idea"},readOnly:{type:Boolean,default:!1}},data(){return{contentValue:this.modelValue,coder:null,opt:{theme:this.theme,styleActiveLine:!0,lineNumbers:!0,lineWrapping:!1,tabSize:4,indentUnit:4,indentWithTabs:!0,mode:this.mode,readOnly:this.readOnly,...this.options}}},computed:{_height(){return Number(this.height)?Number(this.height)+"px":this.height}},watch:{modelValue(e){this.contentValue=e,e!==this.coder.getValue()&&this.coder.setValue(e)}},mounted(){this.init()},methods:{init(){this.coder=(0,l.Xl)(u().fromTextArea(this.$refs.textarea,this.opt)),this.coder.on("change",(e=>{this.contentValue=e.getValue(),this.$emit("update:modelValue",this.contentValue)}))},formatStrInJson(e){return JSON.stringify(JSON.parse(e),null,4)}}}),d=n(8700);const c=(0,d.Z)(s,[["render",h],["__scopeId","data-v-1c04bc3c"]]);var p=c}}]);

View File

@ -1 +0,0 @@
"use strict";(self["webpackChunkx_php_admin"]=self["webpackChunkx_php_admin"]||[]).push([[828],{8828:function(n,t,e){e.r(t),e.d(t,{default:function(){return o}});var a=e(6808);function u(n,t,e,u,r,s){const m=(0,a.up)("x-stat");return(0,a.wg)(),(0,a.j4)(m,{name:r.statName,component:"containe"},null,8,["name"])}var r={name:"stat",components:{},data(){return{statName:this.$route.meta.tablename}},mounted(){}},s=e(8700);const m=(0,s.Z)(r,[["render",u]]);var o=m}}]);

File diff suppressed because one or more lines are too long

1
dist/static/js/app.ef56ee00.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,34 +1,35 @@
<template>
<el-container>
<el-header v-if="this.date || dateGroup.length > 0">
<el-header>
<div class="left-panel">
<el-radio-group v-model="dateType" v-if="dateGroup.length > 0" @change="changedateGroup" style="margin-right: 15px;">
<el-radio-button v-for="item in dateGroup" :key="item.value" :label="item.text" :name="item.value"></el-radio-button>
<el-radio-group v-model="dateType" v-if="data.dateGroup && data.dateGroup.length > 0" @change="changedateGroup" style="margin-right: 10px;">
<el-radio-button v-for="item in data.dateGroup" :key="item.key" :label="item.value" :value="item.value">{{ item.label }}</el-radio-button>
</el-radio-group>
<el-date-picker class="hidden-sm-and-down" v-if="this.date" @change="changedate" format="YYYY-MM-DD HH:mm" v-model="date" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
<el-date-picker class="hidden-sm-and-down" @change="changedate" format="YYYY-MM-DD HH:mm" value-format="YYYY-MM-DD HH:mm" v-model="search.date" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</div>
</el-header>
<el-main>
<el-card shadow="never" v-if="statistic.length > 0 || chartList.length > 0" class="xcard">
<el-scrollbar>
<el-main v-loading="statloading">
<el-empty v-if="!data.statistic && !data.chartList && !data.table" description="没有找到相关统计" style="padding: 200px 0;" />
<el-card shadow="never" v-if="(data.statistic && data.statistic.length > 0) || (data.chartList && data.chartList.length > 0)" class="xcard">
<el-scrollbar v-if="data.statistic && data.statistic.length > 0" style="border-bottom: 1px solid #f0f0f0;margin-bottom: 10px;">
<div class="number-data">
<div class="item" v-for="(s, index) in statistic" :key="index">
<div class="item" v-for="(s, index) in data.statistic" :key="index">
<x-statistic :title="s.title" :value="s.value" :description="s.description" :tips="s.tips" groupSeparator>
<x-trend v-model="s.trend" v-if="s.trend"></x-trend>
</x-statistic>
</div>
</div>
</el-scrollbar>
<div class="chart" v-if="chartList.length > 0">
<div class="chart" v-if="data.chartList && data.chartList.length > 0">
<el-row>
<el-col :span="c.span || 12" v-for="(c, index) in chartList" :key="index">
<el-col :span="c.span || 12" v-for="(c, index) in data.chartList" :key="index">
<xEcharts :height="c.height ? Number(c.height) ? Number(c.height) + 'px' : c.height : '250px'" :option="c.option"></xEcharts>
</el-col>
</el-row>
</div>
</el-card>
<el-card shadow="never" v-if="table && table.column.length > 0" class="xcard">
<xTable ref="table" :data="table.data" :api="table.api" :tableColumn="table.column" :hideDo="table.hideDo || true" :hidePagination="table.hidePagination || true" :height="table.height || 'auto'">
<el-card shadow="never" v-if="data.table && data.table.column.length > 0" class="xcard">
<xTable ref="table" :data="data.table.data" :api="data.table.api" :tableColumn="data.table.column" :hideDo="data.table.hideDo || true" :hidePagination="data.table.hidePagination || true" :height="data.table.height || 'auto'">
<el-table-column type="index" width="50" fixed />
</xTable>
</el-card>
@ -46,74 +47,43 @@ export default {
xStatistic,
},
props: {
name: { type: String, default: "" },
data: {
type: Object, default: () => ({
statistic: [],
chartList: [],
dateGroup: [],
table: {},
})
},
info: { type: Object, default: () => ({}) },
statloading: { type: Boolean, default: false },
},
data() {
return {
dateGroup: [
],
chartList: [
],
statistic: [
],
table: {
api: null,
height: 0,
data: [],
column: [],
},
dateType: '',
date: null,
statName: this.$route.meta.tablename,
search: this.info,
dateType: null,
}
},
watch: {
//props
date() {
},
search: {
handler: function (newSearch) {
this.$emit('search-updated', newSearch);
},
deep: true,
immediate: false
}
},
mounted() {
const now = new Date();
const lastDay = new Date(now.getFullYear(), now.getMonth() + 1, 0);
lastDay.setHours(23, 59, 0, 0);
this.date = [new Date(now.getFullYear(), now.getMonth(), 1, 0, 0), lastDay];
if (this.name) {
this.statName = this.name || this.$route.meta.tablename;
}
this.loaddata();
this.search = this.info;
},
methods: {
changedateGroup() {
this.dateGroup.forEach((item) => {
if (this.dateType === item.text) {
this.date = item.value;
this.loaddata();
this.data.dateGroup.forEach((item) => {
if (this.dateType === item.value) {
this.search[item.key] = item.value;
}
})
},
changedate() {
this.loaddata()
},
loaddata() {
//
if (this.statName) {
this.$http.get('stat/admin/get', { name: this.statName, date: this.date }).then((res) => {
if (res.code == 200) {
Object.assign(this.$data, res.data);
this.dateType = '';
this.dateGroup.forEach((item) => {
if (new Date(item.value[0]).getTime() == new Date(this.date[0]).getTime() && new Date(item.value[1]).getTime() == new Date(this.date[1]).getTime()) {
this.dateType = item.text;
}
})
}
});
}
}
}
}
</script>
@ -167,8 +137,7 @@ export default {
}
.chart {
border-top: 1px solid #f0f0f0;
padding-top: 20px;
padding-top: 10px;
}
.dark .number-data .item {

View File

@ -0,0 +1,122 @@
<template>
<el-container>
测试
</el-container>
</template>
<script>
import xEcharts from '@/components/xEcharts';
import xStatistic from '@/components/xStatistic';
export default {
name: 'chartlist',
components: {
xEcharts,
xStatistic,
},
props: {
data: {
type: Object, default: () => ({
statistic: [],
chartList: [],
dateGroup: [],
table: {},
})
},
info: { type: Object, default: () => ({}) },
statloading: { type: Boolean, default: false },
},
data() {
return {
search: this.info,
dateType: null,
}
},
watch: {
search: {
handler: function (newSearch) {
this.$emit('search-updated', newSearch);
},
deep: true,
immediate: false
}
},
mounted() {
this.search = this.info;
},
methods: {
changedateGroup() {
this.data.dateGroup.forEach((item) => {
if (this.dateType === item.value) {
this.search[item.key] = item.value;
}
})
},
}
}
</script>
<style scoped>
.xcard:not(:last-child) {
margin-bottom: 10px;
}
.xcard:deep(.el-card__body) {
padding: 10px
}
.number-data {
display: flex;
flex-wrap: nowrap;
margin-bottom: 20px;
}
.number-data .item {
flex: 1;
border-right: 1px solid #f0f0f0;
padding: 0 20px;
flex-shrink: 0;
display: flex;
white-space: nowrap;
}
.number-data .item:last-child {
border: 0;
}
.number-data .item h2 {
font-size: 12px;
color: #787a7d;
font-weight: normal;
display: flex;
align-items: center;
}
.number-data .item h2 i {
margin-left: 5px;
color: #8cc5ff;
cursor: pointer;
}
.number-data .item p {
font-size: 20px;
color: #121315;
margin-top: 10px;
}
.chart {
border-top: 1px solid #f0f0f0;
padding-top: 20px;
}
.dark .number-data .item {
border-color: var(--el-border-color-light);
}
.dark .number-data .item p {
color: #d0d0d0;
}
.dark .chart {
border-color: var(--el-border-color-light);
}
</style>

View File

@ -3,10 +3,13 @@
-->
<template>
<div class="x-stat">
<component :is="componentType" :title="lable || '查看统计'" v-model="visible" :size="size" :style="style" @closed="$emit('closed')">
<el-main>
<el-skeleton v-if="loading" :rows="4" />
<stat_1 :name="value"></stat_1>
<component :is="componentType" :title="config.title || config.label || '查看统计'" v-model="visible" :size="config.size" :style="style" @closed="$emit('closed')">
<el-main v-loading="loading">
<el-skeleton v-if="loading" :rows="8" />
<div v-if="!loading">
<stat_2 v-if="config.component == '2'" :data="data" :statloading="statloading" :info="search" @search-updated="handleSearchUpdated"></stat_2>
<stat_1 v-else :data="data" :statloading="statloading" :info="search" @search-updated="handleSearchUpdated"></stat_1>
</div>
</el-main>
</component>
</div>
@ -15,6 +18,7 @@
.x-stat .el-main:first-of-type {
padding: 0px;
}
.x-stat:deep(.el-input) .el-input__wrapper {
min-width: 50px;
}
@ -22,46 +26,55 @@
<script>
import stat_1 from './components/1';
import stat_2 from './components/2';
export default {
emits: ['success', 'closed'],
props: {
column: { type: Array, default: () => [] },
name: { type: String, default: "" },
component: { type: String, default: "" },
},
components: {
stat_1
stat_1,
stat_2,
},
data() {
return {
loading: false,
mode: "plus",
lable: "",
value: this.name,
token: '',
data: {},
style: {},
size: 900,
loading: true,
statloading: false,
visible: false,
type: 'dialog',
style: {},
config: {
size: 900
},
data: {},
search: {},
date: []
}
},
watch: {
column() {
this.config.column = this.column;
}
},
computed: {
componentType() {
return this.type == 'containe' ? 'el-containe' : (this.type == 'drawer' ? 'el-drawer' : 'x-dialog');
return this.config.type == 'containe' ? 'el-containe' : (this.config.type == 'drawer' ? 'el-drawer' : 'x-dialog');
}
},
mounted() {
this.getComponentType(this.component);
},
methods: {
handleSearchUpdated(newSearch) {
this.statloading = true;
this.$http.get(this.config.remoteurl || 'stat/admin/get', newSearch, { cache: this.config.cache ? true : false }).then((res) => {
this.statloading = false;
if (res.code == 200) {
Object.assign(this.data, res.data);
return true;
}
this.$alert(res.message, "提示", { type: 'error' });
});
},
getComponentType(type) {
this.type = type;
this.config.type = type;
return this;
},
//
@ -69,50 +82,60 @@ export default {
this.visible = true;
return this;
},
getMonthDates() {
const currentDate = new Date();
const year = currentDate.getFullYear();
const month = currentDate.getMonth() + 1; // JavaScript 0 1
const startOfMonth = new Date(year, month - 1, 1);
const endOfMonth = new Date(year, month, 0, 23, 59, 59); //
const startDate = this.formatDate(startOfMonth);
const endDate = this.formatDate(endOfMonth);
return [startDate, endDate];
},
formatDate(date) {
const year = date.getFullYear();
const month = this.padZero(date.getMonth() + 1);
const day = this.padZero(date.getDate());
const hours = this.padZero(date.getHours());
const minutes = this.padZero(date.getMinutes());
return `${year}-${month}-${day} ${hours}:${minutes}`;
},
padZero(value) {
return String(value).padStart(2, '0');
},
//
setConfig(o) {
Object.assign(this.$data, o);
// if (typeof this.config.key !== 'undefined' && this.config.key) {
// this.key = this.config.key;
// }
// //
// if (this.config.remoteurl) {
// this.loading = true;
// setTimeout(async () => {
// var res = await this.$http.post(this.config.remoteurl, { [this.key]: this.data[this.key] })
// if (res.code == 200) {
// this.loading = false;
// if (res.data.config) {
// Object.assign(this.config, res.data.config);
// }
Object.assign(this.config, o);
this.loading = true;
this.search.name = this.config.value || this.config.name || this.name;
//
if (typeof this.config.key !== 'undefined' && this.config.key) {
this.search[this.config.key] = this.data[this.config.key];
}
//
if (typeof this.search.date == 'undefined') {
this.search.date = this.getMonthDates();
}
this.$http.get(this.config.remoteurl || 'stat/admin/get', this.search, { cache: this.config.cache ? true : false }).then((res) => {
this.loading = false;
if (res.code == 200) {
//
if (res.config) {
Object.assign(this.config, res.config);
}
// if (res.data.data) {
// this.config.merge ? Object.assign(this.data, res.data.data) : this.setData(res.data.data)
// }
//
if (res.style) {
Object.assign(this.style, res.style);
}
// if (res.data.token) {
// this.token = res.data.token
// }
// if (res.data.size) {
// this.size = res.data.size
// }
// if (res.data.type && res.data.type !== this.type) {
// this.getComponentType(res.data.type)
// }
// if (res.data.style) {
// this.style = res.data.style;
// }
// return;
// }
// this.visible = false;
// this.$alert(res.message, "", { type: 'error' });
// }, 100)
// return false;
// }
Object.assign(this.data, res.data);
return true;
}
this.visible = false;
this.$alert(res.message, "提示", { type: 'error' });
});
},
//
setData(data) {

View File

@ -1,8 +1,9 @@
<template>
<div style="display: flex;">
<el-badge v-if="item.status && item.status.key && row[item.status.key]" is-dot class="item" :type="item.status.type || 'primary'" style="width: 10px;cursor: pointer;margin-top: 10px;"></el-badge>
<x-avatar v-if="item.columntype == 'avatar' || item.component == 'avatar'" :name="item.name" :options="item.options" :data="row"></x-avatar>
<el-badge v-else-if="item.status && item.status.key && row[item.status.key]" is-dot class="item" :type="item.status.type || 'primary'" style="width: 10px;cursor: pointer;margin-top: 10px;"></el-badge>
<el-badge v-else-if="item.columntype == 'badge' || item.columntype == 'imagegroup'" :value="getType(row[item.name])" @click="handleClick(row, item)" v-bind="item.options" style="cursor: pointer; "></el-badge>
<el-link v-else-if="item.columntype == 'link'" v-bind="item.options" @click="handleClick(row, item)"> {{ row[item.name] }} </el-link>
<el-image v-else-if="item.columntype == 'image'" :preview-src-list="[getImg(row[item.name])]" :preview-teleported="true" hide-on-click-modal="true" lazy="true" style="max-width: 60px; height: 26px; border-radius: 2px;" fit="cover" :src="getImg(row[item.name])">
<template #error>
<div class="image-slot">
@ -16,22 +17,19 @@
<x-status-indicator :key="value" pulse :type="type" :label="label" @click="handleClick(row, item)" v-if="value == row[item.name]"></x-status-indicator>
</template>
</p>
<p v-else-if="item.columntype == 'button' && item.options.items && item.options.items.length > 0">
<template v-for="op in item.options.items">
<el-button @click="handleClick(row, op.options || item)" :key="op.value" :type="op.type || 'warning'" :size="op.size || 'small'" v-bind="op" v-if="op.value == row[item.name]">
{{ op.label }}
</el-button>
</template>
</p>
<p v-else-if="item.columntype == 'button'">
<el-button @click="handleClick(row, item)" :type="item.options.type || 'warning'" v-bind="item.options"> {{ row[item.name] }} </el-button>
</p>
<p v-else-if="item.columntype == 'link'">
<el-link v-bind="item.options" @click="handleClick(row, item)"> {{ row[item.name] }} </el-link>
<span v-if="item.options.items && item.options.items.length > 0">
<template v-for="op in item.options.items">
<el-button @click="handleClick(row, op.options || item)" :key="op.value" :type="op.type || 'warning'" :size="op.size || 'small'" v-bind="op" v-if="op.value == row[item.name]">
{{ op.label }}
</el-button>
</template>
</span>
<el-button v-else @click="handleClick(row, item)" :type="item.options.type || 'warning'" v-bind="item.options"> {{ row[item.name] }} </el-button>
</p>
<p v-else-if="item.columntype == 'text'">
<el-text v-bind="item.options" @click="handleClick(row, item)" style="cursor: pointer;display: inline;"> {{ row[item.name] }} </el-text>
<el-text v-bind="item.options" v-if="item.copy" v-copy="row[item.copy]" style="cursor: pointer;display: inline;"> {{ row[item.name] }} </el-text>
<el-text v-bind="item.options" v-else @click="handleClick(row, item)" style="cursor: pointer;display: inline;"> {{ row[item.name] }} </el-text>
</p>
<p v-else-if="item.columntype == 'tag' || item.columntype == 'time'" @click="handleClick(row, item)" v-time.tip="row[item.name]"></p>
<slot v-else :name="item.name">

View File

@ -1,5 +1,5 @@
<template>
<x-stat :name="statName" component="containe"></x-stat>
<x-stat :name="statName" ref="stat"></x-stat>
</template>
<script>
@ -11,6 +11,11 @@ export default {
statName: this.$route.meta.tablename,
}
},
mounted() {},
mounted() {
var config = Object.assign({}, this.$route.meta);
delete config.type;
delete config.breadcrumb;
this.$refs.stat.getComponentType('containe').setConfig(config)
},
}
</script>