纽威
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

155 lines
7.3 KiB

3 years ago
  1. @{
  2. ViewBag.Title = "Form";
  3. Layout = "~/Views/Shared/_Form.cshtml";
  4. }
  5. <script>
  6. var keyValue = $.request("keyValue");
  7. $(function () {
  8. initControl();
  9. if (!!keyValue) {
  10. $.ajax({
  11. url: "/SystemManage/Role/GetFormJson",
  12. data: { keyValue: keyValue },
  13. dataType: "json",
  14. async: false,
  15. success: function (data) {
  16. $("#form1").formSerialize(data);
  17. }
  18. });
  19. }
  20. })
  21. function initControl() {
  22. $("#F_OrganizeId").bindSelect({
  23. url: "/SystemManage/Organize/GetTreeSelectJson",
  24. });
  25. $("#F_Type").bindSelect({
  26. url: "/SystemManage/ItemsData/GetSelectJson",
  27. param: { enCode: "RoleType" }
  28. });
  29. $('#wizard').wizard().on('change', function (e, data) {
  30. var $finish = $("#btn_finish");
  31. var $next = $("#btn_next");
  32. if (data.direction == "next") {
  33. switch (data.step) {
  34. case 1:
  35. if (!$('#form1').formValid()) {
  36. return false;
  37. }
  38. $finish.show();
  39. $next.hide();
  40. break;
  41. default:
  42. break;
  43. }
  44. } else {
  45. $finish.hide();
  46. $next.show();
  47. }
  48. });
  49. $("#permissionTree").treeview({
  50. height: 444,
  51. showcheck: true,
  52. url: "/SystemManage/RoleAuthorize/GetPermissionTree",
  53. param: { roleId: keyValue }
  54. });
  55. }
  56. function submitForm() {
  57. var postData = $("#form1").formSerialize();
  58. postData["permissionIds"] = String($("#permissionTree").getCheckedNodes());
  59. $.submitForm({
  60. url: "/SystemManage/Role/SubmitForm?keyValue=" + keyValue,
  61. param: postData,
  62. success: function () {
  63. $.currentWindow().$("#gridList").trigger("reloadGrid");
  64. }
  65. });
  66. }
  67. </script>
  68. <form id="form1">
  69. <div class="widget-body">
  70. <div id="wizard" class="wizard" data-target="#wizard-steps" style="border-left: none; border-top: none; border-right: none;">
  71. <ul class="steps">
  72. <li data-target="#step-1" class="active"><span class="step">1</span>角色信息<span class="chevron"></span></li>
  73. <li data-target="#step-2"><span class="step">2</span>功能权限<span class="chevron"></span></li>
  74. </ul>
  75. </div>
  76. <div class="step-content" id="wizard-steps" style="border-left: none; border-bottom: none; border-right: none;">
  77. <div class="step-pane active" id="step-1" style="margin: 10px; margin-bottom: 0px;">
  78. <div class="alert alert-danger" style="text-align: left; margin-bottom: 10px;">
  79. <i class="fa fa-warning alert-dismissible" style="position: relative; top: 1px; font-size: 15px; padding-right: 5px;"></i>
  80. 请填写角色信息,用于创建或修改角色信息!
  81. </div>
  82. <div class="panel panel-default">
  83. <div class="panel-heading">
  84. <h3 class="panel-title">表单信息</h3>
  85. </div>
  86. <div class="panel-body" style="width: 98%;">
  87. <table class="form">
  88. <tr>
  89. <th class="formTitle">归属组织</th>
  90. <td class="formValue">
  91. <select id="F_OrganizeId" name="F_OrganizeId" class="form-control required">
  92. </select>
  93. </td>
  94. </tr>
  95. <tr>
  96. <th class="formTitle">角色名称</th>
  97. <td class="formValue">
  98. <input id="F_FullName" name="F_FullName" type="text" class="form-control required" placeholder="请输入角色名称" />
  99. </td>
  100. </tr>
  101. <tr>
  102. <th class="formTitle">角色编号</th>
  103. <td class="formValue">
  104. <input id="F_EnCode" name="F_EnCode" type="text" class="form-control required" placeholder="请输入角色编号" />
  105. </td>
  106. </tr>
  107. <tr>
  108. <th class="formTitle">角色类型</th>
  109. <td class="formValue">
  110. <select id="F_Type" name="F_Type" class="form-control required">
  111. </select>
  112. </td>
  113. </tr>
  114. <tr>
  115. <th class="formTitle">显示顺序</th>
  116. <td class="formValue">
  117. <input id="F_SortCode" name="F_SortCode" type="text" class="form-control required" placeholder="请输入显示顺序" />
  118. </td>
  119. </tr>
  120. <tr>
  121. <th class="formTitle" style="height: 35px;">选项</th>
  122. <td class="formValue" style="padding-top: 1px;">
  123. <div class="ckbox">
  124. <input id="F_AllowEdit" name="F_AllowEdit" type="checkbox"><label for="F_AllowEdit">允许编辑</label>
  125. </div>
  126. <div class="ckbox">
  127. <input id="F_AllowDelete" name="F_AllowDelete" type="checkbox"><label for="F_AllowDelete">允许删除</label>
  128. </div>
  129. <div class="ckbox">
  130. <input id="F_EnabledMark" name="F_EnabledMark" type="checkbox" checked="checked"><label for="F_EnabledMark">有效</label>
  131. </div>
  132. </td>
  133. </tr>
  134. <tr>
  135. <th class="formTitle" valign="top" style="padding-top: 5px;">备注
  136. </th>
  137. <td class="formValue">
  138. <textarea id="F_Description" name="F_Description" class="form-control" style="height: 60px;"></textarea>
  139. </td>
  140. </tr>
  141. </table>
  142. </div>
  143. </div>
  144. </div>
  145. <div class="step-pane" id="step-2">
  146. <div id="permissionTree"></div>
  147. </div>
  148. </div>
  149. <div class="form-button" id="wizard-actions">
  150. <a id="btn_last" disabled class="btn btn-default btn-prev">上一步</a>
  151. <a id="btn_next" class="btn btn-default btn-next">下一步</a>
  152. <a id="btn_finish" class="btn btn-default" style="display: none;" onclick="submitForm()">完成</a>
  153. </div>
  154. </div>
  155. </form>