signal_log.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'signal_log',
  6. # 显示给用户看的名称
  7. 'lang' => '信号器日志',
  8. 'menu' => false,
  9. 'order' => 20,
  10. # 数据结构
  11. 'struct' => array
  12. (
  13. 'id' => array
  14. (
  15. 'type' => 'int-11',
  16. 'name' => 'ID',
  17. 'default' => '',
  18. 'desc' => '',
  19. 'match' => 'is_numeric',
  20. //'search' => 'order',
  21. //'list' => true,
  22. ),
  23. /*
  24. 'id' => array
  25. (
  26. 'type' => 'varchar-50',
  27. 'name' => 'ID',
  28. 'default' => '',
  29. 'desc' => '',
  30. 'match' => 'is_string',
  31. 'search' => 'order',
  32. 'list' => true,
  33. ),
  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. 'signal_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. 'product_signal_id' => array
  64. (
  65. 'type' => 'int-11',
  66. 'name' => '信号器名称',
  67. 'default' => '',
  68. 'desc' => '信号器名称',
  69. 'match' => 'is_numeric',
  70. 'update' => 'text',
  71. 'list' => 'Dever::load("device/product_signal-one#name", {product_signal_id})',
  72. ),
  73. 'value' => array
  74. (
  75. 'type' => 'varchar-500',
  76. 'name' => '数据',
  77. 'default' => '',
  78. 'desc' => '数据',
  79. 'match' => 'is_string',
  80. 'update' => 'textarea',
  81. 'search' => 'fulltext',
  82. 'list' => '"{value}{unit}"',
  83. //'modal' => '查看详情',
  84. ),
  85. 'unit' => array
  86. (
  87. 'type' => 'varchar-30',
  88. 'name' => '单位',
  89. 'default' => '',
  90. 'desc' => '单位',
  91. 'match' => 'is_string',
  92. 'update' => 'text',
  93. 'search' => 'fulltext',
  94. //'list' => true,
  95. ),
  96. 'send' => array
  97. (
  98. 'type' => 'varchar-500',
  99. 'name' => '发送的数据',
  100. 'default' => '',
  101. 'desc' => '发送的数据',
  102. 'match' => 'is_string',
  103. 'update' => 'textarea',
  104. //'list' => true,
  105. ),
  106. 'receive' => array
  107. (
  108. 'type' => 'varchar-500',
  109. 'name' => '接收到的数据',
  110. 'default' => '',
  111. 'desc' => '接收到的数据',
  112. 'match' => 'is_string',
  113. ),
  114. 'exp' => array
  115. (
  116. 'type' => 'varchar-500',
  117. 'name' => '数据计算公式',
  118. 'default' => '',
  119. 'desc' => '数据计算公式',
  120. 'match' => 'is_string',
  121. 'update' => 'textarea',
  122. 'search' => 'fulltext',
  123. 'list' => true,
  124. //'modal' => '查看详情',
  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. 'search' => 'order',
  135. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  136. ),
  137. ),
  138. 'manage' => array
  139. (
  140. 'insert' => false,
  141. 'edit' => false,
  142. ),
  143. # request 请求接口定义
  144. 'request' => array
  145. (
  146. 'getByCdate' => array
  147. (
  148. 'option' => array
  149. (
  150. 'code_id' => 'yes',
  151. 'start' => array('yes-cdate', '>='),
  152. 'end' => array('yes-cdate', '<='),
  153. ),
  154. 'type' => 'all',
  155. 'order' => 'id',
  156. 'col' => '*',
  157. ),
  158. 'getAll' => array
  159. (
  160. # 匹配的正则或函数 选填项
  161. 'option' => array
  162. (
  163. 'product_id' => 'yes',
  164. 'roduct_sensor_id' => 'yes',
  165. 'start' => array('yes-cdate', '>='),
  166. 'end' => array('yes-cdate', '<='),
  167. ),
  168. 'type' => 'all',
  169. 'order' => array('id', 'desc'),
  170. 'limit' => array(100, 0),
  171. 'col' => '*',
  172. ),
  173. ),
  174. );