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 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'
import EsignPicture from '@/pages/applications/contractSign/esignPicture'


// 电子签章
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'

Vue.use(Router)

// 全局跳转路由方法
Router.prototype.pushPage = function (param, bool) {
debugger
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: '/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: '' },
},
{path: '/EsignPicture', component: EsignPicture, name: 'EsignPicture', meta: {keepAlive: false}},
{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}},

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