Преглед на файлове

修改仓库信息路由

huangbin преди 4 години
родител
ревизия
4e36f86528
променени са 3 файла, в които са добавени 10 реда и са изтрити 22 реда
  1. 3 3
      src/router/index.ts
  2. 0 1
      src/views/information/goods/index.vue
  3. 7 18
      src/views/information/warehouse-info/index.vue

+ 3 - 3
src/router/index.ts

@@ -162,11 +162,11 @@ const routes: Array<RouteRecordRaw> = [
                 meta: {
                     requireAuth: true
                 },
-                redirect: to => { return { name: EnumType.WarehouseInfo.normal } },
+                redirect: to => { return { name: 'warehouse_info_normal' } },
                 children: [
                     {
                         path: '/warehouse_info/normal',
-                        name: EnumType.WarehouseInfo.normal,
+                        name: 'warehouse_info_normal',
                         component: () => import('@/views/information/warehouse-info/list/normal-use/index.vue'),
                         meta: {
                             requireAuth: true
@@ -174,7 +174,7 @@ const routes: Array<RouteRecordRaw> = [
                     },
                     {
                         path: '/warehouse_info/stop',
-                        name: EnumType.WarehouseInfo.stop,
+                        name: 'warehouse_info_disabled',
                         component: () => import('@/views/information/warehouse-info/list/stop-use/index.vue'),
                         meta: {
                             requireAuth: true

+ 0 - 1
src/views/information/goods/index.vue

@@ -23,7 +23,6 @@ export default defineComponent({
         const { list, selectMenu, getMenuList } = handleRouterMenu();
         initData(() => {
             getMenuList();
-            console.log('list', list);
         });
         return { list, selectMenu };
     },

+ 7 - 18
src/views/information/warehouse-info/index.vue

@@ -2,7 +2,7 @@
   <!-- 仓库信息 -->
   <div class="warehouse-info">
     <firstMenu :list="list"
-               :value="'value'"
+               :value="'title'"
                @selectMenu="selectMenu" />
     <router-view />
   </div>
@@ -11,31 +11,20 @@
 <script lang="ts">
 import { defineComponent } from 'vue';
 import firstMenu from '@/components/firstMenu/index.vue';
-import { useRouter } from 'vue-router';
-import { WarehouseInfo } from '@/enums/routerName';
+import { handleRouterMenu } from '@/setup/router/index';
 import { initData } from '@/setup/methods/index';
 
-// 处理菜单
-function handleMenu() {
-    const router = useRouter();
-    const list = [
-        { key: WarehouseInfo.normal, value: '正常' },
-        { key: WarehouseInfo.stop, value: '停用' },
-    ];
-    function selectMenu(item: any) {
-        router.push({ name: item.key });
-    }
-    return { list, selectMenu };
-}
-
 export default defineComponent({
     name: 'warehouse-info',
     components: {
         firstMenu,
     },
     setup() {
-        const { list, selectMenu } = handleMenu();
-        initData(() => {});
+        const { list, selectMenu, getMenuList } = handleRouterMenu();
+        initData(() => {
+            getMenuList();
+            console.log('list', list);
+        });
         return { list, selectMenu };
     },
 });