diff --git a/datagear-analysis/src/main/java/org/datagear/analysis/support/html/HtmlTplDashboardWidgetRenderer.java b/datagear-analysis/src/main/java/org/datagear/analysis/support/html/HtmlTplDashboardWidgetRenderer.java index 97bba944..108e6d43 100644 --- a/datagear-analysis/src/main/java/org/datagear/analysis/support/html/HtmlTplDashboardWidgetRenderer.java +++ b/datagear-analysis/src/main/java/org/datagear/analysis/support/html/HtmlTplDashboardWidgetRenderer.java @@ -877,6 +877,13 @@ public abstract class HtmlTplDashboardWidgetRenderer extends TextParserSupport List excludes = StringUtil.splitWithTrim(importExclude, ","); + // 后台生成的样式应该放在最开头,确保页面生成的、用户自定义的css有更高优先级 + if (!excludes.contains(this.themeImportName)) + { + writeNewLine(out); + writeDashboardThemeStyle(renderContext, renderAttr, out, dashboard); + } + if (this.htmlTplDashboardImport != null) { List importItems = this.htmlTplDashboardImport.getImportItems(); @@ -901,12 +908,6 @@ public abstract class HtmlTplDashboardWidgetRenderer extends TextParserSupport } } } - - if (!excludes.contains(this.themeImportName)) - { - writeNewLine(out); - writeDashboardThemeStyle(renderContext, renderAttr, out, dashboard); - } } /** @@ -1029,7 +1030,6 @@ public abstract class HtmlTplDashboardWidgetRenderer extends TextParserSupport writeNewLine(out); out.write(""); - writeNewLine(out); return true; }