<template>
    <div class="farm-table">
        <div class="th">
            <div class="td">农事名称</div>
            <div class="td">农事配方</div>
            <div class="td">服务主体</div>
            <div class="td">认证类型</div>
        </div>
        <div class="tr-wrap" v-if="tableData&&tableData?.length">
            <div class="tr" v-for="(item,index) in tableData.slice(0,4)" :key="index">
                <div class="td">{{item.farmWorkLibName}}</div>
                 <div class="td">{{item.shortName}}</div>
                <!-- <div class="td width">
                    <div v-for="(ele,idx) in item.prescriptionObj" :key="idx">{{ele.name}}</div>
                </div> -->
                <div class="td">{{item.nzName}}</div>
                <div class="td">{{item.standard}}</div>
            </div>
        </div>
        <div v-else class="empty">暂无数据</div>
    </div>
</template>

<script setup>
const props = defineProps({
    tableData:{
        type:Array,
        defalut:[]
    }
})
</script>

<style lang="scss" scoped>
.farm-table {
    margin-top: 8px;
    width: 100%;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 12px;
    color: #999999;
    .th {
        display: flex;
        justify-content: space-between;
        background: #f2f2f2;
        border-radius: 8px 8px 0 0;
        padding: 11px 5px;
        font-size: 13px;
        .td {
            width: 25%;
            text-align: center;
        }
    }
    .tr {
        display: flex;
        align-items: center;
        padding: 11px 5px;
        .td {
            width: 25%;
            text-align: center;
        }
    }

    .tr + .tr {
        border-top: 1px solid rgba(0, 0, 0, 0.2);
    }
    .width{
        width: 30% !important;
    }
    .empty{
        height: 100px;
        line-height: 100px;
        text-align: center;
    }
}
</style>
