<template>
    <app-view>
        <app-table :data="dataList" v-model:columns="columns" border>
            <template #header>
                <app-auth-operation :menus="['add']" />
            </template>
            <template #operate="{ row }">
                <app-auth-operation :menus="['edit']" :options="{ selectedRow: row }" linkButton />
            </template>
            <template #footer>
                <app-pagination :total="400" />
            </template>
        </app-table>
    </app-view>
</template>

<script lang="ts" setup>
import { ElMessage } from 'element-plus'
import { useWarehouse } from '@/business/warehouse'
import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'
import AppTable from '@pc/components/base/table/index.vue'
import AppPagination from '@pc/components/base/pagination/index.vue'

const { dataList, columns, getWarehouseList } = useWarehouse()

getWarehouseList().catch((err) => ElMessage.error(err))
</script>