Bladeren bron

默认值

master
yaoq 2 jaren geleden
bovenliggende
commit
05075396d3
4 gewijzigde bestanden met toevoegingen van 35 en 7 verwijderingen
  1. +4
    -3
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/user/role/RoleHandler.java
  2. +5
    -0
      smtweb-framework/bpm/src/main/resources/static/event/bpm/sys/user/menu/menuList.js
  3. +16
    -0
      smtweb-framework/core/src/main/java/cc/smtweb/framework/core/common/SwEnum.java
  4. +10
    -4
      smtweb-framework/core/src/main/java/cc/smtweb/framework/core/db/impl/DefaultEntity.java

+ 4
- 3
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/sys/user/role/RoleHandler.java Bestand weergeven

@@ -132,6 +132,7 @@ public class RoleHandler {
}
MenuPlanItem item = MenuPlanCache.getInstance().getById(role.getSmpId(), mp_id);
if (item == null) return bean;
bean.put("menu", rc.getMenuRight());
bean.put("func", rc.getFuncRight(item.getId()));
bean.put("read", rc.getFieldRight(item.getId(), 1));
bean.put("write", rc.getFieldRight(item.getId(), 2));
@@ -240,9 +241,9 @@ public class RoleHandler {
SwMap row = new SwMap();
row.put("key", f);
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);
}


+ 5
- 0
smtweb-framework/bpm/src/main/resources/static/event/bpm/sys/user/menu/menuList.js Bestand weergeven

@@ -17,6 +17,10 @@ window.$swEvent.setup("bpm.sys.user.menu.menuList", {
/*$model.menuCard.setFormVal("sm_page_url", getPath(value));*/
};

const onTypeChange = (value) => {
$refs.selectPage.refVars.disabled = (value !== 0);
}

const getPath = (url) => {
//页面类型:0-设计器页面,1-自定义页面,2-外部链接
const sm_type = $$UtilPub._toNumberEx($model.menuCard.getFormVal("sm_type"));
@@ -28,6 +32,7 @@ window.$swEvent.setup("bpm.sys.user.menu.menuList", {

return {
onSelectPage,
onTypeChange,
onUrlChange,
}
}


+ 16
- 0
smtweb-framework/core/src/main/java/cc/smtweb/framework/core/common/SwEnum.java Bestand weergeven

@@ -1,5 +1,6 @@
package cc.smtweb.framework.core.common;

import cc.smtweb.framework.core.util.PubUtil;
import org.apache.commons.lang3.StringUtils;

import java.sql.Types;
@@ -162,6 +163,21 @@ public interface SwEnum {
}
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;
}
}
}

/**


+ 10
- 4
smtweb-framework/core/src/main/java/cc/smtweb/framework/core/db/impl/DefaultEntity.java Bestand weergeven

@@ -18,10 +18,11 @@ public class DefaultEntity extends BaseBean implements Serializable, Cloneable {
private final static String tableNameKey = "_def_table_name";
private final static String statusKey = "_status";

public DefaultEntity() {}
public DefaultEntity() {
}

public DefaultEntity(String _def_table_name) {
this.put(tableNameKey,_def_table_name);
this.put(tableNameKey, _def_table_name);
}

public ModelTable getModelTable() {
@@ -31,6 +32,7 @@ public class DefaultEntity extends BaseBean implements Serializable, Cloneable {
public String getTableName() {
return getStr(tableNameKey);
}

public void setTableName(String tableName) {
put(tableNameKey, tableName);
}
@@ -59,12 +61,16 @@ public class DefaultEntity extends BaseBean implements Serializable, Cloneable {
put(field.getName(), DateUtil.nowDateTimeLong());
} else {
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() {
return getModelTable().getIdField();
}


Laden…
Annuleren
Opslaan