branch.php 5.8 KB

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