<template>
    <!-- 人员动态弹框内 taps栏第一个巡检次数 -->
    <div class="taps-one-container">
        <n-form inline ref="formRef" size="small" label-placement="left">
            <n-form-item>
                <n-date-picker type="daterange" clearable style="width: 240px" />
            </n-form-item>

            <n-form-item>
                <n-button type="info"> 查询 </n-button>
                <n-button color="#6E90A9" style="margin-left: 10px"> 重置 </n-button>
            </n-form-item>
        </n-form>

        <!-- 内容区域 -->
        <n-data-table :columns="columns" :data="data" :style="{ height: `75%` }" flex-height />
        <div style="margin-top: 10px; display: flex; justify-content: flex-end">
            <n-pagination
                v-model:page="page"
                v-model:page-size="pageSize"
                :page-count="100"
                show-size-picker
                :page-sizes="[10, 20, 30, 40]"
            />
        </div>
    </div>
</template>

<script setup>
import { ref } from 'vue'
import { NTag, NImage } from 'naive-ui'

const page = ref(1)
const pageSize = ref(10)

const columns = ref([
    {
        title: '巡检日期',
        key: 'age',
        align: 'center',
    },
    {
        title: '巡检开始时间',
        key: 'tags',
        align: 'center',
    },
    {
        title: '巡检结束时间',
        key: 'age',
        align: 'center',
    },
    {
        title: '巡检图片',
        key: 'tags',
        align: 'center',
        render(row) {
            const tags = row.tags.map((tagKey) => {
                return h(
                    NImage,
                    {
                        width: '40px',
                        height: '40px',
                        src: 'https://gw.alipayobjects.com/zos/antfincdn/aPkFc8Sj7n/method-draw-image.svg',
                        fit: 'cover',
                    },
                    {
                        default: () => tagKey,
                    },
                )
            })
            return tags
        },
    },
    {
        title: '巡检时长',
        key: 'age',
        align: 'center',
    },
])
const data = ref([
    {
        age: '2025-06-01 10:00:00',
        tags: ['nice'],
    },
    {
        age: '2025-06-01 10:00:00',
        tags: ['nice'],
    },
    {
        age: '2025-06-01 10:00:00',
        tags: ['nice'],
    },
    {
        age: '2025-06-01 10:00:00',
        tags: ['nice'],
    },
    {
        age: '2025-06-01 10:00:00',
        tags: ['nice'],
    },
    {
        age: '2025-06-01 10:00:00',
        tags: ['nice'],
    },
    {
        age: '2025-06-01 10:00:00',
        tags: ['nice'],
    },
    {
        age: '2025-06-01 10:00:00',
        tags: ['nice'],
    },
    {
        age: '2025-06-01 10:00:00',
        tags: ['nice'],
    },
    {
        age: '2025-06-01 10:00:00',
        tags: ['nice'],
    },
    {
        age: '2025-06-01 10:00:00',
        tags: ['nice'],
    },
    {
        age: '2025-06-01 10:00:00',
        tags: ['nice'],
    },
    {
        age: '2025-06-01 10:00:00',
        tags: ['nice'],
    },
])
</script>

<style lang="scss" scoped>
.taps-one-container {
    width: 100%;
    height: 100%;
}
</style>
