<script setup lang="ts">
import { ref } from "vue";
import contentConfig from "./config/content.config";
import PurchaseModal from "./components/purchase-modal.vue";

const PageName = "action";
const pageContentRef = ref<any>(null);
const purchaseModalRef = ref<InstanceType<typeof PurchaseModal> | null>(null);

</script>

<template>
  <PageAuth :pageName="PageName">
    <PageContainer :contentConfig="contentConfig" :get-content-ref="ref => pageContentRef = ref">
      <template #content_header>
        <ElButton type="primary" @click="purchaseModalRef?.onDisplay()">添加</ElButton>
      </template>
    </PageContainer>
    <PurchaseModal ref="purchaseModalRef" @refresh="pageContentRef?.onSearch()" />
  </PageAuth>
</template>
