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.

90 lines
4.0 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. @extends('admin.layouts.app')
  2. @section('title', '菜单修改')
  3. @section('content')
  4. <h5 class="sub-header"><a href="/fladmin/menu">菜单列表</a> > 菜单修改</h5>
  5. <form id="addarc" method="post" action="/fladmin/menu/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
  6. <table class="table table-striped table-bordered">
  7. <tbody>
  8. <tr>
  9. <td align="right">上级:</td>
  10. <td>
  11. <select name="pid" id="pid">
  12. <option value="0">顶级菜单</option>
  13. <?php if($menu){foreach($menu as $row){ ?>
  14. <?php if($row["id"]==$post["pid"]){ ?>
  15. <option selected value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "";}echo $row["name"]; ?></option>
  16. <?php }else{ ?>
  17. <option value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "";}echo $row["name"]; ?></option>
  18. <?php }}} ?>
  19. </select>
  20. </td>
  21. </tr>
  22. <tr>
  23. <td align="right">名称:</td>
  24. <td><input name="name" type="text" id="name" value="<?php echo $post["name"]; ?>" class="required" style="width:30%" placeholder="在此输入菜单名称"><input style="display:none;" name="id" type="text" id="id" value="<?php echo $id; ?>"></td>
  25. </tr>
  26. <tr>
  27. <td align="right">操作方法:</td>
  28. <td><input name="action" type="text" id="action" value="<?php echo $post["action"]; ?>" class="required" style="width:30%"></td>
  29. </tr>
  30. <tr>
  31. <td align="right">参数:</td>
  32. <td><input name="data" type="text" id="data" value="<?php echo $post["data"]; ?>" style="width:30%"></td>
  33. </tr>
  34. <tr>
  35. <td align="right">图标:</td>
  36. <td><input name="icon" type="text" id="icon" value="<?php echo $post["icon"]; ?>" style="width:30%"> <small style="color:#999">(Glyphicons字体图标,如glyphicon glyphicon-home)</small></td>
  37. </tr>
  38. <tr>
  39. <td align="right">备注:</td>
  40. <td><input name="des" type="text" id="des" value="<?php echo $post["des"]; ?>" style="width:50%"></td>
  41. </tr>
  42. <tr>
  43. <td align="right">状态:</td>
  44. <td>
  45. <input type="radio" value='1' name="status" <?php if($post['status']==1){echo 'checked';} ?> />&nbsp;显示&nbsp;&nbsp;
  46. <input type="radio" value='0' name="status" <?php if($post['status']==0){echo 'checked';} ?> />&nbsp;隐藏
  47. </td>
  48. </tr>
  49. <tr>
  50. <td align="right">状态:</td>
  51. <td>
  52. <input type="radio" value='1' name="type" <?php if($post['type']==1){echo 'checked';} ?> />&nbsp;权限认证+菜单&nbsp;&nbsp;
  53. <input type="radio" value='0' name="type" <?php if($post['type']==0){echo 'checked';} ?> />&nbsp;只作为菜单
  54. <br><small style="color:#999">注意:“权限认证+菜单”表示加入后台权限管理,纯碎是菜单项请不要选择此项。</small>
  55. </td>
  56. </tr>
  57. <tr>
  58. <td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td>
  59. </tr>
  60. </tbody></table></form><!-- 表单结束 -->
  61. <script>
  62. $(function(){
  63. $(".required").blur(function(){
  64. var $parent = $(this).parent();
  65. $parent.find(".formtips").remove();
  66. if(this.value=="")
  67. {
  68. $parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>');
  69. }
  70. else
  71. {
  72. $parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
  73. }
  74. });
  75. //重置
  76. $('#addarc input[type="reset"]').click(function(){
  77. $(".formtips").remove();
  78. });
  79. $("#addarc").submit(function(){
  80. $(".required").trigger('blur');
  81. var numError = $('#addarc .onError').length;
  82. if(numError){return false;}
  83. });
  84. });
  85. </script>
  86. @endsection