Browse Source

修正 breadcrumb route VIEW路徑

maa3520 2 years ago
parent
commit
1c759e06bb

+ 1 - 16
resources/js/src/navigation/vertical/index.js

@@ -9,22 +9,7 @@ export default [{
     {
         title: '活動抽獎系統',
         icon: 'AwardIcon',
-        children: [{
-                title: '報到系統',
-                route: 'checkin',
-                icon: 'CheckSquareIcon',
-            },
-            {
-                title: '抽獎',
-                route: 'draw',
-                icon: 'UploadIcon',
-            },
-            {
-                title: '活動列表',
-                route: 'activityList',
-                icon: 'ActivityIcon',
-            }
-        ]
+        route: 'activityList',
     },
     {
         header: '管理功能',

+ 33 - 12
resources/js/src/router/config.js

@@ -22,7 +22,7 @@ export const settings = {
         {
             path: '/activityList',
             name: 'activityList',
-            component: () => import('@/views/Activities/ActivityList.vue'),
+            component: () => import('@/views/lottery/Activities/ActivityList.vue'),
             meta: {
                 pageTitle: '活動列表',
                 breadcrumb: [{
@@ -35,7 +35,7 @@ export const settings = {
         {
             path: '/activityPage/:activity_id',
             name: 'activityPage',
-            component: () => import('@/views/Activities/ActivityPage.vue'),
+            component: () => import('@/views/lottery/Activities/ActivityPage.vue'),
             meta: {
                 pageTitle: '活動功能頁面',
                 breadcrumb: [{
@@ -53,7 +53,7 @@ export const settings = {
         {
             path: '/activityStore',
             name: 'activityStore',
-            component: () => import('@/views/Activities/ActivityStore.vue'),
+            component: () => import('@/views/lottery/Activities/ActivityStore.vue'),
             meta: {
                 pageTitle: '新增活動',
                 breadcrumb: [{
@@ -71,13 +71,17 @@ export const settings = {
         {
             path: '/activityUpdate/:activity_id',
             name: 'activityUpdate',
-            component: () => import('@/views/Activities/ActivityUpdate.vue'),
+            component: () => import('@/views/lottery/Activities/ActivityUpdate.vue'),
             meta: {
                 pageTitle: '編輯活動資訊',
                 breadcrumb: [{
                         text: '活動列表',
                         to: '/activityList'
                     },
+                    {
+                        text: '活動功能頁面',
+                        to: '/activityPage'
+                    },
                     {
                         text: '編輯活動資訊',
                         active: true,
@@ -89,7 +93,7 @@ export const settings = {
         {
             path: '/claim/:activity_id',
             name: 'claim',
-            component: () => import('@/views/PrizeClaim.vue'),
+            component: () => import('@/views/lottery/PrizeClaim.vue'),
             meta: {
                 pageTitle: '兌獎',
                 breadcrumb: [{
@@ -153,13 +157,21 @@ export const settings = {
         {
             path: '/draw/:activity_id',
             name: 'draw',
-            component: () => import('@/views/Draw.vue'),
+            component: () => import('@/views/lottery/Draw.vue'),
             meta: {
                 pageTitle: 'Draw',
                 breadcrumb: [{
-                    text: '抽獎',
-                    active: true,
-                }, ],
+                        text: '活動列表',
+                        to: '/activityList'
+                    },
+                    {
+                        text: '活動功能頁面',
+                        to: '/activityPage'
+                    }, {
+                        text: '抽獎',
+                        active: true,
+                    },
+                ],
             },
         },
         {
@@ -169,9 +181,18 @@ export const settings = {
             meta: {
                 pageTitle: '報到系統',
                 breadcrumb: [{
-                    text: '報到系統',
-                    active: true,
-                }, ],
+                        text: '活動列表',
+                        to: '/activityList'
+                    },
+                    {
+                        text: '活動功能頁面',
+                        to: '/activityPage'
+                    },
+                    {
+                        text: '報到系統',
+                        active: true,
+                    },
+                ],
                 requiresAuth: true,
 
             },

+ 5 - 0
resources/js/src/router/index.js

@@ -16,6 +16,10 @@ Vue.use(VueRouter)
 
 const router = new VueRouter(settings)
 router.beforeEach((to, from, next) => {
+    if(to.meta.breadcrumb && to.meta.breadcrumb[1] && to.meta.breadcrumb[1].to) {
+        to.meta.breadcrumb[1].to = `/activityPage/${to.params.activity_id}`
+    }
+    
     if (to.matched.some(record => record.meta.requiresAuth)) {
         if (!isUserLoggedIn()) {
             next({
@@ -46,4 +50,5 @@ router.afterEach(() => {
 })
 
 
+
 export default router

+ 0 - 0
resources/js/src/views/Activities/ActivityList.vue → resources/js/src/views/lottery/Activities/ActivityList.vue


+ 0 - 0
resources/js/src/views/Activities/ActivityPage.vue → resources/js/src/views/lottery/Activities/ActivityPage.vue


+ 0 - 0
resources/js/src/views/Activities/ActivityStore.vue → resources/js/src/views/lottery/Activities/ActivityStore.vue


+ 0 - 0
resources/js/src/views/Activities/ActivityUpdate.vue → resources/js/src/views/lottery/Activities/ActivityUpdate.vue


+ 1 - 1
resources/js/src/views/Draw.vue → resources/js/src/views/lottery/Draw.vue

@@ -47,7 +47,7 @@
 
       <b-modal ref="draw-animation" id="draw-animation" title="抽獎" centered no-stacking hide-footer>
         <br>
-        <div v-for="(item, index) in drawList" :class=counterId(index)>
+        <div :key="index" v-for="(item, index) in drawList" :class=counterId(index)>
           <i :datafinal=item.department>部門</i>
           <div :datafinal=item.userId>
             <i>0</i>

+ 0 - 0
resources/js/src/views/PrizeClaim.vue → resources/js/src/views/lottery/PrizeClaim.vue