menu_group.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?php
  2. # 图标
  3. $icon = array
  4. (
  5. 1 => '默认',
  6. );
  7. if (layadmin()) {
  8. $link = 'https://www.layui.com/doc/element/icon.html';
  9. } else {
  10. $link = 'http://dwz.cn/1j8SP0';
  11. }
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'menu_group',
  16. # 显示给用户看的名称
  17. 'lang' => '菜单分组设置',
  18. 'order' => 2,
  19. 'menu' => false,
  20. # 不允许key重复
  21. 'start' => array
  22. (
  23. //'update' => 'manage/menu.checkKey',
  24. //'insert' => 'manage/menu.checkKey',
  25. ),
  26. //'check' => 'key',
  27. # 数据结构
  28. 'struct' => array
  29. (
  30. 'id' => array
  31. (
  32. 'type' => 'int-11',
  33. 'name' => '分组ID',
  34. 'default' => '',
  35. 'desc' => '',
  36. 'match' => 'is_numeric',
  37. 'order' => 'desc',
  38. ),
  39. 'name' => array
  40. (
  41. 'type' => 'varchar-50',
  42. 'name' => '分组名称',
  43. 'default' => '',
  44. 'desc' => '请输入分组名称',
  45. 'match' => 'is_string',
  46. 'update' => 'text',
  47. 'search' => 'order,fulltext',
  48. 'list' => true,
  49. ),
  50. 'icon' => array
  51. (
  52. 'type' => 'varchar-100',
  53. 'name' => '图标代码-请<a href="'.$link.'" target="_blank">点此</a>查看图标代码',
  54. 'default' => 'glyphicon glyphicon-folder-close',
  55. 'desc' => '请输入图标代码',
  56. 'match' => 'is_string',
  57. //'option' => $icon,
  58. 'update' => 'text',
  59. ),
  60. 'reorder' => array
  61. (
  62. 'type' => 'int-11',
  63. 'name' => '排序',
  64. 'default' => '1',
  65. 'desc' => '请输入排序',
  66. 'match' => 'option',
  67. 'update' => 'text',
  68. 'search' => 'order',
  69. 'list' => true,
  70. 'order' => 'desc',
  71. 'edit' => true,
  72. ),
  73. 'state' => array
  74. (
  75. 'type' => 'tinyint-1',
  76. 'name' => '状态',
  77. 'default' => '1',
  78. 'desc' => '请选择状态',
  79. 'match' => 'is_numeric',
  80. ),
  81. 'cdate' => array
  82. (
  83. 'type' => 'int-11',
  84. 'name' => '录入时间',
  85. 'match' => array('is_numeric', time()),
  86. 'desc' => '',
  87. # 只有insert时才生效
  88. 'insert' => true,
  89. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  90. ),
  91. ),
  92. 'default' => array
  93. (
  94. 'col' => 'name,reorder,state,cdate',
  95. 'value' => array
  96. (
  97. '"基本功能",1,1,' . DEVER_TIME,
  98. ),
  99. ),
  100. 'manage' => array
  101. (
  102. ),
  103. # request 请求接口定义
  104. 'request' => array
  105. (
  106. 'getAll' => array
  107. (
  108. # 匹配的正则或函数 选填项
  109. 'option' => array
  110. (
  111. 'state' => 1,
  112. ),
  113. 'type' => 'all',
  114. 'order' => array('reorder' => 'desc', 'id' => 'asc'),
  115. 'col' => 'id,id as value, name',
  116. ),
  117. 'getIds' => array
  118. (
  119. # 匹配的正则或函数 选填项
  120. 'option' => array
  121. (
  122. 'ids' => array('yes-id', 'in'),
  123. 'state' => 1,
  124. ),
  125. 'type' => 'all',
  126. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  127. 'col' => '*|id',
  128. ),
  129. ),
  130. );