From 8b56a4190cef4e3efd6de1c4f0871d133d65f874 Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Thu, 21 Dec 2023 05:17:05 +0800 Subject: [PATCH] * Fix bug #42148,42150. --- module/metric/js/preview.ui.js | 14 +++++++++++++- module/metric/ui/ajaxgetmultiplemetricbox.html.php | 1 + module/metric/ui/ajaxgettableandcharts.html.php | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/module/metric/js/preview.ui.js b/module/metric/js/preview.ui.js index 3d337dae9d..a17b5ee7a4 100644 --- a/module/metric/js/preview.ui.js +++ b/module/metric/js/preview.ui.js @@ -2,7 +2,7 @@ window.afterPageUpdate = function($target, info, options) { window.isDropdown = false; window.lineCount = 1; - window.checkedList = [{id:current.id + '', name:current.name}]; + window.checkedList = window.initCheckedList(); window.chartList = []; for(key in chartTypeList) { chartList.push({value: key, text: chartTypeList[key]}); @@ -19,6 +19,18 @@ window.afterPageUpdate = function($target, info, options) window.initFilterPanel(); } +window.initCheckedList = function() +{ + if(typeof window.checkedList !== 'undefined' && Array.isArray(window.checkedList) && window.checkedList.length > 1) + { + return window.checkedList; + } + else + { + return [{id:current.id + '', name:current.name}]; + } +} + window.addTitle2Star = function() { $('.metric-collect').attr('title', collectStar); diff --git a/module/metric/ui/ajaxgetmultiplemetricbox.html.php b/module/metric/ui/ajaxgetmultiplemetricbox.html.php index cde89f88db..b8d153077c 100644 --- a/module/metric/ui/ajaxgetmultiplemetricbox.html.php +++ b/module/metric/ui/ajaxgetmultiplemetricbox.html.php @@ -198,6 +198,7 @@ div ( dtable ( + setID('ajaxmetric' . $metric->id), set::height(328), set::rowHeight(32), set::bordered(true), diff --git a/module/metric/ui/ajaxgettableandcharts.html.php b/module/metric/ui/ajaxgettableandcharts.html.php index 1a9cb98322..261a1f5cc1 100644 --- a/module/metric/ui/ajaxgettableandcharts.html.php +++ b/module/metric/ui/ajaxgettableandcharts.html.php @@ -22,6 +22,7 @@ div ( dtable ( + setID('ajaxmetric' . $metric->id), $viewType == 'multiple' ? set::height(328) : set::height(jsRaw('window.getTableHeight')), set::rowHeight(32), set::bordered(true),