Bladeren bron

修改采购页面路由

huangbin 4 jaren geleden
bovenliggende
commit
a52f97f360
2 gewijzigde bestanden met toevoegingen van 8 en 20 verwijderingen
  1. 8 19
      src/views/business/purchase/index.vue
  2. 0 1
      src/views/information/warehouse-info/index.vue

+ 8 - 19
src/views/business/purchase/index.vue

@@ -2,7 +2,7 @@
   <!-- 采购 -->
   <div class="purchase">
     <firstMenu :list="list"
-               :value="'value'"
+               :value="'title'"
                @selectMenu="selectMenu" />
     <router-view />
   </div>
@@ -11,23 +11,8 @@
 <script lang="ts">
 import { defineComponent } from 'vue';
 import firstMenu from '@/components/firstMenu/index.vue';
-import { useRouter } from 'vue-router';
-import { Purchase } from '@/enums/routerName';
-
-// 处理菜单
-function handleMenu() {
-    const router = useRouter();
-    const list = [
-        { key: Purchase.realTime, value: '实时敞口' },
-        { key: Purchase.spot, value: '现货头寸' },
-        { key: Purchase.forward, value: '期货头寸' },
-        { key: Purchase.history, value: '历史敞口' },
-    ];
-    function selectMenu(item: any) {
-        router.push({ name: item.key });
-    }
-    return { list, selectMenu };
-}
+import { handleRouterMenu } from '@/setup/router/index';
+import { initData } from '@/setup/methods/index';
 
 export default defineComponent({
     name: 'purchase',
@@ -35,7 +20,11 @@ export default defineComponent({
         firstMenu,
     },
     setup() {
-        const { list, selectMenu } = handleMenu();
+        const { list, selectMenu, getMenuList } = handleRouterMenu();
+        initData(() => {
+            getMenuList();
+            console.log('list', list);
+        });
         return { list, selectMenu };
     },
 });

+ 0 - 1
src/views/information/warehouse-info/index.vue

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