<script setup lang="ts">
import { PageSearch, usePageSearch } from "/@/components/PageSearch";
import { PageContent } from "/@/components/PageContent";
import searchFormConfig from "./config/search.config";
import contentConfig from "./config/content.config";
import { useRouter } from "vue-router";

defineOptions({
  name: "invoiceheader"
});

const { push } = useRouter();
const { pageContentRef, handleResetClick, handleSearchClick } = usePageSearch();
</script>

<template>
  <div class="main role">
    <PageSearch
      :form-config="searchFormConfig"
      @search-btn-click="handleSearchClick"
      @reset-btn-click="handleResetClick"
    />

    <PageContent
      ref="pageContentRef"
      :content-config="contentConfig"
      @preview-btn-click="
        ({ returnCode }) =>
          push({
            path: '/InvoiceSales/refundDetail',
            query: {
              id: returnCode
            }
          })
      "
    >
      <template #create>
        <el-button
          type="primary"
          @click="() => push('/InvoiceSales/refundDetail')"
          >创建</el-button
        >
      </template>
    </PageContent>
  </div>
</template>

<style scoped lang="scss">
:deep(.el-dropdown-menu__item i) {
  margin: 0;
}
</style>
