product_sensor.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <?php
  2. # 定义几个常用的选项
  3. $option = array
  4. (
  5. 1 => '显示',
  6. 2 => '不显示',
  7. );
  8. $status = array
  9. (
  10. 1 => '未执行',
  11. 2 => '已执行-已发送给客户端',
  12. 3 => '完成执行-客户端发出响应',
  13. );
  14. $type = array
  15. (
  16. 1 => '普通',
  17. 2 => '显示在统计',
  18. );
  19. return array
  20. (
  21. # 表名
  22. 'name' => 'product_sensor',
  23. # 显示给用户看的名称
  24. 'lang' => '设备当前数据',
  25. 'menu' => false,
  26. # 数据结构
  27. 'struct' => array
  28. (
  29. 'id' => array
  30. (
  31. 'type' => 'int-11',
  32. 'name' => 'ID',
  33. 'default' => '',
  34. 'desc' => '',
  35. 'match' => 'is_numeric',
  36. 'search' => 'order',
  37. 'order' => 'desc',
  38. //'list' => true,
  39. ),
  40. 'product_id' => array
  41. (
  42. 'type' => 'int-11',
  43. 'name' => '成品设备',
  44. 'default' => '',
  45. 'desc' => '请输入设备ID',
  46. 'match' => 'is_numeric',
  47. 'update' => 'text',
  48. ),
  49. 'device_id' => array
  50. (
  51. 'type' => 'int-11',
  52. 'name' => '基础设备',
  53. 'default' => '',
  54. 'desc' => '请输入基础设备',
  55. 'match' => 'is_numeric',
  56. 'update' => 'text',
  57. ),
  58. 'sensor_id' => array
  59. (
  60. 'type' => 'int-11',
  61. 'name' => '传感器',
  62. 'default' => '',
  63. 'desc' => '传感器',
  64. 'match' => 'is_numeric',
  65. 'update' => 'text',
  66. //'list' => 'Dever::load("device/sensor-one#name", {sensor_id})',
  67. ),
  68. 'name' => array
  69. (
  70. 'type' => 'varchar-80',
  71. 'name' => '名称',
  72. 'default' => '',
  73. 'desc' => '名称',
  74. 'match' => 'is_string',
  75. 'update' => 'text',
  76. 'list' => true,
  77. ),
  78. 'value' => array
  79. (
  80. 'type' => 'varchar-500',
  81. 'name' => '数据',
  82. 'default' => '',
  83. 'desc' => '数据',
  84. 'match' => 'is_string',
  85. 'update' => 'text',
  86. 'search' => 'fulltext',
  87. //'list' => '{reorder} == 10000 ? Dever::mdate("{value}") : "{value}{dw}"',
  88. 'list' => '"{value}{unit}"',
  89. ),
  90. 'unit' => array
  91. (
  92. 'type' => 'varchar-30',
  93. 'name' => '单位',
  94. 'default' => '',
  95. 'desc' => '单位',
  96. 'match' => 'is_string',
  97. 'update' => 'text',
  98. //'search' => 'fulltext',
  99. //'list' => true,
  100. ),
  101. 'send' => array
  102. (
  103. 'type' => 'varchar-500',
  104. 'name' => '发送的数据',
  105. 'default' => '',
  106. 'desc' => '发送的数据',
  107. 'match' => 'is_string',
  108. 'update' => 'textarea',
  109. //'list' => true,
  110. ),
  111. 'receive' => array
  112. (
  113. 'type' => 'varchar-500',
  114. 'name' => '接收到的数据',
  115. 'default' => '',
  116. 'desc' => '接收到的数据',
  117. 'match' => 'is_string',
  118. //'update' => 'text',
  119. ),
  120. 'reorder' => array
  121. (
  122. 'type' => 'int-11',
  123. 'name' => '排序-数值越大越靠前',
  124. 'default' => '1',
  125. 'desc' => '请输入排序',
  126. 'match' => 'option',
  127. 'update' => 'text',
  128. 'search' => 'order',
  129. //'list' => true,
  130. 'order' => 'desc',
  131. 'edit' => true,
  132. ),
  133. 'status' => array
  134. (
  135. 'type' => 'tinyint-1',
  136. 'name' => '运行状态',
  137. 'default' => '1',
  138. 'desc' => '请选择状态',
  139. 'match' => 'is_numeric',
  140. 'option' => $status,
  141. //'update' => 'radio',
  142. ),
  143. 'state' => array
  144. (
  145. 'type' => 'tinyint-1',
  146. 'name' => '状态',
  147. 'default' => '1',
  148. 'desc' => '请选择状态',
  149. 'match' => 'is_numeric',
  150. 'option' => $option,
  151. 'update' => 'radio',
  152. 'list' => true,
  153. ),
  154. 'cdate' => array
  155. (
  156. 'type' => 'int-11',
  157. 'name' => '时间',
  158. 'match' => array('is_numeric', time()),
  159. 'desc' => '',
  160. # 只有insert时才生效
  161. //'insert' => true,
  162. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  163. ),
  164. ),
  165. //'auth' => 'company',
  166. 'manage' => array
  167. (
  168. 'insert' => false,
  169. //'edit' => false,
  170. 'list_button' => array
  171. (
  172. //11 => array('控制设备', '"farm_device_set&option_farm_device_id={id}"'),
  173. //12 => array('数据记录', '"farm_device_data&option_farm_device_id={id}"'),
  174. 6 => '删除'
  175. ),
  176. ),
  177. # request 请求接口定义
  178. 'request' => array
  179. (
  180. ),
  181. );