<?php
$config = array
(
    'list' => array
    (
        'field'      => array
        (
            'ids' => array
            (
                'name' => '编号',
                'show' => '"G" . Dever\Helper\Str::uid("{id}")'
            ),
            'sort' => array
            (
                'type' => 'input',
                'tips' => '双击修改，正序排序',
            ),
            'name' => array
            (
                //'tip' => false,
            ),
            'cate' => array
            (
                'show' => 'Dever::call("place_source/manage.getCateInfo", array("{cate}"))',
            ),
            'status' => array
            (
                'type' => 'switch',
                'show'  => '{status}',
                'active_value' => 1,
                'inactive_value' => 2,
            ),
            'cdate',
        ),
        'button' => array
        (
            '新增' => array('add'),
        ),
        'data_button' => array
        (
            '编辑' => 'edit',
            '内容' => array('route', array
            (
                'path' => 'source_manage/content',
                'param' => array
                (
                    'set' => array('info_id' => 'id', 'menu' => 'source_manage/info', 'parent' => 'source_manage/info'),
                ),
            )),
        ),
        'search'    => array
        (
            'name' => 'like',
            'cate' => array
            (
                'type' => 'cascader',
                'option'    => 'Dever::call("place_source/manage.getCateList")',
            ),
            /*
            'cdate' => array
            (
                'name' => '创建时间',
                'type' => 'date',
                'date_type' => 'datetimerange',
                'value_format' => 'YYYY-MM-DD HH:mm:ss',
                'start_placeholder' => '开始日期',
                'end_placeholder' => '结束日期',
                'range_separator' => '至',
            ),*/
            'status',
        ),
    ),
    'update' => array
    (
        'end' => 'place_source/manage.updateCate',
        'control' => array
        (
            'place_source/sku' => array
            (
                'spec_type' => 2,
            ),

            'place_source/sku#' => array
            (
                'spec_type' => 3,
            ),
        ),
        'tab' => array
        (
            '基本信息' => 'name,cate,type,pic,info,content',
            '规格设置' => 'spec_type,place_source/sku,place_source/sku#',
            '角色权益' => 'place_source/role_price',
        ),
        'field'    => array
        (
            'name' => array
            (
                'rules' => true,
            ),

            'type' => array
            (
                'type' => 'radio',
            ),

            'cate' => array
            (
                'type' => 'cascader',
                'option'    => 'Dever::call("place_source/manage.getCateList")',
            ),
           
            'pic' => array
            (
                'type' => 'upload',
                'upload' => '1',
                'multiple' => true,
                'style' => 'pic',
            ),
            'info' => array
            (
                'type' => 'textarea',
                //'rows' => 4,
                'autosize' => array('minRows' => 4),
            ),
            'content' => array
            (
                'type' => 'editor',
                'editorMenu' => array
                (
                    'uploadImage' => 1,
                    'uploadVideo' => 3,
                ),
            ),

            'spec_type' => array
            (
                'type' => 'radio',
                'control' => true,
            ),
            'place_source/sku' => array
            (
                'name' => '单规格设置',
                'where'  => array('info_id' => 'id', 'key' => '-1'),
                # 默认值，如果有默认值则无法添加和删除
                'default' => array
                (
                    # 默认值
                    array
                    (
                        'key' => '-1',
                        'code' => '',
                        'm_price' => '',
                        'price' => '',
                        'num' => '1',
                    ),
                ),
                'desc' => '如需设置库存，请到“资源库存”中设置，不设置库存则无库存',
            ),

            'place_source/sku#' => array
            (
                'name' => '多规格设置',
                'where' => array('info_id' => 'id', 'key' => array('!=', '-1')),
                'type' => 'sku',
                # 设置规格表名
                'spec' => 'place_source/spec',
                # 设置规格表关联字段
                'spec_field' => 'info_id',
                # 获取规格数据的接口
                'spec_data' => 'api/spec.manage',
                'desc' => '如需设置库存，请到“资源库存”中设置，不设置库存则无库存',
                'disable' => false,
            ),

            
            'place_source/role_price' => array
            (
                'name' => '角色设置',
                'where'  => array('info_id' => 'id'),
                'desc' => '可以按照角色等级设置不同的价格，设置之后，将覆盖角色等级里的权益设置',
            ),
            /*
            'place_source/client_price' => array
            (
                'name' => '源主销量折扣',
                'where'  => array('info_id' => 'id'),
            ),
            */
        ),
    ),
);

return $config;