role-updateRoleRes.jsp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>为角色分配资源信息</title>
  6. <!--框架必需start-->
  7. <script type="text/javascript" src="${ctx}/qui/libs/js/jquery.js"></script>
  8. <script type="text/javascript" src="${ctx}/qui/libs/js/framework.js"></script>
  9. <link href="${ctx}/qui/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
  10. <link rel="stylesheet" type="text/css" id="skin" prePath="${ctx}/qui/"/>
  11. <link rel="stylesheet" type="text/css" id="customSkin"/>
  12. <!--框架必需end-->
  13. <!--表单异步提交start-->
  14. <script src="${ctx}/qui/libs/js/form/form.js" type="text/javascript"></script>
  15. <!--表单异步提交end-->
  16. <!-- 表单验证start -->
  17. <link rel="stylesheet" href="${ctx}/qui/libs/js/form/validform/css/style.css" type="text/css" media="all" />
  18. <script src="${ctx}/qui/libs/js/form/validform/validform.js" type="text/javascript"></script>
  19. <!-- 表单验证end -->
  20. <!-- 树组件start -->
  21. <script type="text/javascript" src="${ctx}/qui/libs/js/tree/ztree/ztree.js"></script>
  22. <link type="text/css" rel="stylesheet" href="${ctx}/qui/libs/js/tree/ztree/ztree.css"></link>
  23. <!-- 树组件end -->
  24. </head>
  25. <body>
  26. <form id="editForm" action="${ctx}/role/updateRoleResData.do" method="post" target="frmright">
  27. <div class="box1" panelWidth="395">
  28. <input name="roleId" type="hidden" value="${role.roleId}"/>
  29. <input name="resIds" id="resIds" type="hidden" value=""/>
  30. <fieldset>
  31. <legend>为角色【${role.roleName}】分配资源</legend>
  32. <div class="cusBoxContent" style="width:150px;">
  33. <ul id="tree" class="ztree"></ul>
  34. </div>
  35. </fieldset>
  36. <div class="padding_top10">
  37. <table class="tableStyle" formMode="transparent">
  38. <tr>
  39. <td colspan="4">
  40. <input type="submit" value="提交"/>
  41. <input type="button" value="取消" onclick="top.Dialog.close()"/>
  42. </td>
  43. </tr>
  44. </table>
  45. </div>
  46. </div>
  47. </form>
  48. <!-- 异步提交start -->
  49. <script type="text/javascript">
  50. function initComplete(){
  51. initTree();
  52. getSelectValue();
  53. //表单提交
  54. $("#editForm").Validform({
  55. tiptype:3,//表示在右边显示
  56. ajaxPost:true,
  57. showAllError:true,
  58. callback:function(responseText){
  59. $.Hidemsg();
  60. if(responseText.status=="y"){
  61. top.Dialog.alert(responseText.info,function(){
  62. closeWin();
  63. });
  64. }else{
  65. top.Dialog.alert(responseText.info,function(){
  66. return false;
  67. });
  68. }
  69. }
  70. });
  71. }
  72. //树属性配置
  73. var setting = {
  74. check: {
  75. enable: true,
  76. chkboxType:{ "Y" : "s", "N" : "ps" }
  77. },
  78. callback: {
  79. onCheck: getSelectValue
  80. }
  81. };
  82. //树结点的值
  83. var nodes = ${nodes};
  84. //初始化tree处理
  85. function initTree() {
  86. $.fn.zTree.init($("#tree"),setting, nodes);
  87. }
  88. //选择结果
  89. function getSelectValue(){
  90. //获取zTree对象
  91. var zTree = $.fn.zTree.getZTreeObj("tree");
  92. //得到选中的数据集
  93. var checkedNodes = zTree.getCheckedNodes(true);
  94. var msg = "";
  95. for(var i = 0; i < checkedNodes.length; i++){
  96. if(msg == ""){
  97. msg = checkedNodes[i].id;
  98. }else{
  99. msg += "," + checkedNodes[i].id;
  100. }
  101. }
  102. $("#resIds").val(msg);
  103. }
  104. //重置
  105. function closeWin(){
  106. //刷新数据
  107. //top.frmright.resetSearch();
  108. //关闭窗口
  109. top.Dialog.close();
  110. }
  111. </script>
  112. <!-- 异步提交end -->
  113. </body>
  114. </html>