<?php
return array
(
    'list' => array
    (
        'field'      => array
        (
            'id',
            'name',
            'discount',
            'cash' => array
            (
                'name' => '余额 / 授信 / 充值',
                'type' => 'show',
                'show' => '"{cash}/{credit}/{p_cash}"',
            ),
            'status' => array
            (
                'type' => 'switch',
                'show'  => '{status}',
                'active_value' => 1,
                'inactive_value' => 2,
            ),
        ),
        'data_button' => array
        (
            '编辑' => array('fastedit', 'name,credit,discount,notify'),
            '账户设置' => array('fastedit', 'mobile,password', 'Place'),
            '渠道设置' => array('edit', 'seller/channel', 'Operation'),
            '折扣设置' => array('edit', 'seller/goods', 'Odometer'),
            '资金流水' => array('route', array
            (
                'path' => 'dealer/log',
                'param' => array
                (
                    'set' => array('seller_id' => 'id', 'menu' => 'dealer/info', 'parent' => 'dealer/log'),
                ),
            ), 'ChatLineSquare'),
            '查看账户' => array('fastedit', 'doc,host,appkey,appsecret,address,show_mobile,show_password', 'View'),
        ),
        'button' => array
        (
            '新增' => array('fastadd', 'name,credit,discount'),
        ),
        'search' => array
        (
            'name',
        ),
    ),
    'update' => array
    (
        'field'    => array
        (
            'doc' => array
            (
                'name' => '接口文档',
                'type' => 'show',
                'default' => '地址：https://www.showdoc.com.cn/2445802255699675 密码：d04359f11c7d4bc85153cc3e49907e7d',
            ),
            'host' => array
            (
                'name' => '接口域名',
                'type' => 'show',
                'default' => Dever::host(),
            ),
            'appkey' => 'show',
            'appsecret' => 'show',
            'address' => array
            (
                'name' => '后台地址',
                'type' => 'show',
                'default' => Dever::host() . 'package/manage/group.html#/login',
            ),
            'show_mobile' => array
            (
                'name' => '登录账号',
                'type' => 'show',
                'default' => '"{mobile}"',
            ),
            'show_password' => array
            (
                'name' => '登录密码',
                'type' => 'show',
                'default' => '"{password}"',
            ),
            'name',
            'mobile' => array
            (
                'name'      => '手机号',
                'type'      => 'text',
                'disable'   => false,//是否禁用
                'placeholder' => '',//提示语
                # 校验规则，如rules => true，是必填, 无rules或者rules=false，就是选填
                # 参考：https://github.com/yiminghe/async-validator
                'rules'     => array
                (
                    # 规则1
                    array
                    (
                        # 必填
                        'required' => true,
                        # 输入后触发
                        'trigger' => 'blur',
                        # 提示信息
                        'message' => '请输入手机号',
                    ),
                    # 规则2
                    array
                    (
                        # 最小字符
                        //'min' => 3,
                        # 最大字符
                        //'max' => 5,
                        # 长度
                        'len' => 11,
                        # 正则
                        'pattern' => Dever::rule('mobile', ''),
                        'trigger' => 'blur',
                        # 提示信息
                        'message' => '手机号错误',
                        # 验证类型 date,array,number,boolean,integer,float,url,email,enum,string
                        'type' => 'string',
                    ),
                ),
            ),
            'password' => array
            (
                'type' => 'password',
                'rules'     => array
                (
                    array
                    (
                        'required' => true,
                        'trigger' => 'blur',
                        'message' => '请输入密码',
                    ),
                    array
                    (
                        'min' => 6,
                        'max' => 18,
                        'trigger' => 'blur',
                        'message' => '密码长度不能超过18或者少于6个字符',
                    ),
                ),
            ),
            'credit',
            'discount' => array
            (
                'desc' => '直接填写折扣数值，如0.98',
            ),
            'notify',
            'seller/channel' => array
            (
                'name' => '渠道设置',
                'where'  => array('seller_id' => 'id'),
            ),
            'seller/goods' => array
            (
                'name' => '折扣设置',
                'desc' => '设置之后，默认折扣将失效',
                'where'  => array('seller_id' => 'id'),
            ),
        ),
        'start' => 'seller/manage.createUser',
        'end' => 'seller/manage.createAppKey',
    ),
);