branch.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <?php
  2. $group = function()
  3. {
  4. $array = array
  5. (
  6. -1 => array('id' => '-1', 'name' => '请选择'),
  7. );
  8. $data = Dever::load('manage/group-state');
  9. if($data)
  10. {
  11. $array += $data;
  12. }
  13. return $array;
  14. };
  15. $cadre = function()
  16. {
  17. // $array = array();
  18. $array = array
  19. (
  20. -1 => array('id' => '-1', 'name' => '请选择'),
  21. );
  22. $data = Dever::load('manage/admin-state');
  23. if($data)
  24. {
  25. foreach ($data as $k => $v) {
  26. $data[$k]['name'] = $v['username'];
  27. }
  28. $array += $data;
  29. }
  30. return $array;
  31. };
  32. $type = array
  33. (
  34. 1 => '发送',
  35. 2 => '不发送',
  36. );
  37. return array
  38. (
  39. # 表名
  40. 'name' => 'branch',
  41. # 显示给用户看的名称
  42. 'lang' => '相关部门设置',
  43. # 后台菜单排序
  44. 'order' => 94,
  45. // 'menu' => false,
  46. // 'auto' => 100000,
  47. // 'check' => 'group_id',
  48. 'start' => array
  49. (
  50. 'insert' => 'work/lib/appoint.startBranch',
  51. 'update' => 'work/lib/appoint.startBranch',
  52. ),
  53. 'end' => array
  54. (
  55. 'insert' => 'work/lib/appoint.updateBranch',
  56. 'update' => 'work/lib/appoint.updateBranch',
  57. ),
  58. # 数据结构
  59. 'struct' => array
  60. (
  61. 'id' => array
  62. (
  63. 'type' => 'int-11',
  64. 'name' => 'ID',
  65. 'default' => '',
  66. 'desc' => '',
  67. 'match' => 'is_numeric',
  68. 'search' => 'order',
  69. 'list' => true,
  70. 'order' => 'desc',
  71. ),
  72. 'company_id' => array
  73. (
  74. 'type' => 'int-11',
  75. 'name' => '所属公司',
  76. 'default' => '1',
  77. 'desc' => '所属公司',
  78. 'match' => 'is_numeric',
  79. 'update' => 'hidden',
  80. //'search' => $company ? 'select' : false,
  81. //'list' => true,
  82. ),
  83. 'group' => array
  84. (
  85. 'type' => 'varchar-100',
  86. 'name' => '部门和负责人',
  87. 'default' => '-1',
  88. 'desc' => '部门名称',
  89. 'match' => 'is_string',
  90. // 'option' => $group,
  91. 'update' => 'linkage',
  92. 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
  93. 'list' => 'Dever::load("work/lib/manage.xietiao#group",{id})',
  94. ),
  95. 'group_id' => array
  96. (
  97. 'type' => 'int-11',
  98. 'name' => '部门',
  99. 'default' => '-1',
  100. 'desc' => '部门id',
  101. 'match' => 'is_string',
  102. // 'option' => $cadre,
  103. 'update' => 'hidden',
  104. ),
  105. 'coor' => array
  106. (
  107. 'type' => 'int-11',
  108. 'name' => '协调人',
  109. 'default' => '-1',
  110. 'desc' => '协调人',
  111. 'match' => 'is_string',
  112. // 'option' => $coor,
  113. // 'update' => 'select',
  114. // 'search' => array
  115. // (
  116. // 'api' => 'active/info-getSearch',
  117. // 'col' => 'col',
  118. // 'result' => 'id',
  119. // 'search' => 'active_id',
  120. // ),
  121. 'list' => 'Dever::load("work/lib/manage.xietiao#name",{id})',
  122. ),
  123. 'type' => array
  124. (
  125. 'type' => 'tinyint-1',
  126. 'name' => '是否发送每日汇总邮件通知',
  127. 'default' => '2',
  128. 'desc' => '是否发送每日汇总邮件通知',
  129. 'match' => 'is_numeric',
  130. 'update' => 'radio',
  131. 'option' => $type,
  132. // 'search' => 'select',
  133. // 'list' => true,
  134. ),
  135. #弃用,实时查询
  136. 'num' => array
  137. (
  138. 'type' => 'int-11',
  139. 'name' => '关联问题数',
  140. 'default' => '0',
  141. 'desc' => '数量',
  142. 'match' => 'option',
  143. 'update' => 'hidden',
  144. 'list' => 'Dever::load("work/lib/manage.xietiao#num",{id})',
  145. ),
  146. 'reorder' => array
  147. (
  148. 'type' => 'int-11',
  149. 'name' => '排序-数值越大越靠前',
  150. 'default' => '1',
  151. 'desc' => '请输入排序',
  152. 'match' => 'option',
  153. 'update' => 'text',
  154. 'search' => 'order',
  155. 'list' => true,
  156. 'order' => 'desc',
  157. 'edit' => true,
  158. ),
  159. 'state' => array
  160. (
  161. 'type' => 'tinyint-1',
  162. 'name' => '状态',
  163. 'default' => '1',
  164. 'desc' => '请选择状态',
  165. 'match' => 'is_numeric',
  166. ),
  167. 'cdate' => array
  168. (
  169. 'type' => 'int-11',
  170. 'name' => '创建时间',
  171. 'match' => array('is_numeric', time()),
  172. 'desc' => '',
  173. # 只有insert时才生效
  174. 'insert' => true,
  175. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  176. ),
  177. ),
  178. 'manage' => array
  179. (
  180. //'insert' => false,
  181. 'delete' => false,
  182. // 'edit' => false,
  183. 'list_button' => array
  184. (
  185. 'list' => array('关联问题列表', '"question&search_option_branch_id={group_id}&oper_table=branch"')
  186. ),
  187. # 设置公司权限
  188. 'company' => 'company_id',
  189. ),
  190. 'request' => array
  191. (
  192. 'getAll' => array
  193. (
  194. # 匹配的正则或函数 选填项
  195. 'option' => array
  196. (
  197. // 'id' => array('yes','>'),
  198. 'state' => 1,
  199. ),
  200. 'type' => 'all',
  201. 'order' => array('reorder' => 'desc', 'id' => 'asc'),
  202. 'col' => '*',
  203. ),
  204. ),
  205. );