dataInventory.ts 6.2 KB
import type { RouteRecordRaw } from 'vue-router'

function Layout() {
  return import('@/layouts/index.vue')
}

const routes: RouteRecordRaw[] = [
  {
    path: '/data-inventory/classify-grade-manage',
    component: Layout,
    meta: {
      title: '分类分级管理',
      icon: 'sidebar-videos',
    },
    children: [
      {
        path: 'task-config',
        name: 'taskConfig',
        component: () => import('@/views/data_inventory/taskConfig.vue'),
        meta: {
          title: '分类分级任务',
          breadcrumb: false,
          cache: true
        },
      },
      {
        path: 'task-edit',
        name: 'taskEdit',
        component: () => import('@/views/data_inventory/taskEdit.vue'),
        meta: {
          title: '编辑-',
          sidebar: false,
          breadcrumb: false,
          cache: true,
          reuse: true,
          editPage: true,
          activeMenu: '/data-inventory/classify-grade-manage/task-config'
        },
        beforeEnter: (to, from) => {
          if (to.query.name) {
            to.meta.title = `编辑-${to.query.name}`;
          } else {
            to.meta.title = '分类分级任务-新增';
          }
        }
      },
      {
        path: 'task-detail',
        name: 'taskDetail',
        component: () => import('@/views/data_inventory/taskDetail.vue'),
        meta: {
          title: '结果-',
          sidebar: false,
          breadcrumb: false,
          cache: true,
          reuse: true,
          editPage: true,
          activeMenu: '/data-inventory/classify-grade-manage/task-config'
        },
        beforeEnter: (to, from) => {
          if (to.query.type == 'confirm') {
            to.meta.title = `${to.query.name}-结果确认`;
          } else {
            to.meta.title = `${to.query.name}-结果修改`;
          }
        }
      },
      {
        path: 'task-log',
        name: 'taskLog',
        component: () => import('@/views/data_inventory/taskLog.vue'),
        meta: {
          title: '分级分类日志',
          sidebar: false,
          breadcrumb: false,
          cache: true,
          reuse: true,
          editPage: true,
          activeMenu: '/data-inventory/classify-grade-manage/task-config'
        },
        beforeEnter: (to, from) => {
          // if (to.query.name) {
          //   to.meta.title = `编辑-${to.query.name}`;
          // }
        }
      },
      {
        path: 'template-config',
        name: 'templateConfig',
        component: () => import('@/views/data_inventory/templateConfig.vue'),
        meta: {
          title: '分类分级标准',
          breadcrumb: false,
          cache: true
        },
      },
      {
        path: 'data-label',
        name: 'dataLabel',
        component: () => import('@/views/data_inventory/dataLabel.vue'),
        meta: {
          title: '标签管理',
          breadcrumb: false,
          cache: true
        },
      },
      {
        path: 'classStandard-edit',
        name: 'classStandardEdit',
        component: () => import('@/views/data_inventory/classStandardEdit.vue'),
        meta: {
          title: '编辑-',
          sidebar: false,
          breadcrumb: false,
          cache: true,
          reuse: true,
          editPage: true,
          activeMenu: '/data-inventory/classify-grade-manage/template-config'
        },
        beforeEnter: (to, from) => {
          if (to.query.classStandardName) {
        to.meta.title = `编辑-${to.query.classStandardName}`;
          }
        }
      },
      {
        path: 'newCreate-template',
        name: 'newCreateTemplate',
        component: () => import('@/views/data_inventory/newCreateTemplate.vue'),
        meta: {
          title: '新增-',
          sidebar: false,
          breadcrumb: false,
          cache: true,
          reuse: true,
          editPage: true,
          activeMenu: '/data-inventory/classify-grade-manage/template-config'
        },
        beforeEnter: (to, from) => {
          if (to.query.classStandardName) {
            to.meta.title = `新增-${to.query.classStandardName}`;
          }
        }
      },
      {
        path: 'newCreate-class',
        name: 'newCreateClass',
        component: () => import('@/views/data_inventory/newCreateClass.vue'),
        meta: {
          title: '新增分类',
          sidebar: false,
          breadcrumb: false,
          cache: true,
          reuse: true,
          editPage: true,
          activeMenu: '/data-inventory/classify-grade-manage/template-config'
        },
      },
      {
        path: 'classifyGrad-edit',
        name: 'classifyGradEdit',
        component: () => import('@/views/data_inventory/classifyGradEdit.vue'),
        meta: {
          title: '编辑-',
          sidebar: false,
          breadcrumb: false,
          cache: true,
          reuse: true,
          editPage: true,
          activeMenu: '/data-inventory/classify-grade-manage/template-config'
        },
        beforeEnter: (to, from) => {
          if (to.query.classClassifyGradName) {
            to.meta.title = `编辑-${to.query.classClassifyGradName}`;
          }
        }
      },
      {
        path: 'classificationTemplate-edit',
        name: 'classificationTemplateEdit',
        component: () => import('@/views/data_inventory/classificationTemplateEdit.vue'),
        meta: {
          title: '编辑-',
          sidebar: false,
          breadcrumb: false,
          cache: true,
          reuse: true,
          editPage: true,
          activeMenu: '/data-inventory/classify-grade-manage/template-config'
        },
        beforeEnter: (to, from) => {
          if (to.query.classClassifyGradName) {
            to.meta.title = `编辑-${to.query.classClassifyGradName}`;
          }
        }
      },

    ],
  },
  {
    path: '/data-inventory/classify-grade-catalogue',
    component: Layout,
    meta: {
      title: '分类分级目录',
      icon: 'sidebar-videos',
    },
    children: [
      {
        path: '',
        name: 'classifyGradeCatalogue',
        component: () => import('@/views/data_inventory/classifyGradeCatalogue.vue'),
        meta: {
          title: '分类分级目录',
          sidebar: false,
          breadcrumb: false,
          cache: true
        },
      },
    ],
  }
]

export default routes