import Login from './views/Login.vue'
import NotFound from './views/404.vue'
import Home from './views/Home.vue'

// 资产
import assets from './views/assets/assets.vue'
import assetsDetail from './views/assets/assetsDetail.vue'
import assetsRegister from './views/assets/assetsRegister.vue'
import assetsEdit from './views/assets/assetsEdit.vue'
import assetsNumber from './views/assets/assetsNumber.vue'
import assetsHandle from './views/assets/assetsHandle.vue'
import assetsOperation from './views/assets/assetsOperation.vue'
import assetsMaintain from './views/assets/assetsMaintain.vue'

// 数据
import data from './views/data/data.vue'

// 我的
import my from './views/my/my.vue'
import myMessage from './views/my/myMessage.vue'
import myAssets from './views/my/myAssets.vue'
import myScore from './views/my/myScore.vue'
import myScoreDetail from './views/my/myScoreDetail.vue'
import myAddress from './views/my/myAddress.vue'
import mySuggest from './views/my/mySuggest.vue'
import myGrade from './views/my/myGrade.vue'
import myInstitution from './views/my/myInstitution.vue'
import myInsDetail from './views/my/myInsDetail.vue'


let routes = [
    {
        path: '/login',
        component: Login,
        name: '',
        hidden: true
    },
    // 资产
    {
        path: '/',
        component: Home,
        name: '',
        leaf: true,//只有一个节点
        children: [
            { path: '/assets', component: assets, name: '资产', meta: {keepAlive: true, parentPath:'/tab_assets'} },
            { path: '/detail/:id', component: assetsDetail, name: '资产详情', meta: {keepAlive: true, parentPath:'/tab_assets'} },
            { path: '/assetsRegister', component: assetsRegister, name: '登记资产', meta: {keepAlive: true, parentPath:'/tab_assets'} },
            { path: '/assetsEdit/:id/', component: assetsEdit, name: '资产编辑', meta: {keepAlive: true, parentPath:'/tab_assets'} },
            { path: '/assetsNumber/:id/:divisionCode/:suffixCode', component: assetsNumber, name: '资产编号', meta: {keepAlive: true, parentPath:'/tab_assets'} },
            { path: '/assetsHandle/:id', component: assetsHandle, name: '处置资产', meta: {keepAlive: true, parentPath:'/tab_assets'} },
            { path: '/assetsMaintain/:id', component: assetsMaintain, name: '维护资产', meta: {keepAlive: true, parentPath:'/tab_assets'} },
            { path: '/assetsOperation/:id', component: assetsOperation, name: '操作记录', meta: {keepAlive: true, parentPath:'/tab_assets'} },
        ]
    },
    // 数据
    {
        path: '/',
        component: Home,
        name: '',
        leaf: true,//只有一个节点
        children: [
            { path: '/data', component: data, name: '数据', meta: {keepAlive: true, parentPath:'/tab_data'} }
        ]
    },
    // 我的
    {
        path: '/',
        component: Home,
        name: '',
        leaf: true,//只有一个节点
        children: [
            { path: '/my', component: my, name: '我的', meta: {keepAlive: true, parentPath:'/tab_my'} },
            { path: '/myMessage', component: myMessage, name: '我的消息', meta: {keepAlive: true, parentPath:'/tab_my'} },
            { path: '/myAssets', component: myAssets, name: '我的资产', meta: {keepAlive: true, parentPath:'/tab_my'} },
            { path: '/myScore', component: myScore, name: '我的评分', meta: {keepAlive: true, parentPath:'/tab_my'} },
            { path: '/myScore/:uid/:time', component: myScoreDetail, name: '我的评分详情', meta: {keepAlive: true, parentPath:'/tab_my'} },
            { path: '/mySuggest', component: mySuggest, name: '我的建议', meta: {keepAlive: true, parentPath:'/tab_my'} },
            { path: '/myAddress', component: myAddress, name: '通讯录', meta: {keepAlive: true, parentPath:'/tab_my'} },
            { path: '/myGrade/:id/:name', component: myGrade, name: '打分页面', meta: {keepAlive: true, parentPath:'/tab_my'} },
            { path: '/myInstitution', component: myInstitution, name: '管理制度', meta: {keepAlive: true, parentPath:'/tab_my'} },
            { path: '/myInstitution/:id', component: myInsDetail, name: '管理制度详情', meta: {keepAlive: true, parentPath:'/tab_my'} },
        ]
    },
    {
        path: '/404',
        component: NotFound,
        name: '',
        hidden: true
    },
    {
        path: '*',
        hidden: true,
        redirect: { path: '/404' }
    }
];

export default routes;
