From a6f96b0ff302e4ddedb6a2c5ccf3d2956959abaa Mon Sep 17 00:00:00 2001 From: he wei <858544502@qq.com> Date: 星期二, 12 十一月 2024 09:44:27 +0800 Subject: [PATCH] U 历史数据bug修复 --- src/views/datas/dataHis.vue | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/views/datas/dataHis.vue b/src/views/datas/dataHis.vue index b685eff..308ccda 100644 --- a/src/views/datas/dataHis.vue +++ b/src/views/datas/dataHis.vue @@ -36,11 +36,17 @@ const testObj = computed(() => { if (testRecordList.value) { - let [type, record] = testRecordCode.value || []; + let [type, record, record2] = testRecordCode.value || []; if (!type) return {}; let list = testRecordList.value.filter((v) => v.value == type)[0].children; - return list.filter((v) => record == v.value)[0]; + if (record2 !== undefined) { + return list + .filter((v) => record == v.value)[0].children + .filter((vv) => vv.value == record2)[0]; + } else { + return list.filter((v) => record == v.value)[0]; + } } else { return {}; } @@ -98,7 +104,7 @@ } else { // 娣诲姞涓�绾� 鍖哄垎鏄粍1杩樻槸缁�2 let _obj = {}; - for (let i = 0, len = arr.length; i < len; i++ ) { + for (let i = 0, len = arr.length; i < len; i++) { let item = arr[i]; let idx = item.battIdx; _obj[idx] = _obj[idx] || []; @@ -111,7 +117,7 @@ let _count = item.length; children.push({ label: idx, - count: _count, + count: _count, value: `group_${vv}`, children: item.map((vvv) => ({ ...vvv, @@ -132,7 +138,6 @@ } const canSlide = computed(() => !!testDatas.value.length); - function updateChart(data) { let labels = [], @@ -238,7 +243,10 @@ $message.error("璇烽�夋嫨瑕佸鍑虹殑娴嬭瘯璁板綍"); return false; } - exportRecord(currentDevId.value, testRecordCode.value[1]) + exportRecord( + currentDevId.value, + testRecordCode.value[testRecordCode.value.length - 1] + ) .then((res) => { let { data, status, headers } = res; const matchRes = /filename=(.*)/.exec(headers["content-disposition"]); -- Gitblit v1.9.1