<script> var roleId = getQueryString("id"); layui.use(['jquery','form','tree'], function () { var $ = layui.jquery, form = layui.form, layer = layui.layer, tree = layui.tree, $ = layui.$; form.render('select'); //var id = $("#id").val(); $.get(interfaces.selectFuncUrl + '?roleId=' + roleId, function(result){ tree.render({ elem: '#funTree' ,data: result ,showCheckbox: true //是否显示复选框 ,id: 'funcSelect' //,isJump: true //是否允许点击节点时弹出新窗口跳转 ,click: function(obj){ //var data = obj.data; //获取当前点击的节点数据 //layer.msg('状态:'+ obj.state + '<br>节点数据:' + JSON.stringify(data)); } }); }); //监听提交 form.on('submit(saveBtn)', function (data) { var checkedDatas = tree.getChecked('funcSelect'); var ids = getCheckedId(checkedDatas); var formData = data.field; $.post(interfaces.roleUrl+'?ids=' + ids + '&name=' + formData.name + '&type=' + formData.type + '&id=' + roleId, {}, function(result){ if (!result.success){ layer.alert('保存出错','提示'); } else { var iframeIndex = parent.layer.getFrameIndex(window.name); parent.layer.close(iframeIndex); return false; } } ); }); //获取所有选中的节点id function getCheckedId(data) { var id = ""; $.each(data, function (index, item) { if (id != "") { id = id + "," + item.id; } else { id = item.id; } //item 没有children属性 if (item.children != null) { var i = getCheckedId(item.children); if (i != "") { id = id + "," + i; } } }); return id; } }); </script>
一片空白 5.8万
父爱如山,不善表达。回想十多年前,总记得父亲有个宽厚的肩膀,小小的自己跨坐在上面,越过人山人海去看更广阔的天空,那个时候期望自己有一双翅膀,能够像鸟儿一样飞得高,看得远。虽然父亲有时会和自己开玩笑,但在做错事的时候会受到严厉的训斥。父亲有双粗糙的大手掌。