device_control.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. # 定义几个常用的选项
  3. $option = array
  4. (
  5. 1 => '显示',
  6. 2 => '不显示',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'device_control',
  12. # 显示给用户看的名称
  13. 'lang' => '设备状态',
  14. 'menu' => false,
  15. # 数据结构
  16. 'struct' => array
  17. (
  18. 'id' => array
  19. (
  20. 'type' => 'int-11',
  21. 'name' => 'ID',
  22. 'default' => '',
  23. 'desc' => '',
  24. 'match' => 'is_numeric',
  25. 'search' => 'order',
  26. 'order' => 'desc',
  27. //'list' => true,
  28. ),
  29. 'device_id' => array
  30. (
  31. 'type' => 'int-11',
  32. 'name' => '基础设备',
  33. 'default' => '',
  34. 'desc' => '请输入基础设备',
  35. 'match' => 'is_numeric',
  36. 'update' => 'text',
  37. ),
  38. 'control_id' => array
  39. (
  40. 'type' => 'int-11',
  41. 'name' => '控制器',
  42. 'default' => '',
  43. 'desc' => '控制器',
  44. 'match' => 'is_numeric',
  45. 'update' => 'text',
  46. //'list' => 'Dever::load("device/sensor-one#name", {sensor_id})',
  47. ),
  48. 'state' => array
  49. (
  50. 'type' => 'tinyint-1',
  51. 'name' => '状态',
  52. 'default' => '1',
  53. 'desc' => '请选择状态',
  54. 'match' => 'is_numeric',
  55. 'option' => $option,
  56. 'update' => 'radio',
  57. //'list' => true,
  58. ),
  59. 'cdate' => array
  60. (
  61. 'type' => 'int-11',
  62. 'name' => '录入时间',
  63. 'match' => array('is_numeric', time()),
  64. 'desc' => '',
  65. # 只有insert时才生效
  66. 'insert' => true,
  67. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  68. ),
  69. ),
  70. //'auth' => 'company',
  71. 'manage' => array
  72. (
  73. 'list_button' => array
  74. (
  75. //11 => array('控制设备', '"farm_device_set&option_farm_device_id={id}"'),
  76. //12 => array('数据记录', '"farm_device_data&option_farm_device_id={id}"'),
  77. //6 => '删除'
  78. ),
  79. ),
  80. # request 请求接口定义
  81. 'request' => array
  82. (
  83. ),
  84. );