project.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <?php
  2. $token = array();
  3. if (Dever::project('token')) {
  4. $token = function()
  5. {
  6. $array = array();
  7. $info = Dever::db('token/project')->state();
  8. if ($info) {
  9. $array += $info;
  10. }
  11. return $array;
  12. };
  13. }
  14. return array
  15. (
  16. # 表名
  17. 'name' => 'project',
  18. # 显示给用户看的名称
  19. 'lang' => '项目管理',
  20. # 后台菜单排序
  21. 'order' => 1,
  22. /*
  23. 'end' => array
  24. (
  25. 'insert' => array
  26. (
  27. 'manage/top.sync',
  28. ),
  29. 'update' => array
  30. (
  31. 'manage/top.sync',
  32. ),
  33. ),
  34. */
  35. # 数据结构
  36. 'struct' => array
  37. (
  38. 'id' => array
  39. (
  40. 'type' => 'int-11',
  41. 'name' => 'ID',
  42. 'default' => '',
  43. 'desc' => '',
  44. 'match' => 'is_numeric',
  45. 'search' => 'order',
  46. 'list' => true,
  47. 'order' => 'desc',
  48. ),
  49. 'name' => array
  50. (
  51. 'type' => 'varchar-32',
  52. 'name' => '项目名称',
  53. 'default' => '',
  54. 'desc' => '项目名称',
  55. 'match' => 'is_string',
  56. 'update' => 'text',
  57. 'search' => 'fulltext',
  58. 'list' => true,
  59. ),
  60. 'token_project_id' => array
  61. (
  62. 'type' => 'int-11',
  63. 'name' => '关联token',
  64. 'default' => '-1',
  65. 'desc' => '关联token',
  66. 'match' => 'is_numeric',
  67. 'option' => $token,
  68. 'update' => $token ? 'select' : false,
  69. 'list' => $token ? true : false,
  70. ),
  71. 'reorder' => array
  72. (
  73. 'type' => 'int-11',
  74. 'name' => '排序(数值越大越靠前)',
  75. 'default' => '1',
  76. 'desc' => '请输入排序',
  77. 'match' => 'option',
  78. 'update' => 'text',
  79. 'search' => 'order',
  80. 'list' => true,
  81. 'order' => 'desc',
  82. 'edit' => true,
  83. ),
  84. 'state' => array
  85. (
  86. 'type' => 'tinyint-1',
  87. 'name' => '状态',
  88. 'default' => '1',
  89. 'desc' => '请选择状态',
  90. 'match' => 'is_numeric',
  91. ),
  92. 'cdate' => array
  93. (
  94. 'type' => 'int-11',
  95. 'name' => '录入时间',
  96. 'match' => array('is_numeric', time()),
  97. 'desc' => '',
  98. # 只有insert时才生效
  99. 'insert' => true,
  100. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  101. ),
  102. ),
  103. # 默认值
  104. 'default' => array
  105. (
  106. 'col' => 'name,state,cdate',
  107. 'value' => array
  108. (
  109. '"默认项目",1,' . time(),
  110. ),
  111. ),
  112. 'manage' => array
  113. (
  114. 'insert' => false,
  115. 'edit' => false,
  116. # 自定义快捷新增和编辑
  117. 'button' => array
  118. (
  119. '新增' => array('fast'),
  120. ),
  121. # 快捷更新
  122. 'list_button' => array
  123. (
  124. 'edit' => array('编辑'),
  125. ),
  126. ),
  127. /*
  128. 'top' => array
  129. (
  130. # 数据来源
  131. 'data' => 'state',
  132. # 菜单名
  133. 'name' => '项目选择',
  134. # 默认值
  135. 'value' => 1,
  136. # 对应的字段值,设置这个之后,所有设置等于这个值的字段,都要遵循这个权限的控制
  137. 'key' => 'user/project_id',
  138. # 本表中代表名称的字段
  139. 'col' => 'name',
  140. ),*/
  141. 'request' => array
  142. (
  143. 'getAll' => array
  144. (
  145. # 匹配的正则或函数 选填项
  146. 'option' => array
  147. (
  148. 'state' => 1,
  149. ),
  150. 'type' => 'all',
  151. 'order' => array('reorder' => 'desc','id' => 'desc'),
  152. 'col' => '*',
  153. ),
  154. ),
  155. );