Browse Source

Pull request #5590: CHART-20476 图表-超链悬浮窗代码回退

Merge in DESIGN/design from ~TOMMY/design:final/10.0 to final/10.0

* commit '5aa0bc0821ad1648e7fd82707d08b4eb1dbd60ca':
  REPORT-58260 组件包安装适配zip
  REPORT-58260 组件包安装适配zip
  CHART-20476 图表-超链悬浮窗代码回退
final/10.0
Tommy 3 years ago
parent
commit
172d4e94c9
  1. 28
      designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java
  2. 5
      designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java
  3. 11
      designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java

28
designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java

@ -58,21 +58,26 @@ public class ChartHyperlinkGroup extends BaseHyperlinkGroup {
if (template == null) {
return false;
}
if (template.isJWorkBook() || DesignModeContext.isDuchampMode()) {
// 如果是普通报表单元格,那么没有 FormHyperlink 选项
FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
//返回true表示可用,返回false表示不可用
return !ComparatorUtils.equals(clazz, formHyperlink.getClass());
} else {
// 如果是决策报表
Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class};
for (Class aClass : classes) {
if (template.getEditingReportIndex() == BaseJForm.FORM_TAB) {
// 编辑的是决策报表中的图表,那么没有ChartHyperRelateFloatLink 和 ChartHyperRelateCellLink 选项,有FormHyperlink 选项
Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class};
return !ArrayUtils.contains(classes, clazz);
if (ComparatorUtils.equals(aClass, clazz)) {
return false;
}
} else if (template.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB) {
// 编辑的是决策报表中的报表块,那么没有 ChartHyperPoplink 和 ChartHyperRelateFloatLink
Class[] classes = new Class[]{ChartHyperPoplink.class, ChartHyperRelateFloatLink.class};
return !ArrayUtils.contains(classes, clazz);
// 编辑的是决策报表中的报表块,那么没有 ChartHyperRelateFloatLink,有ChartHyperRelateCellLink 和 FormHyperlink 选项
return !ComparatorUtils.equals(clazz, ChartHyperRelateFloatLink.class);
}
}
}
return true;
@ -96,14 +101,17 @@ public class ChartHyperlinkGroup extends BaseHyperlinkGroup {
return !ComparatorUtils.equals(object.getClass(), formHyperlink.getClass());
} else {
// 如果是决策报表
Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class};
for (Class aClass : classes) {
if (template.getEditingReportIndex() == BaseJForm.FORM_TAB) {
// 编辑的是决策报表中的图表,那么没有ChartHyperRelateFloatLink 和 ChartHyperRelateCellLink 选项,有FormHyperlink 选项
Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class};
return !ArrayUtils.contains(classes, object.getClass());
if (ComparatorUtils.equals(aClass, object.getClass())) {
return false;
}
} else if (template.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB) {
// 编辑的是决策报表中的报表块,那么没有 ChartHyperPoplink 和 ChartHyperRelateFloatLink
Class[] classes = new Class[]{ChartHyperPoplink.class, ChartHyperRelateFloatLink.class};
return !ArrayUtils.contains(classes, object.getClass());
// 编辑的是决策报表中的报表块,那么没有 ChartHyperRelateFloatLink,有ChartHyperRelateCellLink 和 FormHyperlink 选项
return !ComparatorUtils.equals(object.getClass(), ChartHyperRelateFloatLink.class);
}
}
}
return true;

5
designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java

@ -120,7 +120,7 @@ public class InstallComponentAction extends UpdateAction {
private boolean containRues(File[] chosenFiles) {
for (File file : chosenFiles) {
if (file.getName().endsWith(ReuxUtils.REUS_SUFFIX))
if (ReuxUtils.isReusFile(file))
return true;
}
return false;
@ -142,8 +142,7 @@ public class InstallComponentAction extends UpdateAction {
return false;
}
ShareComponentUtils.checkReadMe();
boolean isReus = chosenFile.getName().endsWith(ReuxUtils.REUS_SUFFIX);
return isReus ? InstallUtils.installReusFile(chosenFile, installTime, failList) : InstallUtils.installReuFile(chosenFile, installTime, failList);
return ReuxUtils.isReusFile(chosenFile) ? InstallUtils.installReusFile(chosenFile, installTime, failList) : InstallUtils.installReuFile(chosenFile, installTime, failList);
}
private static class InstallBackInfo {

11
designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java

@ -84,7 +84,7 @@ public class InstallUtils {
@Nullable
private static Group createComponentGroup(String fileName) {
String groupName = fileName.substring(0, fileName.indexOf(DOT + ReuxUtils.REUS_SUFFIX));
String groupName = createGroupName(fileName);
//有重名分组则加后缀
if (DefaultShareGroupManager.getInstance().getGroup(groupName) != null) {
@ -101,6 +101,15 @@ public class InstallUtils {
return DefaultShareGroupManager.getInstance().getGroup(groupName);
}
private static String createGroupName(String fileName) {
for (String suffix : ReuxUtils.SUPPORT_REUS_SUFFIX) {
if (fileName.endsWith(suffix)) {
return fileName.substring(0, fileName.indexOf(DOT + suffix));
}
}
return fileName;
}
private static boolean installReuFile(Group group, File chosenFile, long installTime) {
try {
if (!group.installModule(chosenFile)) {

Loading…
Cancel
Save