product_control.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <?php
  2. # 定义几个常用的选项
  3. $option = array
  4. (
  5. 1 => '显示',
  6. 2 => '不显示',
  7. );
  8. $status = array
  9. (
  10. 1 => '未执行',
  11. 2 => '已执行-已发送给客户端',
  12. 3 => '完成执行-客户端发出响应',
  13. );
  14. return array
  15. (
  16. # 表名
  17. 'name' => 'product_control',
  18. # 显示给用户看的名称
  19. 'lang' => '设备状态',
  20. 'menu' => false,
  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. 'search' => 'order',
  32. 'order' => 'desc',
  33. //'list' => true,
  34. ),
  35. 'product_id' => array
  36. (
  37. 'type' => 'int-11',
  38. 'name' => '成品设备',
  39. 'default' => '',
  40. 'desc' => '请输入设备ID',
  41. 'match' => 'is_numeric',
  42. 'update' => 'text',
  43. ),
  44. 'device_id' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => '基础设备',
  48. 'default' => '',
  49. 'desc' => '请输入基础设备',
  50. 'match' => 'is_numeric',
  51. 'update' => 'text',
  52. ),
  53. 'control_id' => array
  54. (
  55. 'type' => 'int-11',
  56. 'name' => '控制器',
  57. 'default' => '',
  58. 'desc' => '控制器',
  59. 'match' => 'is_numeric',
  60. 'update' => 'text',
  61. //'list' => 'Dever::load("device/sensor-one#name", {sensor_id})',
  62. ),
  63. 'name' => array
  64. (
  65. 'type' => 'varchar-80',
  66. 'name' => '名称',
  67. 'default' => '',
  68. 'desc' => '名称',
  69. 'match' => 'is_string',
  70. 'update' => 'text',
  71. 'list' => true,
  72. ),
  73. 'value' => array
  74. (
  75. 'type' => 'varchar-500',
  76. 'name' => '当前的值',
  77. 'default' => '',
  78. 'desc' => '当前的值',
  79. 'match' => 'is_string',
  80. 'update' => 'text',
  81. 'search' => 'fulltext',
  82. //'list' => '{reorder} == 10000 ? Dever::mdate("{value}") : "{value}{dw}"',
  83. 'list' => true,
  84. ),
  85. 'send' => array
  86. (
  87. 'type' => 'varchar-500',
  88. 'name' => '发送的数据',
  89. 'default' => '',
  90. 'desc' => '发送的数据',
  91. 'match' => 'is_string',
  92. 'update' => 'textarea',
  93. //'list' => true,
  94. ),
  95. 'receive' => array
  96. (
  97. 'type' => 'varchar-500',
  98. 'name' => '接收到的数据',
  99. 'default' => '',
  100. 'desc' => '接收到的数据',
  101. 'match' => 'is_string',
  102. 'update' => 'text',
  103. 'list' => true,
  104. ),
  105. 'status' => array
  106. (
  107. 'type' => 'tinyint-1',
  108. 'name' => '运行状态',
  109. 'default' => '1',
  110. 'desc' => '请选择状态',
  111. 'match' => 'is_numeric',
  112. 'option' => $status,
  113. //'update' => 'radio',
  114. ),
  115. 'state' => array
  116. (
  117. 'type' => 'tinyint-1',
  118. 'name' => '状态',
  119. 'default' => '1',
  120. 'desc' => '请选择状态',
  121. 'match' => 'is_numeric',
  122. 'option' => $option,
  123. 'update' => 'radio',
  124. //'list' => true,
  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. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  135. ),
  136. ),
  137. //'auth' => 'company',
  138. 'manage' => array
  139. (
  140. 'list_button' => array
  141. (
  142. //11 => array('控制设备', '"farm_device_set&option_farm_device_id={id}"'),
  143. //12 => array('数据记录', '"farm_device_data&option_farm_device_id={id}"'),
  144. //6 => '删除'
  145. ),
  146. ),
  147. # request 请求接口定义
  148. 'request' => array
  149. (
  150. ),
  151. );