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/realtime.vue | 29 ++++++++++++++++++++++------- 1 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/views/subject/realtime.vue b/src/views/subject/realtime.vue index 9542f57..68e1b83 100644 --- a/src/views/subject/realtime.vue +++ b/src/views/subject/realtime.vue @@ -41,6 +41,7 @@ :categoryLen="categoryLen" :show-zoom='false' sub-title-width="160" + :title-split-len="12" :subtext="true" trigger-on="mousemove"></line-chart-mul> </div> <div class="wrap-table"> @@ -189,20 +190,34 @@ // console.log(obj, 'obj'); this.cur_id = obj.dev_id; this.cur_type = obj.dev_type; - - this.initLegends(obj.dev_type); + let param = []; + switch (obj.dev_type) { + case 11: + case 12: + case 19: + param = [obj.dev_type, obj.dev_id]; + break; + default: + param = [obj.dev_type]; + break; + } + // 鍒濆鍖栧睘鎬у垪琛� + this.initLegends(...param); this.get100Data(obj.dev_type, obj.dev_id); } // 鍒濆鍖栬鏄剧ず鐨勫睘鎬у垪琛� - ,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 = []; if (config) { // console.log(config); - Object.keys(config).forEach((v) => { - if (v != 'unit') { + let props = Object.keys(config); + for (let i = 0, j = props.length; i < j; i++) { + const v = props[i]; + // debugger; + if (v != 'unit' && config[v] != '澶囩敤') { allLegends.push({ key: v, label: config[v], @@ -210,7 +225,7 @@ }); selectedLegends.push(v); } - }); + } } this.allLegends = allLegends; this.selectedLegends = selectedLegends; -- Gitblit v1.9.1