Przeglądaj źródła

首页增加数据看板按钮进行跳转

liubei@c-top.com.cn 3 lat temu
rodzic
commit
48a2c63c44

+ 2 - 2
src/permission.js

@@ -61,7 +61,7 @@ router.beforeEach((to, from, next) => {
                   const a = document.createElement('a');
                                       document.body.appendChild(a);
                                       a.style.display = 'none';
-                                      a.href = ' http://192.168.0.195:9001/boss-data-kanban';
+                                      a.href = 'http://192.168.0.195:9001/boss-data-kanban';
                                       a.target = '_blank'
                                       a.click();
                                       document.body.removeChild(a);
@@ -92,7 +92,7 @@ router.beforeEach((to, from, next) => {
           const a = document.createElement('a');
                               document.body.appendChild(a);
                               a.style.display = 'none';
-                              a.href = ' http://192.168.0.195:9001/boss-data-kanban';
+                              a.href = 'http://192.168.0.195:9001/boss-data-kanban';
                               a.target = '_blank'
                               a.click();
                               document.body.removeChild(a);

+ 4 - 1
src/views/bossDataKanban/index.vue

@@ -468,7 +468,10 @@
             }
         },
         created() {
-
+         let userInfo=localStorage.getItem('pro__Login_Userinfo')
+         if (!userInfo) {
+         this.$router.push({ path: '/user/login'})
+         }
 
 
         },

+ 25 - 2
src/views/dashboard/Analysis.vue

@@ -70,6 +70,8 @@
 </style>
 <template>
   <div class="page-header-index-wide analysis">
+    <a-button  type='primary' style="position:absolute;z-index: 99;right: 28px;top: 133px;" @click="dataKanBan"
+    v-if="userInfoId">数据看板</a-button>
     <div v-if="roleCode == 'operator'">
       <a-row :gutter="24">
         <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
@@ -220,7 +222,7 @@
 
     <Workbench v-else-if="roleCode == 'clip'" />
     <Workbench v-else-if="roleCode == 'plane'" />
-
+    
     <a-tabs default-active-key="1" v-else-if="roleCode == 'admin'" class="only-there">
       <a-tab-pane key="1" tab="快手">
         <statistics />
@@ -228,7 +230,6 @@
       <a-tab-pane key="2" tab="头条">
         <newHome />
       </a-tab-pane>
-
     </a-tabs>
     <!-- 更新公告 -->
     <a-modal v-model="visible" title="" @ok="handleOk" :closable='false' :footer="null" id="updateInfo">
@@ -282,6 +283,7 @@
   import LineChartMultid from '@/components/chart/LineChartMultid'
   import HeadInfo from '@/components/tools/HeadInfo.vue'
   import { getAction, postAction, downFile, downFilePost } from '@/api/manage';
+  import { mapActions, mapGetters } from 'vuex'
   import Trend from '@/components/Trend'
   import {
     getLoginfo,
@@ -336,6 +338,7 @@
         visible:false,//更新通知消息提示框
         updateTime:['2021-03-03'],
         versionId:0,//存储版本号 判断通知什么时候显示
+        userInfoId:false,
       }
     },
     created() {
@@ -344,7 +347,26 @@
       }, 1000)
       this.initLogInfo()
     },
+
     methods: {
+      ...mapGetters(['userInfo']),
+      getUserId(){
+        if (this.userInfo().id == '4aba62011120ac565c7f2b9f8f4aa96b' || this.userInfo().id == 'e9ca23d68d884d4ebb19d07889727dae') {
+          this.userInfoId = true;
+        }else{
+          this.userInfoId = false;
+        }
+      },
+      // 跳转数据看板
+      dataKanBan(){
+                    const a = document.createElement('a');
+                    document.body.appendChild(a);
+                    a.style.display = 'none';
+                    a.href = 'http://192.168.0.195:9001/boss-data-kanban';
+                    a.target = '_blank'
+                    a.click();
+                    document.body.removeChild(a);
+      },
       initLogInfo() {
         getLoginfo(null).then(res => {
           if (res.success) {
@@ -389,6 +411,7 @@
             }
            
         })
+        this.getUserId();
     },
   }
 </script>

+ 1 - 1
src/views/user/Login.vue

@@ -451,7 +451,7 @@ export default {
                     const a = document.createElement('a');
                     document.body.appendChild(a);
                     a.style.display = 'none';
-                    a.href = ' http://192.168.0.195:9001/boss-data-kanban';
+                    a.href = 'http://192.168.0.195:9001/boss-data-kanban';
                     a.target = '_blank'
                     a.click();
                     document.body.removeChild(a);