Forráskód Böngészése

修改现货合同路由

huangbin 4 éve
szülő
commit
0657a89fab

+ 6 - 6
src/router/index.ts

@@ -76,7 +76,7 @@ const routes: Array<RouteRecordRaw> = [
                 meta: {
                     requireAuth: true
                 },
-                redirect: to => { return { name: EnumType.GoodsInfo.spot } },
+                redirect: to => { return { name: 'goods_info_spot' } },
                 children: [
                     {
                         path: '/goods_info/spot',
@@ -119,11 +119,11 @@ const routes: Array<RouteRecordRaw> = [
                 meta: {
                     requireAuth: true
                 },
-                redirect: to => { return { name: EnumType.SpotContract.notCommit } },
+                redirect: to => { return { name: 'spot_contract_unsubmitted' } },
                 children: [
                     {
                         path: '/spot_contract/not-commit',
-                        name: EnumType.SpotContract.notCommit,
+                        name: 'spot_contract_unsubmitted',
                         component: () => import('@/views/information/spot-contract/list/not-commit/index.vue'),
                         meta: {
                             requireAuth: true
@@ -131,7 +131,7 @@ const routes: Array<RouteRecordRaw> = [
                     },
                     {
                         path: '/spot_contract/done',
-                        name: EnumType.SpotContract.done,
+                        name: 'spot_contract_checkpending',
                         component: () => import('@/views/information/spot-contract/list/done/index.vue'),
                         meta: {
                             requireAuth: true
@@ -139,7 +139,7 @@ const routes: Array<RouteRecordRaw> = [
                     },
                     {
                         path: '/spot_contract/peddding',
-                        name: EnumType.SpotContract.peddding,
+                        name: 'spot_contract_performance',
                         component: () => import('@/views/information/spot-contract/list/peddding/index.vue'),
                         meta: {
                             requireAuth: true
@@ -147,7 +147,7 @@ const routes: Array<RouteRecordRaw> = [
                     },
                     {
                         path: '/spot_contract/performance',
-                        name: EnumType.SpotContract.performance,
+                        name: 'spot_contract_finished',
                         component: () => import('@/views/information/spot-contract/list/performance/index.vue'),
                         meta: {
                             requireAuth: true

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

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

+ 7 - 19
src/views/information/spot-contract/index.vue

@@ -2,7 +2,7 @@
   <!-- 现货合同 -->
   <div class="spot-contract">
     <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 { SpotContract } from '@/enums/routerName';
-
-// 处理菜单
-function handleMenu() {
-    const router = useRouter();
-    const list = [
-        { key: SpotContract.notCommit, value: '未提交' },
-        { key: SpotContract.peddding, value: '待审核' },
-        { key: SpotContract.performance, value: '履约中' },
-        { key: SpotContract.done, 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: 'spot-contract',
@@ -35,7 +20,10 @@ export default defineComponent({
         firstMenu,
     },
     setup() {
-        const { list, selectMenu } = handleMenu();
+        const { list, selectMenu, getMenuList } = handleRouterMenu();
+        initData(() => {
+            getMenuList();
+        });
         return { list, selectMenu };
     },
 });