From 052037a2a6c1bc241006e21ab9121badbee5f837 Mon Sep 17 00:00:00 2001
From: zhujiyan <17812234322@163.com>
Date: Tue, 29 Oct 2024 13:52:13 +0800
Subject: [PATCH] =?UTF-8?q?tooltip=E5=8D=95=E4=BD=8D=E4=B8=BAnull=E5=A4=84?=
=?UTF-8?q?=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../govern/device/control/tabs/trend.vue | 104 ++++++++++--------
1 file changed, 57 insertions(+), 47 deletions(-)
diff --git a/src/views/govern/device/control/tabs/trend.vue b/src/views/govern/device/control/tabs/trend.vue
index f2d1d0d..7b02c65 100644
--- a/src/views/govern/device/control/tabs/trend.vue
+++ b/src/views/govern/device/control/tabs/trend.vue
@@ -9,33 +9,48 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -109,7 +124,7 @@ searchForm.value = {
count: '',
searchBeginTime: '',
searchEndTime: '',
- dataLevel:'Primary',
+ dataLevel: 'Primary'
}
//统计指标
const indexOptions: any = ref([])
@@ -247,11 +262,12 @@ const init = async () => {
},
backgroundColor: 'rgba(0,0,0,0.35)',
borderWidth: 0,
- formatter(params) {
+ formatter(params: any) {
const xname = params[0].value[0]
let str = `${xname}
`
- params.forEach((el, index) => {
- str += `${el.marker}${el.seriesName.split('(')[0]}:${el.value[1]}${el.value[2]
+ params.forEach((el: any, index: any) => {
+ let unit = el.value[2] ? el.value[2] : ''
+ str += `${el.marker}${el.seriesName.split('(')[0]}:${el.value[1]}${unit}
}
`
})
return str
@@ -276,8 +292,7 @@ const init = async () => {
title: '下载csv',
icon: 'path://M588.8 551.253333V512H352v39.253333h236.373333z m0 78.933334v-39.253334H352v39.253334h236.373333z m136.533333 78.933333V334.933333l-157.866666-157.866666H273.066667A59.306667 59.306667 0 0 0 213.333333 236.373333v551.253334a59.306667 59.306667 0 0 0 59.306667 59.306666h274.773333v42.666667H853.333333v-180.48zM568.746667 234.666667l100.266666 100.693333h-81.066666a20.053333 20.053333 0 0 1-19.626667-20.053333z m-20.48 573.013333H273.066667a19.2 19.2 0 0 1-17.493334-19.626667V236.373333a19.2 19.2 0 0 1 19.626667-19.626666h256v98.133333a58.88 58.88 0 0 0 58.88 59.306667h96.426667v334.933333h-98.133334v-39.68H352v39.68h196.266667z m100.266666 23.04a37.973333 37.973333 0 0 1-32 15.786667 38.826667 38.826667 0 0 1-32.426666-15.786667 53.76 53.76 0 0 1-10.24-32.853333 42.666667 42.666667 0 0 1 42.666666-47.786667 35.84 35.84 0 0 1 37.546667 29.866667h-12.8a23.893333 23.893333 0 0 0-24.746667-19.2c-17.066667 0-29.013333 14.08-29.013333 35.84s11.52 37.546667 28.586667 37.546666a26.453333 26.453333 0 0 0 26.453333-25.6h12.8a39.253333 39.253333 0 0 1-7.253333 22.186667z m59.733334 15.786667a35.84 35.84 0 0 1-40.106667-34.56H682.666667a23.893333 23.893333 0 0 0 26.88 23.04c12.8 0 22.613333-6.4 22.613333-15.786667s-4.266667-11.52-14.506667-13.653333l-21.333333-5.12c-17.066667-4.266667-24.32-11.52-24.32-23.893334s12.8-26.453333 34.133333-26.453333a31.573333 31.573333 0 0 1 35.413334 30.293333h-13.653334a19.626667 19.626667 0 0 0-22.613333-18.773333c-12.8 0-20.48 5.12-20.48 12.8s5.12 11.093333 17.066667 13.653333l14.933333 2.986667a42.666667 42.666667 0 0 1 20.906667 8.96 23.893333 23.893333 0 0 1 7.68 17.92c-0.426667 17.066667-14.506667 28.16-37.12 28.16z m88.746666 0h-14.506666l-32.426667-92.16h14.08l19.626667 59.733333 6.4 20.053333c0-9.386667 3.413333-12.8 5.546666-20.053333l19.2-59.733333h14.08z',
- onclick: (e) => {
-
+ onclick: e => {
// console.log("🚀 ~ init ~ echartsData.value:", echartsData.value.options.series.map(item => item.data))
let list = echartsData.value.options.series?.map(item => item.data)
@@ -286,15 +301,16 @@ const init = async () => {
list.forEach((item1: any, index1: any) => {
if (index1 > 0) {
value.push(item1 && item1[index] ? item1[index][1] : null)
-
}
})
-
- return value;
- });
- exportCSV(echartsData.value.options.series.map(item => item.name), dataList, '历史趋势.csv')
-
+ return value
+ })
+ exportCSV(
+ echartsData.value.options.series.map(item => item.name),
+ dataList,
+ '历史趋势.csv'
+ )
}
}
}
@@ -537,12 +553,10 @@ const initSearchFormIndexAndCount = (list: any) => {
})
}
})
-
})
- console.log("🚀 ~ initSearchFormIndexAndCount ~ countData.value:", countData.value)
-
- // countData.value = countData.value.filter(item => item.countOptions.length > 0);
+ console.log('🚀 ~ initSearchFormIndexAndCount ~ countData.value:', countData.value)
+ // countData.value = countData.value.filter(item => item.countOptions.length > 0);
}
setTimeout(() => {
tableHeaderRef.value.computedSearchRow()
@@ -555,12 +569,10 @@ const onCountChange = (val: any, index: any) => {
}
}
const onIndexChange = (val: any) => {
-
num.value += 1
if (val.length == 0) {
searchForm.value.index = [indexOptions.value[0].id]
}
-
}
watch(
() => searchForm.value.index,
@@ -575,7 +587,6 @@ watch(
countData.value.map((item: any, key: any) => {
if (
val.findIndex((vv: any) => {
-
return vv == item.index
}) == -1
) {
@@ -649,10 +660,9 @@ defineExpose({ getTrendRequest })
// flex: 1;
margin-top: 10px;
}
-.history_count{
+.history_count {
.el-select {
- min-width: 100px;
+ min-width: 100px;
+ }
}
-}
-