function taskTab() {
    return {
        title: `离线检索`,
        icon: 'fa fa-magnifying-glass',
        tab: [
            {
                type: 'form',
                title: '检索文件',
                actions: [
                    {
                        type: 'submit',
                        label: '提交任务',
                        actionType: 'ajax',
                        api: {
                            method: 'get',
                            url: '${base}/task/scan',
                            data: {
                                key: '${key|default:undefined}',
                                hdfs: '${hdfs|default:undefined}',
                                pulsar: '${pulsar|default:undefined}',
                                topic: '${topic|default:undefined}',
                                mode: '${scan_mode|default:undefined}',
                            }
                        }
                    },
                ],
                body: [
                    {
                        name: 'scan_mode',
                        type: 'checkboxes',
                        label: '检索范围',
                        checkAll: true,
                        required: true,
                        value: 'log',
                        options: [
                            {label: '消息队列', value: 'queue'},
                            {label: '日志文件', value: 'log'},
                            {label: '数据文件', value: 'base'},
                        ]
                    },
                    {
                        type: 'input-text',
                        name: 'key',
                        label: '检索字段',
                        required: true,
                        clearable: true,
                        description: '检索带有该字符的记录',
                    },
                    {
                        type: 'input-text',
                        name: 'hdfs',
                        label: 'HDFS路经',
                        requiredOn: '${CONTAINS(scan_mode, \'log\') || CONTAINS(scan_mode, \'base\')}',
                        visibleOn: '${CONTAINS(scan_mode, \'log\') || CONTAINS(scan_mode, \'base\')}',
                        clearable: true,
                        description: '输入表HDFS路径',
                        autoComplete: '${base}/table/all_hdfs?key=$term',
                    },
                    {
                        type: 'group',
                        body: [
                            {
                                type: 'input-text',
                                name: 'topic',
                                label: 'Pulsar主题',
                                requiredOn: '${CONTAINS(scan_mode, \'queue\')}',
                                visibleOn: '${CONTAINS(scan_mode, \'queue\')}',
                                clearable: true,
                                description: '输入Pulsar主题',
                                autoComplete: '${base}/table/all_pulsar_topic?key=$term',
                                columnRatio: 4,
                            },
                            {
                                type: 'input-text',
                                name: 'pulsar',
                                label: 'Pulsar地址',
                                requiredOn: '${CONTAINS(scan_mode, \'queue\')}',
                                visibleOn: '${CONTAINS(scan_mode, \'queue\')}',
                                clearable: true,
                                description: '输入Pulsar地址',
                                autoComplete: '${base}/table/all_pulsar?key=$term',
                            },
                        ]
                    }
                ]
            },
            {
                type: 'form',
                title: '检索最后操作时间',
                actions: [
                    {
                        type: 'submit',
                        label: '提交任务',
                        actionType: 'ajax',
                        api: {
                            method: 'get',
                            url: '${base}/task/latest_op_ts',
                            data: {
                                hdfs: '${hdfs|default:undefined}',
                            }
                        }
                    },
                ],
                body: [
                    {
                        type: 'input-text',
                        name: 'hdfs',
                        label: 'HDFS路经',
                        required: true,
                        clearable: true,
                        description: '输入表HDFS路径',
                        autoComplete: '${base}/table/all_hdfs?key=$term',
                    },
                ]
            },
            {
                type: 'crud',
                api: {
                    method: 'get',
                    url: `\${base}/yarn/job_list`,
                    data: {
                        clusters: commonInfo.clusters.sync_names(),
                        page: '${page|default:undefined}',
                        count: '${perPage|default:undefined}',
                        order: '${orderBy|default:undefined}',
                        direction: '${orderDir|default:undefined}',
                        filter_state: '${state|default:undefined}',
                        filter_final_status: '${finalStatus|default:undefined}',
                        search_id: '${id|default:undefined}',
                        search_name: 'Service_Task',
                        precise: false,
                    }
                },
                affixHeader: false,
                interval: 10000,
                syncLocation: false,
                silentPolling: true,
                resizable: false,
                perPage: 10,
                headerToolbar: [
                    "reload",
                    {
                        label: "任务管理器日志",
                        type: "action",
                        tooltip: '打开Grafana日志',
                        onEvent: {
                            click: {
                                actions: [
                                    {
                                        actionType: 'custom',
                                        script: () => window.open(serviceLogByAppName("service-executor-manager"), '_blank'),
                                    }
                                ]
                            }
                        }
                    },
                    paginationCommonOptions(),
                ],
                footerToolbar: [],
                columns: yarnCrudColumns(),
            }
        ]
    }
}