'显示', 2 => '不显示', ); $parent = function() { $param['option_page_id'] = -1; $info = Dever::db('module/page')->all($param); $array = array(-1 => array('name' => '无')); if ($info) { $array += $info; } return $array; }; $time = time(); return array ( # 表名 'name' => 'page', # 显示给用户看的名称 'lang' => '页面管理', # 后台菜单排序 'order' => 9, 'check' => 'key', # 数据结构 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => '页面ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', 'search' => 'order', 'list' => true, 'order' => 'desc', ), 'name' => array ( 'type' => 'varchar-32', 'name' => '页面名称', 'default' => '', 'desc' => '请输入页面名称', 'match' => 'is_string', 'update' => 'text', 'search' => 'order,fulltext', 'list' => true, //'list' => '"{name}"', ), 'key' => array ( 'type' => 'varchar-60', 'name' => '页面标识', 'default' => '', 'desc' => '页面标识', 'match' => 'is_string', 'update' => 'text', 'search' => 'fulltext', 'list' => true, ), 'page_id' => array ( 'type' => 'int-11', 'name' => '父级页面', 'default' => Dever::input('page_id', '-1'), 'desc' => '请选择父级页面id', 'match' => 'is_numeric', 'option' => $parent, 'update' => 'select', 'search' => 'select', //'list' => true, ), 'reorder' => array ( 'type' => 'int-11', 'name' => '排序(数值越大越靠前)', 'default' => '1', 'desc' => '请输入排序', 'match' => 'option', 'update' => 'text', 'search' => 'order', 'list_name' => '排序', 'list' => true, 'order' => 'desc', 'edit' => true, ), 'state' => array ( 'type' => 'tinyint-1', 'name' => '状态', 'default' => '1', 'desc' => '请选择状态', 'match' => 'is_numeric', ), '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 ( 'list_type' => 'parent', 'list_button' => array ( 'addPage' => array('新增子页面', '"page&page_id={id}"', '{page_id} == -1'), 'add' => array('新增模块', '"info&project=module&search_option_page_id={id}&oper_parent=page&oper_project=module"', '{page_id} > -1'), 'list' => array('模块列表', '"info&project=module&search_option_page_id={id}&oper_parent=page&oper_project=module"', '{page_id} > -1'), ), ), # 默认值 'default' => array ( 'col' => 'id,name,state,cdate', 'value' => array ( '1,"首页",1,' . $time, ), ), # request 请求接口定义 'request' => array ( # 获取列表页 'getParent' => array ( # 匹配的正则或函数 选填项 'where' => array ( 'page_id' => -1, 'state' => 1, ), 'type' => 'all', 'order' => array('reorder' => 'desc'), 'col' => '*', ), 'getChild' => array ( # 匹配的正则或函数 选填项 'where' => array ( 'page_id' => array(-1, '>'), 'state' => 1, ), 'type' => 'all', 'order' => array('reorder' => 'desc'), 'col' => '*|page_id|id|', ), ), );