Browse Source

Pull request #7271: REPORT-55241

Merge in DESIGN/design from ~FLY.LI/design:feature/x to feature/x

* commit 'b1d23b093d436c24efdb5f7a885d4b3e9810a43b':
  REPORT-55241:修改没有开启固定分页时固定分页的数值
  REPORT-55241:修改一下代码格式
  REPORT-55241:添加报表引擎属性埋点
feature/x
Fly.Li 3 years ago
parent
commit
e3a7a7c66e
  1. 40
      designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java

40
designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java

@ -5,9 +5,15 @@ import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.WorkSheetDesigner;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.ReportEnginePane;
import com.fr.intelli.record.FocusPoint;
import com.fr.intelli.record.MetricRegistry;
import com.fr.intelli.record.Original;
import com.fr.json.JSONObject;
import com.fr.report.stable.LayerReportAttr;
import com.fr.report.worksheet.WorkSheet;
public class ReportEngineAttrAction extends ReportComponentAction<WorkSheetDesigner> {
@ -19,7 +25,6 @@ public class ReportEngineAttrAction extends ReportComponentAction<WorkSheetDesig
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon("/com/fr/design/images/m_report/reportEngineAttr");
this.generateAndSetSearchText(ReportEnginePane.class.getName());
}
private boolean isChange;
@ -43,9 +48,15 @@ public class ReportEngineAttrAction extends ReportComponentAction<WorkSheetDesig
@Override
public void doOk() {
isChange = true;
tplEC.setLayerReportAttr(layerReportEnginePane.updateBean());
LayerReportAttr originLayerReportAttr = tplEC.getLayerReportAttr();
LayerReportAttr layerReportAttr = layerReportEnginePane.updateBean();
tplEC.setLayerReportAttr(layerReportAttr);
//设置新引擎后,需要刷新一下,计算属性设置入口是否显示,取决于是否设置了新引擎模式。
DesignerContext.getDesignerFrame().resetToolkitByPlus(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate());
//只有当前设置为新引擎时,才会提交埋点。
if (layerReportAttr.isEnableEngineX() && layerReportAttr.isChanged(originLayerReportAttr)){
new ReportEngineMetricRecord().submit(layerReportAttr);
}
}
});
@ -53,4 +64,29 @@ public class ReportEngineAttrAction extends ReportComponentAction<WorkSheetDesig
return isChange;
}
/**
* 内部类
* */
class ReportEngineMetricRecord{
private final static String FOCUS_ID = "FR-F6011";
private void submit(LayerReportAttr layerReportAttr){
JSONObject body = new JSONObject();
body.put("totalPage", layerReportAttr.isPageQuery() ? 1 : 0);
body.put("pagesize", layerReportAttr.getCountPerPage());
body.put("totalNum", layerReportAttr.isEnableRowCount() ? 1 : 0);
FocusPoint focusPoint = FocusPoint.newBuilder()
.id(FOCUS_ID)
.source(Original.EMBED)
.text(getPath())
.body(body.toString())
.build();
MetricRegistry.getMetric().submit(focusPoint);
}
private String getPath(){
JTemplate<?, ?> currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
return currentEditingTemplate.getPath();
}
}
}

Loading…
Cancel
Save