version.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?php
  2. /**
  3. * tester
  4. */
  5. $user = function()
  6. {
  7. $array = array();
  8. $info = Dever::load('component/user-state');
  9. if($info)
  10. {
  11. $array += $info;
  12. }
  13. return $array;
  14. };
  15. $template = function()
  16. {
  17. $array = array();
  18. $info = Dever::load('component/template-state');
  19. if($info)
  20. {
  21. $array += $info;
  22. }
  23. return $array;
  24. };
  25. return array
  26. (
  27. # 表名
  28. 'name' => 'version',
  29. # 显示给用户看的名称
  30. 'lang' => '版本管理',
  31. 'order' => 97,
  32. 'end' => array
  33. (
  34. 'insert' => array
  35. (
  36. 'component/version.update',
  37. ),
  38. 'update' => array
  39. (
  40. 'component/version.update',
  41. ),
  42. ),
  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. 'search' => 'order',
  54. //'list' => true,
  55. ),
  56. 'project_id' => array
  57. (
  58. 'type' => 'int-11',
  59. 'name' => '项目',
  60. 'default' => '',
  61. 'desc' => '请输入项目',
  62. 'match' => 'is_numeric',
  63. 'list' => true,
  64. 'edit' => true,
  65. ),
  66. 'user' => array
  67. (
  68. 'type' => 'varchar-255',
  69. 'name' => '用户-不选择则获取所有用户',
  70. 'default' => '',
  71. 'desc' => '用户',
  72. 'match' => 'is_string',
  73. //'search' => 'order,fulltext',
  74. 'update' => 'checkbox',
  75. 'option' => $user,
  76. 'list' => true,
  77. ),
  78. 'name' => array
  79. (
  80. 'type' => 'varchar-60',
  81. 'name' => '版本号',
  82. 'default' => '',
  83. 'desc' => '版本号',
  84. 'match' => 'is_string',
  85. 'update' => 'text',
  86. 'list' => true,
  87. ),
  88. 'template_id' => array
  89. (
  90. 'type' => 'int-11',
  91. 'name' => '小程序模板',
  92. 'default' => '1',
  93. 'desc' => '小程序模板',
  94. 'match' => 'is_numeric',
  95. 'update' => 'select',
  96. 'option' => $template,
  97. 'list' => true,
  98. ),
  99. 'desc' => array
  100. (
  101. 'type' => 'varchar-255',
  102. 'name' => '版本描述',
  103. 'default' => '',
  104. 'desc' => '版本描述',
  105. 'match' => 'option',
  106. 'update' => 'textarea',
  107. //'list' => true,
  108. ),
  109. 'state' => array
  110. (
  111. 'type' => 'tinyint-1',
  112. 'name' => '状态',
  113. 'default' => '1',
  114. 'desc' => '请选择状态',
  115. 'match' => 'is_numeric',
  116. ),
  117. 'mdate' => array
  118. (
  119. 'type' => 'int-11',
  120. 'name' => '提交时间',
  121. 'match' => array('is_numeric', time()),
  122. 'desc' => '',
  123. 'default' => '',
  124. 'list' => 'date("Y-m-d H:i:s", {mdate})',
  125. ),
  126. 'cdate' => array
  127. (
  128. 'type' => 'int-11',
  129. 'name' => '录入时间',
  130. 'match' => array('is_numeric', time()),
  131. 'desc' => '',
  132. # 只有insert时才生效
  133. 'insert' => true,
  134. ),
  135. ),
  136. 'top' => Dever::config('base', 'component')->top,
  137. 'manage' => array
  138. (
  139. 'delete' => false,
  140. 'list_button' => array
  141. (
  142. 'list' => array('日志', '"version_log&search_option_version_id={id}&oper_parent=version"'),
  143. 'oper' => array('提审', '"component/auditing.submit?id={id}"'),
  144. 'oper3' => array('撤回', '"component/unaudit.submit?id={id}"'),
  145. 'oper1' => array('发布', '"component/publish.submit?id={id}"'),
  146. 'oper2' => array('回退', '"component/revert.submit?id={id}"'),
  147. ),
  148. ),
  149. );