|
|
@@ -1,5 +1,6 @@
|
|
|
package nckd.base.common.utils;
|
|
|
|
|
|
+import kd.bos.base.BaseShowParameter;
|
|
|
import kd.bos.bill.BillShowParameter;
|
|
|
import kd.bos.bill.OperationStatus;
|
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
|
@@ -20,7 +21,9 @@ import kd.bos.form.events.HyperLinkClickListener;
|
|
|
import kd.bos.form.field.*;
|
|
|
import kd.bos.form.field.events.BeforeF7SelectListener;
|
|
|
import kd.bos.form.plugin.AbstractFormPlugin;
|
|
|
+import kd.bos.form.plugin.IFormPlugin;
|
|
|
import kd.bos.list.BillList;
|
|
|
+import kd.bos.list.ListShowParameter;
|
|
|
import kd.bos.orm.query.QCP;
|
|
|
import kd.bos.orm.query.QFilter;
|
|
|
import nckd.base.common.constant.BaseFieldConst;
|
|
|
@@ -430,4 +433,143 @@ public final class FormUtils {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 打开动态表单界面
|
|
|
+ *
|
|
|
+ * @param view
|
|
|
+ * @param entityName 动态表单标识
|
|
|
+ * @param value 传入动态表单界面的参数
|
|
|
+ */
|
|
|
+ public static void formShowParameter(IFormView view, String entityName, Map<String, Object> value,
|
|
|
+ IFormPlugin plugin, String actionId) {
|
|
|
+ formShowParameter(view, entityName, value, ShowType.Modal,plugin,actionId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 打开动态表单界面
|
|
|
+ *
|
|
|
+ * @param view
|
|
|
+ * @param entityName 动态表单标识
|
|
|
+ * @param value 传入动态表单界面的参数
|
|
|
+ * @param ShowType 打开方式
|
|
|
+ */
|
|
|
+ public static void formShowParameter(IFormView view, String entityName, Map<String, Object> value, ShowType ShowType,
|
|
|
+ IFormPlugin plugin,String actionId) {
|
|
|
+ FormShowParameter showParameter = new FormShowParameter();
|
|
|
+ //动态表单标识
|
|
|
+ showParameter.setFormId(entityName);
|
|
|
+ //打开方式
|
|
|
+ showParameter.getOpenStyle().setShowType(ShowType);
|
|
|
+ //设置参数
|
|
|
+ showParameter.setCustomParams(value);
|
|
|
+ //关闭页面回调标识
|
|
|
+ showParameter.setCloseCallBack(new CloseCallBack(plugin,actionId));
|
|
|
+ view.showForm(showParameter);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 打开单据界面
|
|
|
+ * @param view
|
|
|
+ * @param entityName 单据标识
|
|
|
+ * @param pkId 单据id
|
|
|
+ * @param value 传入的参数
|
|
|
+ * @param operationStatus 页面状态
|
|
|
+ */
|
|
|
+ public static void billShowParameter(IFormView view, String entityName, Object pkId, Map<String, Object> value, OperationStatus operationStatus) {
|
|
|
+ billShowParameter(view, entityName, pkId, value, ShowType.Modal, operationStatus);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 打开单据界面
|
|
|
+ * @param view
|
|
|
+ * @param entityName 单据标识
|
|
|
+ * @param pkId 单据id
|
|
|
+ * @param value 传入的参数
|
|
|
+ * @param ShowType 打开方式
|
|
|
+ * @param operationStatus 页面状态
|
|
|
+ */
|
|
|
+ public static void billShowParameter(IFormView view, String entityName, Object pkId, Map<String, Object> value, ShowType ShowType, OperationStatus operationStatus) {
|
|
|
+ BillShowParameter showParameter = new BillShowParameter();
|
|
|
+ //id为空默认新增
|
|
|
+ showParameter.setStatus(ObjectUtils.isEmpty(pkId) ? OperationStatus.ADDNEW : operationStatus);
|
|
|
+ if(!ObjectUtils.isEmpty(pkId)){
|
|
|
+ //单据id
|
|
|
+ showParameter.setPkId(pkId);
|
|
|
+ }
|
|
|
+ //单据标识
|
|
|
+ showParameter.setFormId(entityName);
|
|
|
+ //打开方式
|
|
|
+ showParameter.getOpenStyle().setShowType(ShowType);
|
|
|
+ //设置参数
|
|
|
+ showParameter.setCustomParams(value);
|
|
|
+ view.showForm(showParameter);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 打开列表界面
|
|
|
+ * @param view
|
|
|
+ * @param entityName 单据标识
|
|
|
+ * @param qFilter 列表过滤条件
|
|
|
+ */
|
|
|
+ public static void listShowParameter(IFormView view, String entityName, QFilter qFilter) {
|
|
|
+ listShowParameter(view, entityName, ShowType.Modal, qFilter);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 打开列表界面
|
|
|
+ * @param view
|
|
|
+ * @param entityName 单据标识
|
|
|
+ * @param ShowType 打开方式
|
|
|
+ * @param qFilter 列表过滤条件
|
|
|
+ */
|
|
|
+ public static void listShowParameter(IFormView view, String entityName, ShowType ShowType, QFilter qFilter) {
|
|
|
+ ListShowParameter showParameter = new ListShowParameter();
|
|
|
+ //单据标识
|
|
|
+ showParameter.setBillFormId(entityName);
|
|
|
+ //列表的模板标识
|
|
|
+ showParameter.setFormId("bos_list");
|
|
|
+ //打开方式
|
|
|
+ showParameter.getOpenStyle().setShowType(ShowType);
|
|
|
+ //列表界面时过滤条件
|
|
|
+ showParameter.getListFilterParameter().getQFilters().add(qFilter);
|
|
|
+ view.showForm(showParameter);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 打开基础资料界面
|
|
|
+ * @param view
|
|
|
+ * @param entityName 单据标识
|
|
|
+ * @param pkId 单据id
|
|
|
+ * @param value 传入的参数
|
|
|
+ * @param operationStatus 页面状态
|
|
|
+ */
|
|
|
+ public static void baseShowParameter(IFormView view, String entityName, Object pkId, Map<String, Object> value, OperationStatus operationStatus) {
|
|
|
+ baseShowParameter(view, entityName, pkId, value, ShowType.Modal, operationStatus);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 打开基础资料界面
|
|
|
+ * @param view
|
|
|
+ * @param entityName 单据标识
|
|
|
+ * @param pkId 单据id
|
|
|
+ * @param value 传入的参数
|
|
|
+ * @param ShowType 打开方式
|
|
|
+ * @param operationStatus 页面状态
|
|
|
+ */
|
|
|
+ public static void baseShowParameter(IFormView view, String entityName, Object pkId, Map<String, Object> value, ShowType ShowType, OperationStatus operationStatus){
|
|
|
+ BaseShowParameter showParameter = new BaseShowParameter();
|
|
|
+ //id为空默认新增
|
|
|
+ showParameter.setStatus(ObjectUtils.isEmpty(pkId) ? OperationStatus.ADDNEW : operationStatus);
|
|
|
+ //单据id
|
|
|
+ showParameter.setPkId(ObjectUtils.isEmpty(pkId) ? 0l : pkId);
|
|
|
+ //单据标识
|
|
|
+ showParameter.setFormId(entityName);
|
|
|
+ //打开方式
|
|
|
+ showParameter.getOpenStyle().setShowType(ShowType);
|
|
|
+ //设置参数
|
|
|
+ showParameter.setCustomParams(value);
|
|
|
+ view.showForm(showParameter);
|
|
|
+ }
|
|
|
+
|
|
|
}
|