<template>
    <div class="lb-container">
        <div class="title">{{ tLang('message', '检测结果') }}</div>
        <div class="content">
            <BottomTable v-tableAutoScroll="{ delay: 30 }" :columns="prop.column" :tableData="prop.data.accessData">
                <template #checkResult="scope">
                    <span v-if="scope.row.checkResult == 'NG'" style="color: red">{{ scope.row.checkResult }}</span>
                    <span v-else style="color: #17C27B;">{{ scope.row.checkResult }}</span>
                </template>
            </BottomTable>
        </div>
        
    <div class="ok-ng">
        <div class="total">检测总数: {{ prop.data.total }}</div>
        <div class="ok">OK总数: {{ prop.data.okNum }}</div>
        <div class="ng">NG总数: {{ prop.data.ngNum }}</div>
    </div>
    </div>
</template>

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

const prop = defineProps({
    column: {
        type: Array,
        default: () => {
            return [
                {
                    prop: 'name',
                    label: '名称',
                    width: '100px'
                },
                {
                    prop: 'value',
                    label: '值',
                    width: '100px'
                }
            ]
        }
    },
    data: {
        type: Object,
        default: () => {
            return {
                total: 0,
                okNum: 0,
                ngNum: 0,
                accessData: []
            }
        }
    }
})
</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>
