123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- <?php
- # 定义几个常用的选项
- $option = array
- (
- 1 => '可用',
- 2 => '删除',
- );
- $type = array
- (
- 1 => '未激活',
- 2 => '已激活',
- 3 => '不可用',
- );
- $info = function()
- {
- return Dever::load('device/info-all');
- };
- $url = '&option_product_id={id}&search_option_product_id={id}&oper_parent=product&oper_key=device';
- return array
- (
- # 表名
- 'name' => 'product',
- # 显示给用户看的名称
- 'lang' => '出厂产品管理',
- # 后台菜单排序
- 'order' => 30,
- //'desc' => '网关地址:http://api.xinnongbaohe.com/?key=设备标识',
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => '设备ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- 'order' => 'desc',
- //'list' => true,
- ),
- 'info_id' => array
- (
- 'type' => 'int-11',
- 'name' => '基础设备',
- 'default' => '1',
- 'desc' => '请选择基础设备',
- 'match' => 'is_numeric',
- 'option' => $info,
- // 'update' => 'select',
- 'search' => 'select',
- 'list_name' => '设备名称',
- # 显示在table里的,与下面的list=table相对应
- 'list_table'=> 'Dever::load("device/data.product_info#dname", {id})',
- ),
- 'name' => array
- (
- 'type' => 'varchar-40',
- 'name' => '产品名称',
- 'default' => '',
- 'desc' => '产品名称',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- // 'list' => true,
- ),
- 'key' => array
- (
- 'type' => 'varchar-60',
- 'name' => '设备标识',
- 'default' => '',
- 'desc' => '设备标识',
- 'match' => 'is_string',
- //'update' => 'text',
- 'search' => 'fulltext',
- 'list' => 'table',
- ),
- /*
- 'api' => array
- (
- 'type' => 'varchar-500',
- 'name' => '设备网关',
- 'default' => '',
- 'desc' => '设备网关',
- 'match' => 'is_string',
- //'update' => 'textarea',
- 'search' => 'fulltext',
- 'list' => true,
- ),
- */
- 'tcp' => array
- (
- 'type' => 'varchar-500',
- 'name' => '设备tcp服务器',
- 'default' => '',
- 'desc' => '设备tcp服务器',
- 'match' => 'is_string',
- //'update' => 'textarea',
- //'search' => 'fulltext',
- //'list' => true,
- ),
- 'tcp_id' => array
- (
- 'type' => 'varchar-500',
- 'name' => '客户端id',
- 'default' => '',
- 'desc' => '客户端id',
- 'match' => 'is_string',
- 'update' => 'textarea',
- //'search' => 'fulltext',
- 'list' => true,
- 'list_name' => '客户端',
- 'list_table' => '"{tcp_id}" > 0 ? "已连接" : "未连接"',
- ),
-
- 'live_url' => array
- (
- 'type' => 'varchar-500',
- 'name' => '直播地址',
- 'default' => '',
- 'desc' => '直播地址',
- 'match' => 'is_string',
- 'update' => 'textarea',
- //'list' => true,
- 'list_name' => '直播地址',
-
- ),
- 'code' => array
- (
- 'type' => 'varchar-500',
- 'name' => '二维码链接',
- 'default' => '',
- 'desc' => '二维码链接',
- 'match' => 'is_string',
- //'update' => 'textarea',
- //'search' => 'fulltext',
- //'list' => true,
- 'list_table'=> false,
- ),
- 'uid' => array
- (
- 'type' => 'int-11',
- 'name' => '激活人',
- 'default' => '0',
- 'desc' => '激活人',
- 'match' => 'is_numeric',
- 'list_name' => '传感器与控制器',
- 'list' => 'Dever::load("device/element.getAll", {id})',
- ),
- 'type' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '是否激活',
- 'default' => '1',
- 'desc' => '请选择是否激活',
- 'match' => 'is_numeric',
- 'option' => $type,
- //'update' => 'select',
- 'search' => 'select',
- //'list' => true,
- ),
-
- 'state' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '是否删除',
- 'default' => '1',
- 'desc' => '请选择是否删除',
- 'match' => 'is_numeric',
- 'option' => $option,
- 'update' => 'radio',
- 'list' => true,
- ),
-
- 'cdate' => array
- (
- 'type' => 'int-11',
- 'name' => '包装时间',
- 'match' => array('is_numeric', time()),
- 'desc' => '',
- # 只有insert时才生效
- 'insert' => true,
- //'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
- 'manage' => array
- (
- # 不允许编辑
- //'edit' => false,
- 'insert' => false,
-
- # 可以删除
- 'list_button' => array
- (
- 11 => array('<br />'),
- 14 => array('当前数据', '"product_sensor'.$url.'"'),
- //15 => array('数据统计', '"stat&key=server'.$url.'"'),
- 12 => array('<br />'),
- 16 => array('传感器日志', '"sensor_log&key=api'.$url.'"'),
- 13 => array('<br />'),
- 17 => array('控制器日志', '"control_log&key=api'.$url.'"'),
- 15 => array('<br />'),
- 18 => array('信号器日志', '"signal_log&key=api'.$url.'"'),
- 19 => array('<br />'),
- 25 => array('查看二维码', 'modal|showMsg(\'查看二维码\',$(this),\''.Dever::url('data.product_code', 'device').'\',function(){updateMsg(\'sendmsg\')})|"id={id}"'),
- ),
-
- //'desc' => '注意:命令码',
- ),
-
- # request 请求接口定义
- 'request' => array
- (
- ),
- );
|