layui table中cols取list中的实体类,并且给状态添加判断

1 table中cols取list中的实体类 比如 

{field: 'user.uname', title: '用户名',  80, sort: true}
这样取不到值

需要在实体类中添加
public String getBedName() {
return bed.getBedName();
}

2 给状态添加判断
{field: 'mrStatus', title: '状态', 240,
templet : function(data) {// 替换数据
if (data.mrStatus == 1) {
return "生成病历";
} else if (data.mrStatus == 2) {
return "添加床位医生护士";
} else if (data.mrStatus == 3) {
return "出院申请";
} else if (data.mrStatus == 4) {
return "结算费用";
} else if (data.mrStatus == 5) {
return "出院成功";
} else if (data.mrStatus == 6) {
return "删除病历";
}
}
}
原文地址:https://www.cnblogs.com/hello-top/p/13845477.html