<template>
    <global-page :padding="24" title="工具列表">
        <template v-for="(item, index) in getToolsList" :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 { getToolsList } = storeToRefs(mcoStore)
const goTo = (index) => {
    uni.$mocpJump.navigateTo('/panel/mco/tools-details').then(() => {
        mcoStore.setState('toolsIndex', index)
    })
}
</script>
<style lang="scss" scoped></style>
