123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- <?php
- # 定义几个常用的选项
- $option = array
- (
- 1 => '可用',
- 2 => '不可用',
- );
- $type = function()
- {
- return Dever::load('device/data.type', 2);
- };
- $info = function()
- {
- return Dever::load('device/info-all');
- };
- return array
- (
- # 表名
- 'name' => 'control',
- # 显示给用户看的名称
- 'lang' => '控制器管理',
- # 后台菜单排序
- //'menu' => false,
- 'order' => 14,
- 'check' => 'key',
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- 'order' => 'desc',
- //'list' => true,
- ),
- 'key' => array
- (
- 'type' => 'varchar-52',
- 'name' => '标识-标识必须唯一,之后所有的操作都需要使用这个标识',
- 'default' => '',
- 'desc' => '请输入标识',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- ),
- 'name' => array
- (
- 'type' => 'varchar-80',
- 'name' => '名称',
- 'default' => '',
- 'desc' => '名称',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- ),
- /*
- 'info_id' => array
- (
- 'type' => 'int-11',
- 'name' => '所属设备',
- 'default' => Dever::input('option_info_id', 1),
- 'desc' => '请选择所属设备',
- 'match' => 'is_numeric',
- 'option' => $info,
- 'update' => 'select',
- 'search' => 'select',
- 'list' => true,
- ),
- */
-
- 'type_id' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '类型',
- 'default' => '1',
- 'desc' => '请选择类型',
- 'match' => 'is_numeric',
- 'option' => $type,
- 'update' => 'radio',
- 'search' => 'select',
- 'list' => true,
- 'bind' => array('onchange', 'loading', array('element' => 'unit', 'url' => Dever::url("device/data.typeOne?json=1"))),
- 'show' => 'type_id',
- ),
- 'max' => array
- (
- 'type' => 'int-11',
- 'name' => '最大值',
- 'default' => '1',
- 'desc' => '最大值',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- 'show' => 'type_id',
- ),
- 'min' => array
- (
- 'type' => 'int-11',
- 'name' => '最小值',
- 'default' => '0',
- 'desc' => '最小值',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- ),
- 'reorder' => array
- (
- 'type' => 'int-11',
- 'name' => '排序-数值越大越靠前',
- 'default' => '1',
- 'desc' => '请输入排序',
- 'match' => 'option',
- 'update' => 'text',
- 'search' => 'order',
- 'list' => true,
- 'order' => 'desc',
- 'edit' => 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,
-
- # 列表页的类型
- //'list_type' => 'parent',
-
- # 可以删除
- 'list_button' => array
- (
- //oper_save_jump=system&oper_parent=system 特殊配置 oper_save_jump保存之后跳到那个表的列表页 oper_parent下级列表页中显示返回上一页的链接
- //21 => array('新增命令码', '"code&option_element_id={id}&oper_parent=element"'),
- //11 => array('命令码列表', '"code&option_element_id={id}&oper_save_jump=element&oper_parent=element"'),
- //22 => array('新增设备', '"system&option_element_id={id}&oper_save_jump=system&oper_parent=system"', '{element_id}==-1'),
- //6 => '删除'
- ),
-
- //'desc' => '注意:命令码',
- ),
-
- # request 请求接口定义
- 'request' => array
- (
- # 根据id获取
- 'getByids' => array
- (
- 'where' => array
- (
- 'id' => array('yes', 'in'),
- ),
- 'type' => 'all',
- 'col' => '*',
- ),
- ),
- );
|