fix: timeRange添加注释
This commit is contained in:
@@ -53,7 +53,7 @@ const panel = {
|
|||||||
refreshTime: null, // 自动刷新时间的秒数
|
refreshTime: null, // 自动刷新时间的秒数
|
||||||
refreshFlag: true, // 关闭自动刷新标志,true为off,false即开启自动刷新
|
refreshFlag: true, // 关闭自动刷新标志,true为off,false即开启自动刷新
|
||||||
timeRangeArray: [], // 时间范围列表:开始/结束时间
|
timeRangeArray: [], // 时间范围列表:开始/结束时间
|
||||||
timeRangeFlag: 60, // 时间范围标志,默认60即一小时,-1为手动选择的时间范围
|
timeRangeFlag: null, // 时间范围标志,默认60即一小时,-1为手动选择的时间范围
|
||||||
routerPath: '', // 当前路由路径
|
routerPath: '', // 当前路由路径
|
||||||
httpCancel: null // 终止http请求
|
httpCancel: null // 终止http请求
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -168,9 +168,11 @@ export default {
|
|||||||
const panel = ref({})
|
const panel = ref({})
|
||||||
let panelType = 1 // 取得panel的type
|
let panelType = 1 // 取得panel的type
|
||||||
const { params, query, path } = useRoute()
|
const { params, query, path } = useRoute()
|
||||||
|
// 下钻和返回都是在同一路由下进行,根据store存储的timeRange可避免下钻后返回被重置的情况,
|
||||||
|
// 切换其他界面时重置timeRange,避免影响其他界面使用timeRange
|
||||||
if (path === store.getters.getRouterPath) {
|
if (path === store.getters.getRouterPath) {
|
||||||
if (query.startTime === undefined && store.getters.getTimeRangeFlag !== null) {
|
if (query.startTime === undefined && store.getters.getTimeRangeFlag !== null) {
|
||||||
// 为了避免下钻后将timeRange由范围改为为小时制
|
// 为了避免下钻后返回timeRange被重置,以及timeRange被修改,返回时url没有更新
|
||||||
const newUrl = urlParamsHandler(window.location.href, query, {
|
const newUrl = urlParamsHandler(window.location.href, query, {
|
||||||
startTime: store.getters.getTimeRangeArray[0],
|
startTime: store.getters.getTimeRangeArray[0],
|
||||||
endTime: store.getters.getTimeRangeArray[1],
|
endTime: store.getters.getTimeRangeArray[1],
|
||||||
|
|||||||
Reference in New Issue
Block a user