123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <?php
- /*
- |--------------------------------------------------------------------------
- | role.php 角色表
- |--------------------------------------------------------------------------
- */
- # 定义几个常用的选项
- $option = array
- (
- 1 => '可用',
- 2 => '不可用',
- );
- $company = function()
- {
- $array = array();
- $data = Dever::db('manage/company')->state();
- if($data)
- {
- $array += $data;
- }
- return $array;
- };
- $area = function()
- {
- return Dever::load('setting/area-getAll', array('where_area_id_parent' => 0));
- };
- $config = array
- (
- # 表名
- 'name' => 'group',
- # 显示给用户看的名称
- 'lang' => '部门设置',
- 'order' => 8,
- # 表类型 值为\innodb\myisam\,默认为innodb,仅在mysql类型有效
- 'type' => 'innodb',
- 'menu' => false,
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => '组ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- 'list' => true,
- ),
- 'company_id' => array
- (
- 'type' => 'int-11',
- 'name' => '选择公司',
- 'default' => '',
- 'desc' => '公司名称',
- 'match' => 'is_numeric',
- 'update' => 'radio',
- 'list_name' => '公司名称',
- 'option' => $company,
- 'list' => true,
- 'search' => 'select',
- ),
-
- 'name' => array
- (
- 'type' => 'varchar-50',
- 'name' => '部门名称',
- 'default' => '',
- 'desc' => '请输入部门名称',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- //'list_name' => '角色名',//定义列表页的名称
- 'list' => true,
- 'edit' => true,
- ),
- 'area' => array
- (
- 'type' => 'varchar-255',
- 'name' => '区域',
- 'default' => '',
- 'desc' => '请选择区域',
- 'match' => 'option',
- //'update' => 'checkbox',
- //'option' => $area,
- ),
- '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',
- ),
- 'cdate' => array
- (
- 'type' => 'int-11',
- 'name' => '录入时间',
- 'match' => array('is_numeric', DEVER_TIME),
- 'desc' => '',
- # 只有insert时才生效
- 'insert' => true,
- 'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
- # 默认值
- 'default' => array
- (
- 'col' => 'company_id,name,state,cdate',
- 'value' => array
- (
- '1, "默认部门",1,' . DEVER_TIME,
- ),
-
- ),
-
- # 后台管理 此处的功能全部开放
- 'manage' => array
- (
- 'insert' => false,
- 'edit' => false,
- # 自定义快捷新增和编辑
- 'button' => array
- (
- '新增' => array('fast'),
- ),
- # 快捷更新
- 'list_button' => array
- (
- 'edit' => array('编辑'),
- ),
- ),
- 'request' => array
- (
- 'getCompanyIds' => array
- (
- 'type' => 'all',
- 'option' => array
- (
- 'ids' => array('yes-id', 'in'),
- 'state' => 1,
- ),
- 'order' => array('id' => 'desc'),
- 'group' => 'company_id',
- 'col' => '*|company_id',
- ),
- 'getData' => array
- (
- 'type' => 'all',
- 'option' => array
- (
- 'ids' => array('yes-id', 'in'),
- 'state' => 1,
- ),
- 'order' => array('id' => 'desc'),
- 'col' => '*',
- ),
- ),
- );
- return $config;
|