<template>
    <global-page-swiper title="布置工作" refresherEnabled loadingMoreEnabled :tabList="tabList" :api="getRqmListApi" ref="paging" :padding="24">
        <template #="{ dataList }">
            <view class="item" v-for="item in dataList" :key="item.id" @tap="goDetails(item)">
                <view class="item-title">
                    <view class="left">
                        <view class="type">{{ item.status == 1 ? 'OPEN' : 'ClOSE' }}</view>
                        <view class="txt">早会工作详情</view>
                    </view>
                    <view class="right">早会工作</view>
                </view>
                <view class="item-content u-line-3">
                    海航技术专项布置〔2024〕00022号： 首6709飞机1月10日广州航前有AC ESS
                    BUSSHED信息，同时左侧MCDU和ND黑屏，断电重启无效，排故所需8XH和9XH继电器集团无料的情况，要求采购管理部对使用及库存情况进行核实，尽快安排采购配备。
                </view>
                <view class="item-footer">
                    <view class="label">
                        <global-icon icon="calendar"></global-icon>
                        <text class="txt">2024-01-10</text>
                    </view>
                    <view class="label">
                        <global-icon icon="idcard"></global-icon>
                        <text class="txt">陈朝丽测试</text>
                    </view>
                </view>
            </view>
        </template>
    </global-page-swiper>
</template>

<script setup>
import { ref } from 'vue'
import { getRqmListApi } from '@/api/appraisal-record'
import { onLoad, onUnload } from '@dcloudio/uni-app'
import useAppraisalRecordStore from '@/store/appraisal-record'

const tabList = ref([
    { name: 'OPEN', value: 1 },
    { name: 'CLOSE', value: 0 },
    { name: '全部', value: -1 }
])
//跳转
const goDetails = (data) => {
    uni.navigateTo({
        url: 'details?id=' + data.id
    })
}
//加载下拉框数据
const appraisalRecordStore = useAppraisalRecordStore()
onLoad(() => {
    appraisalRecordStore.getRqmOptions()
})
//刷新
const paging = ref()
uni.$on('appraisalRecordReload', () => {
    paging.value?.reload()
})
onUnload(() => {
    uni.$off('appraisalRecordReload')
})
</script>
<style lang="scss" scoped>
@import './constants/list.scss';
</style>
