From 640034fb4f659cbcecbd23df75016d97231ad7bd Mon Sep 17 00:00:00 2001
From: whychw <858544502@qq.com>
Date: 星期五, 20 十一月 2020 08:27:26 +0800
Subject: [PATCH] U 修改参试设备配置

---
 src/views/subject/history.vue |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/src/views/subject/history.vue b/src/views/subject/history.vue
index a8fe940..b470809 100644
--- a/src/views/subject/history.vue
+++ b/src/views/subject/history.vue
@@ -64,6 +64,7 @@
             :show-zoom='true'
             :end="50"
             sub-title-width="160"
+            :title-split-len="12"
             :subtext="true"  trigger-on="mousemove"></line-chart-mul>
           </div>
           <div class="wrap-table">
@@ -130,7 +131,6 @@
 // 鍥捐〃瀹炰緥瀵硅薄
 let G = null;
 const isArray = common.isArray;
-let dev_idx = 0;
 export default {
   name: 'subject_history',
   components: {
@@ -318,8 +318,19 @@
       this.cur_devname = data.dev_name;
       this.cur_devid = data.dev_id;
       this.cur_devtype = data.dev_type;
+      let param = [];
+      switch (data.dev_type) {
+        case 11:
+        case 12:
+        case 19:
+          param = [data.dev_type, data.dev_id];
+          break;
+        default:
+          param = [data.dev_type];
+          break;
+      }
       // 鍒濆鍖栧睘鎬у垪琛�
-      this.initLegends(data.dev_type);
+      this.initLegends(...param);
       // 鏍¢獙鏈夋病鏈夋暟鎹� 娌℃湁鍒欐彁閱�
       this.checkHis();
       // 鏌ヨ鍘嗗彶鏁版嵁
@@ -463,8 +474,8 @@
       });
     }
     // 鍒濆鍖栬鏄剧ず鐨勫睘鎬у垪琛�
-    ,initLegends (type) {
-      config = CONFIG.DIR[type];
+    ,initLegends (type, id) {
+      config = id ? CONFIG.DIR[type][id] : CONFIG.DIR[type];
       unit = config.unit;
       let allLegends = [];
       let selectedLegends = [];
@@ -481,15 +492,15 @@
           }
         });*/
 
-        let idx = idx || 0;
 
         let props = Object.keys(config);
         for (let i = 0, j = props.length; i < j; i++) {
           const v = props[i];
-          if (v != 'unit') {
+          // debugger;
+          if (v != 'unit' && config[v] != '澶囩敤') {
             allLegends.push({
               key: v,
-              label: isArray(config[v]) ? config[v][idx] : config[v],
+              label: config[v],
               unit: config.unit[v]
             });
             selectedLegends.push(v);

--
Gitblit v1.9.1