<template>
    <global-page title="考核记录" ref="pageRef" v-model="dataList" @query="getList" refresherEnabled>
        <template #top>
            <z-tabs :list="tabList" @change="tabsChange" bar-width="80rpx" bg-color="#f7f8fa" />
        </template>
        <view class="list">
            <view class="item" v-for="(item, index) in dataList" :key="index" @tap="goTo">
                <view class="item-title">
                    <view class="desc">
                        <view class="type">OPEN</view>
                        <view class="txt">190机型管控中心</view>
                        <view class="place">华北基地</view>
                    </view>
                    <score-details :type="index % 2 == 0 ? 'success' : 'warning'"></score-details>
                </view>
                <view class="item-content">
                    3月31日,天津航空6837/A320飞机执行天津=长春、天津=昆明航班，23:00落地，航后执行52A检工作，利用夜间8小时左右执行飞机检查和维修工
                </view>
            </view>
        </view>
    </global-page>
</template>

<script setup>
import { ref } from 'vue'

const tabIndex = ref(0)
const tabList = ref(['OPEN', 'CLOSE', '全部'])
//导航切换
const tabsChange = (index) => {
    tabIndex.value = index
    dataList.value = []
    pageRef.value?.reload()
}
//加载
const pageRef = ref()
const dataList = ref([])
const getList = (opt) => {
    setTimeout(() => {
        pageRef.value?.complete([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
    }, 500)
}
//跳转
const goTo = () => {
    uni.navigateTo({ url: 'details' })
}
</script>
<style lang="scss" scoped>
@import './constants/list.scss';
</style>
