group.php 3.7 KB

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