<script setup lang="ts">
import { ref } from "vue";
import { usePageSearch, type PageHooks, type PageEvents } from "/@/hooks/page";
import contentConfig from "./config/content.config";
import searchConfig from "./config/search.config";

import dayjs from "dayjs"

const PageName = "sheetOrderRecord";

const hooks: PageHooks = {
  pageSearchHook: () => usePageSearch((params = {}) => {
    const { order_timer, ... result } = params

    if(order_timer && order_timer.length === 2){ 
      const [start, end] = order_timer
      result['betweenTime'] = [dayjs(start).format('YYYY-MM-DD'), dayjs(end).format('YYYY-MM-DD')]
     }

    return {
      result,
      deleteProps: ['start','end']
    }
  }, undefined, searchConfig)
};
</script>

<template>
  <PageAuth :pageName="PageName">
    <PageContainer
      :hooks="hooks"
      :contentConfig="contentConfig"
      :search-config="searchConfig"
    >
    </PageContainer>
  </PageAuth>
</template>
