<!-- 我的收藏 -->
<template>
    <app-view>
        <template #header>
            <app-filter v-bind="{ selectList,  buttonList }" />
        </template>
        <app-table :data="dataList" v-model:columns="columns" :loading="loading">
            <!-- 我的出价 -->
            <template #price="{ row }">
                {{ row.zscurrencytypedisplayunit + formatDecimal(row.price) }}
            </template>
            <!-- 克拉单价 -->
            <template #priceper="{ row }">
                {{ row.zscurrencytypedisplayunit + formatDecimal(row.priceper) }}
            </template>
            <!-- 操作 -->
            <template #operate="{ row }">
                <app-auth-operation :options="{ selectedRow: row }" @closed="getFavoriteList" />
            </template>
            <template #footer>
                <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex" />
            </template>
        </app-table>
    </app-view>
</template>

<script lang="ts" setup>
import { formatDecimal } from '@/filters'
import { useFavorite } from '@/business/favorite'
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'
import AppFilter from '@pc/components/base/table-filter/index.vue'

const { loading, dataList, columns, total, pageIndex, pageSize, selectList, buttonList, getFavoriteList } = useFavorite()
</script>