menu.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. * Copyright (c) 2018-2025, lengleng All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright notice,
  8. * this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * Neither the name of the pig4cloud.com developer nor the names of its
  13. * contributors may be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. * Author: lengleng (wangiegie@gmail.com)
  16. */
  17. import iconList from '@/const/iconList'
  18. export const tableOption = {
  19. tip: false,
  20. dialogWidth: "60%",
  21. tree: true,
  22. border: true,
  23. index: true,
  24. viewBtn: true,
  25. align: 'center',
  26. column: [
  27. {
  28. label: "菜单名称",
  29. prop: "name",
  30. width: 180,
  31. rules: [
  32. {
  33. required: true,
  34. message: "请输入菜单名称",
  35. trigger: "blur"
  36. }
  37. ]
  38. },
  39. {
  40. label: "路由路径",
  41. prop: "path",
  42. width: 180,
  43. overHidden: true,
  44. rules: [
  45. {
  46. required: true,
  47. message: "请输入路由地址",
  48. trigger: "blur"
  49. }
  50. ]
  51. },
  52. {
  53. label: "上级菜单",
  54. prop: "parentId",
  55. type: "tree",
  56. dicUrl: "/admin/menu/tree",
  57. hide: true,
  58. props: {
  59. label: "name",
  60. value: "id"
  61. },
  62. rules: [
  63. {
  64. required: false,
  65. message: "请选择上级菜单",
  66. trigger: "click"
  67. }
  68. ]
  69. },
  70. {
  71. label: "图标",
  72. prop: "icon",
  73. type: "icon-select",
  74. slot: true,
  75. iconList: iconList,
  76. rules: [
  77. {
  78. required: true,
  79. message: "请输入图标",
  80. trigger: "click"
  81. }
  82. ]
  83. },
  84. {
  85. label: "类型",
  86. prop: "type",
  87. type: "radio",
  88. slot: true,
  89. valueFormat: "string",
  90. dicData: [
  91. {
  92. label: "菜单",
  93. value: "0"
  94. },
  95. {
  96. label: "按钮",
  97. value: "1"
  98. }
  99. ],
  100. rules: [
  101. {
  102. required: true,
  103. message: "请选择菜单类型",
  104. trigger: "blur"
  105. }
  106. ]
  107. },
  108. {
  109. label: "权限标识",
  110. prop: "code",
  111. rules: [
  112. {
  113. message: "菜单类型可不填",
  114. trigger: "blur"
  115. }
  116. ]
  117. },
  118. {
  119. label: "排序",
  120. prop: "sort",
  121. type: "number",
  122. rules: [
  123. {
  124. required: true,
  125. message: "请输入菜单排序",
  126. trigger: "blur"
  127. }
  128. ]
  129. }
  130. ]
  131. }