|
|
|
@ -1,12 +1,15 @@
|
|
|
|
|
package com.engine.organization.util;
|
|
|
|
|
|
|
|
|
|
import com.api.browser.bean.BrowserBean;
|
|
|
|
|
import com.api.browser.bean.SearchConditionItem;
|
|
|
|
|
import com.api.browser.bean.SearchConditionOption;
|
|
|
|
|
import com.api.browser.util.ConditionFactory;
|
|
|
|
|
import com.api.browser.util.ConditionType;
|
|
|
|
|
import weaver.hrm.User;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -19,6 +22,7 @@ public class OrganizationFormItemUtil {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 下拉框
|
|
|
|
|
*
|
|
|
|
|
* @param user
|
|
|
|
|
* @param selectOptions
|
|
|
|
|
* @param colSpan
|
|
|
|
@ -29,9 +33,9 @@ public class OrganizationFormItemUtil {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static SearchConditionItem selectItem(User user, List<SearchConditionOption> selectOptions, int colSpan, int fieldcol,
|
|
|
|
|
int labelcol, boolean isQuickSearch, String label,String name) {
|
|
|
|
|
int labelcol, boolean isQuickSearch, String label, String name) {
|
|
|
|
|
ConditionFactory conditionFactory = new ConditionFactory(user);
|
|
|
|
|
SearchConditionItem select = conditionFactory.createCondition(ConditionType.SELECT,502327,name);
|
|
|
|
|
SearchConditionItem select = conditionFactory.createCondition(ConditionType.SELECT, 502327, name);
|
|
|
|
|
select.setOptions(selectOptions);
|
|
|
|
|
select.setColSpan(colSpan);
|
|
|
|
|
select.setFieldcol(fieldcol);
|
|
|
|
@ -44,6 +48,7 @@ public class OrganizationFormItemUtil {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* checkbox
|
|
|
|
|
*
|
|
|
|
|
* @param user
|
|
|
|
|
* @param colSpan
|
|
|
|
|
* @param fieldcol
|
|
|
|
@ -54,9 +59,9 @@ public class OrganizationFormItemUtil {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static SearchConditionItem checkboxItem(User user, int colSpan, int fieldcol,
|
|
|
|
|
int viewAttr, boolean isQuickSearch, String label,String name) {
|
|
|
|
|
int viewAttr, boolean isQuickSearch, String label, String name) {
|
|
|
|
|
ConditionFactory conditionFactory = new ConditionFactory(user);
|
|
|
|
|
SearchConditionItem checkbox = conditionFactory.createCondition(ConditionType.CHECKBOX,502327,name);
|
|
|
|
|
SearchConditionItem checkbox = conditionFactory.createCondition(ConditionType.CHECKBOX, 502327, name);
|
|
|
|
|
checkbox.setColSpan(colSpan);
|
|
|
|
|
checkbox.setFieldcol(fieldcol);
|
|
|
|
|
checkbox.setViewAttr(viewAttr);
|
|
|
|
@ -68,6 +73,7 @@ public class OrganizationFormItemUtil {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 输入框数字
|
|
|
|
|
*
|
|
|
|
|
* @param user
|
|
|
|
|
* @param colSpan
|
|
|
|
|
* @param fieldcol
|
|
|
|
@ -75,10 +81,10 @@ public class OrganizationFormItemUtil {
|
|
|
|
|
* @param label
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static SearchConditionItem inputNumberItem(User user,int colSpan, int fieldcol,
|
|
|
|
|
int viewAttr, String label,String name) {
|
|
|
|
|
public static SearchConditionItem inputNumberItem(User user, int colSpan, int fieldcol,
|
|
|
|
|
int viewAttr, String label, String name) {
|
|
|
|
|
ConditionFactory conditionFactory = new ConditionFactory(user);
|
|
|
|
|
SearchConditionItem inputnumber = conditionFactory.createCondition(ConditionType.INPUTNUMBER,502327, name);
|
|
|
|
|
SearchConditionItem inputnumber = conditionFactory.createCondition(ConditionType.INPUTNUMBER, 502327, name);
|
|
|
|
|
inputnumber.setColSpan(colSpan);
|
|
|
|
|
inputnumber.setFieldcol(fieldcol);
|
|
|
|
|
inputnumber.setViewAttr(viewAttr);
|
|
|
|
@ -89,6 +95,7 @@ public class OrganizationFormItemUtil {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 输入框文本
|
|
|
|
|
*
|
|
|
|
|
* @param user
|
|
|
|
|
* @param colSpan
|
|
|
|
|
* @param fieldcol
|
|
|
|
@ -97,10 +104,10 @@ public class OrganizationFormItemUtil {
|
|
|
|
|
* @param label
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static SearchConditionItem inputItem(User user,int colSpan, int fieldcol,
|
|
|
|
|
int viewAttr,int length, String label,String name) {
|
|
|
|
|
public static SearchConditionItem inputItem(User user, int colSpan, int fieldcol,
|
|
|
|
|
int viewAttr, int length, String label, String name) {
|
|
|
|
|
ConditionFactory conditionFactory = new ConditionFactory(user);
|
|
|
|
|
SearchConditionItem input = conditionFactory.createCondition(ConditionType.INPUT,25034, name);
|
|
|
|
|
SearchConditionItem input = conditionFactory.createCondition(ConditionType.INPUT, 25034, name);
|
|
|
|
|
input.setColSpan(colSpan);
|
|
|
|
|
input.setFieldcol(fieldcol);
|
|
|
|
|
input.setViewAttr(viewAttr);
|
|
|
|
@ -109,8 +116,10 @@ public class OrganizationFormItemUtil {
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 浏览按钮
|
|
|
|
|
*
|
|
|
|
|
* @param user
|
|
|
|
|
* @param colSpan
|
|
|
|
|
* @param fieldcol
|
|
|
|
@ -118,23 +127,62 @@ public class OrganizationFormItemUtil {
|
|
|
|
|
* @param isQuickSearch
|
|
|
|
|
* @param label
|
|
|
|
|
* @param type
|
|
|
|
|
* @param name
|
|
|
|
|
* @param iscustom 是否为自定义浏览按钮
|
|
|
|
|
* @param fieldDbType 数据展现集成标识
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static SearchConditionItem browserItem(User user,int colSpan, int fieldcol,
|
|
|
|
|
int viewAttr,boolean isQuickSearch,String label,String type,String name) {
|
|
|
|
|
public static SearchConditionItem browserItem(User user, int colSpan, int fieldcol,
|
|
|
|
|
int viewAttr, boolean isQuickSearch, String label, String type, String name, Boolean iscustom, String fieldDbType) {
|
|
|
|
|
ConditionFactory conditionFactory = new ConditionFactory(user);
|
|
|
|
|
SearchConditionItem browser = conditionFactory.createCondition(ConditionType.BROWSER,502327,name,type);
|
|
|
|
|
SearchConditionItem browser = conditionFactory.createCondition(ConditionType.BROWSER, 502327, name, type);
|
|
|
|
|
browser.setColSpan(colSpan);
|
|
|
|
|
browser.setFieldcol(fieldcol);
|
|
|
|
|
browser.setViewAttr(viewAttr);
|
|
|
|
|
browser.setIsQuickSearch(isQuickSearch);
|
|
|
|
|
browser.setLabel(label);
|
|
|
|
|
if (iscustom) {
|
|
|
|
|
fieldDbType = "browser." + fieldDbType;
|
|
|
|
|
BrowserBean browserBean = new BrowserBean();
|
|
|
|
|
// completeParams
|
|
|
|
|
Map<String, Object> completeMap = new HashMap<>();
|
|
|
|
|
completeMap.put("f_weaver_belongto_usertype", 0);
|
|
|
|
|
completeMap.put("type", type);
|
|
|
|
|
completeMap.put("fielddbtype", fieldDbType);
|
|
|
|
|
browserBean.setCompleteParams(completeMap);
|
|
|
|
|
// conditionDataParams
|
|
|
|
|
Map<java.lang.String, Object> conditionDataMap = new HashMap<>();
|
|
|
|
|
conditionDataMap.put("f_weaver_belongto_usertype", 0);
|
|
|
|
|
conditionDataMap.put("type", fieldDbType);
|
|
|
|
|
conditionDataMap.put("fielddbtype", fieldDbType);
|
|
|
|
|
browserBean.setConditionDataParams(conditionDataMap);
|
|
|
|
|
// dataParams
|
|
|
|
|
Map<java.lang.String, Object> dataMap = new HashMap<>();
|
|
|
|
|
dataMap.put("f_weaver_belongto_usertype", 0);
|
|
|
|
|
dataMap.put("type", fieldDbType);
|
|
|
|
|
browserBean.setDataParams(dataMap);
|
|
|
|
|
// destDataParams
|
|
|
|
|
Map<java.lang.String, Object> destDataMap = new HashMap<>();
|
|
|
|
|
destDataMap.put("f_weaver_belongto_usertype", 0);
|
|
|
|
|
destDataMap.put("type", fieldDbType);
|
|
|
|
|
browserBean.setDestDataParams(destDataMap);
|
|
|
|
|
|
|
|
|
|
browserBean.setLinkUrl("");
|
|
|
|
|
browserBean.setMobileLinkUrl("");
|
|
|
|
|
browserBean.setPageSize(10);
|
|
|
|
|
browserBean.setScrollx(true);
|
|
|
|
|
browserBean.setTitle(label);
|
|
|
|
|
browserBean.setType(type);
|
|
|
|
|
|
|
|
|
|
browser.setBrowserConditionParam(browserBean);
|
|
|
|
|
}
|
|
|
|
|
return browser;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 日期区间
|
|
|
|
|
*
|
|
|
|
|
* @param user
|
|
|
|
|
* @param colSpan
|
|
|
|
|
* @param fieldcol
|
|
|
|
@ -142,20 +190,21 @@ public class OrganizationFormItemUtil {
|
|
|
|
|
* @param label
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static SearchConditionItem rangeDateItem(User user,int colSpan, int fieldcol,int viewAttr
|
|
|
|
|
,String label,String name1,String name2) {
|
|
|
|
|
public static SearchConditionItem rangeDateItem(User user, int colSpan, int fieldcol, int viewAttr
|
|
|
|
|
, String label, String name1, String name2) {
|
|
|
|
|
ConditionFactory conditionFactory = new ConditionFactory(user);
|
|
|
|
|
SearchConditionItem rangeDate = conditionFactory.createCondition(ConditionType.TIMEPICKER,502327,new String[]{name1,name2});
|
|
|
|
|
SearchConditionItem rangeDate = conditionFactory.createCondition(ConditionType.TIMEPICKER, 502327, new String[]{name1, name2});
|
|
|
|
|
rangeDate.setColSpan(colSpan);
|
|
|
|
|
rangeDate.setFieldcol(fieldcol);
|
|
|
|
|
rangeDate.setViewAttr(viewAttr);
|
|
|
|
|
rangeDate.setLabel(label);
|
|
|
|
|
return rangeDate;
|
|
|
|
|
return rangeDate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 多行文本框
|
|
|
|
|
*
|
|
|
|
|
* @param user
|
|
|
|
|
* @param colSpan
|
|
|
|
|
* @param fieldcol
|
|
|
|
@ -166,10 +215,10 @@ public class OrganizationFormItemUtil {
|
|
|
|
|
* @param name
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static SearchConditionItem textareaItem(User user,int colSpan, int fieldcol,boolean isQuickSearch,
|
|
|
|
|
int viewAttr,int length, String label,String name) {
|
|
|
|
|
public static SearchConditionItem textareaItem(User user, int colSpan, int fieldcol, boolean isQuickSearch,
|
|
|
|
|
int viewAttr, int length, String label, String name) {
|
|
|
|
|
ConditionFactory conditionFactory = new ConditionFactory(user);
|
|
|
|
|
SearchConditionItem textarea = conditionFactory.createCondition(ConditionType.TEXTAREA,502227, name);
|
|
|
|
|
SearchConditionItem textarea = conditionFactory.createCondition(ConditionType.TEXTAREA, 502227, name);
|
|
|
|
|
textarea.setColSpan(colSpan);
|
|
|
|
|
textarea.setFieldcol(fieldcol);
|
|
|
|
|
textarea.setIsQuickSearch(isQuickSearch);
|
|
|
|
@ -183,6 +232,7 @@ public class OrganizationFormItemUtil {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 日期
|
|
|
|
|
*
|
|
|
|
|
* @param user
|
|
|
|
|
* @param colSpan
|
|
|
|
|
* @param fieldcol
|
|
|
|
@ -192,10 +242,10 @@ public class OrganizationFormItemUtil {
|
|
|
|
|
* @param name
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static SearchConditionItem datePickerItem(User user,int colSpan, int fieldcol,boolean isQuickSearch,
|
|
|
|
|
int viewAttr,String label,String name) {
|
|
|
|
|
public static SearchConditionItem datePickerItem(User user, int colSpan, int fieldcol, boolean isQuickSearch,
|
|
|
|
|
int viewAttr, String label, String name) {
|
|
|
|
|
ConditionFactory conditionFactory = new ConditionFactory(user);
|
|
|
|
|
SearchConditionItem datePicker = conditionFactory.createCondition(ConditionType.DATEPICKER,502227, name);
|
|
|
|
|
SearchConditionItem datePicker = conditionFactory.createCondition(ConditionType.DATEPICKER, 502227, name);
|
|
|
|
|
datePicker.setColSpan(colSpan);
|
|
|
|
|
datePicker.setFieldcol(fieldcol);
|
|
|
|
|
datePicker.setIsQuickSearch(isQuickSearch);
|
|
|
|
@ -205,8 +255,4 @@ public class OrganizationFormItemUtil {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|