Browse Source

Pull request #5525: REPORT-57147 【回归测试】设计器模版默认预览方式不生效

Merge in DESIGN/design from ~HENRY.WANG/design:release/11.0 to release/11.0

* commit 'd21b416daada88c765ff494839839a1d22a27fbc':
  REPORT-57147 【回归测试】设计器模版默认预览方式不生效
fix-lag
Henry.Wang 3 years ago
parent
commit
03fb8d579a
  1. 20
      designer-form/src/main/java/com/fr/design/fit/JFormType.java

20
designer-form/src/main/java/com/fr/design/fit/JFormType.java

@ -69,12 +69,12 @@ public enum JFormType {
}; };
private int type; private int type;
private boolean newType; private boolean newType;
private PreviewProvider previewType; private PreviewProvider defaultPreviewType;
JFormType(int type, PreviewProvider previewType) { JFormType(int type, PreviewProvider defaultPreviewType) {
this.type = type; this.type = type;
this.newType = (type == 1); this.newType = (type == 1);
this.previewType = previewType; this.defaultPreviewType = defaultPreviewType;
} }
public int getType() { public int getType() {
@ -85,8 +85,8 @@ public enum JFormType {
return newType; return newType;
} }
public PreviewProvider getPreviewType() { public PreviewProvider getDefaultPreviewType() {
return previewType; return defaultPreviewType;
} }
public abstract void switchUI(); public abstract void switchUI();
@ -128,6 +128,14 @@ public enum JFormType {
* @date: 2020/12/17 16:17 * @date: 2020/12/17 16:17
*/ */
public void updatePreviewType(JTemplate jTemplate) { public void updatePreviewType(JTemplate jTemplate) {
jTemplate.setPreviewType(this.getPreviewType()); if (jTemplate.getPreviewType() != null) {
PreviewProvider[] previewProviders = jTemplate.supportPreview();
for (PreviewProvider previewProvider : previewProviders) {
if (previewProvider.getClass() == jTemplate.getPreviewType().getClass()) {
return;
}
}
}
jTemplate.setPreviewType(this.getDefaultPreviewType());
} }
} }

Loading…
Cancel
Save