// 视图组件
const PageView = () => import('@/layout/PageView')

import { GetInvoiceAuthenUrl } from '@/api/ent_info'
import { Message } from 'element-ui'

// 基础版本路由
const basicVersionRoutes = [
    {
        name: 'dashboard',
        path: 'dashboard',
        component: () => import('@/pages/index/children/dashboard'),
        meta: {
            icon: 'dashboard',
            affix: true,
            keep: true
        }
    },
    {
        name: 'tax_hardware',
        path: 'tax_hardware',
        component: PageView,
        meta: {
            icon: 'global'
        },
        children: [
            {
                name: 'ent_invoice_stock_page',
                path: 'ent_invoice_stock_page',
                component: () => import('@/pages/tax_hardware/ent_invoice_stock_page'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'tax_hardware_monitor_page',
                path: 'tax_hardware_monitor_page',
                component: () => import('@/pages/tax_hardware/tax_hardware_monitor_page'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            }
        ]
    },
    {
        name: 'invoice',
        path: 'invoice',
        component: PageView,
        meta: {
            icon: 'documentation'
        },
        children: [
            {
                name: 'invoice_scan_code',
                path: 'invoice_scan_code',
                component: () => import('@/pages/invoice/invoice_scan_code'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'invoice_todo',
                path: 'invoice_todo',
                component: () => import('@/pages/invoice/invoice_todo'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'special_invoice',
                path: 'special_invoice',
                component: () => import('@/pages/invoice/special_invoice'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'ordinary_invoice',
                path: 'ordinary_invoice',
                component: () => import('@/pages/invoice/ordinary_invoice'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'electronics_invoice',
                path: 'electronics_invoice',
                component: () => import('@/pages/invoice/electronics_invoice'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'electronics_special_invoice',
                path: 'electronics_special_invoice',
                component: () => import('@/pages/invoice/electronics_special_invoice'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'digital_electronic_invoice',
                path: 'digital_electronic_invoice',
                component: () => import('@/pages/invoice/digital_electronic_invoice'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'files_import',
                path: 'files_import',
                component: () => import('@/pages/batch_invoice/files_import'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'batch_invoice',
                path: 'batch_invoice',
                component: () => import('@/pages/batch_invoice/batch_invoice'),
                meta: {
                    icon: 'documentation',
                    hidden: true
                }
            }
        ]
    },
    {
        name: 'invoice_query_menu',
        path: 'invoice_query_menu',
        component: PageView,
        meta: {
            icon: 'documentation'
        },
        children: [
            {
                name: 'invoice_query2',
                path: 'invoice_query2',
                component: () => import('@/pages/invoice_management/invoice_query2'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'invoice_export',
                path: 'invoice_export',
                component: () => import('@/pages/invoice_management/invoice_export'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'invoice_info_inquiry',
                path: 'invoice_info_inquiry',
                component: () => import('@/pages/invoice_management/invoice_info_inquiry'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            }
        ]
    },
    {
        name: 'invoice_management',
        path: 'invoice_management',
        component: PageView,
        meta: {
            icon: 'documentation'
        },
        children: [
            {
                name: 'invoice_recovery',
                path: 'invoice_recovery',
                component: () => import('@/pages/tax_hardware/invoice_recovery'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'invoice_get',
                path: 'invoice_get',
                component: () => import('@/pages/invoice_management/invoice_get'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'invoice_purchase',
                path: 'invoice_purchase',
                component: () => import('@/pages/invoice_management/invoice_purchase'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            // {
            //     name: 'invoice_can_hongchong',
            //     path: 'invoice_can_hongchong',
            //     component: () => import('@/pages/invoice_management/invoice_can_hongchong'),
            //     meta: {
            //         icon: 'documentation',
            //         keep: true
            //     }
            // },
            {
                name: 'invoice_invalid',
                path: 'invoice_invalid',
                component: () => import('@/pages/invoice_invalid/invoice_invalid'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            // {
            //     name: 'open_invoice_authen_url',
            //     path: "open_invoice_authen_url",
            //     dynamic: function () {
            //         let _this = this;
            //         GetInvoiceAuthenUrl()
            //             .then((val) => {
            //                 if (
            //                     val.data.authUrl
            //                 ) {
            //                     Message.success(val.data.authUrl);
            //                     let a = document.createElement("a");
            //                     a.href = val.data.authUrl;
            //                     a.target = "_blank";
            //                     a.click();
            //                 }
            //             })
            //             .catch((err) => {
            //                 Message.error(err);
            //                 return false;
            //             });
            //     },
            //     meta: {
            //         icon: 'documentation',
            //         keep: true
            //     }
            // },
            {
                name: 'invoice_red_letter',
                path: 'invoice_red_letter',
                component: () => import('@/pages/invoice_management/invoice_red_letter'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'invoice_batch_printing',
                path: 'invoice_batch_printing',
                component: () => import('@/pages/invoice_management/invoice_batch_printing'),
                meta: {
                    icon: 'documentation'
                }
            }
        ]
    },
    {
        name: 'invoice_authentication',
        path: 'invoice_authentication',
        component: PageView,
        meta: {
            icon: 'documentation'
        },
        children: [
            // {
            //     name: 'InvoiceDKGXOverview',
            //     path: '/invoice-DKGX-overview',
            //     component: () => import('@/pages/invoice-DKGX/overview'),
            //     meta: {
            //         icon: 'documentation',
            //         keep: true
            //     }
            // },
            {
                name: 'InvoiceDKGX',
                path: '/invoice-DKGX',
                component: () => import('@/pages/invoice-DKGX'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            // {
            //     name: 'InvoiceNoDKGX',
            //     path: '/invoice-no-DKGX',
            //     component: () => import('@/pages/invoice-DKGX/no-DKGX'),
            //     meta: {
            //         icon: 'documentation',
            //         keep: true
            //     }
            // },
            // {
            //     name: 'batch_check_certification',
            //     path: 'batch_check_certification',
            //     component: () => import('@/pages/invoice_authentication/batch_check_certification/batch_check_certification'),
            //     meta: {
            //         icon: 'documentation',
            //         keep: true
            //     }
            // },
            {

                name: 'deduction_check_statistics',
                path: 'deduction_check_statistics',
                component: () => import('@/pages/invoice_authentication/deduction_check_statistics/deduction_check_statistics'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            }
        ]
    },
    {
        name: 'service',
        path: 'service',
        component: PageView,
        meta: {
            icon: 'documentation'
        },
        children: [
            {
                name: 'ServiceBuy',
                path: 'ServiceBuy',
                component: () => import('@/pages/service-buy/index'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'coupon',
                path: 'coupon',
                component: () => import('@/pages/service/coupon/coupon'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'TransRecords',
                path: '/trans-records',
                component: () => import('@/pages/trans-records'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            }
        ]
    },
    {
        name: 'config',
        path: 'config',
        component: PageView,
        meta: {
            icon: 'documentation'
        },
        children: [
            {

                name: 'purchaser_info',
                path: 'purchaser_info',
                component: () => import('@/pages/config/purchaser'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'personnel_info',
                path: 'personnel_info',
                component: () => import('@/pages/config/personnel'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'commodity_info',
                path: 'commodity_info',
                component: () => import('@/pages/config/commodity'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'enterprise_information',
                path: 'enterprise_information',
                component: () => import('@/pages/enterprise_information'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'basic_software',
                path: 'basic_software',
                component: () => import('@/pages/basic_software/basic_software'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            },
            {
                name: 'ExpressAddress',
                path: '/express-address',
                component: () => import('@/pages/config/express-address'),
                meta: {
                    icon: 'documentation',
                }
            }
        ]
    },
    {
        name: 'help',
        path: 'help',
        component: PageView,
        meta: {
            icon: 'documentation'
        },
        children: [
            {

                name: 'help',
                path: 'help',
                component: () => import('@/pages/help/help'),
                meta: {
                    icon: 'documentation',
                    keep: true
                }
            }
        ]
    }
]

export default basicVersionRoutes
