diff --git a/nezha-fronted/src/components/page/alert/config.vue b/nezha-fronted/src/components/page/alert/config.vue index f7044522f..48c6e820d 100644 --- a/nezha-fronted/src/components/page/alert/config.vue +++ b/nezha-fronted/src/components/page/alert/config.vue @@ -535,6 +535,7 @@ this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; + this.tableTitleReset(this.tableTitle,this.tools.customTableTitle); //是否存在分页缓存 let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if (pageSize != 'undefined' && pageSize != null) { diff --git a/nezha-fronted/src/components/page/alert/list.vue b/nezha-fronted/src/components/page/alert/list.vue index ea5db8189..bad6d223e 100644 --- a/nezha-fronted/src/components/page/alert/list.vue +++ b/nezha-fronted/src/components/page/alert/list.vue @@ -685,6 +685,7 @@ this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; + this.tableTitleReset(this.tableTitle,this.tools.customTableTitle); //是否存在分页缓存 let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if (pageSize != 'undefined' && pageSize != null) { diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index 7fc35efd1..b837065af 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -737,6 +737,8 @@ ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; + this.tableTitleReset(this.tableTitle,tableTitle); + if (this.assetPingSwitch == 'off') { this.dispatchEvent('asset-ping-switch-change',false) for (let i in tableTitle) { diff --git a/nezha-fronted/src/components/page/config/account.vue b/nezha-fronted/src/components/page/config/account.vue index 53e7bde1b..81dea8482 100644 --- a/nezha-fronted/src/components/page/config/account.vue +++ b/nezha-fronted/src/components/page/config/account.vue @@ -365,6 +365,7 @@ this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; + this.tableTitleReset(this.tableTitle,this.tools.customTableTitle); //是否存在分页缓存 let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if (pageSize != 'undefined' && pageSize != null) { diff --git a/nezha-fronted/src/components/page/config/dc.vue b/nezha-fronted/src/components/page/config/dc.vue index 1255dde96..ee2fdd8eb 100644 --- a/nezha-fronted/src/components/page/config/dc.vue +++ b/nezha-fronted/src/components/page/config/dc.vue @@ -448,6 +448,7 @@ this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; + this.tableTitleReset(this.tableTitle,this.tools.customTableTitle); //是否存在分页缓存 let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if (pageSize != 'undefined' && pageSize != null) { diff --git a/nezha-fronted/src/components/page/config/mib.vue b/nezha-fronted/src/components/page/config/mib.vue index 42f13fbe5..d53749fc2 100644 --- a/nezha-fronted/src/components/page/config/mib.vue +++ b/nezha-fronted/src/components/page/config/mib.vue @@ -336,6 +336,7 @@ this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; + this.tableTitleReset(this.tableTitle,this.tools.customTableTitle); //是否存在分页缓存 let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if (pageSize != 'undefined' && pageSize != null) { diff --git a/nezha-fronted/src/components/page/config/model.vue b/nezha-fronted/src/components/page/config/model.vue index 31eafeeee..ad5683597 100644 --- a/nezha-fronted/src/components/page/config/model.vue +++ b/nezha-fronted/src/components/page/config/model.vue @@ -336,6 +336,7 @@ this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; + this.tableTitleReset(this.tableTitle,this.tools.customTableTitle); //是否存在分页缓存 let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if (pageSize != 'undefined' && pageSize != null) { diff --git a/nezha-fronted/src/components/page/config/operationlog.vue b/nezha-fronted/src/components/page/config/operationlog.vue index d6b492215..497eb7cf2 100644 --- a/nezha-fronted/src/components/page/config/operationlog.vue +++ b/nezha-fronted/src/components/page/config/operationlog.vue @@ -272,6 +272,7 @@ this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; + this.tableTitleReset(this.tableTitle,this.tools.customTableTitle); //是否存在分页缓存 let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if (pageSize && pageSize != 'undefined') { diff --git a/nezha-fronted/src/components/page/config/promServer.vue b/nezha-fronted/src/components/page/config/promServer.vue index 70ac76549..e7a26fa75 100644 --- a/nezha-fronted/src/components/page/config/promServer.vue +++ b/nezha-fronted/src/components/page/config/promServer.vue @@ -406,6 +406,7 @@ this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; + this.tableTitleReset(this.tableTitle,this.tools.customTableTitle); //是否存在分页缓存 let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if (pageSize != 'undefined' && pageSize != null) { diff --git a/nezha-fronted/src/components/page/config/terminallog.vue b/nezha-fronted/src/components/page/config/terminallog.vue index cdb106b13..4337814cf 100644 --- a/nezha-fronted/src/components/page/config/terminallog.vue +++ b/nezha-fronted/src/components/page/config/terminallog.vue @@ -290,6 +290,7 @@ this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; + this.tableTitleReset(this.tableTitle,this.tools.customTableTitle); //是否存在分页缓存 let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if (pageSize && pageSize != 'undefined') { diff --git a/nezha-fronted/src/components/page/dashboard/overview/chart.vue b/nezha-fronted/src/components/page/dashboard/overview/chart.vue index 6407bd895..8362c8048 100644 --- a/nezha-fronted/src/components/page/dashboard/overview/chart.vue +++ b/nezha-fronted/src/components/page/dashboard/overview/chart.vue @@ -163,6 +163,18 @@ this.option.yAxis.axisLabel.formatter=this.defaultYAxisFormatter } } + if(this.chartType == 'overviewLine'){ + this.option.xAxis.axisLabel.formatter=function(value,index){ + value=bus.computeTimezone(value) + let t_date = new Date(value); + let month=t_date.getMonth()+1>9?t_date.getMonth()+1:'0'+(t_date.getMonth()+1); + let day = t_date.getDate()>9?t_date.getDate():'0'+t_date.getDate(); + let hour = t_date.getHours()>9?t_date.getHours():'0'+t_date.getHours(); + let minute=t_date.getMinutes()>9?t_date.getMinutes():'0'+t_date.getMinutes(); + return [ month, day].join('-') + "\n" + + [hour, minute].join(':'); + } + } if(this.series){ this.$set(this.option,'series',this.series); this.noData=false; diff --git a/nezha-fronted/src/components/page/dashboard/overview/chartConfig.vue b/nezha-fronted/src/components/page/dashboard/overview/chartConfig.vue index 64f123315..e63a941ec 100644 --- a/nezha-fronted/src/components/page/dashboard/overview/chartConfig.vue +++ b/nezha-fronted/src/components/page/dashboard/overview/chartConfig.vue @@ -88,7 +88,7 @@ type: 'time', // boundaryGap: false,//line-false; bar-true; axisLabel: { - intervale: 0, + interval: 0, rotate: 0, formatter: function (value) { value=value @@ -313,19 +313,6 @@ }, toolbox:{ show:false, - top:'0', - showTitle:false, - tooltip:{ - show:false, - }, - feature:{ - dataZoom:{ - yAxisIndex:false - }, - magicType:{ - type:['stack'] - }, - } }, tooltip: { trigger: 'axis', @@ -344,22 +331,8 @@ xAxis: { type: 'time', axisLabel: { - intervale: 0, rotate: 0, - formatter: function (value) { - value = bus.computeTimezone(value) - let now = bus.computeTimezone(new Date().getTime()); - let t_date = new Date(value); - let hhmm = [t_date.getHours(), t_date.getMinutes() < 10 ? "0" + t_date.getMinutes() : t_date.getMinutes()].join(':'); - let mmdd = [t_date.getMonth() + 1, t_date.getDate() < 10 ? "0" + t_date.getDate() : t_date.getDate()].join('/'); - if (now-value < 1000*60*60*24) { - return hhmm; - } else if (now-value >= 1000*60*60*24 && now-value < 1000*60*60*24*30) { - return mmdd + " " + hhmm; - } else { - return mmdd; - } - }, + fontSize: 13*window.devicePixelRatio }, axisPointer: {//y轴上显示指针对应的值 diff --git a/nezha-fronted/src/main.js b/nezha-fronted/src/main.js index c1c58cf6a..c601177b1 100644 --- a/nezha-fronted/src/main.js +++ b/nezha-fronted/src/main.js @@ -112,7 +112,15 @@ Vue.mixin({ if(time){ return bus.timeFormate(this.timezoneToUtcTime(time),format) } - } + }, + tableTitleReset:function(src,dist){ + dist.forEach(item=>{ + let title=src.find(t=>t.prop == item.prop) + if(title&&title.label){ + item.label=title.label; + } + }) + }, } })