<template>
    <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" @query="query" safe-area-inset-bottom>
        <template #top>
            <ut-navbar title="种植管理" :fixed="false"> </ut-navbar>
        </template>
        <view class="pd-24">
            <Task_card :data="taskDate" />
            <view class="d-flex a-c j-sb pt-20">
                <view class="startline-title pl-24 ml-24 mb-16">管理记录</view>
                <view class="bg-#37A954 b-radius pd4-10-20-10-20 d-flex a-c" style="width: max-content" @click="$u.route({ type: 'navigateTo', url: '/plant/port/supervise-create/index', params: { id: item?.id } })">
                    <up-icon name="plus" color="#fff"></up-icon>
                    <view class="c-#fff f-s-22">添加管理记录</view>
                </view>
            </view>
        </view>
    </z-paging>
</template>
<script setup lang="ts">
import { useClientRequest } from '@/utils/request';
import Task_card from './models/task_card.vue';
const paging = ref();
const list = ref([]);
const taskId = ref('');
const taskDate = ref('');
const query = async (pageNo: number, pageSize: number) => {
    const res = await useClientRequest.get('/plt-api/app/plantationTask/list', {
        pageNo,
        pageSize,
    });
    // if (res) {
    //     const { rows } = res;
    //     paging.value.complete(rows);
    // }
};
onMounted(async () => {
    const res = await useClientRequest.get(`/plt-api/app/plantationTask/getInfo/${taskId.value}`, {
        pageNo: 1,
        pageSize: 10,
    });
    taskDate.value = res.data;
});
onLoad((options: any) => {
    taskId.value = options?.id;
});
</script>
