/**
 * 今日运行-通用
 */
import React from 'react';
import VMTable from '../../../vm-table';
import outTime from '../../imgs/outTime.png';
import runTime from '../../imgs/runTime.png';

export default function TodayRun(props: any) {
    window.console.log(props);
    const columns = [
        {
            title: '报警类型',
            dataIndex: 'type',
            key: 'type',
            width: 100,
            ellipsis: true,
        },
        {
            title: '报警时间',
            dataIndex: 'time',
            key: 'time',
            width: 120,
            ellipsis: true,
        },
        {
            title: '报警内容',
            dataIndex: 'alarmContent',
            key: 'alarmContent',
            ellipsis: true,
        },
    ];
    const tableProps = {
        height: 220,
        paganitation: false,
        dataSource: [
            { type: '超速', time: '213' },
            { type: '超速2', time: '213' },
            { type: '超速2', time: '213' },
        ],
    };

    return (
        <div className="today-run">
            <div className="today-run-head">
                <div className="today-run-head-item">
                    <img src={outTime} />
                    <div>
                        <div className="today-run-head-item--name">出车时间</div>
                        <div className="today-run-head-item--value">08:00:00</div>
                    </div>
                </div>
                <div className="today-run-head-item">
                    <img src={runTime} />
                    <div>
                        <div className="today-run-head-item--name">运行时长</div>
                        <div className="today-run-head-item--value">1h20min08s</div>
                    </div>
                </div>
            </div>
            <VMTable columns={columns} isIndex={false} rowKey="index" {...tableProps} />
        </div>
    );
}
