<template>
    <div class="recycle-order-number flex flex-col items-start ml-6">
        <div class="common-text cursor-pointer">
            <el-text type="primary" @click="handleClick(row)">{{
                row?.bookName
            }}</el-text>
        </div>
        <div class="flex justify-between items-start">
            <div class="flex flex-col items-start" style="min-width: 240px">
                <div class="common-text">
                    <el-text>ISBN：</el-text>
                    <el-text>{{ row?.isbn }}</el-text>
                </div>
                <div class="common-text">
                    <el-text>作 者：</el-text>
                    <el-text>{{ row?.author || '-' }} </el-text>
                </div>
                <div class="common-text">
                    <el-text>出版社：</el-text>
                    <el-text>{{ row?.publish || '-' }}</el-text>
                </div>
            </div>
            <div class="flex flex-col items-start ml-5">
                <div class="common-text">
                    <el-text>定价：</el-text>
                    <el-text>￥ {{ row?.price || 0 }}</el-text>
                </div>
                <div class="common-text">
                    <el-text>出版时间：</el-text>
                    <el-text
                        >{{
                            row?.pubDate
                                ? dayjs(row?.pubDate).format('YYYY-MM-DD')
                                : '-'
                        }}
                    </el-text>
                </div>
                <div class="common-text">
                    <el-text>装帧：</el-text>
                    <el-text>{{ row?.bookPack || '暂无' }}</el-text>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>
    import { dayjs } from 'element-plus';
    const emit = defineEmits(['click']);

    const props = defineProps({
        row: {
            type: Object,
            default: () => {}
        }
    });

    function handleClick(row) {
        emit('click', row);
    }
</script>
