<template>
    <div class="app-container">
        <page-search :searchFormConfig="searchFormConfig" @resetBtnClick="handleResetClick"
            @queryBtnClick="handleQueryClick" />

        <page-content ref="pageContentRef" :contentTableConfig="contentTableConfig" pageName="/WorkReport/WorkOrderType"
            :isCreate="false" :buttons="['', '导出']" @newBtnClick="handleNewData"
            @editBtnClick="handleEditData"></page-content>
        <!-- <page-modal :defaultInfo="defaultInfo" :title="'添加归属地'" ref="pageModalRef" pageName="/call/mobile"
            :modalConfig="modalConfig"></page-modal> -->
    </div>
</template>
  
<script>
import { defineComponent, ref, computed, watch, getCurrentInstance } from 'vue'

import PageSearch from '@/components/page-search'
import PageContent from '@/components/page-content'
import PageModal from '@/components/page-modal'

import { searchFormConfig } from './config/search.config'
import { contentTableConfig } from './config/content.config'
import { usePageSearch } from '@/hooks/use-page-search'
import { usePageModal } from '@/hooks/use-page-modal'
import { modalConfig } from './config/modal.config'

export default defineComponent({
    name: 'OrderTypeReport',
    components: {
        PageSearch,
        PageContent,
        PageModal,
    },
    setup () {

        // 1.处理逻辑
        const newCallback = () => { }
        const editCallback = () => { }

        const [pageContentRef, handleResetClick, handleQueryClick] = usePageSearch()
        const { proxy } = getCurrentInstance()

        const recordData = ref({})
        const open = ref(false)

        const clRowData = ref({})

        // 3.调用hook获取公共变量和函数
        const [pageModalRef, defaultInfo, handleNewData, handleEditData] =
            usePageModal(newCallback, editCallback)

        return {
            modalConfig,
            defaultInfo,
            handleNewData,
            handleEditData,
            pageModalRef,
            clRowData,
            searchFormConfig,
            contentTableConfig,
            pageContentRef,
            handleResetClick,
            handleQueryClick,
            recordData,
            open,
        }
    }
})
</script>
  