group.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | role.php 角色表
  5. |--------------------------------------------------------------------------
  6. */
  7. # 定义几个常用的选项
  8. $option = array
  9. (
  10. 1 => '可用',
  11. 2 => '不可用',
  12. );
  13. $area = function()
  14. {
  15. return Dever::load('setting/area-getAll', array('where_area_id_parent' => 0));
  16. };
  17. $config = array
  18. (
  19. # 表名
  20. 'name' => 'group',
  21. # 显示给用户看的名称
  22. 'lang' => '部门设置',
  23. 'order' => 8,
  24. # 表类型 值为\innodb\myisam\,默认为innodb,仅在mysql类型有效
  25. 'type' => 'innodb',
  26. 'menu' => false,
  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. 'search' => 'order',
  38. 'list' => true,
  39. ),
  40. 'company_id' => array
  41. (
  42. 'type' => 'int-11',
  43. 'name' => '公司名称',
  44. 'default' => '',
  45. 'desc' => '公司名称',
  46. 'match' => 'is_numeric',
  47. 'update' => 'hidden',
  48. ),
  49. 'name' => array
  50. (
  51. 'type' => 'varchar-50',
  52. 'name' => '部门名称',
  53. 'default' => '',
  54. 'desc' => '请输入部门名称',
  55. 'match' => 'is_string',
  56. 'update' => 'text',
  57. 'search' => 'fulltext',
  58. //'list_name' => '角色名',//定义列表页的名称
  59. 'list' => true,
  60. 'edit' => true,
  61. ),
  62. 'area' => array
  63. (
  64. 'type' => 'varchar-255',
  65. 'name' => '区域',
  66. 'default' => '',
  67. 'desc' => '请选择区域',
  68. 'match' => 'option',
  69. //'update' => 'checkbox',
  70. //'option' => $area,
  71. ),
  72. 'reorder' => array
  73. (
  74. 'type' => 'int-11',
  75. 'name' => '排序-数字越大越靠前',
  76. 'default' => '1',
  77. 'desc' => '请输入排序',
  78. 'match' => 'option',
  79. 'update' => 'text',
  80. 'search' => 'order',
  81. //'list' => true,
  82. 'order' => 'desc',
  83. //'edit' => true,
  84. ),
  85. 'state' => array
  86. (
  87. 'type' => 'tinyint-1',
  88. 'name' => '状态',
  89. 'default' => '1',
  90. 'desc' => '请选择状态',
  91. 'match' => 'is_numeric',
  92. ),
  93. 'cdate' => array
  94. (
  95. 'type' => 'int-11',
  96. 'name' => '录入时间',
  97. 'match' => array('is_numeric', DEVER_TIME),
  98. 'desc' => '',
  99. # 只有insert时才生效
  100. 'insert' => true,
  101. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  102. ),
  103. ),
  104. # 默认值
  105. 'default' => array
  106. (
  107. 'col' => 'company_id,name,state,cdate',
  108. 'value' => array
  109. (
  110. '1, "默认部门",1,' . DEVER_TIME,
  111. ),
  112. ),
  113. # 后台管理 此处的功能全部开放
  114. 'manage' => array
  115. (
  116. 'insert' => false,
  117. 'edit' => false,
  118. # 自定义快捷新增和编辑
  119. 'button' => array
  120. (
  121. '新增' => array('fast'),
  122. ),
  123. # 快捷更新
  124. 'list_button' => array
  125. (
  126. 'edit' => array('编辑'),
  127. ),
  128. ),
  129. 'request' => array
  130. (
  131. 'getCompanyIds' => array
  132. (
  133. 'type' => 'all',
  134. 'option' => array
  135. (
  136. 'ids' => array('yes-id', 'in'),
  137. 'state' => 1,
  138. ),
  139. 'order' => array('id' => 'desc'),
  140. 'group' => 'company_id',
  141. 'col' => '*|company_id',
  142. ),
  143. 'getData' => array
  144. (
  145. 'type' => 'all',
  146. 'option' => array
  147. (
  148. 'ids' => array('yes-id', 'in'),
  149. 'state' => 1,
  150. ),
  151. 'order' => array('id' => 'desc'),
  152. 'col' => '*',
  153. ),
  154. 'getAll' => array
  155. (
  156. # 匹配的正则或函数 选填项
  157. 'option' => array
  158. (
  159. 'company_id' => 'yes',
  160. 'ids' => array('yes-id', 'in'),
  161. 'noid' => array('yes-id', 'not in'),
  162. 'state' => 1,
  163. ),
  164. 'type' => 'all',
  165. 'order' => array('id' => 'desc'),
  166. 'col' => 'id,id as value, name',
  167. ),
  168. ),
  169. );
  170. return $config;