<template>
    <div class="lb-container">
        <div class="title">{{ prop.title }}</div>
        <div class="content">
            <BottomTable v-tableAutoScroll="{ delay: 30 }" :columns="prop.column" :tableData="prop.data">
                <template #workTime="scope">
                    {{ (scope.row.workTime / 60).toFixed(1) }} min
                </template>
                <template #totalTime="scope">
                    {{ (scope.row.totalTime / 60).toFixed(1) }} min
                </template>
            </BottomTable>
        </div>
    </div>
</template>

<script setup>
import BottomTable from './bottomTable.vue'

const prop = defineProps({
    title: {
        type: String,
        default: ''
    },
    column: {
        type: Array,
        default: () => {
            return [
                {
                    prop: 'name',
                    label: '名称',
                    width: '100px'
                },
                {
                    prop: 'value',
                    label: '值',
                    width: '100px'
                }
            ]
        }
    },
    data: {
        type: Object,
        default: () => {
            return []
        }
    }
})
</script>

<style lang="scss" scoped>
.title {
    width: 100%;
    height: 20px;
    line-height: 20px;
    font-size: 14px;
    color: #cfcfcf;

}

.content {
    width: 100%;
    height: calc(100% - 20px);
}

.lb-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.ok-ng {
    width: 70%;
    height: 20px;
    line-height: 20px;
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    align-items: center;

    div {
        font-size: 12px;
        margin-right: 15px;
    }

    .ok {
        color: #17C27B;
    }

    .ng {
        color: red;

    }
}
</style>
