fix: timeRange添加注释

This commit is contained in:
刘洪洪
2022-10-27 16:32:16 +08:00
parent e7cf758ffd
commit e019f8a02e
2 changed files with 4 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ const panel = {
refreshTime: null, // 自动刷新时间的秒数
refreshFlag: true, // 关闭自动刷新标志true为offfalse即开启自动刷新
timeRangeArray: [], // 时间范围列表:开始/结束时间
timeRangeFlag: 60, // 时间范围标志默认60即一小时-1为手动选择的时间范围
timeRangeFlag: null, // 时间范围标志默认60即一小时-1为手动选择的时间范围
routerPath: '', // 当前路由路径
httpCancel: null // 终止http请求
},

View File

@@ -168,9 +168,11 @@ export default {
const panel = ref({})
let panelType = 1 // 取得panel的type
const { params, query, path } = useRoute()
// 下钻和返回都是在同一路由下进行根据store存储的timeRange可避免下钻后返回被重置的情况
// 切换其他界面时重置timeRange避免影响其他界面使用timeRange
if (path === store.getters.getRouterPath) {
if (query.startTime === undefined && store.getters.getTimeRangeFlag !== null) {
// 为了避免下钻后将timeRange由范围改为为小时制
// 为了避免下钻后返回timeRange被重置以及timeRange被修改返回时url没有更新
const newUrl = urlParamsHandler(window.location.href, query, {
startTime: store.getters.getTimeRangeArray[0],
endTime: store.getters.getTimeRangeArray[1],