function tableTab() {
    return {
        title: `表任务`,
        tab: [
            {
                id: 'table-service',
                type: 'service',
                data: {},
                body: [
                    {
                        type: 'crud',
                        api: {
                            method: 'get',
                            url: `\${base}/table/list`,
                            data: {
                                page: '${page|default:undefined}',
                                count: '${perPage|default:undefined}',
                                order: '${orderBy|default:undefined}',
                                direction: '${orderDir|default:undefined}',
                                search_flink_job_id: '${flinkJobId|default:undefined}',
                                search_alias: '${alias|default:undefined}',
                                filter_run_mode: '${run_mode|default:undefined}',
                                filter_compaction_status: '${compaction_status|default:undefined}'
                            }
                        },
                        syncLocation: false,
                        // interval: 10000,
                        silentPolling: true,
                        filter: {
                            mode: 'inline',
                            title: '表筛选',
                            body: [
                                {
                                    type: 'group',
                                    body: [
                                        {
                                            type: 'input-text',
                                            name: 'flinkJobId',
                                            label: 'Flink job id',
                                            clearable: true,
                                            placeholder: '通过 ID 搜索',
                                            size: 'md'
                                        },
                                        {
                                            type: 'input-text',
                                            name: 'alias',
                                            label: '名称',
                                            clearable: true,
                                            placeholder: '通过别名搜索',
                                            size: 'md'
                                        },
                                    ]
                                },
                            ],
                            actions: [
                                {
                                    type: "submit",
                                    level: "primary",
                                    label: "查询",
                                },
                                {
                                    type: "reset",
                                    label: "重置",
                                },
                            ]
                        },
                        filterTogglable: true,
                        filterDefaultVisible: true,
                        stopAutoRefreshWhenModalIsOpen: true,
                        resizable: false,
                        perPage: 10,
                        headerToolbar: [
                            "reload",
                            'filter-toggler',
                            {
                                type: 'pagination',
                                layout: ['pager', 'perPage'],
                                maxButtons: 8,
                                showPageInput: false,
                            },
                        ],
                        footerToolbar: [
                            {
                                type: 'pagination',
                                layout: ['pager', 'perPage'],
                                maxButtons: 8,
                                showPageInput: false,
                            },
                        ],
                        columns: [
                            {
                                label: 'Flink job id',
                                width: 170,
                                fixed: 'left', type: 'wrapper',
                                size: 'none',
                                body: [
                                    {
                                        type: 'action',
                                        level: 'link',
                                        label: '${flinkJobId}',
                                        size: 'xs',
                                        actionType: 'dialog',
                                        tooltip: '查看详情',
                                        dialog: flinkJobDialog(),
                                    },
                                    {
                                        type: 'action',
                                        level: 'link',
                                        label: '',
                                        icon: 'fa fa-copy',
                                        size: 'xs',
                                        actionType: 'copy',
                                        content: '${flinkJobId}',
                                        tooltip: '复制 ID',
                                    }
                                ],
                            },
                            {
                                label: '别名',
                                type: 'wrapper',
                                fixed: 'left',
                                size: 'none',
                                body: [
                                    {
                                        type: 'action',
                                        level: 'link',
                                        label: '${tableMeta.alias}',
                                        size: 'xs',
                                        actionType: 'dialog',
                                        tooltip: '查看详情',
                                        dialog: tableMetaDialog(),
                                    },
                                    {
                                        type: 'action',
                                        level: 'link',
                                        label: '',
                                        icon: 'fa fa-copy',
                                        size: 'xs',
                                        actionType: 'copy',
                                        content: '${tableMeta.alias}',
                                        tooltip: '复制别名',
                                    },
                                ],
                            },
                            {
                                name: 'run_mode',
                                label: '表类型',
                                width: 60,
                                align: 'center',
                                ...runModeMapping('flinkJob.runMode'),
                                filterable: {
                                    multiple: true,
                                    options: [
                                        {label: '1对1', value: 'ONE_IN_ONE'},
                                        {label: '1对多', value: 'ALL_IN_ONE'},
                                        {label: '按表1对多', value: 'ALL_IN_ONE_BY_TABLE'},
                                        {label: '按库1对多', value: 'ALL_IN_ONE_BY_SCHEMA'},
                                    ]
                                }
                            },
                            {
                                name: 'source_start_time',
                                label: '同步启动时间',
                                width: 140,
                                type: 'tpl',
                                tpl: timeAndFrom('syncState.sourceStartTime', 'syncState.sourceStartTimeFromNow', '未启动'),
                                sortable: true,
                                align: 'center',
                                className: 'bg-green-50',
                            },
                            {
                                name: 'source_checkpoint_time',
                                label: '同步心跳时间',
                                width: 140,
                                type: 'tpl',
                                tpl: timeAndFrom('syncState.sourceCheckpointTime', 'syncState.sourceCheckpointTimeFromNow', '未启动'),
                                sortable: true,
                                align: 'center',
                                className: 'bg-green-50',
                            },
                            {
                                name: 'source_publish_time',
                                label: '源端发布时间',
                                width: 140,
                                type: 'tpl',
                                tpl: timeAndFrom('syncState.sourcePublishTime', 'syncState.sourcePublishTimeFromNow', '无增量'),
                                sortable: true,
                                align: 'center',
                                className: 'bg-green-50',
                            },
                            {
                                name: 'source_operation_time',
                                label: '源端业务时间',
                                width: 140,
                                type: 'tpl',
                                tpl: timeAndFrom('syncState.sourceOperationTime', 'syncState.sourceOperationTimeFromNow', '无增量'),
                                sortable: true,
                                align: 'center',
                                className: 'bg-green-50',
                            },
                            {
                                name: 'compaction_status',
                                label: '压缩状态',
                                width: 60,
                                align: 'center',
                                ...compactionStatusMapping('syncState.compactionStatus'),
                                className: 'bg-cyan-50',
                                /*filterable: {
                                    multiple: true,
                                    options: [
                                        {label: '调度', value: 'SCHEDULE'},
                                        {label: '开始', value: 'START'},
                                        {label: '完成', value: 'FINISH'},
                                        {label: '失败', value: 'FAIL'},
                                    ]
                                }*/
                            },
                            {
                                name: 'compaction_start_time',
                                label: '压缩启动时间',
                                width: 140,
                                type: 'tpl',
                                tpl: timeAndFrom('syncState.compactionStartTime', 'syncState.compactionStartTimeFromNow'),
                                sortable: true,
                                align: 'center',
                                className: 'bg-cyan-50',
                            },
                            {
                                name: 'compaction_finish_time',
                                label: '压缩完成时间',
                                width: 140,
                                type: 'tpl',
                                tpl: timeAndFrom('syncState.compactionFinishTime', 'syncState.compactionFinishTimeFromNow'),
                                sortable: true,
                                align: 'center',
                                className: 'bg-cyan-50',
                            },
                            {
                                type: "operation",
                                label: "操作",
                                width: 120,
                                fixed: 'right',
                                buttons: [
                                    {
                                        label: '同步',
                                        type: 'action',
                                        level: 'link',
                                        actionType: 'dialog',
                                        dialog: simpleYarnDialog('sync', '同步详情')
                                    },
                                    {
                                        label: '压缩',
                                        type: 'action',
                                        level: 'link',
                                        actionType: 'dialog',
                                        dialog: simpleYarnDialog('compaction', '压缩详情')
                                    },
                                    {
                                        label: '队列',
                                        type: 'action',
                                        level: 'link',
                                        actionType: 'dialog',
                                        dialog: {
                                            title: '队列详情',
                                            actions: [],
                                            size: 'lg',
                                            body: {
                                                type: 'service',
                                                api: {
                                                    method: 'get',
                                                    url: '${base}/pulsar/topic',
                                                    data: {
                                                        pulsar_url: '${tableMeta.pulsarAddress|default:undefined}',
                                                        topic: '${tableMeta.topic|default:undefined}',
                                                    }
                                                },
                                                body: [
                                                    {
                                                        type: 'property',
                                                        title: '基本信息',
                                                        items: [
                                                            {label: 'Topic', content: copyField('detail.name'), span: 2},
                                                            {label: '最末位移', content: copyField('detail.lastMessageId')},
                                                        ],
                                                    },
                                                    {type: 'divider'},
                                                    {
                                                        type: 'property',
                                                        title: '指标信息',
                                                        column: 4,
                                                        items: [
                                                            {label: '入队列消息速率', content: '${detail.state.messageRateIn}'},
                                                            {label: '出队列消息速率', content: '${detail.state.messageRateOut}'},
                                                            {label: '入队列消息吞吐量', content: '${detail.state.messageThroughputIn}'},
                                                            {label: '出队列消息吞吐量', content: '${detail.state.messageThroughputOut}'},
                                                            {label: '入队列消息数量', content: '${detail.state.messageInCounter}'},
                                                            {label: '出队列消息数量', content: '${detail.state.messageOutCounter}'},
                                                            {label: '入队列消息字节数', content: '${detail.state.byteInCounter}'},
                                                            {label: '出队列消息字节数', content: '${detail.state.byteOutCounter}'},
                                                            {label: '存储消息大小', content: '${detail.state. storageSize}'},
                                                            {label: '积压消息大小', content: '${detail.state.backlogSize}'},
                                                            {label: '平均消息大小', content: '${detail.state.averageMessageSize}'},
                                                        ],
                                                    },
                                                    {type: 'divider'},
                                                    {
                                                        type: 'table',
                                                        title: '消费者们',
                                                        source: '${detail.subscriptionStateVOS}',
                                                        itemAction: {
                                                            type: 'action',
                                                            actionType: 'dialog',
                                                            dialog: {
                                                                title: '详情',
                                                                closeOnEsc: true,
                                                                closeOnOutside: true,
                                                                showCloseButton: false,
                                                                actions: [],
                                                                size: 'md',
                                                                body: [
                                                                    {
                                                                        type: 'property',
                                                                        column: 1,
                                                                        items: [
                                                                            {label: '在此订阅上传递的消息的总速率(msg/s)', content: '${messageRateOut}'},
                                                                            {label: '此订阅提供的总吞吐量(字节/秒)', content: '${messageThroughputOut}'},
                                                                            {label: '传送给消费者的总字节数(字节)', content: '${bytesOutCounter}'},
                                                                            {label: '传递给消费者的消息总数(msg)', content: '${messageOutCounter}'},
                                                                            {label: '此订阅上重新传递的消息的总速率(msg/s)', content: '${messageRateRedeliver}'},
                                                                            {label: '分块消息调度速率', content: '${chunkedMessageRate}'},
                                                                            {label: '积压的大小(字节)', content: '${backlogSize}'},
                                                                            {label: '积压中不包含延迟消息的消息数', content: '${messageBacklogNoDelayed}'},
                                                                            {label: '验证订阅是否由于达到未确认消息的阈值而被阻止', content: '${blockedSubscriptionOnUnackedMessages}'},
                                                                            {label: '当前正在跟踪的延迟消息数', content: '${messageDelayed}'},
                                                                            {label: '订阅的未确认消息数', content: '${unackedMessages}'},
                                                                            {label: '单个活跃消费者订阅处于活跃状态的消费者名称(故障转移、独占)', content: '${activeConsumerName}'},
                                                                            {label: '此订阅上过期的消息总速率(msg/s)', content: '${messageRateExpired}'},
                                                                            {label: '此订阅上过期的消息总数', content: '${totalMessageExpired}'},
                                                                            {
                                                                                label: '最后一条消息过期时间',
                                                                                content: {
                                                                                    type: 'tpl',
                                                                                    tpl: '${lastExpireTimestamp|date:YYYY-MM-DD HH\\:mm\\:ss:x}',
                                                                                }
                                                                            },
                                                                            {
                                                                                label: '上次接收的消费流命令时间',
                                                                                content: {
                                                                                    type: 'tpl',
                                                                                    tpl: '${lastConsumedFlowTimestamp|date:YYYY-MM-DD HH\\:mm\\:ss:x}',
                                                                                }
                                                                            },
                                                                            {
                                                                                label: '上次消费消息时间',
                                                                                content: {
                                                                                    type: 'tpl',
                                                                                    tpl: '${lastConsumedTimestamp|date:YYYY-MM-DD HH\\:mm\\:ss:x}',
                                                                                }
                                                                            },
                                                                            {
                                                                                label: '上次确认消息时间',
                                                                                content: {
                                                                                    type: 'tpl',
                                                                                    tpl: '${lastAckedTimestamp|date:YYYY-MM-DD HH\\:mm\\:ss:x}',
                                                                                }
                                                                            },
                                                                            {label: '此订阅是持久订阅还是临时订阅', content: '${durable}'},
                                                                            {label: '标记订阅状态在不同区域之间保持同步', content: '${replicated}'},
                                                                        ]
                                                                    },
                                                                ]
                                                            }
                                                        },
                                                        columns: [
                                                            {
                                                                name: 'name',
                                                                label: "订阅名称",
                                                                ...copyField('name')
                                                            },
                                                            {
                                                                name: 'type',
                                                                label: '订阅类型',
                                                                fixed: 'right',
                                                                ...subscriptionTypeMapping('type')
                                                            },
                                                            {name: 'messageBacklog', label: '积压', fixed: 'right'},
                                                        ]
                                                    },
                                                    {type: 'divider'},
                                                    {
                                                        type: 'table',
                                                        title: '生产者们',
                                                        source: '${detail.state.publishers}',
                                                        itemAction: {
                                                            type: 'action',
                                                            actionType: 'dialog',
                                                            dialog: {
                                                                title: '详情',
                                                                closeOnEsc: true,
                                                                closeOnOutside: true,
                                                                showCloseButton: false,
                                                                actions: [],
                                                                size: 'md',
                                                                body: [
                                                                    {
                                                                        type: 'property',
                                                                        column: 1,
                                                                        items: [
                                                                            {label: '发布消息速率(msg/s)', content: '${messageRateIn}'},
                                                                            {label: '发布消息吞吐量(字节/秒)', content: '${messageThroughputIn}'},
                                                                            {label: '消息平均大小(字节)', content: '${averageMessageSize}'},
                                                                            {label: '接收到的分块消息总数(msg)', content: '${chunkedMessageRate}'},
                                                                            {label: '生产者地址', content: '${address}'},
                                                                            {label: '客户端版本', content: '${clientVersion}'},
                                                                        ]
                                                                    },
                                                                ]
                                                            }
                                                        },
                                                        columns: [
                                                            {
                                                                name: 'producerId',
                                                                label: "ID",
                                                                width: 50,
                                                            },
                                                            {
                                                                name: 'producerName',
                                                                label: "名称",
                                                                ...copyField('producerName'),
                                                            },
                                                            {
                                                                name: 'connectedSince',
                                                                label: "连接时间",
                                                                type: 'tpl',
                                                                tpl: '${connectedSince}'
                                                            },
                                                            {
                                                                name: 'accessMode',
                                                                label: '发布类型',
                                                                fixed: 'right',
                                                                ...publishTypeMapping('accessMode'),
                                                            },
                                                        ]
                                                    },
                                                ]
                                            }
                                        }
                                    },
                                ]
                            }
                        ]
                    }
                ]
            }
        ],
    }
}