import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/pages/home'
import ModuleFunction from '@/pages/homeManager/module-function'
// test工具类
import HlsPopup from '@/pages/hlsPopup'
import EsignPicture from '@/pages/applications/utils/esignPicture'
{{#wfl}}
// 工作流
import WorkflowList from '@/pages/applications/workflow/workflow-list'
import WorkflowDetail from '@/pages/applications/workflow/workflow-detail'
{{/wfl}}

{{#bp}}
// 商业伙伴
import PartnerCreate from '@/pages/applications/partnerManager/partner-create'
import PartnerList from '@/pages/applications/partnerManager/partner-list'
import PartnerMainten from '@/pages/applications/partnerManager/partner-mainten'
import PartnerOrgMainten from '@/pages/applications/partnerManager/partner-org-mainten'
{{/bp}}


{{#project}}
// 融资试算
  import CalculationEnter from '@/pages/applications/financCalculate/calculationEnter'
  import CalculationMain from '@/pages/applications/financCalculate/calculationMain'
  import ResultMain from '@/pages/applications/financCalculate/resultMain'
  import ResultDetails from '@/pages/applications/financCalculate/resultDetails'

// 租赁申请
import PrjCreate from '@/pages/applications/projectManager/prjCreate'
import PrjMaintenList from '@/pages/applications/projectManager/PrjMaintenList'
import InfoMationMain from '@/pages/applications/projectManager/infoMationMain'
import PrjBpInfo from '@/pages/applications/projectManager/prjBpInfo'
import LeaseCarDetail from '@/pages/applications/projectManager/leaseCarDetail'
import PrjQuotionInfo from '@/pages/applications/projectManager/prjQuotionInfo'
import PrjAttachment from '@/pages/applications/projectManager/prjAttachment'
    {{/project}}

{{#contract}}
// 合同
import ContractMaintenList from '@/pages/applications/contractMainten/contract-mainten-list'
import ContractMainten from '@/pages/applications/contractMainten/contract-mainten'
import ContractSignList from '@/pages/applications/contractSign/contract-sign-list'
import ContractSign from '@/pages/applications/contractSign/contract-sign'


      {{/contract}}

{{#riskstrom}}
// 风报
import RiskHome from '@/pages/applications/riskStorm/riskHome'
import RiskSearch from '@/pages/applications/riskStorm/riskSearch'
import RiskSearchDetail from '@/pages/applications/riskStorm/riskSearchDetail'
import RiskDetailTab from '@/pages/applications/riskStorm/riskDetailTab'

        {{/riskstrom}}

{{#robot}}
// Robot
import Robot from '@/pages/applications/robot/robot'
          {{/robot}}

{{#esign}}
// E 签宝
import Esign from '@/pages/applications/esign/Esign'
import BankVerified from '@/pages/applications/esign/BankVerified'
import PersonAccount from '@/pages/applications/esign/PersonAccount'
import SignPdf from '@/pages/applications/esign/SignPdf'
import ViewPicture from '@/pages/applications/esign/ViewPicture'
            {{/esign}}

{{#report}}
// 报表
import Reports from '@/pages/applications/reports/reports'
import BasicChart from '@/pages/applications/reports/basicChart/basicChart'
import SeniorChart from '@/pages/applications/reports/seniorChart/seniorChart'
import AreaChart from '@/pages/applications/reports/basicChart/areaChart/areaChart'
import BreadChart from '@/pages/applications/reports/basicChart/breadChart/breadChart'
import ColumnChart from '@/pages/applications/reports/basicChart/columnChart/columnChart'
import CombinationChart from '@/pages/applications/reports/basicChart/combinationChart/combinationChart'
import LineChart from '@/pages/applications/reports/basicChart/lineChart/lineChart'
import NoodlesChart from '@/pages/applications/reports/basicChart/noodlesChart/noodlesChart'
import PointChart from '@/pages/applications/reports/basicChart/pointChart/pointChart'
import ArcGridChart from '@/pages/applications/reports/seniorChart/arcGridChart/arcGridChart'
import ClickLine from '@/pages/applications/reports/seniorChart/clickLine/clickLine'
import Guide from '@/pages/applications/reports/seniorChart/guide/guide'
import HeartRate from '@/pages/applications/reports/seniorChart/heartRate/heartRate'
import InteractionLegend from '@/pages/applications/reports/seniorChart/interactionLegend/interactionLegend'
import OtherChart from '@/pages/applications/reports/seniorChart/otherChart/otherChart'
import RadarChart from '@/pages/applications/reports/seniorChart/radarChart/radarChart'
import StatsCard from '@/pages/applications/reports/seniorChart/stasCard/stasCard'
import TitleTooltip from '@/pages/applications/reports/seniorChart/titleTooltip/titleTooltip'

{{/report}}


{{#qixin}}
// 启信宝
import QiXinBao from '@/pages/applications/qiXinBao/qiXinBao'
import QiXinSearch from '@/pages/applications/qiXinBao/qiXinSearch'
import QiXinDetail from '@/pages/applications/qiXinBao/qiXinDetail/qiXinDetail'
import CompanyDetail from '@/pages/applications/qiXinBao/qiXinDetail/companyInformation'
import industrialCommDetail from '@/pages/applications/qiXinBao/qiXinDetail/industrialCommDetail'
import changeRecord from '@/pages/applications/qiXinBao/qiXinDetail/changeRecord'
import investRelatDetail from '@/pages/applications/qiXinBao/qiXinDetail/investRelatDetail'
import annualReports from '@/pages/applications/qiXinBao/qiXinDetail/annualReports'
import annualReportsDetail from '@/pages/applications/qiXinBao/qiXinDetail/annualReportsDetail'
import courtDecisionDetail from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/courtDecisionDetail'
import executedPersonDetail from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/executedPersonDetail'
import openNoticeDetail from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/openNoticeDetail'
import openNoticeDetailArrow from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/openNoticeDetailArrow'
import courtNoticeDetail from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/courtNoticeDetail'
import courtNoticeDetailArrow from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/courtNoticeDetailArrow'
import loseInformation from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/loseInformation'
import loseInformationDetail from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/loseInformationDetail'
import chattelMortgage from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/chattelMortgage'
import chattelMortgageDetail from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/chattelMortgageDetail'
import taxesInformation from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/taxesInformation'
import judicialSale from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/judicialSale'
import equityPledged from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/equityPledged'
import equityPledgedDetail from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/equityPledgedDetail'
import managementAbnormal from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/managementAbnormal'
import administrativePunish from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/administrativePunish'
import administrativePunishDetail from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/administrativePunishDetail'
import checkInspect from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/checkInspect'
import equityFreeze from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/equityFreeze'
import equityFreezeDetail from '@/pages/applications/qiXinBao/qiXinDetail/riskInfo/equityFreezeDetail'

import trademarkInformation from '@/pages/applications/qiXinBao/qiXinDetail/knowledgeInfo/trademarkInformation'
import trademarkInformationDetail from '@/pages/applications/qiXinBao/qiXinDetail/knowledgeInfo/trademarkInformationDetail'
import patentInformation from '@/pages/applications/qiXinBao/qiXinDetail/knowledgeInfo/patentInformation'
import patentInformationDetail from '@/pages/applications/qiXinBao/qiXinDetail/knowledgeInfo/patentInformationDetail'
import copyright from '@/pages/applications/qiXinBao/qiXinDetail/knowledgeInfo/copyright'
import certificationInformation from '@/pages/applications/qiXinBao/qiXinDetail/knowledgeInfo/certificationInformation'

import financeInformation from '@/pages/applications/qiXinBao/qiXinDetail/businessInfo/financeInformation'
import newsSentiment from '@/pages/applications/qiXinBao/qiXinDetail/businessInfo/newsSentiment'
import bid from '@/pages/applications/qiXinBao/qiXinDetail/businessInfo/bid'
import recruitInformation from '@/pages/applications/qiXinBao/qiXinDetail/businessInfo/recruitmentInformation'
import internetInformation from '@/pages/applications/qiXinBao/qiXinDetail/businessInfo/internetInformation'
import administrativeLicense from '@/pages/applications/qiXinBao/qiXinDetail/businessInfo/administrativeLicense'
import administrativeLicenseDetail from '@/pages//applications/qiXinBao/qiXinDetail/businessInfo/administrativeLicenseDetail'
import growthProcess from '@/pages//applications/qiXinBao/qiXinDetail/businessInfo/growthProcess'

  {{/qixin}}

{{#ocr}}
// ocr
import OcrIdentify from '@/pages/applications/ocrIdentify/ocrIdentify'
import BusinessCard from '@/pages/applications/ocrIdentify/businessCard'
import BusinessLicenseInformaton from '@/pages/applications/ocrIdentify/businessLicenseInformation'
import DriverLicenseInformation from '@/pages/applications/ocrIdentify/driverLicenseInformation'
import IdCard from '@/pages/applications/ocrIdentify/idCard'
import VehicleCard from '@/pages/applications/ocrIdentify/vehicleCard'

  {{/ocr}}

Vue.use(Router)

// 全局跳转路由方法
Router.prototype.pushPage = function (param, bool) {
  let key = true
  if (bool === undefined) {
    key = true
  } else if (bool === true || bool === false) {
    key = bool
  }
  this.currentRoute.meta.nextReload = key
  this.push(param)
}

export default new Router({
  routes: [
    {
      path: '/',
      redirect: to => {
        return { name: 'Home' }
      },
    },
    { path: '/home', component: Home, name: 'Home', meta: { keepAlive: true, nextReload: true} },
    { path: '/ModuleFunction', component: ModuleFunction, name: 'ModuleFunction', meta: { keepAlive: true } },
    // test工具类
    { path: '/hls-popup', component: HlsPopup, name: 'HlsPopup', meta: { keepAlive: false, nextReload: '' } },
      {path: '/EsignPicture', component: EsignPicture, name: 'EsignPicture', meta: {keepAlive: false}},
    {{#wfl}}
    // 工作流
    {
      path: '/WorkflowList',
      component: WorkflowList,
      name: 'WorkflowList',
      meta: { keepAlive: true, nextReload: '' },
    },
    {
      path: '/WorkflowDetail',
      component: WorkflowDetail,
      name: 'WorkflowDetail',
      meta: { keepAlive: false, nextReload: '' },
    },
    {{/wfl}}

    {{#bp}}
    // 商业伙伴
    {
      path: '/PartnerCreate',
      component: PartnerCreate,
      name: 'PartnerCreate',
      meta: { keepAlive: true, nextReload: '' },
    },
    {
      path: '/PartnerList',
      component: PartnerList,
      name: 'PartnerList',
      meta: { keepAlive: false, nextReload: '' },
    },
    {
      path: '/PartnerMainten',
      component: PartnerMainten,
      name: 'PartnerMainten',
      meta: { keepAlive: false, nextReload: '' },
    },
    {
      path: '/PartnerOrgMainten',
      component: PartnerOrgMainten,
      name: 'PartnerOrgMainten',
      meta: { keepAlive: false, nextReload: '' },
    },
    {{/bp}}


      {{#project}}
    // 融资试算
    {path: '/CalculationEnter', component: CalculationEnter, name: 'CalculationEnter', meta: {keepAlive: false}},
    {path: '/calculationMain', component: CalculationMain, name: 'CalculationMain', meta: {keepAlive: false}},
    {path: '/resultMain', component: ResultMain, name: 'ResultMain', meta: {keepAlive: false}},
    {path: '/resultDetails', component: ResultDetails, name: 'ResultDetails', meta: {keepAlive: false}},

    // 租赁申请
    {path: '/PrjCreate', component: PrjCreate, name: 'PrjCreate', meta: {keepAlive: false}},
    {path: '/PrjMaintenList', component: PrjMaintenList, name: 'PrjMaintenList', meta: {keepAlive: false}},
    {path: '/InfoMationMain', component: InfoMationMain, name: 'InfoMationMain', meta: {keepAlive: false}},
    {path: '/PrjBpInfo', component: PrjBpInfo, name: 'PrjBpInfo', meta: {keepAlive: false}},
    {path: '/LeaseCarDetail', component: LeaseCarDetail, name: 'LeaseCarDetail', meta: {keepAlive: false}},
    {path: '/PrjQuotionInfo', component: PrjQuotionInfo, name: 'PrjQuotionInfo', meta: {keepAlive: false}},
    {path: '/PrjAttachment', component: PrjAttachment, name: 'PrjAttachment', meta: {keepAlive: false}},
        {{/project}}

          {{#contract}}
    // 合同维护与签约
    {
      path: '/ContractMaintenList',
      component: ContractMaintenList,
      name: 'ContractMaintenList',
      meta: { keepAlive: false, nextReload: '' },
    },
    {
      path: '/ContractMainten',
      component: ContractMainten,
      name: 'ContractMainten',
      meta: { keepAlive: false, nextReload: '' },
    },
    {
      path: '/ContractSignList',
      component: ContractSignList,
      name: 'ContractSignList',
      meta: { keepAlive: false, nextReload: '' },
    },
    {
      path: '/ContractSign',
      component: ContractSign,
      name: 'ContractSign',
      meta: { keepAlive: false, nextReload: '' },
    },

          {{/contract}}

            {{#robot}}
    // Robot
    {path: '/Robot', component: Robot, name: 'Robot', meta: {keepAlive: false}},
            {{/robot}}
                              {{#esign}}
     {path: '/Esign', component: Esign, name: 'Esign', meta: {keepAlive: false}},
     {path: '/BankVerified', component: BankVerified, name: 'BankVerified', meta: {keepAlive: true}},
     {path: '/PersonAccount', component: PersonAccount, name: 'PersonAccount', meta: {keepAlive: true}},
     {path: '/SignPdf', component: SignPdf, name: 'SignPdf', meta: {keepAlive: true}},
     {path: '/ViewPicture', component: ViewPicture, name: 'ViewPicture', meta: {keepAlive: true}},
              {{/esign}}
                              {{#riskstrom}}
    // 风报
    {path: '/RiskHome', component: RiskHome, name: 'RiskHome', meta: {keepAlive: true}},
    {path: '/RiskSearch', component: RiskSearch, name: 'RiskSearch', meta: {keepAlive: false}},
    {path: '/RiskSearchDetail', component: RiskSearchDetail, name: 'RiskSearchDetail', meta: {keepAlive: false}},
    {path: '/RiskDetailTab', component: RiskDetailTab, name: 'RiskDetailTab', meta: {keepAlive: false}},

                {{/riskstrom}}
                  {{#report}}
    // 报表
    {path: '/Reports', component: Reports, name: 'Reports', meta: {keepAlive: false}},
    {path: '/BasicChart', component: BasicChart, name: 'BasicChart', meta: {keepAlive: false}},
    {path: '/SeniorChart', component: SeniorChart, name: 'SeniorChart', meta: {keepAlive: false}},
    {path: '/AreaChart', component: AreaChart, name: 'AreaChart', meta: {keepAlive: false}},
    {path: '/BreadChart', component: BreadChart, name: 'BreadChart', meta: {keepAlive: false}},
    {path: '/ColumnChart', component: ColumnChart, name: 'ColumnChart', meta: {keepAlive: false}},
    {path: '/CombinationChart', component: CombinationChart, name: 'CombinationChart', meta: {keepAlive: false}},
    {path: '/LineChart', component: LineChart, name: 'LineChart', meta: {keepAlive: false}},
    {path: '/NoodlesChart', component: NoodlesChart, name: 'NoodlesChart', meta: {keepAlive: false}},
    {path: '/PointChart', component: PointChart, name: 'PointChart', meta: {keepAlive: false}},
    {path: '/ArcGridChart', component: ArcGridChart, name: 'ArcGridChart', meta: {keepAlive: false}},
    {path: '/ClickLine', component: ClickLine, name: 'ClickLine', meta: {keepAlive: false}},
    {path: '/Guide', component: Guide, name: 'Guide', meta: {keepAlive: false}},
    {path: '/HeartRate', component: HeartRate, name: 'HeartRate', meta: {keepAlive: false}},
    {path: '/InteractionLegend', component: InteractionLegend, name: 'InteractionLegend', meta: {keepAlive: false}},
    {path: '/OtherChart', component: OtherChart, name: 'OtherChart', meta: {keepAlive: false}},
    {path: '/RadarChart', component: RadarChart, name: 'RadarChart', meta: {keepAlive: false}},
    {path: '/StasCard', component: StatsCard, name: 'StatsCard', meta: {keepAlive: false}},
    {path: '/TitleTooltip', component: TitleTooltip, name: 'TitleTooltip', meta: {keepAlive: false}},
                  {{/report}}

                    {{#qixin}}
    // 启信宝
    {path: '/QiXinBao', component: QiXinBao, name: 'QiXinBao', meta: {keepAlive: false}},
    {path: '/qiXinSearsh', component: QiXinSearch, name: 'QiXinSearch', meta: {keepAlive: true}},
    {path: '/qiXinDetail', component: QiXinDetail, name: 'QiXinDetail', meta: {keepAlive: false}},
    {path: '/companyInformation', component: CompanyDetail, name: 'CompanyDetail', meta: {keepAlive: false}},
    {path: '/industrialCommDetail', component: industrialCommDetail, name: 'industrialCommDetail', meta: {keepAlive: false}},
    {path: '/changeRecord', component: changeRecord, name: 'changeRecord', meta: {keepAlive: false}},
    {path: '/investRelatDetail', component: investRelatDetail, name: 'investRelatDetail', meta: {keepAlive: false}},
    {path: '/annualReports', component: annualReports, name: 'annualReports', meta: {keepAlive: false}},
    {path: '/annualReportsDetail', component: annualReportsDetail, name: 'annualReportsDetail', meta: {keepAlive: false}},
    {path: '/courtDecisionDetail', component: courtDecisionDetail, name: 'courtDecisionDetail', meta: {keepAlive: false}},
    {path: '/executedPersonDetail', component: executedPersonDetail, name: 'executedPersonDetail', meta: {keepAlive: false}},
    {path: '/openNoticeDetail', component: openNoticeDetail, name: 'openNoticeDetail', meta: {keepAlive: false}},
    {path: '/openNoticeDetailArrow', component: openNoticeDetailArrow, name: 'openNoticeDetailArrow', meta: {keepAlive: false}},
    {path: '/courtNoticeDetail', component: courtNoticeDetail, name: 'courtNoticeDetail', meta: {keepAlive: false}},
    {path: '/courtNoticeDetailArrow', component: courtNoticeDetailArrow, name: 'courtNoticeDetailArrow', meta: {keepAlive: false}},
    {path: '/loseInformation', component: loseInformation, name: 'loseInformation', meta: {keepAlive: false}},
    {path: '/loseInformationDetail', component: loseInformationDetail, name: 'loseInformationDetail', meta: {keepAlive: false}},
    {path: '/chattelMortgage', component: chattelMortgage, name: 'chattelMortgage', meta: {keepAlive: false}},
    {path: '/chattelMortgageDetail', component: chattelMortgageDetail, name: 'chattelMortgageDetail', meta: {keepAlive: false}},
    {path: '/taxesInformation', component: taxesInformation, name: 'taxesInformation', meta: {keepAlive: false}},
    {path: '/judicialSale', component: judicialSale, name: 'judicialSale', meta: {keepAlive: false}},
    {path: '/equityPledged', component: equityPledged, name: 'equityPledged', meta: {keepAlive: false}},
    {path: '/equityPledgedDetail', component: equityPledgedDetail, name: 'equityPledgedDetail', meta: {keepAlive: false}},
    {path: '/managementAbnormal', component: managementAbnormal, name: 'managementAbnormal', meta: {keepAlive: false}},
    {path: '/administrativePunish', component: administrativePunish, name: 'administrativePunish', meta: {keepAlive: false}},
    {path: '/administrativePunishDetail', component: administrativePunishDetail, name: 'administrativePunishDetail', meta: {keepAlive: false}},
    {path: '/checkInspect', component: checkInspect, name: 'checkInspect', meta: {keepAlive: false}},
    {path: '/equityFreeze', component: equityFreeze, name: 'equityFreeze', meta: {keepAlive: false}},
    {path: '/equityFreezeDetail', component: equityFreezeDetail, name: 'equityFreezeDetail', meta: {keepAlive: false}},
    {path: '/trademarkInformation', component: trademarkInformation, name: 'trademarkInformation', meta: {keepAlive: false}},
    {path: '/trademarkInformationDetail', component: trademarkInformationDetail, name: 'trademarkInformationDetail', meta: {keepAlive: false}},
    {path: '/patentInformation', component: patentInformation, name: 'patentInformation', meta: {keepAlive: false}},
    {path: '/patentInformationDetail', component: patentInformationDetail, name: 'patentInformationDetail', meta: {keepAlive: false}},
    {path: '/copyright', component: copyright, name: 'copyright', meta: {keepAlive: false}},
    {path: '/certificationInformation', component: certificationInformation, name: 'certificationInformation', meta: {keepAlive: false}},
    {path: '/financeInformation', component: financeInformation, name: 'financeInformation', meta: {keepAlive: false}},
    {path: '/newsSentiment', component: newsSentiment, name: 'newsSentiment', meta: {keepAlive: false}},
    {path: '/bid', component: bid, name: 'bid', meta: {keepAlive: false}},
    {path: '/recruitInformation', component: recruitInformation, name: 'recruitInformation', meta: {keepAlive: false}},
    {path: '/internetInformation', component: internetInformation, name: 'internetInformation', meta: {keepAlive: false}},
    {path: '/administrativeLicense', component: administrativeLicense, name: 'administrativeLicense', meta: {keepAlive: false}},
    {path: '/administrativeLicenseDetail', component: administrativeLicenseDetail, name: 'administrativeLicenseDetail', meta: {keepAlive: false}},
    {path: '/growthProcess', component: growthProcess, name: 'growthProcess', meta: {keepAlive: false}},

                    {{/qixin}}
                      {{#ocr}}
    // ocr
    {path: '/OcrIdentify', component: OcrIdentify, name: 'OcrIdentify', meta: {keepAlive: false}},
    {path: '/businessCard', component: BusinessCard, name: 'BusinessCard', meta: {keepAlive: false}},
    {path: '/businessLicenseInformation', component: BusinessLicenseInformaton, name: 'BusinessLicenseInformaton', meta: {keepAlive: false}},
    {path: '/driverLicenseInformation', component: DriverLicenseInformation, name: 'DriverLicenseInformation', meta: {keepAlive: false}},
    {path: '/idCard', component: IdCard, name: 'IdCard', meta: {keepAlive: false}},
    {path: '/vehicleCard', component: VehicleCard, name: 'VehicleCard', meta: {keepAlive: false}},

                      {{/ocr}}
  ],
  scrollBehavior (to, from, savedPosition) {
    if (to.hash) {
      return {
        selector: to.hash,
      }
    }
  },
})
