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.

89 lines
3.6 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 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/doadd" 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($pid<>0 && $row["id"]==$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="" class="required" style="width:30%" placeholder="在此输入菜单名称"></td>
  25. </tr>
  26. <tr>
  27. <td align="right">操作方法:</td>
  28. <td><input name="action" type="text" id="action" value="" 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="" style="width:30%"></td>
  33. </tr>
  34. <tr>
  35. <td align="right">图标:</td>
  36. <td><input name="icon" type="text" id="icon" value="" 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="" style="width:50%"></td>
  41. </tr>
  42. <tr>
  43. <td align="right">状态:</td>
  44. <td>
  45. <input type="radio" value='1' name="status" checked />&nbsp;显示&nbsp;&nbsp;
  46. <input type="radio" value='0' name="status" />&nbsp;隐藏
  47. </td>
  48. </tr>
  49. <tr>
  50. <td align="right">状态:</td>
  51. <td>
  52. <input type="radio" value='1' name="type" checked />&nbsp;权限认证+菜单&nbsp;&nbsp;
  53. <input type="radio" value='0' name="type" />&nbsp;只作为菜单<br><small style="color:#999">注意:“权限认证+菜单”表示加入后台权限管理,纯碎是菜单项请不要选择此项。</small>
  54. </td>
  55. </tr>
  56. <tr>
  57. <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><input type="hidden"></input></td>
  58. </tr>
  59. </tbody></table></form><!-- 表单结束 -->
  60. <script>
  61. $(function(){
  62. $(".required").blur(function(){
  63. var $parent = $(this).parent();
  64. $parent.find(".formtips").remove();
  65. if(this.value=="")
  66. {
  67. $parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>');
  68. }
  69. else
  70. {
  71. $parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
  72. }
  73. });
  74. //重置
  75. $('#addarc input[type="reset"]').click(function(){
  76. $(".formtips").remove();
  77. });
  78. $("#addarc").submit(function(){
  79. $(".required").trigger('blur');
  80. var numError = $('#addarc .onError').length;
  81. if(numError){return false;}
  82. });
  83. });
  84. </script>
  85. @endsection