<template>
    <global-page :padding="24" title="航材列表">
        <template v-for="(item, index) in getMaterialsList" :key="item.id">
            <global-card :title="item.name" titleSuffix="查看详情" @handleTitleClick="goTo(index)">
                <global-text-status :value="item.isValid" dictkey="mocMaterial_isValid"></global-text-status>
            </global-card>
        </template>
    </global-page>
</template>

<script setup>
import { storeToRefs } from 'pinia'
import useMcoStore from 'mocp/store/mco'

const mcoStore = useMcoStore()
const { getMaterialsList } = storeToRefs(mcoStore)
const goTo = (index) => {
    uni.$mocpJump.navigateTo('/panel/mco/materials-details').then(() => {
        mcoStore.setState('materialsIndex', index)
    })
}
</script>
<style lang="scss" scoped></style>
