import Vue from 'vue'
import Router from 'vue-router'
/* Layout */
import Layout from '@/layout'
// import { getIndex } from '@/api/user'

Vue.use(Router)

/**
 * Note: sub-menu only appear when route children.length >= 1
 * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
 *
 * hidden: true                   if set true, item will not show in the sidebar(default is false)
 * alwaysShow: true               if set true, will always show the root menu
 *                                if not set alwaysShow, when item has more than one children route,
 *                                it will becomes nested mode, otherwise not show the root menu
 * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
 * name:'router-name'             the name is used by <keep-alive> (must set!!!)
 * meta : {
    roles: ['admin','editor']    control the page roles (you can set multiple roles)
    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
    icon: 'svg-name'             the icon show in the sidebar
    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
  }
 */

/**
 * constantRoutes
 * a base page that does not have permission requirements
 * all roles can be accessed
 */
export const constantRoutes = [
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path*',
        component: () => import('@/views/redirect/index')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/login/login.vue'),
    hidden: true
  },
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    runKind: 0,
    children: [{
      path: 'dashboard',
      name: 'Dashboard',
      component: () => import('@/views/dashboard/index'),
      meta: {title: '首页', icon: 'dashboard', affix: true},
      runKind: 0
    }]
  },

  /* erp调用地址开始 */
  {
    path: '/select/selectAccessoriesInfo',
    component: () => import('@/views/select/accessoriesInfo'),
    hidden: true
  },
  {
    path: '/select/selectSupplierInfo',
    component: () => import('@/views/baseInfo/supplier/supplierInfo.vue'),
    hidden: true
  },
  {
    path: '/select/selectBasePaperInfo',
    component: () => import('@/views/baseInfo/paper/basePaperInfo'),
    hidden: true
  },

  {
    path: '/select/selectPaperInfo',
    component: () => import('@/views/select/paperInfo'),
    hidden: true
  },

  {
    path: '/select/selectOutsideProcessingInfo',
    component: () => import('@/views/baseInfo/outsideProcessingInfo'),
    hidden: true
  },

  {
    path: '/select/selectPrinterType',
    component: () => import('@/views/baseInfo/printerType'),
    hidden: true
  },

  {
    path: '/select/selectMachineInfo',
    component: () => import('@/views/baseInfo/machineInfo'),
    hidden: true
  },
  {
    path: '/select/selectStockRoom',
    component: () => import('@/views/baseInfo/stockRoomList/stockRoomList'),
    hidden: true
  },
  {
    path: '/select/selectMaterialStockRoom',
    component: () => import('@/views/select/materialStockList'),
    hidden: true
  },
  {
    path: '/select/selectdepartment',
    component: () => import('@/views/select/department'),
    hidden: true
  },
  {
    path: '/select/orderDetail',
    component: () => import('@/components/orderDetail/orderDetail'),
    meta: {title: '订单详情'},
    hidden: true
  },

  {
    path: '/select/clientList',
    component: () => import('@/views/doc/client/clientList'),
    hidden: true
  },
  {
    path: '/select/subjectInfo',
    component: () => import('@/views/baseInfo/subjectInfo'),
    hidden: true
  },
  /* erp调用地址结束 */
  {
    path: '/404',
    component: () => import('@/components/error-page/404'),
    hidden: true
  },
  {
    path: '/401',
    component: () => import('@/components/error-page/401'),
    hidden: true
  },
  {
    path: '/upload',
    component: () => import('@/views/uploadWeb'),
    hidden: true
  },
  {
    path: '/printbill',
    component: Layout,
    runKind: 0,
    children: [{
      path: 'printBillView',
      name: 'printBillView',
      component: () => import('@/views/printbill/printBillView'),
      hidden: true,
      meta: {title: '查看施工单版式'},
      runKind: 0
    }]
  },
]

/**
 * asyncRoutes
 * the routes that need to be dynamically loaded based on user roles
 */
