edit.blade.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <div style="margin-top: 10px;" id="menuUrls-app">
  2. <div style="text-align: center;margin-top: 5px;margin-bottom: 10px;font-size: 20px;">
  3. 编辑地址信息
  4. </div>
  5. <el-form action="{{route('admin.menuUrl.update',array('id'=>$model->id))}}" method="post" id="form-create">
  6. <ui-input-text label="链接名称" name="url_name" value="{{$model->url_name}}" maxlength="255" autofocus="true"></ui-input-text>
  7. <ui-input-text label="链接地址" disabled="disabled " value="{{$model->url}}" maxlength="255" autofocus="true"></ui-input-text>
  8. <input type="hidden" name="id" value="{{$model->id}}"></input>
  9. <ui-linkage label="关联菜单" :options="menu_list"></ui-linkage>
  10. <ui-submit></ui-submit>
  11. </el-form>
  12. </div>
  13. <script type="application/javascript">
  14. $(function () {
  15. // 注意:Vue组件一定放在jQuery.validator前面验证
  16. new Vue({
  17. el: '#menuUrls-app',
  18. data :function () {
  19. return {
  20. menu_list:{
  21. 'tier':3,
  22. 'one_id':'{{$model->parent_id}}',
  23. 'two_id':'{{$model->menu_id}}',
  24. 'three_id':'{{$model->child_id}}',
  25. 'send_url':'{{route('admin.menu.parentMenu')}}',
  26. 'one_name':'parent_id',
  27. 'two_name':'menu_id',
  28. 'three_name':'child_id',
  29. }
  30. };
  31. }
  32. });
  33. jQuery.validator.setDefaults({
  34. debug: false, // 调试模式true不会提交,false允许提交
  35. success: "success", // 匹配成功的class样式名称
  36. errorElement: 'div' // 兼容el标签时使用(兼容el Vue组件label.error标签问题)
  37. });
  38. // 前台数据验证 验证需要设置window.form全局变量
  39. window.form = $('#form-create').validate({
  40. rules: {
  41. image: {
  42. required: true,
  43. maxlength: 255,
  44. normalizer: function ( value ) {
  45. return $.trim(value);
  46. }
  47. },
  48. // link: {
  49. // required: true,
  50. // maxlength: 255,
  51. // normalizer: function ( value ) {
  52. // return $.trim(value);
  53. // }
  54. // },
  55. show: {
  56. required: true
  57. },
  58. sort: {
  59. required: true,
  60. normalizer: function ( value ) {
  61. return $.trim(value);
  62. }
  63. }
  64. }
  65. });
  66. // 编辑保存变量
  67. window.formDatum = $('form').serialize();
  68. });
  69. </script>
  70. @include('layouts.admin.form_script')