<template>
    <global-page :padding="24" :title="getTitle" auto :localData="getMaterialData">
        <template #default="{ item, index }">
            <global-card :title="item.pn" titleSuffix="查看详情" @handleTitleClick="goTo(index)">
                <global-text-status :value="item.actualArrivalTime ? '1' : '0'" dictkey="aogDetails_status"></global-text-status>
            </global-card>
        </template>
    </global-page>
</template>

<script setup>
import { storeToRefs } from 'pinia'
import useAogStore from 'mocp/store/aog'
import { computed } from 'vue'

const aogStore = useAogStore()
const { getMaterialData, materialType } = storeToRefs(aogStore)
const goTo = (index) => {
    uni.$mocpJump.navigateTo('/panel/aog/material-details').then(() => {
        aogStore.setState('materialIndex', index)
    })
}
const getTitle = computed(() => {
    if (materialType.value == 1) {
        return '航材进展列表'
    } else {
        return '工具进展列表'
    }
})
</script>
<style lang="scss" scoped></style>
