Skip to content

Commit

Permalink
fix: 【监控】图表列没有获取缓存的列数缓存
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 29595
  • Loading branch information
yzygyin committed Jan 20, 2025
1 parent 0b41691 commit 925d5dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,8 @@ export default class CommonPageNew extends tsc<ICommonPageProps, ICommonPageEven
async initData() {
this.localSceneType = this.sceneType;
this.loading = true;
this.columns = +localStorage.getItem(DASHBOARD_PANEL_COLUMN_KEY) || 2;
const storedValue = localStorage.getItem(DASHBOARD_PANEL_COLUMN_KEY);
this.columns = storedValue === '0' ? 0 : +storedValue || 2;
this.filtersReady = false;
this.selectorReady = false;
await this.$nextTick();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,8 @@ export default class CommonPage extends tsc<ICommonPageProps, ICommonPageEvent>
async initData() {
this.localSceneType = this.sceneType;
this.loading = true;
this.columns = +localStorage.getItem(DASHBOARD_PANEL_COLUMN_KEY) || 2;
const storedValue = localStorage.getItem(DASHBOARD_PANEL_COLUMN_KEY);
this.columns = storedValue === '0' ? 0 : +storedValue || 2;
this.filtersReady = false;
this.selectorReady = false;
await this.$nextTick();
Expand Down Expand Up @@ -1141,9 +1142,11 @@ export default class CommonPage extends tsc<ICommonPageProps, ICommonPageEvent>
/** 变量数据请求完毕 */
handleFilterVarDataReady(list: FilterDictType[]) {
/** 统计filter参与过滤的数量 */
this.filterCount = list.reduce((len, cur) => {
Object.entries(cur).every(item => (Array.isArray(item[1]) ? !!item[1].length : item[1] !== '')) && (len += 1);
return len;
this.filterCount = list.reduce((accumulator, cur) => {
const allPropertiesValid = Object.entries(cur).every(([, value]) =>
Array.isArray(value) ? value.length > 0 : value !== ''
);
return allPropertiesValid ? accumulator + 1 : accumulator;
}, 0);
this.variables = this.handleGetVariables(list);
this.handleUpdateViewOptions();
Expand Down

0 comments on commit 925d5dc

Please sign in to comment.