From 44928ebc6495f00f3bb09d315e30770bbc544ac8 Mon Sep 17 00:00:00 2001 From: yigekaiguan Date: Fri, 24 Sep 2021 15:38:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BAchartFactory=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E7=A7=81=E6=9C=89=E5=B1=9E=E6=80=A7=E6=B7=BB=E5=8A=A0'=5F'?= =?UTF-8?q?=E5=89=8D=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/script/datagear-chartFactory.js | 31 ++++++++++--------- .../static/script/datagear-chartSetting.js | 14 ++++----- .../static/script/datagear-chartSupport.js | 2 +- .../script/datagear-dashboardFactory.js | 2 +- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/datagear-web/src/main/resources/org/datagear/web/static/script/datagear-chartFactory.js b/datagear-web/src/main/resources/org/datagear/web/static/script/datagear-chartFactory.js index 650d31b3..28849d63 100644 --- a/datagear-web/src/main/resources/org/datagear/web/static/script/datagear-chartFactory.js +++ b/datagear-web/src/main/resources/org/datagear/web/static/script/datagear-chartFactory.js @@ -193,19 +193,19 @@ chartFactory.CHART_EVENT_CHART_TYPE_HTML = "html"; /**内置名字标识片段*/ - chartFactory.BUILT_IN_NAME_PART = "datagear"; + chartFactory._BUILT_IN_NAME_PART = "datagear"; /**内置名字标识片段*/ - chartFactory.BUILT_IN_NAME_UNDERSCORE_PREFIX = "_" + chartFactory.BUILT_IN_NAME_PART; + chartFactory._BUILT_IN_NAME_UNDERSCORE_PREFIX = "_" + chartFactory._BUILT_IN_NAME_PART; /**数据对象的原始信息属性名*/ - chartFactory.DATA_ORIGINAL_INFO_PROP_NAME = chartFactory.BUILT_IN_NAME_UNDERSCORE_PREFIX + "OriginalInfo"; + chartFactory._DATA_ORIGINAL_INFO_PROP_NAME = chartFactory._BUILT_IN_NAME_UNDERSCORE_PREFIX + "OriginalInfo"; /**图表主题的CSS信息属性名*/ - chartFactory._KEY_THEME_STYLE_SHEET_INFO = chartFactory.BUILT_IN_NAME_UNDERSCORE_PREFIX + "StyleSheetInfo"; + chartFactory._KEY_THEME_STYLE_SHEET_INFO = chartFactory._BUILT_IN_NAME_UNDERSCORE_PREFIX + "StyleSheetInfo"; /** 关键字:注册得ECharts主题名 */ - chartFactory._KEY_REGISTERED_ECHARTS_THEME_NAME = chartFactory.BUILT_IN_NAME_UNDERSCORE_PREFIX + "RegisteredEchartsThemeName"; + chartFactory._KEY_REGISTERED_ECHARTS_THEME_NAME = chartFactory._BUILT_IN_NAME_UNDERSCORE_PREFIX + "RegisteredEchartsThemeName"; /** * 图表使用的渲染上下文属性名。 @@ -965,7 +965,7 @@ { var thisChart = this; - this.themeStyleSheet(chartFactory.builtinName("ChartEle"), function() + this.themeStyleSheet(chartFactory.builtinPropName("ChartEle"), function() { var theme = thisChart.theme(); @@ -2803,7 +2803,7 @@ resultDataIndex = undefined; } - var pname = chartFactory.DATA_ORIGINAL_INFO_PROP_NAME; + var pname = chartFactory._DATA_ORIGINAL_INFO_PROP_NAME; var isArray = $.isArray(data); @@ -3027,7 +3027,7 @@ { var theme = this.theme(); - var pn = chartFactory.builtinName("ChartEleStyleName"); + var pn = chartFactory.builtinPropName("ChartEleStyleName"); var sn = theme[pn]; if(!sn) @@ -3362,11 +3362,12 @@ }; /** - * 获取指定名称的内置名称(添加内置前缀)。 + * 获取内置属性名(添加内置前缀)。 + * 内置属性名以'_'开头。 */ - chartFactory.builtinName = function(name) + chartFactory.builtinPropName = function(name) { - return chartFactory.BUILT_IN_NAME_UNDERSCORE_PREFIX + name; + return chartFactory._BUILT_IN_NAME_UNDERSCORE_PREFIX + name; }; /** @@ -3379,7 +3380,7 @@ */ chartFactory.extValueBuiltin = function(chart, name, value) { - name = chartFactory.builtinName(name); + name = chartFactory.builtinPropName(name); return chart.extValue(name, value); }; @@ -3455,7 +3456,7 @@ }; /** HTML元素上已渲染的图表对象KEY */ - chartFactory._KEY_ELEMENT_RENDERED_CHART = chartFactory.BUILT_IN_NAME_UNDERSCORE_PREFIX + "RenderedChart"; + chartFactory._KEY_ELEMENT_RENDERED_CHART = chartFactory._BUILT_IN_NAME_UNDERSCORE_PREFIX + "RenderedChart"; /** * 获取当前在指定HTML元素上渲染的图表对象,返回null表示元素上并未渲染图表。 @@ -3471,7 +3472,7 @@ }; /** 生成元素ID用的前缀 */ - chartFactory._ELEMENT_ID_PREFIX = chartFactory.BUILT_IN_NAME_PART + new Number(new Date().getTime()).toString(16); + chartFactory._ELEMENT_ID_PREFIX = chartFactory._BUILT_IN_NAME_PART + new Number(new Date().getTime()).toString(16); /** * 执行JS代码。 @@ -3551,7 +3552,7 @@ return (element.attr("style") || ""); }; - chartFactory._KEY_GRADUAL_COLORS = chartFactory.BUILT_IN_NAME_UNDERSCORE_PREFIX + "GradualColors"; + chartFactory._KEY_GRADUAL_COLORS = chartFactory._BUILT_IN_NAME_UNDERSCORE_PREFIX + "GradualColors"; /** * 获取主题从背景色(actualBackgroundColor)到前景色(color)之间的渐变因子对应的颜色。 diff --git a/datagear-web/src/main/resources/org/datagear/web/static/script/datagear-chartSetting.js b/datagear-web/src/main/resources/org/datagear/web/static/script/datagear-chartSetting.js index 528cc4e0..4d6fb0ab 100644 --- a/datagear-web/src/main/resources/org/datagear/web/static/script/datagear-chartSetting.js +++ b/datagear-web/src/main/resources/org/datagear/web/static/script/datagear-chartSetting.js @@ -242,7 +242,7 @@ chartSetting.dataSetParamValueFormThemeStyle = function(chartTheme) { - var styleNameKey = chartFactory.builtinName("DataSetParamValueFormStyleName"); + var styleNameKey = chartFactory.builtinPropName("DataSetParamValueFormStyleName"); var styleName = chartTheme[styleNameKey]; if(styleName) @@ -250,7 +250,7 @@ styleName = (chartTheme[styleNameKey] = chartFactory.nextElementId()); - chartFactory.themeStyleSheet(chartTheme, chartFactory.builtinName("DataSetParamValueForm"), function() + chartFactory.themeStyleSheet(chartTheme, chartFactory.builtinPropName("DataSetParamValueForm"), function() { var color = chartFactory.gradualColor(chartTheme, 1); var bgColor = chartFactory.gradualColor(chartTheme, 0); @@ -681,7 +681,7 @@ $input.attr("dg-validation-number", "true"); }; - chartSetting._DATETIME_PICKER_ROOT_ID = chartFactory.BUILT_IN_NAME_PART + "DatetimepickerRoot"; + chartSetting._DATETIME_PICKER_ROOT_ID = chartFactory._BUILT_IN_NAME_PART + "DatetimepickerRoot"; chartSetting.datetimepicker = function($input, datetimepickerOptions, chartTheme) { @@ -765,7 +765,7 @@ */ chartSetting.datetimepickerThemeStyle = function(chartTheme) { - var styleNameKey = chartFactory.builtinName("DatetimepickerStyleName"); + var styleNameKey = chartFactory.builtinPropName("DatetimepickerStyleName"); var styleName = chartTheme[styleNameKey]; if(styleName) @@ -773,7 +773,7 @@ styleName = (chartTheme[styleNameKey] = chartFactory.nextElementId()); - chartFactory.themeStyleSheet(chartTheme, chartFactory.builtinName("Datetimepicker"), function() + chartFactory.themeStyleSheet(chartTheme, chartFactory.builtinPropName("Datetimepicker"), function() { var color = chartFactory.gradualColor(chartTheme, 1); var bgColor = chartFactory.gradualColor(chartTheme, 0); @@ -1346,7 +1346,7 @@ chartSetting.setChartSettingBoxThemeStyle = function(chart, $box) { - chart.themeStyleSheet(chartFactory.builtinName("ChartSettingBox"), function() + chart.themeStyleSheet(chartFactory.builtinPropName("ChartSettingBox"), function() { var color = chart.gradualColor(1); var bgColor = chart.gradualColor(0); @@ -1790,7 +1790,7 @@ chartSetting.setChartSettingDataPanelThemeStyle = function(chart, $panel) { - chart.themeStyleSheet(chartFactory.builtinName("ChartSettingDataPanel"), function() + chart.themeStyleSheet(chartFactory.builtinPropName("ChartSettingDataPanel"), function() { var theme = chart.theme(); //表格背景色应与面板背景色一致,且不能设透明背景色,因为设置了固定列 diff --git a/datagear-web/src/main/resources/org/datagear/web/static/script/datagear-chartSupport.js b/datagear-web/src/main/resources/org/datagear/web/static/script/datagear-chartSupport.js index ac4517af..c4e705a0 100644 --- a/datagear-web/src/main/resources/org/datagear/web/static/script/datagear-chartSupport.js +++ b/datagear-web/src/main/resources/org/datagear/web/static/script/datagear-chartSupport.js @@ -5156,7 +5156,7 @@ chartSupport.selectThemeStyleSheet = function(chart) { - chart.themeStyleSheet(chartFactory.builtinName("SelectChart"), function() + chart.themeStyleSheet(chartFactory.builtinPropName("SelectChart"), function() { var chartTheme = chart.theme(); diff --git a/datagear-web/src/main/resources/org/datagear/web/static/script/datagear-dashboardFactory.js b/datagear-web/src/main/resources/org/datagear/web/static/script/datagear-dashboardFactory.js index e08151dc..4898b3d5 100644 --- a/datagear-web/src/main/resources/org/datagear/web/static/script/datagear-dashboardFactory.js +++ b/datagear-web/src/main/resources/org/datagear/web/static/script/datagear-dashboardFactory.js @@ -2141,7 +2141,7 @@ var re = []; - var pname = chartFactory.DATA_ORIGINAL_INFO_PROP_NAME; + var pname = chartFactory._DATA_ORIGINAL_INFO_PROP_NAME; for(var i=0; i