| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341 |
- import {createRouter, createWebHistory} from 'vue-router'
- /* Layout */
- import Layout from '@/layout'
- /**
- * Note: ルート設定項目
- *
- * hidden: true // true を設定すると、そのルートはサイドバーに表示されません。例:401、loginなどのページ、または編集ページ /edit/1
- * alwaysShow: true // 子ルートが1つ以上のとき、自動的にネストされたモードになります - 例えばコンポーネントページ
- * // 子ルートが1つのとき、その子ルートがルートとしてサイドバーに表示されます - 例えばガイドページ
- * // どのような場合でもルートを常に表示したい場合は、alwaysShow: true を設定できます。これにより、以前に定義されたルールが無視され、常にルートが表示されます
- * redirect: noRedirect // noRedirect を設定すると、そのルートはパンくずナビゲーションでクリックできません
- * name: 'router-name' // ルートの名前を設定します。必ず設定してください。そうでないと <keep-alive> を使用する際に様々な問題が発生します
- * query: '{"id": 1, "name": "ry"}' // ルートにアクセスする際のデフォルトのパラメータを設定します
- * roles: ['admin', 'common'] // ルートにアクセスできるロール権限を設定します
- * permissions: ['a:a:a', 'b:b:b'] // ルートにアクセスできるメニュー権限を設定します
- * meta : {
- noCache: true // true を設定すると、<keep-alive> によってキャッシュされません (デフォルトは false)
- title: 'title' // そのルートがサイドバーとパンくずナビゲーションで表示される名前を設定します
- icon: 'svg-name' // そのルートのアイコンを設定します。対応するパスは src/assets/icons/svg
- breadcrumb: false // false を設定すると、パンくずナビゲーションに表示されません
- activeMenu: '/system/user' // このプロパティを設定すると、対応するサイドバーがハイライトされます
- }
- */
- // 公共ルート
- export const constantRoutes = [
- {
- path: '/redirect',
- component: Layout,
- hidden: true,
- children: [
- {
- path: '/redirect/:path(.*)',
- component: () => import('@/views/redirect/index.vue')
- }
- ]
- },
- {
- path: '/login',
- component: () => import('@/views/login'),
- hidden: true
- },
- {
- path: "/:pathMatch(.*)*",
- component: () => import('@/views/error/404'),
- hidden: true
- },
- {
- path: '/401',
- component: () => import('@/views/error/401'),
- hidden: true
- },
- {
- path: '',
- component: Layout,
- redirect: '/index',
- children: [
- {
- path: '/index',
- component: () => import('@/views/index'),
- name: 'Index',
- meta: {title: 'FC管理システム', icon: 'dashboard', affix: true}
- }
- ]
- },
- {
- path: '/user',
- component: Layout,
- hidden: true,
- redirect: 'noredirect',
- children: [
- {
- path: 'profile',
- component: () => import('@/views/system/user/profile/index'),
- name: 'Profile',
- meta: {title: '個人センター', icon: 'user'}
- }
- ]
- },
- {
- path: '/fcbi',
- component: Layout,
- hidden: true,
- redirect: 'noredirect',
- children: [
- {
- path: 'order/detail/:orderId',
- component: () => import('@/views/fcbi/order/detail'),
- name: 'OrderDetail',
- meta: {title: '発注詳細', icon: 'user'}
- },
- {
- path: 'order/compilation/:orderId/:version',
- component: () => import('@/views/fcbi/order/compilation'),
- name: 'OrderCompilation',
- meta: {title: '指示書編集', icon: 'user'}
- },
- {
- path: 'order/instruction/:orderId/:version',
- component: () => import('@/views/fcbi/order/instruction'),
- name: 'OrderInstruction',
- meta: {title: '指示書参照', icon: 'user'}
- },
- {
- path: 'result/compilation/:resultId',
- component: () => import('@/views/fcbi/result/compilation'),
- name: 'ResultCompilation',
- meta: {title: '実績詳細', icon: 'user'}
- }
- ]
- },
- {
- path: '/surveyAdmin',
- component: Layout,
- hidden: true,
- redirect: 'noredirect',
- children: [
- {
- path: 'surveyDecision',
- component: () => import('@/views/fcbi/survey/decision'),
- name: 'SurveyDecision',
- meta: {title: 'アンケートフォーム確定', icon: 'user'}
- }
- ]
- },
- {
- path: '/surveyAdmin',
- component: Layout,
- hidden: true,
- redirect: 'noredirect',
- children: [
- {
- path: 'surveyDetail/:surveyId',
- component: () => import('@/views/fcbi/survey/detail'),
- name: 'surveyDetail',
- meta: {title: 'アンケート照会確定', icon: 'user'}
- }
- ]
- },
- {
- path: '/surveyAdmin',
- component: Layout,
- hidden: true,
- redirect: 'noredirect',
- children: [
- {
- path: 'surveyResults/:surveyCode',
- component: () => import('@/views/fcbi/survey/results'),
- name: 'surveyResults',
- meta: {title: 'アンケート回答集計結果', icon: 'user'}
- }
- ]
- },
- {
- path: '/surveyAdmin',
- component: Layout,
- hidden: true,
- redirect: 'noredirect',
- children: [
- {
- path: 'surveyForm',
- component: () => import('@/views/fcbi/survey/form'),
- name: 'surveyForm',
- meta: {title: 'アンケートフォーム作成', icon: 'user'}
- }
- ]
- },
- {
- path: '/surveyAdmin',
- component: Layout,
- hidden: true,
- redirect: 'noredirect',
- children: [
- {
- path: 'surveyAnswerDetails/:surveyId',
- component: () => import('@/views/fcbi/survey/answer'),
- name: 'surveyAnswerDetails',
- meta: {title: 'アンケート回答詳細', icon: 'user'}
- }
- ]
- },
- {
- path: '/salesAdmin',
- component: Layout,
- hidden: true,
- redirect: 'noredirect',
- children: [
- {
- path: 'salesSumResult',
- component: () => import('@/views/fcbi/sales/sumResult'),
- name: 'salesSumResult',
- meta: {title: '売上集計結果', icon: 'user'}
- }
- ]
- },
- {
- path: '/customerAdmin',
- component: Layout,
- hidden: true,
- redirect: 'noredirect',
- children: [
- {
- path: 'customerDetail/:customerId',
- component: () => import('@/views/fcbi/customer/detail'),
- name: 'customerDetail',
- meta: {title: '顧客詳細', icon: 'user'}
- }
- ]
- },
- {
- path: '/customerAdmin',
- component: Layout,
- hidden: true,
- redirect: 'noredirect',
- children: [
- {
- path: 'customerHistory/:customerId',
- component: () => import('@/views/fcbi/customer/history'),
- name: 'customerHistory',
- meta: {title: '顧客購入履歴', icon: 'user'}
- }
- ]
- },
- {
- path: '/fcMemberAdmin',
- component: Layout,
- hidden: true,
- redirect: 'noredirect',
- children: [
- {
- path: 'fcMember',
- component: () => import('@/views/fcbi/fcMember/list'),
- name: 'fcMember',
- meta: {title: '会員一覧', icon: 'user'}
- }
- ]
- },
- {
- path: '/fcMemberAdmin',
- component: Layout,
- hidden: true,
- redirect: 'noredirect',
- children: [
- {
- path: 'fcMemberEdit/:fcMemberId',
- component: () => import('@/views/fcbi/fcMember/edit'),
- name: 'fcMemberEdit',
- meta: {title: '会員情報編集', icon: 'user'}
- }
- ]
- },
- ]
- // ダイナミックルート、ユーザー権限に基づいて動的に読み込みます
- export const dynamicRoutes = [
- {
- path: '/system/user-auth',
- component: Layout,
- hidden: true,
- permissions: ['system:user:edit'],
- children: [
- {
- path: 'role/:userId(\\d+)',
- component: () => import('@/views/system/user/authRole'),
- name: 'AuthRole',
- meta: {title: '役割の割り当て', activeMenu: '/system/user'}
- }
- ]
- },
- {
- path: '/system/role-auth',
- component: Layout,
- hidden: true,
- permissions: ['system:role:edit'],
- children: [
- {
- path: 'user/:roleId(\\d+)',
- component: () => import('@/views/system/role/authUser'),
- name: 'AuthUser',
- meta: {title: 'ユーザーの割り当て', activeMenu: '/system/role'}
- }
- ]
- },
- {
- path: '/system/dict-data',
- component: Layout,
- hidden: true,
- permissions: ['system:dict:list'],
- children: [
- {
- path: 'index/:dictId(\\d+)',
- component: () => import('@/views/system/dict/data'),
- name: 'Data',
- meta: {title: '辞書データ', activeMenu: '/system/dict'}
- }
- ]
- },
- {
- path: '/monitor/job-log',
- component: Layout,
- hidden: true,
- permissions: ['monitor:job:list'],
- children: [
- {
- path: 'index/:jobId(\\d+)',
- component: () => import('@/views/monitor/job/log'),
- name: 'JobLog',
- meta: {title: 'ジョブログ', activeMenu: '/monitor/job'}
- }
- ]
- },
- {
- path: '/tool/gen-edit',
- component: Layout,
- hidden: true,
- permissions: ['tool:gen:edit'],
- children: [
- {
- path: 'index/:tableId(\\d+)',
- component: () => import('@/views/tool/gen/editTable'),
- name: 'GenEdit',
- meta: {title: '生成設定の編集', activeMenu: '/tool/gen'}
- }
- ]
- }
- ]
- const router = createRouter({
- history: createWebHistory(),
- routes: constantRoutes,
- scrollBehavior(to, from, savedPosition) {
- if (savedPosition) {
- return savedPosition
- }
- return {top: 0}
- },
- });
- export default router;
|