Files
SOP/sop-admin/sop-admin-front/assets/js/routerole.js
tanghc 43c72530d3 1.1.0
2019-04-01 20:57:56 +08:00

22 lines
881 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var RouteRole = {
loadAllRole: function (form, contentId, callback) {
ApiUtil.post('role.listall', {}, function (resp) {
var roles = resp.data;
var html = []
for (var i = 0; i < roles.length; i++) {
if (i > 0 && i % 5 === 0) {
html.push('<br>');
}
var role = roles[i];
html.push('<input type="checkbox" name="roleCode" value="'+role.roleCode+'" lay-skin="primary" title="'+role.description+'">');
}
$('#' + contentId).html(html.join(''));
// 如果你的HTML是动态生成的自动渲染就会失效
// 因此你需要在相应的地方,执行下述方法来手动渲染,跟这类似的还有 element.init();
form.render();
callback && callback();
});
}
}