li.shaoyi 4 rokov pred
rodič
commit
013be5e251

+ 1 - 1
public/config/app.config.json

@@ -1,3 +1,3 @@
 {
-    "apiUrl": "http://192.168.31.137:8080/cfg?key=test_137"
+    "apiUrl": "http://192.168.31.203:8080/cfg?key=test_203"
 }

+ 1 - 1
src/common/setup/table/compose.ts

@@ -93,7 +93,7 @@ export function handleComposeTable_detail<T>({ queryFn, tableName, tableFilterKe
     const data = getThirdMenuData()
     const list = data.find((e) => e.code === menuType);
     const tabList = ref<TabList[]>([])
-    list?.children.forEach(el => {
+    list?.children?.forEach(el => {
         // const { code, title, type } = el
         // if (type === 3) {
         //     tabList.value.push({ lable: title, code })

+ 2 - 1
src/router/dynamic.ts

@@ -19,7 +19,7 @@ const addNotFound = () => {
  */
 const addRoutes = (routes: OperationTabMenu[], parentName = ''): void => {
     routes.forEach((item) => {
-        if (item.path && item.isshow && !item.url) {
+        if (item.path && item.isshow && item.component) {
             let component;
             switch (item.component) {
                 case 'Layout':
@@ -40,6 +40,7 @@ const addRoutes = (routes: OperationTabMenu[], parentName = ''): void => {
                 component,
                 meta: {
                     title: item.title,
+                    url: item.url,
                     auth: item.auth ?? [],
                     remark: item.remark,
                 },

+ 1 - 1
src/router/index.ts

@@ -2049,7 +2049,7 @@ router.beforeEach((to, from, next) => {
                     routerComplete = true;
                     next({ ...to, replace: true });
                 }).catch(() => {
-                    console.error('菜单加载失败');
+                    console.error('路由加载失败');
                 })
             }
         } else {

+ 1 - 1
src/views/business/exposure/list/futures/index.vue

@@ -105,7 +105,7 @@ export default defineComponent({
                 }
             }
         });
-        return { loading, tableList, visible, closeDrawer, columns, updateColumn, columnsDetail, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, getBuyOrSellName, getChannelBuildName };
+        return { loading, tableList, visible, closeDrawer, columns, changeTab, updateColumn, columnsDetail, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, getBuyOrSellName, getChannelBuildName };
     },
 });
 </script>

+ 19 - 0
src/views/iframe/index.vue

@@ -0,0 +1,19 @@
+<template>
+    <!-- 管理端 -->
+    <div class="iframe-container">
+        <iframe :src="url" style="border: 0"></iframe>
+    </div>
+</template>
+
+<script lang="ts">
+import { defineComponent } from 'vue';
+import { getIframeUrl } from './setup';
+
+export default defineComponent({
+    setup() {
+        return {
+            url: getIframeUrl(),
+        };
+    },
+});
+</script>

+ 92 - 0
src/views/iframe/setup.ts

@@ -0,0 +1,92 @@
+import { useRoute } from 'vue-router';
+import { serviceURL } from "@/services/request";
+import { getToken } from "@/services/bus/token";
+import { OperationTabMenuAuth } from '@/services/go/commonService/interface';
+
+interface IframeCode {
+    code: string;
+    tabIndex: number,
+    buttons: {
+        //  权限按钮 info(详情):add(新增):edit(修改):del(停用启用)
+        [key: string]: string,
+    }
+}
+
+const iframeCode: IframeCode[] = [
+    {
+        code: 'goods_spot', // 基础设置-商品设置-现货品种
+        tabIndex: 1,
+        buttons: {
+            goods_spot_add: 'add',
+            goods_spot_edit: 'edit',
+            goods_spot_stop: 'stop',
+            goods_spot_recover: 'recover',
+            info: 'info',
+        }
+    },
+    {
+        code: 'goods_hedge', // 基础设置-商品设置-套保品种
+        tabIndex: 2,
+        buttons: {
+            goods_hedge_add: 'add',
+            goods_hedge_edit: 'edit',
+            info: 'info',
+        }
+    },
+    {
+        code: 'hedge_ratio_checkpending', // 风管审核-套保比例审核-待审核
+        tabIndex: 1,
+        buttons: {
+            hedge_ratio_check: 'check',
+            info: 'info',
+        }
+    },
+    {
+        code: 'hedge_ratio_performance', // 风管审核-套保比例审核-已审核
+        tabIndex: 2,
+        buttons: {
+            info: 'info',
+        }
+    },
+    {
+        code: 'spot_params_checkpending', // 风管审核-现货参数审核-待审核
+        tabIndex: 1,
+        buttons: {
+            spot_params_check: 'check',
+            info: 'info',
+        }
+    },
+    {
+        code: 'spot_params_performance', // 风管审核-现货参数审核-已审核
+        tabIndex: 2,
+        buttons: {
+            info: 'info',
+        }
+    }
+]
+
+/**
+ * 获取管理端url
+ */
+export function getIframeUrl(): string {
+    let param = 'resourcepcmenu=';
+    const route = useRoute();
+    const url = route.meta.url;
+    // 根据当前路由 name(code) 查找出对应的 iframeCode
+    const item = iframeCode.find((item) => item.code === route.name);
+
+    if (item) {
+        const auth = route.meta.auth as OperationTabMenuAuth[];
+        const fn = (code: string) => auth.find((e) => e.code === code);
+
+        // 拼接按钮权限参数
+        Object.entries(item.buttons).forEach((values) => {
+            if (values[0] === 'info' || fn(values[0])) {
+                param += `:${values[1]}`;
+            }
+        });
+
+        return `${serviceURL.pcMangerUrl + url}?token=${getToken()}&tabindex=${item.tabIndex}&${param}`;
+    }
+    return '';
+}