diff --git a/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java b/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java index 18c93f74c5..de223e2ccc 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java @@ -1,6 +1,5 @@ package com.fr.design.actions.file; -import com.fr.base.extension.FileExtension; import com.fr.base.vcs.DesignerMode; import com.fr.design.fun.PreviewProvider; import com.fr.design.mainframe.DesignerContext; @@ -11,7 +10,6 @@ import com.fr.file.FileNodeFILE; import com.fr.general.GeneralUtils; import com.fr.general.web.ParameterConstants; import com.fr.stable.project.ProjectConstants; -import com.fr.stable.web.AbstractWebletCreator; import javax.swing.JOptionPane; import java.util.Collections; @@ -90,13 +88,6 @@ public final class WebPreviewUtils { java.util.List parameterNameList = new java.util.ArrayList(); java.util.List parameterValueList = new java.util.ArrayList(); - // 暂时屏蔽cptx直接访问 - if (path.endsWith(FileExtension.CPTX.getSuffix())) { - path = path.substring(0, path.length() - 1); - parameterNameList.add(AbstractWebletCreator.FORMAT); - parameterValueList.add(AbstractWebletCreator.X); - } - parameterNameList.add(actionType); parameterValueList.add(path); if (map != null) { diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java index f9b18b7f8d..51af636aa2 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java @@ -2,8 +2,10 @@ package com.fr.design.gui.itree.filetree; import com.fr.base.FRContext; import com.fr.base.extension.FileExtension; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.file.NodeAuthProcessor; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; +import com.fr.design.mainframe.App; import com.fr.file.filetree.FileNode; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; @@ -15,7 +17,9 @@ import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreePath; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashSet; import java.util.List; +import java.util.Set; /* * 显示Env下的reportlets目录下面的所有cpt文件 @@ -124,9 +128,28 @@ public class TemplateFileTree extends EnvFileTree { } public FileNode[] listFile(String path) { + // 支持插件扩展, 先从env的filter拿, 再从插件拿 + Set supportTypes = createFileExtensionFilter(); return FRContext.getFileNodes().list( path, - new FileExtension[]{FileExtension.CPT, FileExtension.FRM, FileExtension.CHT, FileExtension.XLS, FileExtension.XLSX}); + supportTypes.toArray(new FileExtension[supportTypes.size()]) + ); + } + + private Set createFileExtensionFilter() { + Set supportTypes = new HashSet(); + if (filter != null) { + for (String temp : filter.getSupportedTypes()) { + supportTypes.add(FileExtension.parse(temp)); + } + } + Set apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING); + for (App temp : apps) { + for (String extendsion : temp.defaultExtensions()) { + supportTypes.add(FileExtension.parse(extendsion)); + } + } + return supportTypes; } /* @@ -205,18 +228,6 @@ public class TemplateFileTree extends EnvFileTree { if (fileNodes == null) { fileNodes = new FileNode[0]; } - // 用FileNodeFilter过滤一下 - if (filter != null) { - List list = new ArrayList(); - for (FileNode fileNode : fileNodes) { - if (filter.accept(fileNode)) { - list.add(fileNode); - } - } - - fileNodes = list.toArray(new FileNode[list.size()]); - } - Arrays.sort(fileNodes, new FileNodeComparator(FRContext.getFileNodes().getSupportedTypes())); return fileNodes; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index 68386f3095..b16c9237e1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -109,6 +109,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane{ resetTitleAttr(chart); //重置监控刷新选项 resetRefreshMoreLabelAttr((VanChart)chart); + resetFilterDefinition(chart); } @@ -118,6 +119,10 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane{ chart.setTitle(vanChartPlot.getDefaultTitle()); } + //重置数据配置 + protected void resetFilterDefinition(Chart chart){ + + } //重置监控刷新面板 protected void resetRefreshMoreLabelAttr(VanChart chart){ diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java index 76a47afd84..244660adf5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java @@ -6,10 +6,10 @@ import com.fr.chart.chartattr.Plot; import com.fr.design.mainframe.chart.gui.type.ChartImagePane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.log.FineLoggerFactory; - import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.map.MapIndependentVanChart; import com.fr.plugin.chart.map.VanChartMapPlot; +import com.fr.plugin.chart.map.data.VanMapDefinition; import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; import com.fr.van.chart.designer.type.AbstractVanChartTypePane; @@ -129,6 +129,11 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane { } + @Override + protected void resetFilterDefinition(Chart chart) { + chart.setFilterDefinition(new VanMapDefinition()); + } + protected void resetAttr(Plot plot) { sourceChoosePane.resetComponentValue((VanChartMapPlot) plot); }