unit.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <?php
  2. $type = function()
  3. {
  4. $array = array();
  5. $data = Dever::load('scm/unit_type-state');
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'unit',
  16. # 显示给用户看的名称
  17. 'lang' => '单位设置',
  18. # 是否显示在后台菜单
  19. 'order' => 10,
  20. 'config_type' => $type,
  21. # 数据结构
  22. 'struct' => array
  23. (
  24. 'id' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => 'ID',
  28. 'default' => '',
  29. 'desc' => '',
  30. 'match' => 'is_numeric',
  31. 'list' => true,
  32. 'order' => 'asc',
  33. ),
  34. 'name' => array
  35. (
  36. 'type' => 'varchar-150',
  37. 'name' => '单位名称',
  38. 'default' => '',
  39. 'desc' => '单位名称',
  40. 'match' => 'is_string',
  41. 'update' => 'text',
  42. 'search' => 'fulltext',
  43. 'list' => true,
  44. 'edit' => true,
  45. ),
  46. 'en_name' => array
  47. (
  48. 'type' => 'varchar-150',
  49. 'name' => '单位英文名称',
  50. 'default' => '',
  51. 'desc' => '单位英文名称',
  52. 'match' => 'is_string',
  53. 'update' => 'text',
  54. 'search' => 'fulltext',
  55. 'list' => true,
  56. 'edit' => true,
  57. ),
  58. 'type_id' => array
  59. (
  60. 'type' => 'int-11',
  61. 'name' => '单位分类',
  62. 'default' => '1',
  63. 'desc' => '单位分类',
  64. 'match' => 'is_numeric',
  65. 'update' => 'radio',
  66. 'option' => $type,
  67. 'search' => 'select',
  68. 'list' => true,
  69. ),
  70. 'reorder' => array
  71. (
  72. 'type' => 'int-11',
  73. 'name' => '排序(数值越大越靠前)',
  74. 'default' => '1',
  75. 'desc' => '请输入排序',
  76. 'match' => 'option',
  77. //'update' => 'text',
  78. 'search' => 'order',
  79. 'list_name' => '排序',
  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. //'search' => 'date',
  101. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  102. ),
  103. ),
  104. 'manage' => array
  105. (
  106. 'insert' => false,
  107. 'edit' => false,
  108. 'button' => array
  109. (
  110. '新增' => array('fast'),
  111. '分类设置' => array('list', 'unit_type&oper_parent=unit'),
  112. ),
  113. 'list_button' => array
  114. (
  115. 'edit' => array('编辑'),
  116. )
  117. ),
  118. 'default' => array
  119. (
  120. 'col' => 'name,en_name,type_id,reorder,state,cdate',
  121. 'value' => array
  122. (
  123. # 重量单位Weight
  124. '"千克","kilogram",1,2199,1,' . DEVER_TIME,
  125. '"克","gram",1,2198,1,' . DEVER_TIME,
  126. '"吨","ton",1,197,1,' . DEVER_TIME,
  127. '"公吨","metricton",1,196,1,' . DEVER_TIME,
  128. '"长吨","longton",1,195,1,' . DEVER_TIME,
  129. '"短吨","shortton",1,194,1,' . DEVER_TIME,
  130. '"盎司","ounce",1,193,1,' . DEVER_TIME,
  131. # 数量单位Number
  132. '"个","pcs",2,2399,1,' . DEVER_TIME,
  133. '"袋","bag",2,2299,1,' . DEVER_TIME,
  134. '"件","piece",2,2298,1,' . DEVER_TIME,
  135. '"箱","box",2,2297,1,' . DEVER_TIME,
  136. '"双","pair",2,296,1,' . DEVER_TIME,
  137. '"套","set",2,295,1,' . DEVER_TIME,
  138. '"打","dozen",2,294,1,' . DEVER_TIME,
  139. '"罗","gross",2,293,1,' . DEVER_TIME,
  140. '"桶","drum",2,292,1,' . DEVER_TIME,
  141. '"包","bale",2,291,1,' . DEVER_TIME,
  142. '"卷","roll",2,290,1,' . DEVER_TIME,
  143. # 长度单位Length
  144. '"米","meter",3,1399,1,' . DEVER_TIME,
  145. '"英尺","foot",3,398,1,' . DEVER_TIME,
  146. '"码","yard",3,399,1,' . DEVER_TIME,
  147. # 面积单位Area
  148. '"平方米","squaremeter",4,499,1,' . DEVER_TIME,
  149. '"平方英尺","squarefeet",4,498,1,' . DEVER_TIME,
  150. '"平方码","squareyard",4,497,1,' . DEVER_TIME,
  151. # 体积单位Voiume
  152. '"立方米","cubicmeter",5,599,1,' . DEVER_TIME,
  153. '"立方英尺","cubicfoot",5,598,1,' . DEVER_TIME,
  154. '"立方码","cubicyard",5,597,1,' . DEVER_TIME,
  155. # 容积单位Capality
  156. '"公升","litre",6,699,1,' . DEVER_TIME,
  157. '"加仑","gallon",6,698,1,' . DEVER_TIME,
  158. '"蒲式耳","bushel",6,697,1,' . DEVER_TIME,
  159. ),
  160. ),
  161. 'request' => array
  162. (
  163. 'getAll' => array
  164. (
  165. # 匹配的正则或函数 选填项
  166. 'option' => array
  167. (
  168. 'type_id' => 'yes',
  169. 'state' => 1,
  170. ),
  171. 'type' => 'all',
  172. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  173. 'col' => 'id,id as value, name',
  174. ),
  175. )
  176. );