Ver Fonte

ws-增加测试报表菜单

ws há 1 ano atrás
pai
commit
d2b09659d5

+ 5 - 0
chuanyi_client/src/components/LeftMenu/index.vue

@@ -40,6 +40,11 @@
       <el-image :src="require('@/assets/images/print.png')" fit="contain"></el-image>
       <span>打印配置</span>
     </el-col>
+      <el-col :class="currMenuIndex == 9 ? 'cy-conn cy-conn-select' : 'cy-conn'"
+              @click.native="changeNavTypeAction(9)">
+          <el-image :src="require('@/assets/images/report.png')" fit="contain"></el-image>
+          <span>测试报表</span>
+      </el-col>
 
     <!-- 数据源配置弹出层 -->
     <el-dialog

+ 5 - 1
chuanyi_client/src/router/index.js

@@ -71,7 +71,11 @@ const routes = [
             {
                 path:'showReport',
                 component: () => import('@/views/run_config/showReport')
-            }
+            },
+            {
+                path: 'reportTemplate2',
+                component: () => import('@/views/report_template/index2')
+            },
         ]
     }
 ]

+ 2 - 0
chuanyi_client/src/views/index.vue

@@ -110,6 +110,8 @@ export default {
         gotoPage(this, '/userGroup')
       } else if (type == 5) {
         gotoPage(this, '/printConfig')
+      } else if (type == 9) {
+          gotoPage(this, '/reportTemplate2')
       }else {
         gotoPage(this, '/index')
         this.changeTabType()

+ 49 - 0
chuanyi_client/src/views/report_template/index2.vue

@@ -0,0 +1,49 @@
+<template>
+  <iframe @load="sendToken"  id="myIframe" :src="iframeSrc" style="height: calc(100% - 70px);width: 100%;border: none;" ></iframe>
+</template>
+
+<script>
+import {goPage} from "@/utils/cqcy";
+
+export default {
+    name: "index2",
+    data() {
+        return {
+            iframeWin: null,
+            iframeSrc: 'http://127.0.0.1:8848/reportSheet/index.html'
+        }
+    },
+    methods: {
+        sendToken() {
+            document.getElementById('myIframe').contentWindow.postMessage({
+                cmd: 'init',
+                data: {
+                    token: localStorage.getItem('C_TOKEN'),
+                    url: localStorage.getItem('SYS_HOST'),
+                }
+            }, '*')
+            const _this = this
+            window.addEventListener('message', function (event) {
+                const json = event.data
+                if (json.cmd === 'close') {
+                    goPage(_this, '/index')
+                }
+            })
+        },
+
+    },
+    created() {
+    },
+    mounted() {
+    },
+    destroyed() {
+        window.removeEventListener('message', function (e) {
+            console.log(e)
+        });
+    }
+}
+</script>
+
+<style scoped>
+
+</style>