@@ -132,6 +132,7 @@ public class RoleHandler { | |||||
} | } | ||||
MenuPlanItem item = MenuPlanCache.getInstance().getById(role.getSmpId(), mp_id); | MenuPlanItem item = MenuPlanCache.getInstance().getById(role.getSmpId(), mp_id); | ||||
if (item == null) return bean; | if (item == null) return bean; | ||||
bean.put("menu", rc.getMenuRight()); | |||||
bean.put("func", rc.getFuncRight(item.getId())); | bean.put("func", rc.getFuncRight(item.getId())); | ||||
bean.put("read", rc.getFieldRight(item.getId(), 1)); | bean.put("read", rc.getFieldRight(item.getId(), 1)); | ||||
bean.put("write", rc.getFieldRight(item.getId(), 2)); | bean.put("write", rc.getFieldRight(item.getId(), 2)); | ||||
@@ -240,9 +241,9 @@ public class RoleHandler { | |||||
SwMap row = new SwMap(); | SwMap row = new SwMap(); | ||||
row.put("key", f); | row.put("key", f); | ||||
row.put("key_text", DataRightDefineCache.getInstance().get(f).getName()); | row.put("key_text", DataRightDefineCache.getInstance().get(f).getName()); | ||||
if (data.get(f) != null && PubUtil.isNotEmpty(data.get(f).toString())) { | |||||
row.put("value", data.get(f)); | |||||
row.put("value_text", DataRightGroupCache.getInstance().get(data.get(f).toString()).getName()); | |||||
if (data.containsKey("value")) { | |||||
row.put("value", data.get("value")); | |||||
row.put("value_text", DataRightGroupCache.getInstance().get(data.get("value").toString()).getName()); | |||||
} | } | ||||
list.add(row); | list.add(row); | ||||
} | } | ||||
@@ -17,6 +17,10 @@ window.$swEvent.setup("bpm.sys.user.menu.menuList", { | |||||
/*$model.menuCard.setFormVal("sm_page_url", getPath(value));*/ | /*$model.menuCard.setFormVal("sm_page_url", getPath(value));*/ | ||||
}; | }; | ||||
const onTypeChange = (value) => { | |||||
$refs.selectPage.refVars.disabled = (value !== 0); | |||||
} | |||||
const getPath = (url) => { | const getPath = (url) => { | ||||
//页面类型:0-设计器页面,1-自定义页面,2-外部链接 | //页面类型:0-设计器页面,1-自定义页面,2-外部链接 | ||||
const sm_type = $$UtilPub._toNumberEx($model.menuCard.getFormVal("sm_type")); | const sm_type = $$UtilPub._toNumberEx($model.menuCard.getFormVal("sm_type")); | ||||
@@ -28,6 +32,7 @@ window.$swEvent.setup("bpm.sys.user.menu.menuList", { | |||||
return { | return { | ||||
onSelectPage, | onSelectPage, | ||||
onTypeChange, | |||||
onUrlChange, | onUrlChange, | ||||
} | } | ||||
} | } | ||||
@@ -1,5 +1,6 @@ | |||||
package cc.smtweb.framework.core.common; | package cc.smtweb.framework.core.common; | ||||
import cc.smtweb.framework.core.util.PubUtil; | |||||
import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
import java.sql.Types; | import java.sql.Types; | ||||
@@ -162,6 +163,21 @@ public interface SwEnum { | |||||
} | } | ||||
return REMARK; | return REMARK; | ||||
} | } | ||||
public static Object getDataValue(String value, String fieldValue) { | |||||
DataTypeBean dataType = instance.getByValue(value); | |||||
if (dataType == null) return fieldValue; | |||||
switch (dataType.javaType) { | |||||
case "long": | |||||
return PubUtil.getLongIgnoreErr(fieldValue); | |||||
case "int": | |||||
return PubUtil.getIntIgnoreErr(fieldValue); | |||||
case "boolean": | |||||
return PubUtil.getBool(fieldValue); | |||||
default: | |||||
return fieldValue; | |||||
} | |||||
} | |||||
} | } | ||||
/** | /** | ||||
@@ -18,10 +18,11 @@ public class DefaultEntity extends BaseBean implements Serializable, Cloneable { | |||||
private final static String tableNameKey = "_def_table_name"; | private final static String tableNameKey = "_def_table_name"; | ||||
private final static String statusKey = "_status"; | private final static String statusKey = "_status"; | ||||
public DefaultEntity() {} | |||||
public DefaultEntity() { | |||||
} | |||||
public DefaultEntity(String _def_table_name) { | public DefaultEntity(String _def_table_name) { | ||||
this.put(tableNameKey,_def_table_name); | |||||
this.put(tableNameKey, _def_table_name); | |||||
} | } | ||||
public ModelTable getModelTable() { | public ModelTable getModelTable() { | ||||
@@ -31,6 +32,7 @@ public class DefaultEntity extends BaseBean implements Serializable, Cloneable { | |||||
public String getTableName() { | public String getTableName() { | ||||
return getStr(tableNameKey); | return getStr(tableNameKey); | ||||
} | } | ||||
public void setTableName(String tableName) { | public void setTableName(String tableName) { | ||||
put(tableNameKey, tableName); | put(tableNameKey, tableName); | ||||
} | } | ||||
@@ -59,12 +61,16 @@ public class DefaultEntity extends BaseBean implements Serializable, Cloneable { | |||||
put(field.getName(), DateUtil.nowDateTimeLong()); | put(field.getName(), DateUtil.nowDateTimeLong()); | ||||
} else { | } else { | ||||
String s = field.getDefaultValue(); | String s = field.getDefaultValue(); | ||||
if (StringUtils.isNotEmpty(s)) put(field.getName(), s); | |||||
if (StringUtils.isNotEmpty(s)) { | |||||
put(field.getName(), SwEnum.DataType.getDataValue(field.getDataType(), s)); | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/** 主键字段 */ | |||||
/** | |||||
* 主键字段 | |||||
*/ | |||||
public String getPkFieldName() { | public String getPkFieldName() { | ||||
return getModelTable().getIdField(); | return getModelTable().getIdField(); | ||||
} | } | ||||