去除时间选择 默认查询一个小时的数据
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
}
|
||||
.legend-container{
|
||||
width: calc(100% - 30px);
|
||||
max-height:80px;
|
||||
max-height:40px;
|
||||
min-height:25px;
|
||||
font-size:12px;
|
||||
text-align:left;
|
||||
|
||||
@@ -60,7 +60,10 @@
|
||||
arr.forEach(item1=>{
|
||||
this.getData(item1, '', '');
|
||||
})
|
||||
})
|
||||
});
|
||||
this.$set(this.filter, "start_time", bus.timeFormate(new Date().getTime()-60*60*1000, "yyyy-MM-dd hh:mm:ss"));
|
||||
this.$set(this.filter, "end_time", bus.timeFormate(new Date().getTime(), "yyyy-MM-dd hh:mm:ss"));
|
||||
this.$set(this.filter, "panelId", this.projectId);
|
||||
},
|
||||
methods:{
|
||||
//刷新图表
|
||||
@@ -80,12 +83,10 @@
|
||||
},
|
||||
//获取图表数据
|
||||
getData(chartInfo, pos, filterType){
|
||||
this.$set(this.filter, "start_time", bus.timeFormate(new Date().getTime()-24*60*60*1000, "yyyy-MM-dd hh:mm:ss"));
|
||||
this.$set(this.filter, "end_time", bus.timeFormate(new Date().getTime(), "yyyy-MM-dd hh:mm:ss"));
|
||||
this.$set(this.filter, "panelId", this.projectId);
|
||||
let startTime = bus.timeFormate(new Date().getTime()-24*60*60*1000, "yyyy-MM-dd hh:mm:ss");
|
||||
let endTime = bus.timeFormate(new Date().getTime(), "yyyy-MM-dd hh:mm:ss");
|
||||
let startTime = this.filter.start_time
|
||||
let endTime = this.filter.end_time;
|
||||
let step = bus.getStep(startTime, endTime);
|
||||
chartInfo.loading=true;
|
||||
const chartItem = chartInfo;
|
||||
this.$nextTick(() => {
|
||||
const axiosArr = chartItem.elements.map((ele) => {
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<template>
|
||||
<div style="background: #F9F9F9;height: 100%">
|
||||
<div class="top-tools">
|
||||
<!--时间选择-->
|
||||
<template>
|
||||
<div class="top-tool-main-right">
|
||||
<div class="top-tool-search relative-position margin-r-20">
|
||||
<el-input ref="queryPanel" @clear="clearInput" id="queryPanel" @focus="focusInput" @blur="blurInput" v-model="filter.searchName" class="query-input-inactive" size="mini" clearable >
|
||||
<i slot="suffix" class="el-input__icon el-icon-search" @click="focusInput" style="float: right"></i>
|
||||
</el-input>
|
||||
</div>
|
||||
<pick-time :refresh-data-func="dateChange" v-model="searchTime" :use-chart-unit="false"></pick-time>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div style="background: #F9F9F9;height: 100%;padding-top: 15px">
|
||||
<!--<div class="top-tools">-->
|
||||
<!--<!–时间选择–>-->
|
||||
<!--<template>-->
|
||||
<!--<div class="top-tool-main-right">-->
|
||||
<!--<div class="top-tool-search relative-position margin-r-20">-->
|
||||
<!--<el-input ref="queryPanel" @clear="clearInput" id="queryPanel" @focus="focusInput" @blur="blurInput" v-model="filter.searchName" class="query-input-inactive" size="mini" clearable >-->
|
||||
<!--<i slot="suffix" class="el-input__icon el-icon-search" @click="focusInput" style="float: right"></i>-->
|
||||
<!--</el-input>-->
|
||||
<!--</div>-->
|
||||
<!--<pick-time :refresh-data-func="dateChange" v-model="searchTime" :use-chart-unit="false"></pick-time>-->
|
||||
<!--</div>-->
|
||||
<!--</template>-->
|
||||
<!--</div>-->
|
||||
<div class="project-facade">
|
||||
<div class="facade-content">
|
||||
<!--拓扑图盒子-->
|
||||
@@ -122,7 +122,10 @@
|
||||
mounted(){
|
||||
if(this.obj.id){
|
||||
this.getProjectData(this.obj);
|
||||
}
|
||||
};
|
||||
this.$set(this.filter, "start_time", bus.timeFormate(new Date().getTime()-60*60*1000, "yyyy-MM-dd hh:mm:ss"));
|
||||
this.$set(this.filter, "end_time", bus.timeFormate(new Date().getTime(), "yyyy-MM-dd hh:mm:ss"));
|
||||
this.$set(this.filter, "panelId", this.projectId);
|
||||
},
|
||||
methods:{
|
||||
getProjectData(n){
|
||||
@@ -150,7 +153,7 @@
|
||||
let classVal=document.getElementById('queryPanel').parentElement.getAttribute("class");
|
||||
classVal=classVal.replace('query-input-inactive','query-input-active');
|
||||
document.getElementById('queryPanel').parentElement.setAttribute("class",classVal );
|
||||
this.$refs.queryPanel.focus();
|
||||
// this.$refs.queryPanel.focus();
|
||||
},
|
||||
blurInput() {
|
||||
if(!this.filter.searchName || this.filter.searchName == ''){
|
||||
@@ -160,6 +163,7 @@
|
||||
document.getElementById('queryPanel').parentElement.setAttribute("class",classVal );
|
||||
},100)
|
||||
}
|
||||
console.log(this.filter);
|
||||
},
|
||||
clearInput() {
|
||||
this.$refs.queryPanel.focus();
|
||||
|
||||
@@ -18,11 +18,20 @@ const store = new Vuex.Store({
|
||||
isAddConsole: false,//是否增加窗口
|
||||
consoleParam: {},//新开console窗口参数
|
||||
linkData: [],//导航数据
|
||||
projectFilter:{
|
||||
panelId: 0,
|
||||
start_time: '',
|
||||
end_time: '',
|
||||
searchName: ''
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
getLinkData(state){
|
||||
return state.linkData
|
||||
}
|
||||
},
|
||||
getProjectFilter(state){
|
||||
return state.projectFilter
|
||||
},
|
||||
},
|
||||
mutations: {
|
||||
/* 监听对象变化,用于顶部菜单与底部内容的同步 */
|
||||
@@ -73,6 +82,9 @@ const store = new Vuex.Store({
|
||||
setLinkData(state, data) {
|
||||
state.linkData = data;
|
||||
},
|
||||
setProjectFilter(state, data) {
|
||||
state.projectFilter = data;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user