// store.getters.addRouters
// const name  = store.getters.name
// console.log('name', name)
export const routerMap = {
  // 你需要动态引入的页面组件
  // {文件地址，hideen路由在菜单内是否隐藏，默认显示（false）}
  Layout: Layout,

  // 系统管理
  menu: {component: () => import('@/views/system/menu/menu.vue'), hidden: false},
  role: {component: () => import('@/views/system/role/role.vue'), hidden: false},
  user: {component: () => import('@/views/system/user/user.vue'), hidden: false},
  department: {component: () => import('@/views/system/department/department.vue'), hidden: false},
  dictType: {component: () => import('@/views/system/dict/type.vue'), hidden: false},
  dictData: {component: () => import('@/views/system/dict/data.vue'), hidden: true},
  config: {component: () => import('@/views/system/config/config.vue'), hidden: false},
  siteInfo: {component: () => import('@/views/system/config/siteInfo'), hidden: false},
  fileManagement: {component: () => import('@/views/system/file/fileManagement.vue'), hidden: false},
  operlog: {component: () => import('@/views/system/log/operlog.vue'), hidden: false},
  loadedScript: {component: () => import('@/views/system/loadedScript/loadedScript'), hidden: false},
  noticeMessage: {component: () => import('@/views/system/noticeMessage/noticeMessage'), hidden: false}, // 消息类型
  noticeMessageUser: {component: () => import('@/views/system/noticeMessage/noticeMessageUser'), hidden: true},// 订阅人员
  onlineUser: {component: () => import('@/views/system/onlineUser/onlineUser'), hidden: false},
  changePassword: {component: () => import('@/views/changePassword/list.vue'), hidden: false},
  purviewControler: {component: () => import('@/views/system/purviewControler/purviewControler.vue'), hidden: false},
  myTask: {component: () => import('@/views/system/myTask/myTask'), hidden: false}, // 我的任务
  notice: {component: () => import('@/views/system/notice/list.vue'), hidden: false}, // 公司公告

  // 基础档案管理
  printerType: {component: () => import('@/views/baseInfo/printerType'), hidden: false}, // 机型档案
  basePaperInfo: {component: () => import('@/views/baseInfo/paper/basePaperInfo'), hidden: false}, // 基础纸张档案
  paperType: {component: () => import('@/views/baseInfo/paper/paperType'), hidden: false}, // 纸张分类档案
  paperInfo: {component: () => import('@/views/baseInfo/paper/paperInfo'), hidden: false}, // 纸张档案
  clientInfo: {component: () => import('@/views/baseInfo/client/clientInfo'), hidden: false}, // 客户档案
  addClient: {component: () => import('@/views/baseInfo/client/createClient.vue'), hidden: true}, // 增加客户档案
  editClient: {component: () => import('@/views/baseInfo/client/editClient.vue'), hidden: true}, // 修改客户档案
  readClient: {component: () => import('@/views/baseInfo/client/readClient.vue'), hidden: true}, // 查看客户档案
  logisticsInfo: {component: () => import('@/views/baseInfo/logisticsInfo'), hidden: false}, // 物流档案
  supplierInfo: {component: () => import('@/views/baseInfo/supplier/supplierInfo'), hidden: false}, // 供应商档案
  depotInfo: {component: () => import('@/views/baseInfo/depot/depotInfo'), hidden: false}, // 库房档案
  depotLocationInfo: {component: () => import('@/views/baseInfo/depot/depotLocationInfo'), hidden: true}, // 库位档案
  outsideProcessingInfo: {component: () => import('@/views/baseInfo/outsideProcessingInfo'), hidden: false}, // 外加工档案
  subjectInfo: {component: () => import('@/views/baseInfo/subjectInfo'), hidden: false}, // 科目档案
  machineInfo: {component: () => import('@/views/baseInfo/machineInfo'), hidden: false}, // 机台档案
  personFileInfo: {component: () => import('@/views/baseInfo/personFileInfo'), hidden: false}, // 人员档案
  cupPlateTemplateInfo: {component: () => import('@/views/baseInfo/personFileInfo'), hidden: false}, // 拼版模板档案
  accessoriesInfo: {component: () => import('@/views/baseInfo/accessories/accessoriesInfo'), hidden: false}, // 辅料档案
  accessoriesType: {component: () => import('@/views/baseInfo/accessories/accessoriesType'), hidden: false}, // 辅料分类档案
  BusinessScriptList: {component: () => import('@/views/baseInfo/businessScript/businessScriptList'), hidden: false}, // 业务脚本
  scriptCode: {component: () => import('@/views/baseInfo/businessScript/scriptCode.vue'), hidden: true}, // 业务脚本内容
  formatInfo: {component: () => import('@/views/baseInfo/formatInfo/formatInfo.vue'), hidden: false}, // 版式定义管理
  companyInfoList: {component: () => import('@/views/baseInfo/companyInfoList/companyInfoList.vue'), hidden: false}, // 分厂信息列表
  stockRoomList: {component: () => import('@/views/baseInfo/stockRoomList/stockRoomList.vue'), hidden: false}, // 分厂信息列表
  defineList: {component: () => import('@/views/baseInfo/defineList/defineList.vue'), hidden: false}, // 单据定义列表
  defineData: {component: () => import('@/views/baseInfo/defineList/defineData.vue'), hidden: true}, // 单据步骤流程列表
  paperCutInfoList: {component: () => import('@/views/baseInfo/paperCutInfoList/paperCutInfoList.vue'), hidden: false}, // 纸张开数档案列表
  inquireMainInfo: {component: () => import('@/views/baseInfo/inquireMainInfo/inquireMainInfo.vue'), hidden: false}, // 查询统计列表
  workTeam: {component: () => import('@/views/baseInfo/workTeam/workTeam.vue'), hidden: false}, // 班组列表
  workTeamPerson: {component: () => import('@/views/baseInfo/workTeam/workTeamPerson.vue'), hidden: true}, // 班组列表
  plateSizeTemplate: {component: () => import('@/views/baseInfo/plateSizeTemplate/plateSizeTemplate'), hidden: false}, // 版芯档案
  plateTitle: {component: () => import('@/views/baseInfo/plateSizeTemplate/plateTitle'), hidden: false}, // 版式标题
  originFactories: {component: () => import('@/views/baseInfo/originFactories/list.vue'), hidden: false}, // 外协厂档案
  craftInfoList: {component: () => import('@/views/baseInfo/craftInfoList/list.vue'), hidden: false}, // 工艺档案（外协厂）
  Guarantor: {component: () => import('@/views/baseInfo/guarantor'), hidden: false}, // 担保人档案
  paperBrand: {component: () => import('@/views/baseInfo/paperBrand/paperBrand.vue'), hidden: false}, // 纸张品牌档案
  paperQuote: {component: () => import('@/views/baseInfo/paperQuote/paperQuote.vue'), hidden: false}, // 纸张报价档案
  remoteOrder: {component: () => import('@/views/baseInfo/remoteOrder/remoteOrder.vue'), hidden: false}, // 对接订单网站

  // 产品档案
  productInfo: {component: () => import('@/views/productFile/product/productInfo'), hidden: false}, // 产品档案
  spec: {component: () => import('@/views/productFile/product/spec'), hidden: true}, // 查看产品属性
  priceScript: {component: () => import('@/views/productFile/product/scriptCode.vue'), hidden: true}, // 脚本报价
  priceScriptItem: {component: () => import('@/views/productFile/product/scriptItem.vue'), hidden: true}, // 报价参数
  productDetile: {component: () => import('@/views/productFile/product/productDetile.vue'), hidden: true}, // 查看产品详情
  productImgList: {component: () => import('@/views/productFile/product/imgList.vue'), hidden: true}, // 产品图片列表
  productType: {component: () => import('@/views/productFile/productType'), hidden: false}, // 产品分类档案
  productParameter: {component: () => import('@/views/productFile/productParameter'), hidden: false}, // 产品参数档案
  partInfo: {component: () => import('@/views/productFile/part/partInfo'), hidden: true}, // 部件档案
  partParameterInfo: {component: () => import('@/views/productFile/part/partParameterInfo'), hidden: true}, // 部件参数档案
  partParameterChild: {component: () => import('@/views/productFile/part/partParameterChild'), hidden: true}, // 部件参数List
  partWorkProcessInfo: {component: () => import('@/views/productFile/part/partWorkProcessInfo'), hidden: true}, // 部件工序档案
  workProcessInfo: {component: () => import('@/views/productFile/workProcessInfo'), hidden: false}, // 工序档案
  category: {component: () => import('@/views/productFile/sku/category.vue'), hidden: false}, // sku类目档案
  categorySpec: {component: () => import('@/views/productFile/sku/categorySpec.vue'), hidden: true}, // sku类目属性档案
  categorySpecValue: {component: () => import('@/views/productFile/sku/categorySpecValue.vue'), hidden: true}, // sku类目属性值
  pagePrice: {component: () => import('@/views/productFile/pagePrice/pagePrice'), hidden: false}, // P数计价规则

  // 订单
  orderList: {component: () => import('@/views/order/orderList/orderList.vue'), hidden: false}, // 订单列表
  CreateOrder: {component: () => import('@/views/order/orderList/createOrder.vue'), hidden: true}, // 增加订单
  EditOrder: {component: () => import('@/views/order/orderList/editOrder.vue'), hidden: true}, // 修改订单
  TobeEdited: {component: () => import('@/views/order/tobeEdited.vue'), hidden: false}, // 待编辑订单
  DepositAudit: {component: () => import('@/views/order/depositAudit.vue'), hidden: false}, // 定金审核
  TobeReviewed: {component: () => import('@/views/order/tobeReviewed.vue'), hidden: false}, // 待审核订单
  TobeAssembled: {component: () => import('@/views/order/tobeAssembled.vue'), hidden: false}, // 待组版订单
  orderSchedule: {component: () => import('@/views/order/orderSchedule.vue'), hidden: false}, // 订单进度
  tobeShipped: {component: () => import('@/views/order/tobeShipped.vue'), hidden: false}, // 待发货
  toVoidOrder: {component: () => import('@/views/order/toVoidOrder.vue'), hidden: false}, // 作废订单
  lockingOderList: {component: () => import('@/views/order/lockingOderList.vue'), hidden: false}, // 网站待对接订单
  clientPayBillList: {component: () => import('@/views/order/clientPayBillList.vue'), hidden: false}, // 客户预存查询
  saleManReportList: {component: () => import('@/views/order/saleManReportList.vue'), hidden: false}, // 业务员报表
  cupDraw: {component: () => import('@/views/order/orderList/cupDraw.vue'), hidden: false}, // 微信小程序设计文件下载

  // 客户管理
  clientList: {component: () => import('@/views/doc/client/clientList.vue'), hidden: false}, // 客户列表
  // addClient:{component: ()=>import('@/views/baseInfo/client/createClient.vue'),hidden:true},//增加客户档案
  // editClient:{component: ()=>import('@/views/baseInfo/client/editClient.vue'),hidden:true},//修改客户档案
  createCustomer: {component: () => import('@/views/doc/client/createCustomer.vue'), hidden: true}, // 增加客户
  editCustomer: {component: () => import('@/views/doc/client/editCustomer.vue'), hidden: true}, // 编辑客户
  industry: {component: () => import('@/views/doc/industryInfo/industryInfoList.vue'), hidden: false}, // 行业列表
  shipArea: {component: () => import('@/views/doc/shipArea/shipAreaList.vue'), hidden: false}, // 区域档案
  level: {component: () => import('@/views/doc/level/levelList.vue'), hidden: false}, // 客户等级列表
  payMode: {component: () => import('@/views/doc/payMode/payModeList.vue'), hidden: false}, // 客户付款方式
  shipMode: {component: () => import('@/views/doc/shipMode/shipModeList.vue'), hidden: false}, // 客户发货方式
  logistics: {component: () => import('@/views/doc/logistics/logisticsList.vue'), hidden: false}, // 物流档案
  // 外协厂业务模块
  queryCraftBill: {component: () => import('@/views/outsideFactory/queryCraftBill/list.vue'), hidden: false}, // 外加工单列表
  processTos: {component: () => import('@/views/outsideFactory/processTos/list.vue'), hidden: false}, // 工序排产
  processFeedback: {component: () => import('@/views/outsideFactory/processFeedback/list.vue'), hidden: false}, // 反馈工序
  feedbackGroupList: {component: () => import('@/views/outsideFactory/feedbackGroupList/list.vue'), hidden: false}, // 反馈组
  convertRemote: {component: () => import('@/views/outsideFactory/convertRemote/list.vue'), hidden: false}, // 对接外协单
  // 施工单模块
  editionList: {component: () => import('@/views/printbill/editionList.vue'), hidden: false},//专版主板
  printBillList: {component: () => import('@/views/printbill/list.vue'), hidden: false}, // 施工单列表
  listSearch: {component: () => import('@/views/printbill/listSearch.vue'), hidden: true},// 查询施工单
  createPrintBill: {component: () => import('@/views/printbill/create.vue'), hidden: true},// 增加施工单
  editPrintBill: {component: () => import('@/views/printbill/edit.vue'), hidden: true}, // 编辑施工单
  printBillView: {component: () => import('@/views/printbill/printBillView.vue'), hidden: true}, // 查看施工单版式
  breedTasks: {component: () => import('@/views/printbill/breedTasks/breedTasks.vue'), hidden: false}, // 调度排产
  preOut: {component: () => import('@/views/printbill/preOut/list.vue'), hidden: false}, // 预出库
  collarPaper: {component: () => import('@/views/printbill/collarPaper/collarPaper.vue'), hidden: false}, // 施工单版领纸
  collarStock: {component: () => import('@/views/printbill/collarPaper/collarStock.vue'), hidden: false}, // 辅料领料
  printbillSchedule: {component: () => import('@/views/printbill/printbillSchedule/printbillSchedule'), hidden: false}, // 施工单进度查询
  queryPreOut: {component: () => import('@/views/printbill/queryPreOut/queryPreOut.vue'), hidden: false}, // 预出库查询
  queryPreOutStock: {component: () => import('@/views/printbill/processPreOut/listBack.vue'), hidden: false}, // 辅料预出库查询
  materialListForProOut: {
    component: () => import('@/views/printbill/materialList/materialListForProOut.vue'),
    hidden: false
  }, // 物料订单列表

  // 外协单模块
  outsidebillList: {component: () => import('@/views/outsidebill/list.vue'), hidden: false}, //外协单列表
  outsidebillListWholeorder: {component: () => import('@/views/outsidebill/listWholeorder.vue'), hidden: false}, //外协单列表-整单
  outSourceList: {component: () => import('@/views/outsidebill/outSourceList.vue'), hidden: false}, //外协单列表
  outSourceListWholeorder: {component: () => import('@/views/outsidebill/outSourceListWholeorder.vue'), hidden: false}, //外协单列表-整单
  processPreOut: {component: () => import('@/views/printbill/processPreOut/list.vue'), hidden: false}, // 辅料预出库
  outSourceQueryList: {component: () => import('@/views/outsidebill/querylist.vue'), hidden: false}, //工厂外协单查询

  // 生产反馈
  feedbackList: {component: () => import('@/views/feedBack/list.vue'), hidden: false}, // 拼版反馈
  platemakingList: {component: () => import('@/views/feedBack/platemakingList.vue'), hidden: false}, // 制版反馈
  trimmingList: {component: () => import('@/views/feedBack/trimmingList.vue'), hidden: false}, // 白料裁切反馈
  printingList: {component: () => import('@/views/feedBack/printingList.vue'), hidden: false}, // 印刷反馈
  goodsinglist: {component: () => import('@/views/feedBack/goodsinglist.vue'), hidden: false}, // 订单反馈
  semiList: {component: () => import('@/views/feedBack/semiList.vue'), hidden: false}, // 半成品反馈

  // 发货管理
  toStockOrderList: {component: () => import('@/views/delivery/ToStockOrderList.vue'), hidden: false}, // 包数录入
  stockItemList: {component: () => import('@/views/delivery/StockItemList.vue'), hidden: false}, // 成品入库
  toTransferItemList: {component: () => import('@/views/delivery/ToTransferItemList.vue'), hidden: false}, // 手动发货
  deliverFeedback: {component: () => import('@/views/delivery/DeliverFeedback.vue'), hidden: false}, // 发货反馈
  sendBillList: {component: () => import('@/views/delivery/SendBillList.vue'), hidden: false}, // 发货单查询

  // 应收管理
  orderCollection: {component: () => import('@/views/orderCharge/orderCollection'), hidden: false}, // 订单收款
  collectionRecords: {component: () => import('@/views/orderCharge/collectionRecords'), hidden: false}, // 收款记录
  depositEntry: {component: () => import('@/views/orderCharge/depositEntry'), hidden: false}, // 定金入账
  clientMoney: {component: () => import('@/views/orderCharge/clientMoney'), hidden: false}, // 客户预存
  prestoreOffset: {component: () => import('@/views/orderCharge/prestoreOffset'), hidden: false}, // 预存冲抵
  sendBillReview: {component: () => import('@/views/delivery/SendBillReview'), hidden: false}, // 发货单审核
  logisticsCollection: {component: () => import('@/views/orderCharge/logisticsCollection'), hidden: false}, // 物流代收
  orderTradeBill: {component: () => import('@/views/orderCharge/orderTradeBill.vue'), hidden: false}, // 订单入账流水
  // 进销存
  paperInventory: {component: () => import('@/views/stock/paperInventory'), hidden: false}, // 纸张库存档案
  paperInventoryInRoom: {component: () => import('@/views/stock/paperInventoryInRoom'), hidden: false}, // 纸张在库查询
  tradeBillList: {component: () => import('@/views/stock/tradeBillList'), hidden: true}, // 纸张库存账表流水
  CheckStockPaper: {component: () => import('@/views/stock/checkStockPaper'), hidden: false}, // 纸张库存盘点
  paperWarehousingBill: {component: () => import('@/views/stock/paperWarehousingBill'), hidden: false}, // 纸张入库明细
  paperExwarehouseBill: {component: () => import('@/views/stock/paperExwarehouseBill'), hidden: false}, // 纸张出库明细
  accessoriesInventory: {component: () => import('@/views/stock/accessoriesInventory'), hidden: false}, // 辅料库存档案
  accessoriesInventoryInRoom: {component: () => import('@/views/stock/accessoriesInventoryInRoom'), hidden: false}, // 辅料在库查询
  adjustStockTradeBill: {component: () => import('@/views/stock/adjustStockTradeBill'), hidden: false}, // 库存账调整
  materialBill: { component: () => import('@/views/stock/bill/materialBill'), hidden: false }, // 辅料领料单-web
  // 测试
  test: {component: () => import('@/views/test/test.vue'), hidden: false},
  // 投诉
  complaintRegister: {component: () => import('@/views/complaint/complaintRegister'), hidden: false}, // 投诉登记
  customerPage: {component: () => import('@/views/complaint/customerPage'), hidden: false}, // 客服工作台
  complaintSurvey: {component: () => import('@/views/complaint/complaintSurvey'), hidden: false}, // 调查反馈
  complaintStatement: {component: () => import('@/views/complaint/complaintStatement'), hidden: false}, // 登记人结单
  complaintReview: {component: () => import('@/views/complaint/complaintReview'), hidden: false}, // 行政工作台
  reviewerList: {component: () => import('@/views/complaint/reviewerList'), hidden: false},
  relateManCountPage: {component: () => import('@/views/complaint/relateManCountPage'), hidden: false}, // 人员统计
  complaintBillList: {component: () => import('@/views/complaint/complaintBillList'), hidden: false}, // 投诉综合查询
  // 应付管理
  auditOfStock: {component: () => import('@/views/payable/auditOfStock'), hidden: false}, // 入库单审核

  // 财务管理
  accountBalance: {component: () => import('@/views/financial/accountBalance'), hidden: false}, // 科目余额
  transactionDetails: {component: () => import('@/views/financial/transactionDetails'), hidden: true}, // 科目账表流水
  accountClosedData: {component: () => import('@/views/financial/accountClosedData'), hidden: false}, // 收支汇总
  guarantorReview: {component: () => import('@/views/financial/guarantorReview'), hidden: false}, // 担保人审核
  subscription: {component: () => import('@/views/financial/subscription'), hidden: false}, // 担保认款审核
  unionPay: {component: () => import('@/views/financial/unionPay'), hidden: false}, // 银联支付配置

  // 专版修图
  DispatchOrder: {component: () => import('@/views/specialEdition/dispatchOrder'), hidden: false}, // 订单分配
  FileHandle: {component: () => import('@/views/specialEdition/fileHandle'), hidden: false}, // 订单文件处理
  ProcessStatistics: {component: () => import('@/views/specialEdition/processStatistics'), hidden: false}, // 专版处理汇总

  // 开票管理
  invoiceOrderList: {component: () => import('@/views/invoice/invoiceOrderList'), hidden: false}, // 开票申请
  invoiceBillReview: {component: () => import('@/views/invoice/invoiceBillReview'), hidden: false}, // 开票申请审核

  // 查询统计
  ExecInquireResult: {component: () => import('@/views/doc/inquire/ExecInquireResult.vue'), hidden: false}, // 查询统计执行结果
  machineBurdenInfos: {component: () => import('@/views/doc/inquire/MachineBurdenInfos.vue'), hidden: false}, // 机台负荷
  sendWarning: {component: () => import('@/views/invoice/sendWarning.vue'), hidden: false}, // 发货预警
  chartSummary: {component: () => import('@/views/dashboard/indexVital.vue'), hidden: false}, // 产值图表汇总

  // 专版拼版任务
  ExclusiveSpliceDispatch: {component: () => import('@/views/exclusiveSplice/dispatchOrder.vue'), hidden: false}, // 获取待分配的拼版任务
  ExclusiveSpliceProcess: {component: () => import('@/views/exclusiveSplice/fileHandle.vue'), hidden: false} // 处理拼版任务
}

const createRouter = () => new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({y: 0}),
  routes: constantRoutes
})

const router = createRouter()

// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router
