From 51e1c9817febe7e38413871af6f4bf59e7a0a9ce Mon Sep 17 00:00:00 2001 From: richie Date: Thu, 19 Sep 2019 14:34:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=8E=A7=E4=BB=B6=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readme.md | 1 + .../com/fanruan/api/report/form/BaseWidget.java | 7 +++---- .../api/report/form/category/LoadingWidget.java | 14 ++++++++++++++ .../api/report/form/category/PlainWidget.java | 17 +++++++++++++++++ 4 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/fanruan/api/report/form/category/LoadingWidget.java create mode 100644 src/main/java/com/fanruan/api/report/form/category/PlainWidget.java diff --git a/readme.md b/readme.md index 2b6cbfa..5bd856e 100644 --- a/readme.md +++ b/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-widget-ztree| |网页框插件|https://git.fanruan.com/fanruan/demo-widget-iframe| +|时钟控件|https://git.fanruan.com/fanruan/demo-show-clock| ## 如何判断插件中调用的API需要增加到FineKit中 diff --git a/src/main/java/com/fanruan/api/report/form/BaseWidget.java b/src/main/java/com/fanruan/api/report/form/BaseWidget.java index 703fad3..3483a54 100644 --- a/src/main/java/com/fanruan/api/report/form/BaseWidget.java +++ b/src/main/java/com/fanruan/api/report/form/BaseWidget.java @@ -1,7 +1,6 @@ package com.fanruan.api.report.form; import com.fr.data.act.Describer; -import com.fr.data.act.Producer; import com.fr.form.ui.Widget; import com.fr.json.JSONException; import com.fr.json.JSONObject; @@ -13,9 +12,9 @@ import com.fr.stable.web.Repository; * @author richie * @version 10.0 * 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 public boolean isEditor() { @@ -23,7 +22,7 @@ public abstract class BaseWidget extends Widget implements Describer, Producer { } @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); mixinJSON(repository, calculator, jo); return jo; diff --git a/src/main/java/com/fanruan/api/report/form/category/LoadingWidget.java b/src/main/java/com/fanruan/api/report/form/category/LoadingWidget.java new file mode 100644 index 0000000..bc5eaf6 --- /dev/null +++ b/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 { + +} diff --git a/src/main/java/com/fanruan/api/report/form/category/PlainWidget.java b/src/main/java/com/fanruan/api/report/form/category/PlainWidget.java new file mode 100644 index 0000000..199f509 --- /dev/null +++ b/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; + } +}