Browse Source

睿德看板调整,根据人员所属楼层,展示楼层

xiaost 2 years ago
parent
commit
31d5febb66
5 changed files with 15 additions and 62 deletions
  1. 7 0
      src/components/Global.vue
  2. 3 1
      src/main.js
  3. 0 54
      src/views/center.vue
  4. 4 5
      src/views/index.vue
  5. 1 2
      src/views/login.vue

+ 7 - 0
src/components/Global.vue

@@ -0,0 +1,7 @@
+<script>
+    const level=''
+    export default
+    {
+        level,//所属楼层
+    }
+</script>

+ 3 - 1
src/main.js

@@ -17,12 +17,14 @@ import 'vue-awesome/icons/align-left.js';
 //4.x 引用方式
 import echarts from 'echarts'
 import ElementUI from 'element-ui';
+import global_ from './components/Global'//引用文件
+
 //5.x 引用方式为按需引用
 //希望使用5.x版本的话,需要在package.json中更新版本号,并切换引用方式
 //import * as echarts from 'echarts'
 Vue.prototype.$echarts = echarts
 Vue.config.productionTip = false;
-Vue.prototype.level = '';
+Vue.prototype.GLOBAL = global_ ; //挂载到Vue实例上面
 // 全局注册
 Vue.component('icon', Icon);
 Vue.use(dataV);

+ 0 - 54
src/views/center.vue

@@ -28,7 +28,6 @@
 </template>
 
 <script>
-/*import CenterChart from '@/components/echart/center/centerChartRate'*/
 
 export default {
   data() {
@@ -46,37 +45,6 @@ export default {
         waveNum: 3,
         waveHeight:20
       },
-      // 通过率和达标率的组件复用数据
-    /*  rate: [
-        {
-          id: 'centerRate1',
-          tips: 60,
-          colorData: {
-            textStyle: '#3fc0fb',
-            series: {
-              color: ['#00bcd44a', 'transparent'],
-              dataColor: {
-                normal: '#03a9f4',
-                shadowColor: '#97e2f5'
-              }
-            }
-          }
-        },
-        {
-          id: 'centerRate2',
-          tips: 40,
-          colorData: {
-            textStyle: '#67e0e3',
-            series: {
-              color: ['#faf3a378', 'transparent'],
-              dataColor: {
-                normal: '#ff9800',
-                shadowColor: '#fcebad'
-              }
-            }
-          }
-        }
-      ]*/
     }
   },
   components: {
@@ -145,28 +113,6 @@ export default {
                         console.error(result)
                       }
               );
-      //饼图pie,首检合格率,巡检合格率
-      /*await this.$http.get("kanban/datalist.action?caller=PieCheckRate&_noc=1&page=1&pageSize=100&condition=1=1")
-              .then((result)=>{
-                        let dataList = JSON.parse(result.data.data);
-                        this.rate[0].tips = dataList[0].firstcheckrate;
-                        this.rate[0].tips = dataList[0].xcheckrate;
-                      },(result)=>{
-                        console.error(result)
-                      }
-              );
-      //水波图,首检合格率,巡检合格率
-      await this.$http.get("kanban/datalist.action?caller=WaterCheckRate&_noc=1&page=1&pageSize=100&condition=1=1")
-              .then((result)=>{
-                        let dataList = JSON.parse(result.data.data);
-                        let waterdatas = new Array();
-                        waterdatas.push(dataList[0].firstcheckrate);
-                        waterdatas.push(dataList[0].xcheckrate);
-                         this.water = { data: waterdatas }
-                      },(result)=>{
-                        console.error(result)
-                      }
-              );*/
     }
   }
 }

+ 4 - 5
src/views/index.vue

@@ -29,7 +29,7 @@
           <div class="d-flex aside-width">
             <div class="react-left ml-4 react-l-s">
               <span class="react-left"></span>
-              <span class="text">生产实况分析{{level}}</span>
+              <span class="text">生产实况分析{{slevel}}</span>
             </div>
             <div class="react-left ml-3">
               <span class="text">品质趋势分析</span>
@@ -104,7 +104,7 @@
 
 <script>
 import drawMixin from "../utils/drawMixin";
-import { formatTime } from '../utils/index.js'
+import { formatTime } from '../utils/index.js';
 import centerLeft1 from './centerLeft1'
 import centerLeft_two from './centerLeft_two'
 import centerRight1 from './centerRight1'
@@ -164,12 +164,11 @@ export default {
       }, 5000)
     },
     showlevel(){
-      if(this.level != null && "" !=this.level){
-        this.slevel ="("+this.level+")";
+      if(this.GLOBAL.level != null && "" !=this.GLOBAL.level){
+        this.slevel ="("+this.GLOBAL.level+")";
       } else {
         this.slevel="";
       }
-      console.log(this.slevel);
     }
   }
 }

+ 1 - 2
src/views/login.vue

@@ -81,8 +81,7 @@
                                 if(res.success || "检测到您已登录本系统,请不要重复登录、打开空白页!" == res.reason) {
                                     //登录成功返回session
                                     sessionStorage.setItem('x-access-token', res.token);
-                                    //this.level = '2F';
-                                    //console.log(this);
+                                    this.GLOBAL.level = res.level;
                                     this.$router.push({path: this.redirect || '/'})
                                 }else{
                                     this.$message.error(res.reason);