park.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <?php
  2. # 定义几个常用的选项
  3. $option = array
  4. (
  5. 1 => '可用',
  6. 2 => '不可用',
  7. );
  8. $kj = array
  9. (
  10. 1 => '否',
  11. 2 => '是',
  12. );
  13. $yt = array
  14. (
  15. 1 => '播放',
  16. 2 => '全云台',
  17. 3 => '焦距',
  18. );
  19. # 当为本地的时候,所有按钮不可用
  20. $status = array
  21. (
  22. 1 => '远程',
  23. 2 => '本地',
  24. 3 => '混合',
  25. );
  26. $type = array
  27. (
  28. 1 => '大田',
  29. 2 => '喷灌机',
  30. 3 => '温室',
  31. 4 => '气象站',
  32. 5 => '远程阀门',
  33. );
  34. $url = '&option_park_id={id}&search_option_park_id={id}&oper_parent=park&oper_key=project_box_company';
  35. return array
  36. (
  37. # 表名
  38. 'name' => 'park',
  39. # 显示给用户看的名称
  40. 'lang' => '园区管理',
  41. # 后台菜单排序
  42. 'order' => 9,
  43. //'menu' => false,
  44. 'end' => array
  45. (
  46. //'insert' => 'company/device.upList',
  47. //'update' => 'company/device.upList',
  48. ),
  49. # 数据结构
  50. 'struct' => array
  51. (
  52. 'id' => array
  53. (
  54. 'type' => 'int-11',
  55. 'name' => '园区ID',
  56. 'default' => '',
  57. 'desc' => '',
  58. 'match' => 'is_numeric',
  59. 'search' => 'order',
  60. 'order' => 'desc',
  61. //'list' => true,
  62. ),
  63. 'reorder' => array
  64. (
  65. 'type' => 'int-11',
  66. 'name' => '排序-数值越大越靠前',
  67. 'default' => '1',
  68. 'desc' => '请输入排序',
  69. 'match' => 'option',
  70. 'update' => 'text',
  71. 'search' => 'order',
  72. 'list' => true,
  73. 'order' => 'desc',
  74. 'edit' => true,
  75. ),
  76. 'name' => array
  77. (
  78. 'type' => 'varchar-80',
  79. 'name' => '园区名称',
  80. 'default' => '',
  81. 'desc' => '请输入园区名称',
  82. 'match' => 'is_string',
  83. 'update' => 'text',
  84. 'search' => 'fulltext',
  85. 'list' => true,
  86. ),
  87. 'type' => array
  88. (
  89. 'type' => 'tinyint-1',
  90. 'name' => '园区类型',
  91. 'default' => '1',
  92. 'desc' => '园区类型',
  93. 'match' => 'is_numeric',
  94. 'option' => $type,
  95. 'update' => 'radio',
  96. //'list' => true,
  97. ),
  98. 'baidu' => array
  99. (
  100. 'type' => 'varchar-300',
  101. 'name' => '百度地图配置-请以逗号隔开,分别为:中心点x坐标,中心点y坐标,中心点地图大小级别[默认为15],横向经度,纵向纬度',
  102. 'default' => '116.4114029862,40.165531944737,15,0.3,0.3',
  103. 'desc' => '当前园区中心坐标',
  104. 'match' => 'option',
  105. 'update' => 'text',
  106. ),
  107. 'baidu_key' => array
  108. (
  109. 'type' => 'varchar-300',
  110. 'name' => '百度地图的key-可以到<a href="http://lbsyun.baidu.com/apiconsole/key" target="_blank">百度地图api</a>申请,因为每个key有限制显示次数,所以这里可以根据园区填写不同的key,默认请填写:bVe3y15p9lPq9lGbrPP71lUL',
  111. 'default' => '',
  112. 'desc' => '百度地图的key',
  113. 'match' => 'option',
  114. 'update' => 'text',
  115. ),
  116. 'video' => array
  117. (
  118. 'type' => 'varchar-500',
  119. 'name' => '直播地址-请输入摄像头直播地址,多个用换行隔开',
  120. 'default' => '',
  121. 'desc' => '直播地址',
  122. 'match' => 'option',
  123. 'update' => 'textarea',
  124. ),
  125. 'video_kj' => array
  126. (
  127. 'type' => 'tinyint-1',
  128. 'name' => '摄像头是否通过控件播放-选择是,则通过web控件来播放视频',
  129. 'default' => '1',
  130. 'desc' => '摄像头是否通过控件播放',
  131. 'match' => 'is_numeric',
  132. 'option' => $kj,
  133. 'update' => 'radio',
  134. //'list' => true,
  135. ),
  136. 'video_yt' => array
  137. (
  138. 'type' => 'tinyint-1',
  139. 'name' => '摄像头是否通过控件的云台控制',
  140. 'default' => '1',
  141. 'desc' => '摄像头是否通过控件的云台控制',
  142. 'match' => 'is_numeric',
  143. 'option' => $yt,
  144. 'update' => 'radio',
  145. //'list' => true,
  146. ),
  147. 'gps' => array
  148. (
  149. 'type' => 'text-255',
  150. 'name' => '当前gps信息',
  151. 'default' => '',
  152. 'desc' => 'gps信息',
  153. 'match' => 'option',
  154. 'list_name' => '挂载设备及操作',
  155. 'list' => 'Dever::load("company/device.manage", {id})',
  156. 'update' => 'textarea',
  157. //'search' => 'fulltext',
  158. //'list' => true,
  159. ),
  160. 'quan' => array
  161. (
  162. 'type' => 'int-11',
  163. 'name' => '当前设备圈数',
  164. 'default' => '',
  165. 'desc' => '当前设备圈数',
  166. 'match' => 'option',
  167. //'search' => 'fulltext',
  168. //'list' => true,
  169. ),
  170. 'pic' => array
  171. (
  172. 'type' => 'varchar-150',
  173. 'name' => '园区平面图',
  174. 'default' => '',
  175. 'desc' => '请选择园区平面图',
  176. 'match' => 'option',
  177. 'update' => 'image',
  178. 'key' => '1',
  179. 'place' => '120',
  180. ),
  181. 'status' => array
  182. (
  183. 'type' => 'tinyint-1',
  184. 'name' => '按钮状态',
  185. 'default' => '1',
  186. 'desc' => '请选择状态',
  187. 'match' => 'is_numeric',
  188. 'option' => $status,
  189. 'update' => 'radio',
  190. //'list' => true,
  191. ),
  192. 'state' => array
  193. (
  194. 'type' => 'tinyint-1',
  195. 'name' => '状态',
  196. 'default' => '1',
  197. 'desc' => '请选择状态',
  198. 'match' => 'is_numeric',
  199. 'option' => $option,
  200. //'update' => 'radio',
  201. //'list' => true,
  202. ),
  203. 'cdate' => array
  204. (
  205. 'type' => 'int-11',
  206. 'name' => '录入时间',
  207. 'match' => array('is_numeric', time()),
  208. 'desc' => '',
  209. # 只有insert时才生效
  210. 'insert' => true,
  211. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  212. ),
  213. ),
  214. //'auth' => 'company',
  215. 'alter' => array
  216. (
  217. 1 => array
  218. (
  219. array('update', 'gps', 'gps', 'text-255 gps'),//更新字段
  220. ),
  221. 'version' => 1,
  222. ),
  223. 'manage' => array
  224. (
  225. 'list_button' => array
  226. (
  227. 11 => array('通讯设置', '"park_server'.$url.'"'),
  228. 12 => array('设备列表', '"device'.$url.'"'),
  229. 13 => array('设备维护记录', '"device_log'.$url.'"'),
  230. 14 => array('设备当前数据', '"device_data'.$url.'"'),
  231. 15 => array('数据统计', '"stat&key=server'.$url.'"'),
  232. 16 => array('数据日志', '"content&key=server'.$url.'"'),
  233. 17 => array('操作日志', '"log&key=server'.$url.'"'),
  234. //6 => '删除'
  235. ),
  236. ),
  237. # request 请求接口定义
  238. 'request' => array
  239. (
  240. 'getByIds' => array
  241. (
  242. # 匹配的正则或函数 选填项
  243. 'where' => array
  244. (
  245. 'id' => array('yes', 'in'),
  246. 'state' => 1,
  247. ),
  248. 'option' => array
  249. (
  250. //'farm_id' => 'yes',
  251. ),
  252. //'order' => 'find_in_set(id, "1")',
  253. 'type' => 'all',
  254. 'col' => '*|id',
  255. ),
  256. ),
  257. );