|
|
|
@ -10,7 +10,10 @@ import com.fr.form.main.WidgetUtil;
|
|
|
|
|
import com.fr.form.ui.AbstractBorderStyleWidget; |
|
|
|
|
import com.fr.form.ui.BaseChartEditor; |
|
|
|
|
import com.fr.form.ui.CardSwitchButton; |
|
|
|
|
import com.fr.form.ui.ElementCaseEditor; |
|
|
|
|
import com.fr.form.ui.ElementCaseEditorProvider; |
|
|
|
|
import com.fr.form.ui.LayoutBorderStyle; |
|
|
|
|
import com.fr.form.ui.PaddingMargin; |
|
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
|
import com.fr.form.ui.container.WAbsoluteLayout; |
|
|
|
|
import com.fr.form.ui.container.WLayout; |
|
|
|
@ -18,7 +21,6 @@ import com.fr.general.ComparatorUtils;
|
|
|
|
|
import com.fr.json.JSONArray; |
|
|
|
|
import com.fr.json.JSONObject; |
|
|
|
|
import com.fr.report.cell.DefaultTemplateCellElement; |
|
|
|
|
|
|
|
|
|
import java.util.Iterator; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
@ -94,23 +96,40 @@ public class JFormProcessInfo extends TemplateProcessInfo<Form> {
|
|
|
|
|
private boolean hasTestECReport() { |
|
|
|
|
ElementCaseEditorProvider[] elementCaseEditorProviders = this.template.getElementCases(); |
|
|
|
|
for (ElementCaseEditorProvider elementCaseEditorProvider : elementCaseEditorProviders) { |
|
|
|
|
FormElementCaseProvider elementCase = elementCaseEditorProvider.getElementCase(); |
|
|
|
|
Iterator it = elementCase.cellIterator(); |
|
|
|
|
if (!it.hasNext()) { |
|
|
|
|
if (isTestECReport(elementCaseEditorProvider)) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
while (it.hasNext()) { |
|
|
|
|
DefaultTemplateCellElement ce = (DefaultTemplateCellElement) it.next(); |
|
|
|
|
Object value = ce.getValue(); |
|
|
|
|
if (isTestCell(value, ce.getStyle())) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean isTestECReport(ElementCaseEditorProvider elementCaseEditorProvider) { |
|
|
|
|
FormElementCaseProvider elementCase = elementCaseEditorProvider.getElementCase(); |
|
|
|
|
if (!isTestElementCaseEditor((ElementCaseEditor) elementCaseEditorProvider)) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
Iterator it = elementCase.cellIterator(); |
|
|
|
|
if (!it.hasNext()) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
while (it.hasNext()) { |
|
|
|
|
DefaultTemplateCellElement ce = (DefaultTemplateCellElement) it.next(); |
|
|
|
|
Object value = ce.getValue(); |
|
|
|
|
if (!isTestCell(value, ce.getStyle())) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean isTestElementCaseEditor(ElementCaseEditor editor) { |
|
|
|
|
return editor.getToolBars().length == 0 && editor.getListenerSize() == 0 |
|
|
|
|
&& ComparatorUtils.equals(editor.getBorderStyle(), new LayoutBorderStyle()) |
|
|
|
|
&& ComparatorUtils.equals(editor.getMargin(), new PaddingMargin()) |
|
|
|
|
&& editor.getBackground() == null; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean hasTestChart() { |
|
|
|
|
final boolean[] hasTestChart = {false}; |
|
|
|
|
Form.traversalWidget(this.template.getContainer(), new WidgetGather() { |
|
|
|
@ -226,7 +245,7 @@ public class JFormProcessInfo extends TemplateProcessInfo<Form> {
|
|
|
|
|
|
|
|
|
|
private void addComponentRemoveInfo(JSONObject jsonObject) { |
|
|
|
|
String componentID = jsonObject.getString("componentID"); |
|
|
|
|
if (componentID == null){ |
|
|
|
|
if (componentID == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
JSONObject info = componentProcessInfoMap.get(componentID); |
|
|
|
|