log.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | log.php 日志表
  5. |--------------------------------------------------------------------------
  6. */
  7. $admin = function()
  8. {
  9. $array = array();
  10. $info = Dever::load('manage/admin-state');
  11. if($info)
  12. {
  13. $array += $info;
  14. }
  15. return $array;
  16. };
  17. $type = array
  18. (
  19. 1 => '新增',
  20. 2 => '更新',
  21. 3 => '删除',
  22. 4 => '恢复',
  23. );
  24. return array
  25. (
  26. # 表名
  27. 'name' => 'log',
  28. # 显示给用户看的名称
  29. 'lang' => '管理操作日志',
  30. # 关闭验证重复提交功能
  31. 'submit' => false,
  32. 'config_type' => $type,
  33. # 建表时进行分区,一般按照时间分区,仅在mysql类型有效
  34. 'partition' => array
  35. (
  36. 'type' => 'range',//range分区,具体的值请查看mysql分区类型
  37. 'col' => 'YEAR(cdate)',//分区的字段值
  38. 'value' => array(2000,2010),//分区的值
  39. 'exp' => 'LESS THEN',//LESS THEN还是in等表达式
  40. ),
  41. # 表类型 值为\innodb\myisam\,默认为innodb,仅在mysql类型有效
  42. //'type' => 'innodb',
  43. # 数据结构
  44. 'struct' => array
  45. (
  46. 'id' => array
  47. (
  48. 'type' => 'int-11',
  49. 'name' => 'ID',
  50. 'default' => '',
  51. 'desc' => '',
  52. 'match' => 'is_numeric',
  53. 'list' => true,
  54. ),
  55. 'project' => array
  56. (
  57. 'type' => 'varchar-80',
  58. 'name' => '项目名',
  59. 'default' => '',
  60. 'desc' => '请输入项目名',
  61. 'match' => 'is_string',
  62. //'list' => 'Dever::load("manage/project.name", "{project}")',
  63. ),
  64. 'table' => array
  65. (
  66. 'type' => 'varchar-80',
  67. 'name' => '项目下的表名',
  68. 'default' => '',
  69. 'desc' => '项目下的表名',
  70. 'match' => 'is_string',
  71. //'list' => 'Dever::load("manage/database.getTableName", "{project}", "{table}")',
  72. ),
  73. 'menu_id' => array
  74. (
  75. 'type' => 'varchar-80',
  76. 'name' => '菜单',
  77. 'default' => '',
  78. 'desc' => '菜单',
  79. 'match' => 'is_string',
  80. 'search' => 'linkage',
  81. 'update' => 'linkage',
  82. 'option' => Dever::url('menu.getManageMenu', 'manage'),
  83. //'list' => 'Dever::load("manage/menu-one#name", "{menu_id}")',
  84. 'list' => 'Dever::load("manage/src/lib/log.getMenuInfo", "{menu_id}")',
  85. ),
  86. 'name' => array
  87. (
  88. 'type' => 'varchar-80',
  89. 'name' => '操作名',
  90. 'default' => '',
  91. 'desc' => '操作名',
  92. 'match' => 'is_string',
  93. 'search' => 'fulltext',
  94. 'list' => true,
  95. ),
  96. 'type' => array
  97. (
  98. 'type' => 'tinyint-1',
  99. 'name' => '操作类型',
  100. 'default' => '1',
  101. 'desc' => '操作类型',
  102. 'match' => 'is_numeric',
  103. 'option' => $type,
  104. 'search' => 'select',
  105. 'update' => 'radio',
  106. 'list' => true,
  107. ),
  108. 'admin' => array
  109. (
  110. 'type' => 'int-11',
  111. 'name' => '操作人',
  112. 'default' => '',
  113. 'desc' => '操作人',
  114. 'match' => 'is_string',
  115. 'search' => array
  116. (
  117. 'api' => 'manage/admin-getSearch',
  118. 'col' => 'col',
  119. 'result' => 'id',
  120. 'search' => 'admin',
  121. ),
  122. 'list' => 'Dever::load("manage/admin-one#username", {admin})',
  123. //'option' => $admin,
  124. ),
  125. 'info' => array
  126. (
  127. 'type' => 'longtext',
  128. 'name' => '操作记录',
  129. 'default' => '',
  130. 'desc' => '操作记录',
  131. 'match' => 'is_string',
  132. 'search' => 'fulltext',
  133. 'list' => 'Dever::load("manage/src/lib/log.getInfo", "{id}")',
  134. //'modal' => '查看详情',
  135. ),
  136. 'tid' => array
  137. (
  138. 'type' => 'int-11',
  139. 'name' => '来源表id',
  140. 'default' => '',
  141. 'desc' => '来源表id',
  142. 'match' => 'is_string',
  143. //'list' => true,
  144. ),
  145. 'state' => array
  146. (
  147. 'type' => 'tinyint-1',
  148. 'name' => '状态',
  149. 'default' => '1',
  150. 'desc' => '请选择状态',
  151. 'match' => 'option',
  152. ),
  153. 'cdate' => array
  154. (
  155. 'type' => 'int-11',
  156. 'name' => '操作时间',
  157. 'match' => array('is_numeric', time()),
  158. 'desc' => '',
  159. # 只有insert时才生效
  160. 'insert' => true,
  161. 'search' => 'time',
  162. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  163. ),
  164. ),
  165. 'manage' => array
  166. (
  167. 'list_table' => 'html',
  168. 'delete' => false,
  169. 'edit' => false,
  170. 'insert' => false,
  171. ),
  172. # 索引
  173. 'index' => array
  174. (
  175. # 索引名 => 索引id
  176. //'id' => 'id,state',
  177. ),
  178. # request 请求接口定义
  179. 'request' => array
  180. (
  181. # onload 增加hack功能 使用该请求接口必须首先载入的类 如果需要子项也添加类似功能,可以使用start、end
  182. 'onload' => 'manage/auth.init',//这个是权限验证,必须后台登录
  183. ),
  184. );