Browse Source

完善控件接口

master
richie 5 years ago
parent
commit
51e1c9817f
  1. 1
      readme.md
  2. 7
      src/main/java/com/fanruan/api/report/form/BaseWidget.java
  3. 14
      src/main/java/com/fanruan/api/report/form/category/LoadingWidget.java
  4. 17
      src/main/java/com/fanruan/api/report/form/category/PlainWidget.java

1
readme.md

@ -52,6 +52,7 @@ SessionKit#getSession(@NotNull String sessionID);
|评分形态插件|https://git.fanruan.com/fanruan/demo-show-present| |评分形态插件|https://git.fanruan.com/fanruan/demo-show-present|
|急速下拉树插件|https://git.fanruan.com/fanruan/demo-widget-ztree| |急速下拉树插件|https://git.fanruan.com/fanruan/demo-widget-ztree|
|网页框插件|https://git.fanruan.com/fanruan/demo-widget-iframe| |网页框插件|https://git.fanruan.com/fanruan/demo-widget-iframe|
|时钟控件|https://git.fanruan.com/fanruan/demo-show-clock|
## 如何判断插件中调用的API需要增加到FineKit中 ## 如何判断插件中调用的API需要增加到FineKit中

7
src/main/java/com/fanruan/api/report/form/BaseWidget.java

@ -1,7 +1,6 @@
package com.fanruan.api.report.form; package com.fanruan.api.report.form;
import com.fr.data.act.Describer; import com.fr.data.act.Describer;
import com.fr.data.act.Producer;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.json.JSONException; import com.fr.json.JSONException;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
@ -13,9 +12,9 @@ import com.fr.stable.web.Repository;
* @author richie * @author richie
* @version 10.0 * @version 10.0
* Created by richie on 2019-09-10 * Created by richie on 2019-09-10
* 控件的插件接口 * 控件接口如果控件支持"控件值"属性则需要实现接口 {@link com.fr.form.ui.DataControl}
*/ */
public abstract class BaseWidget extends Widget implements Describer, Producer { public abstract class BaseWidget extends Widget implements Describer {
@Override @Override
public boolean isEditor() { public boolean isEditor() {
@ -23,7 +22,7 @@ public abstract class BaseWidget extends Widget implements Describer, Producer {
} }
@Override @Override
public JSONObject createJSONConfig(Repository repository, Calculator calculator, NodeVisitor nodeVisitor) throws JSONException { public final JSONObject createJSONConfig(Repository repository, Calculator calculator, NodeVisitor nodeVisitor) throws JSONException {
JSONObject jo = super.createJSONConfig(repository, calculator, nodeVisitor); JSONObject jo = super.createJSONConfig(repository, calculator, nodeVisitor);
mixinJSON(repository, calculator, jo); mixinJSON(repository, calculator, jo);
return jo; return jo;

14
src/main/java/com/fanruan/api/report/form/category/LoadingWidget.java

@ -0,0 +1,14 @@
package com.fanruan.api.report.form.category;
import com.fanruan.api.report.form.BaseWidget;
import com.fr.data.act.Producer;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-09-19
* 初始化的时候除了配置还会有加载数据的控件典型的控件如下拉框下拉树复选框组等
*/
public abstract class LoadingWidget extends BaseWidget implements Producer {
}

17
src/main/java/com/fanruan/api/report/form/category/PlainWidget.java

@ -0,0 +1,17 @@
package com.fanruan.api.report.form.category;
import com.fanruan.api.report.form.BaseWidget;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-09-19
* 初始化时只有配置的控件没有数据设置典型的比如按钮标签等
*/
public abstract class PlainWidget extends BaseWidget {
@Override
public boolean isEditor() {
return false;
}
}
Loading…
Cancel
Save