<?php
$extend = Dever::load('common', 'manage')->extend();
$uid = $extend['data_id'];
$account_id = Dever::input('set')['account_id'] ?? 0;
return array
(
    'source' => 'pan/task',
    'list' => array
    (
        'where' => array('uid' => $uid),
        'field'      => array
        (
            'name',
            'type',
            'status',
            'cdate',
        ),
        'button' => array
        (
            '新增' => array('fastadd', array('uid' => $uid, 'account_id' => $account_id)),
        ),
        'data_button' => array
        (
            '编辑' => 'fastedit',
            '数据' => array('route', array
            (
                'path' => 'user_tool_manage/user_pan_task_data',
                'param' => array
                (
                    'set' => array('account_id' => 'account_id', 'account_task_id' => 'id', 'type' => 'type', 'menu' => 'user_tool_manage/user_tool_list', 'parent' => 'user_tool_manage/user_pan_account.user_tool_manage/user_pan_task', 'parent_param' => array('account_id' => $account_id, 'menu' => 'user_tool_manage/user_tool_list')),
                ),
            ), 'ChatLineSquare'),
            '执行' => array('api', 'pan/task.run', '', 'status=1'),
            '重新执行' => array('api', 'pan/task.run', '', 'status=3'),
        ),
        'search'    => array
        (
            'name',
            'type',
        ),
    ),
    'update' => array
    (
        'control' => array
        (
            'oper_ext' => array
            (
                'type' => 2,
            ),
            'oper_filter' => array
            (
                'type' => 2,
            ),

            'path' => array
            (
                'mul' => 1,
            ),
            'file' => array
            (
                'mul' => 2,
            ),

            'save_path' => array
            (
                'type' => 1,
            ),
        ),
        'field'    => array
        (
            'uid' => array
            (
                'type' => 'hidden',
            ),
            'account_id' => array
            (
                'type' => 'hidden',
            ),
            'name' => array
            (
                'rules' => true,
            ),
            'type' => array
            (
                'type' => 'radio',
                'rules' => true,
                'control' => true,
            ),
            'mul' => array
            (
                'type' => 'radio',
                'rules' => true,
                'control' => true,
            ),
            'path' => array
            (
                'type' => 'textarea',
                //'rules' => true,
                'autosize' => array('minRows' => 4),
                'desc' => '如有提取码，请用换行隔开填写',
            ),
            'file' => array
            (
                'type' => 'upload',
                //'rules' => true,
                'upload' => 4,
                'yun' => true,
                'multiple' => false,
                'tip' => '',
                'style' => 'list',
                'desc' => '请上传excel文件，A列为链接，B列为提取码(可为空)',
            ),
            'save_path' => array
            (
                'type' => 'textarea',
                'autosize' => array('minRows' => 4),
                'desc' => '如果为空，就是保存到根目录',
            ),
            /*
            'oper' => array
            (
                'rules' => true,
            ),*/
            'oper_ext' => array
            (
                'type' => 'textarea',
                'autosize' => array('minRows' => 4),
                'desc' => '输入要保留的资源后缀，如mp4，多个用换行隔开，目录请输入dir，文件请输入file，不输入则不限制后缀',
            ),
            'oper_filter' => array
            (
                'type' => 'textarea',
                'autosize' => array('minRows' => 4),
                'desc' => '输入后将过滤掉包括该名称的资源，多个用换行隔开',
            ),
        ),
    ),
);