zhangqing пре 1 година
родитељ
комит
64db629cc9
2 измењених фајлова са 49 додато и 1 уклоњено
  1. 5 1
      src/store/modules/user.js
  2. 44 0
      src/views/reportForms/sourceLink/index.vue

+ 5 - 1
src/store/modules/user.js

@@ -17,6 +17,9 @@ const formatRouter = (list) => {
         p.children = [];
         authorities.push(p);
       } else {
+        if (p.source === 2 && p.extend) {
+          p.path = p.path + '/' + p.extend;
+        }
         if (p.children?.length) {
           p.children = fn(p.children);
         } else {
@@ -122,8 +125,8 @@ export default {
       if (!list.length) {
         return {};
       }
-
       const { menuList, authorities } = formatRouter(list[0].children);
+      console.log('menuList', menuList);
 
       // 用户权限
       // const authorities =
@@ -144,6 +147,7 @@ export default {
             parentIdField: 'parentId'
           })
       );
+      console.log(menus, 'mens')
       // 用户路由按钮
       const { menus: authoritiesRouter } = formatMenus(
         USER_MENUS ??

+ 44 - 0
src/views/reportForms/sourceLink/index.vue

@@ -0,0 +1,44 @@
+<template>
+    <div class="ele-body">
+        <jimureportBrowse :url="fileUrl"></jimureportBrowse>
+    </div>
+  </template>
+  
+  <script>
+  import jimureportBrowse from '@/components/jimureport/browse.vue';
+  import { getServiceurl } from '@/components/jimureport/api.js';
+  import { getToken } from '@/utils/token-util';
+  export default {
+    components: {
+        jimureportBrowse
+    },
+  
+    data() {
+      return {
+        fileUrl: ''
+      };
+    },
+    computed: {},
+    watch: {
+      '$route'(to, from) {
+        if (to.path) {
+          this.getJmPrintBrowse();  // 重新加载数据
+        }
+      }
+    },
+    created() {
+        this.getJmPrintBrowse()
+    },
+    methods: {
+       async getJmPrintBrowse(){
+        let id = this.$route.path.split('/').pop()
+        let url = await getServiceurl();
+        this.fileUrl = `${url}/jmreport/view/${id}?token=${getToken()}`;
+       }
+    }
+  };
+  </script>
+  <style lang="scss" scoped>
+
+  </style>
+