瀏覽代碼

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

zhou.xiaoning 4 年之前
父節點
當前提交
41de59c06e

+ 11 - 11
src/router/index.ts

@@ -76,11 +76,11 @@ 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',
-                        name: EnumType.GoodsInfo.spot,
+                        name: 'goods_info_spot',
                         component: () => import('@/views/information/goods/list/spot-variety/index.vue'),
                         meta: {
                             requireAuth: true
@@ -88,7 +88,7 @@ const routes: Array<RouteRecordRaw> = [
                     },
                     {
                         path: '/goods_info/hedging',
-                        name: EnumType.GoodsInfo.hedging,
+                        name: 'goods_info_hedge',
                         component: () => import('@/views/information/goods/list/hedging-variety/index.vue'),
                         meta: {
                             requireAuth: true
@@ -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
@@ -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

+ 1 - 1
src/setup/router/index.ts

@@ -25,7 +25,7 @@ function mateRouter(router: Router) {
     return result
 }
 
-export function handleMenu() {
+export function handleRouterMenu() {
     const router = useRouter();
     const list = ref<OperationTabMenu[]>([])
     // 获取动态路由

+ 2 - 6
src/views/information/custom/index.vue

@@ -11,11 +11,8 @@
 <script lang="ts">
 import { defineComponent, ref } from 'vue';
 import firstMenu from '@/components/firstMenu/index.vue';
-import { useRouter } from 'vue-router';
-import { CustomInfo } from '@/enums/routerName';
 import { initData } from '@/setup/methods/index';
-import { handleMenu } from '@/setup/router/index';
-import { OperationTabMenu } from '@/goServiceAPI/commonService/interface';
+import { handleRouterMenu } from '@/setup/router/index';
 
 export default defineComponent({
     name: 'custom',
@@ -23,10 +20,9 @@ export default defineComponent({
         firstMenu,
     },
     setup() {
-        const { list, selectMenu, getMenuList } = handleMenu();
+        const { list, selectMenu, getMenuList } = handleRouterMenu();
         initData(() => {
             getMenuList();
-            console.log('list', list);
         });
         return { list, selectMenu };
     },

+ 7 - 17
src/views/information/goods/index.vue

@@ -2,7 +2,7 @@
   <!-- 商品信息 -->
   <div class="goods-info">
     <firstMenu :list="list"
-               :value="'value'"
+               :value="'title'"
                @selectMenu="selectMenu" />
     <router-view />
   </div>
@@ -11,21 +11,8 @@
 <script lang="ts">
 import { defineComponent } from 'vue';
 import firstMenu from '@/components/firstMenu/index.vue';
-import { useRouter } from 'vue-router';
-import { GoodsInfo } from '@/enums/routerName';
-
-// 处理菜单
-function handleMenu() {
-    const router = useRouter();
-    const list = [
-        { key: GoodsInfo.spot, value: '现货品种' },
-        { key: GoodsInfo.hedging, 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: 'custom',
@@ -33,7 +20,10 @@ export default defineComponent({
         firstMenu,
     },
     setup() {
-        const { list, selectMenu } = handleMenu();
+        const { list, selectMenu, getMenuList } = handleRouterMenu();
+        initData(() => {
+            getMenuList();
+        });
         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 };
     },
 });

+ 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 };
     },
 });