若依框架. 仿ThymeLeaf前端SelectDictLable方法

  1. 在framework项目下新增所需服务

2. 在admin项目下,编辑ry-ui.js,新增table的方法。

 

 

// ry-ui.js中代码:
selectUserName: function(datas, value) {
var actions = [];
$.each(datas,
function(index, user) {
if (user.userId == ('' + value)) {
actions.push($.common.sprintf("<span class='%s'>%s</span>", "", user.userName));
return false;
}
});
return actions.join('');
},

//页面中js代码
var
userList = [[$ {@user.getUserList()}]]; {   field: 'consultantId',   title: '业务经理',   sortable: true,   formatter: function(value, row, index) {       return $.table.selectUserName(userList, value);   } },

猜你喜欢

转载自www.cnblogs.com/initx/p/11493005.html