From 1c01fe5ae19334224b90debe17d1ac931f55fe36 Mon Sep 17 00:00:00 2001 From: guanj Date: Fri, 12 Jun 2026 11:02:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/harmonicRatio‌.vue | 41 ++++++--------- .../components/harmonicRatio‌.vue | 41 ++++++--------- .../listOfMainMonitoringPoints/index.vue | 52 ++++++++++++++++--- .../components/harmonicRatio‌.vue | 41 ++++++--------- .../cockpit/trendComparison/index.vue | 43 ++++++++++++--- src/components/echarts/MyEchart.vue | 10 ++-- src/utils/echartMethod.ts | 35 +++++++++++++ src/views/govern/alarm/Device.vue | 12 +++-- src/views/govern/alarm/Front.vue | 2 +- src/views/govern/analyze/APF/APF.vue | 31 ++++++++--- .../analyze/steadyState/components/chart.vue | 31 ++++++++--- src/views/govern/device/control/detail.vue | 2 +- .../device/control/tabs/electroplating.vue | 40 +++++--------- .../govern/device/control/tabs/trend.vue | 40 +++++--------- src/views/govern/device/planData/index.vue | 22 ++++---- 15 files changed, 268 insertions(+), 175 deletions(-) diff --git a/src/components/cockpit/gridSideStatistics/components/harmonicRatio‌.vue b/src/components/cockpit/gridSideStatistics/components/harmonicRatio‌.vue index 9211ece..b8f40e1 100644 --- a/src/components/cockpit/gridSideStatistics/components/harmonicRatio‌.vue +++ b/src/components/cockpit/gridSideStatistics/components/harmonicRatio‌.vue @@ -45,9 +45,6 @@ @@ -64,7 +61,7 @@ import { ref, onMounted, watch } from 'vue' import MyEchart from '@/components/echarts/MyEchart.vue' import { useDictData } from '@/stores/dictData' import { queryStatistical } from '@/api/system-boot/csstatisticalset' -import { yMethod, exportCSV, completeTimeSeries } from '@/utils/echartMethod' +import { yMethod, exportSeriesCSV, completeTimeSeries } from '@/utils/echartMethod' import TableHeader from '@/components/table/header/index.vue' import { trendData } from '@/api/harmonic-boot/cockpit/cockpit' import DatePicker from '@/components/form/datePicker/index.vue' @@ -352,8 +349,7 @@ const setEchart = () => { itemStyle: { opacity: 0 }, //去圆点 type: 'scroll', // 开启滚动分页 // orient: 'vertical', // 垂直排列 - top: 5, - right: 70 + // width: 550, // height: 50 }, @@ -413,27 +409,22 @@ const setEchart = () => { myTool1: { show: true, 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 => { - // console.log("🚀 ~ init ~ echartsData.value:", echartsData.value.options.series.map(item => item.data)) - - let list = echartsData.value.options.series?.map((item: any) => item.data) - let dataList = list[0]?.map((item: any, index: any) => { - let value = [item[0], item[1]] - 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: any) => item.name), - dataList, - '监测点指标趋势.csv' + icon: 'path://M642 673.1H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9s-8 17.9-17.9 17.9zM642 511.8H301.6c-9.9 0-17.9-8-17.9-17.9 0-9.9 8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9 0 9.9-8 17.9-17.9 17.9zM480.7 350.6H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9h179.2c9.9 0 17.9 8 17.9 17.9s-8.1 17.9-18 17.9zM874.9 350.6H695.7c-49.4 0-89.6-40.2-89.6-89.6V81.9c0-9.9 8-17.9 17.9-17.9 9.9 0 17.9 8 17.9 17.9V261c0 29.6 24.1 53.7 53.7 53.7h179.2c9.9 0 17.9 8 17.9 17.9s-7.9 18-17.8 18zM794.3 959.7H221c-49.4 0-89.6-40.2-89.6-89.6V153.5c0-49.4 40.2-89.6 89.6-89.6h403.1c4.8 0 9.3 1.9 12.7 5.2L887.6 320c3.4 3.4 5.2 7.9 5.2 12.7v537.5c0 52.7-51.9 89.5-98.5 89.5zM221 99.8c-29.6 0-53.7 24.1-53.7 53.7v716.6c0 29.6 24.1 53.7 53.7 53.7h573.3c29 0 62.7-23.5 62.7-53.7v-530L616.7 99.8H221z', + onclick: () => { + exportSeriesCSV( + echartsData.value.options.series, + `${dialogTitle.value || '监测点指标趋势'}.csv` ) } + }, + myTool2: { + show: true, + title: timeControl.value ? '关闭缺失数据' : '缺失数据', + icon: 'path://M832 512l-192-192v128H128v128h512v128l192-192zM192 512l192 192v-128h512v-128H384V320L192 512z', + iconStyle: timeControl.value ? { borderColor: '#409EFF' } : {}, + onclick: () => { + setTimeControl() + } } } }, diff --git a/src/components/cockpit/indicatorFittingChart/components/harmonicRatio‌.vue b/src/components/cockpit/indicatorFittingChart/components/harmonicRatio‌.vue index 15b586a..235dad6 100644 --- a/src/components/cockpit/indicatorFittingChart/components/harmonicRatio‌.vue +++ b/src/components/cockpit/indicatorFittingChart/components/harmonicRatio‌.vue @@ -45,9 +45,6 @@ @@ -64,7 +61,7 @@ import { ref, onMounted, watch } from 'vue' import MyEchart from '@/components/echarts/MyEchart.vue' import { useDictData } from '@/stores/dictData' import { queryStatistical } from '@/api/system-boot/csstatisticalset' -import { yMethod, exportCSV, completeTimeSeries } from '@/utils/echartMethod' +import { yMethod, exportSeriesCSV, completeTimeSeries } from '@/utils/echartMethod' import TableHeader from '@/components/table/header/index.vue' import { trendData } from '@/api/harmonic-boot/cockpit/cockpit' import DatePicker from '@/components/form/datePicker/index.vue' @@ -351,8 +348,7 @@ const setEchart = () => { itemStyle: { opacity: 0 }, //去圆点 type: 'scroll', // 开启滚动分页 // orient: 'vertical', // 垂直排列 - top: 5, - right: 70 + // width: 550, // height: 50 }, @@ -412,27 +408,22 @@ const setEchart = () => { myTool1: { show: true, 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 => { - // console.log("🚀 ~ init ~ echartsData.value:", echartsData.value.options.series.map(item => item.data)) - - let list = echartsData.value.options.series?.map((item: any) => item.data) - let dataList = list[0]?.map((item: any, index: any) => { - let value = [item[0], item[1]] - 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: any) => item.name), - dataList, - '历史趋势.csv' + icon: 'path://M642 673.1H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9s-8 17.9-17.9 17.9zM642 511.8H301.6c-9.9 0-17.9-8-17.9-17.9 0-9.9 8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9 0 9.9-8 17.9-17.9 17.9zM480.7 350.6H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9h179.2c9.9 0 17.9 8 17.9 17.9s-8.1 17.9-18 17.9zM874.9 350.6H695.7c-49.4 0-89.6-40.2-89.6-89.6V81.9c0-9.9 8-17.9 17.9-17.9 9.9 0 17.9 8 17.9 17.9V261c0 29.6 24.1 53.7 53.7 53.7h179.2c9.9 0 17.9 8 17.9 17.9s-7.9 18-17.8 18zM794.3 959.7H221c-49.4 0-89.6-40.2-89.6-89.6V153.5c0-49.4 40.2-89.6 89.6-89.6h403.1c4.8 0 9.3 1.9 12.7 5.2L887.6 320c3.4 3.4 5.2 7.9 5.2 12.7v537.5c0 52.7-51.9 89.5-98.5 89.5zM221 99.8c-29.6 0-53.7 24.1-53.7 53.7v716.6c0 29.6 24.1 53.7 53.7 53.7h573.3c29 0 62.7-23.5 62.7-53.7v-530L616.7 99.8H221z', + onclick: () => { + exportSeriesCSV( + echartsData.value.options.series, + `${dialogTitle.value || '历史趋势'}.csv` ) } + }, + myTool2: { + show: true, + title: timeControl.value ? '关闭缺失数据' : '缺失数据', + icon: 'path://M832 512l-192-192v128H128v128h512v128l192-192zM192 512l192 192v-128h512v-128H384V320L192 512z', + iconStyle: timeControl.value ? { borderColor: '#409EFF' } : {}, + onclick: () => { + setTimeControl() + } } } }, diff --git a/src/components/cockpit/listOfMainMonitoringPoints/index.vue b/src/components/cockpit/listOfMainMonitoringPoints/index.vue index b4b9f25..82bc238 100644 --- a/src/components/cockpit/listOfMainMonitoringPoints/index.vue +++ b/src/components/cockpit/listOfMainMonitoringPoints/index.vue @@ -72,7 +72,12 @@ import { cslineList, fittingData } from '@/api/harmonic-boot/cockpit/cockpit' import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree' import { ElMessage } from 'element-plus' import { getTime } from '@/utils/formatTime' +import { exportSeriesCSV } from '@/utils/echartMethod' import PointTree from '@/components/tree/govern/pointTree.vue' + +const CSV_DOWNLOAD_ICON = + 'path://M896 346.8c-0.1 0 0 0 0 0 0-0.9-0.1-1.7-0.2-2.5 0-0.1 0-0.3-0.1-0.4-0.2-1.7-0.5-3.3-1-4.9-0.5-1.7-1-3.3-1.7-4.9v-0.1c-0.3-0.8-0.7-1.5-1.1-2.3v-0.1c-0.4-0.7-0.8-1.5-1.2-2.2-0.1-0.1-0.1-0.2-0.2-0.3-0.4-0.6-0.8-1.2-1.3-1.9-0.1-0.1-0.1-0.2-0.2-0.2-0.5-0.6-1-1.3-1.5-1.9-0.1-0.1-0.2-0.3-0.4-0.4-0.5-0.6-1-1.2-1.6-1.7l-0.1-0.1L637.3 74.5c-0.6-0.6-1.2-1.1-1.8-1.6-0.1-0.1-0.3-0.2-0.4-0.4-0.6-0.5-1.2-1-1.9-1.5-0.1 0-0.1-0.1-0.2-0.1-0.6-0.5-1.3-0.9-1.9-1.3-0.1-0.1-0.2-0.1-0.3-0.2-0.7-0.4-1.4-0.9-2.2-1.3-0.8-0.4-1.5-0.8-2.3-1.1h-0.1c-1.6-0.7-3.2-1.3-4.9-1.7-1.6-0.4-3.2-0.8-4.9-1-0.1 0-0.3 0-0.4-0.1-1.4-0.2-2.8-0.3-4.3-0.3H164c-19.9 0-36 16.1-36 36v823.3c0 19.9 16.1 36 36 36h696c19.9 0 36-16.1 36-36V348.6v-1.8zM647.8 186.9l125.4 125.6H647.8V186.9zM200 887.2V135.9h375.8v212.7c0 19.9 16.1 36 36 36H824v502.7H200zM363.5 661.5c-7.2 6.3-15.8 9.5-25.8 9.5-13.5 0-24.5-5-33-15S292 629.3 292 605.7c0-22.2 4.3-38.2 12.9-48.1 8.6-9.9 19.8-14.9 33.6-14.9 10 0 18.5 2.8 25.5 8.4s11.6 13.2 13.8 22.9l37.2-8.9c-4.2-14.9-10.6-26.3-19-34.3-14.2-13.5-32.7-20.2-55.5-20.2-26.1 0-47.1 8.6-63.1 25.7s-24 41.2-24 72.2c0 29.3 8 52.4 23.9 69.3 15.9 16.9 36.2 25.3 60.9 25.3 20 0 36.5-4.9 49.4-14.8 13-9.9 22.3-24.9 27.9-45.3L379 631.6c-3.1 13.6-8.3 23.6-15.5 29.9zM561.5 597.2c-8.8-4.6-22.3-9.1-40.6-13.4s-29.8-8.5-34.5-12.4c-3.7-3.1-5.6-6.9-5.6-11.3 0-4.8 2-8.7 6-11.6 6.2-4.5 14.7-6.7 25.6-6.7 10.6 0 18.5 2.1 23.8 6.3 5.3 4.2 8.7 11.1 10.3 20.6l37.6-1.7c-0.6-17.1-6.8-30.8-18.6-41s-29.4-15.4-52.7-15.4c-14.3 0-26.5 2.2-36.6 6.5-10.1 4.3-17.9 10.6-23.2 18.9-5.4 8.3-8.1 17.1-8.1 26.6 0 14.7 5.7 27.2 17.1 37.5 8.1 7.3 22.3 13.4 42.4 18.4 15.7 3.9 25.7 6.6 30.1 8.1 6.4 2.3 10.9 5 13.5 8.1 2.6 3.1 3.9 6.8 3.9 11.2 0 6.9-3.1 12.8-9.2 18-6.1 5.1-15.3 7.7-27.4 7.7-11.4 0-20.5-2.9-27.2-8.6-6.7-5.8-11.2-14.8-13.4-27l-36.6 3.6c2.5 20.8 10 36.7 22.6 47.5 12.6 10.9 30.7 16.3 54.2 16.3 16.2 0 29.7-2.3 40.5-6.8s19.2-11.4 25.1-20.8c5.9-9.3 8.9-19.3 8.9-30 0-11.8-2.5-21.6-7.4-29.6s-11.7-14.3-20.5-19zM689.9 651.6l-47.1-137.7h-40.7L668.6 700h40.1l66.7-186.1h-39.9z' + const prop = defineProps({ w: { type: [String, Number] }, h: { type: [String, Number] }, @@ -157,15 +162,52 @@ const selectChange = (showSelect: any, height: any, datePickerValue?: any) => { } } +const formatExceedanceValue = (value: any) => { + if (value == 0) return '不越限' + if (value == 1) return '越限' + return value +} + +const getSeriesForCsvExport = () => { + const indicatorSeriesName = indicatorList.value?.find( + (item: any) => item.id === tableStore.table.params.indicator + )?.name + return echartList.value.options.series.map((item: any) => ({ + name: item.name, + data: item.data?.map((point: any) => [ + point[0], + item.name === indicatorSeriesName ? formatExceedanceValue(point[1]) : point[1], + point[2] + ]) + })) +} + const setEchart = () => { // 获取当前选择的功率和指标名称 const powerName = powerList.value?.find((item: any) => item.id === tableStore.table.params.power)?.name || '功率' const indicatorName = indicatorList.value?.find((item: any) => item.id === tableStore.table.params.indicator)?.name || '电能质量指标' + const chartTitle = `${indicatorName}与${powerName}负荷曲线拟合图` + echartList.value = { title: { - text: `${indicatorName}与${powerName}负荷曲线拟合图` + text: chartTitle + }, + toolbox: { + featureProps: { + myTool1: { + show: true, + title: '下载csv', + icon: CSV_DOWNLOAD_ICON, + onclick: () => { + exportSeriesCSV( + getSeriesForCsvExport(), + `${echartList.value.title?.text || '负荷曲线拟合图'}.csv` + ) + } + } + } }, tooltip: { trigger: 'axis', @@ -174,12 +216,8 @@ const setEchart = () => { params.forEach((item: any) => { if (item.seriesName === indicatorName) { // 对于电能质量指标,格式化Y轴值显示 - let valueText = '' - if (item.value[1] == 0) { - valueText = '不越限' - } else if (item.value[1] == 1) { - valueText = '越限' - } else { + let valueText = formatExceedanceValue(item.value[1]) + if (valueText === item.value[1]) { valueText = item.value[1] } result += `
${item.marker}${item.seriesName}: ${valueText}` diff --git a/src/components/cockpit/overLimitStatistics/components/harmonicRatio‌.vue b/src/components/cockpit/overLimitStatistics/components/harmonicRatio‌.vue index 819773b..cd0a8d1 100644 --- a/src/components/cockpit/overLimitStatistics/components/harmonicRatio‌.vue +++ b/src/components/cockpit/overLimitStatistics/components/harmonicRatio‌.vue @@ -75,9 +75,6 @@ @@ -94,7 +91,7 @@ import { ref, onMounted, watch } from 'vue' import MyEchart from '@/components/echarts/MyEchart.vue' import { useDictData } from '@/stores/dictData' import { queryStatistical } from '@/api/system-boot/csstatisticalset' -import { yMethod, exportCSV, completeTimeSeries } from '@/utils/echartMethod' +import { yMethod, exportSeriesCSV, completeTimeSeries } from '@/utils/echartMethod' import TableHeader from '@/components/table/header/index.vue' import { trendData } from '@/api/harmonic-boot/cockpit/cockpit' import DatePicker from '@/components/form/datePicker/index.vue' @@ -386,8 +383,7 @@ const setEchart = () => { itemStyle: { opacity: 0 }, //去圆点 type: 'scroll', // 开启滚动分页 // orient: 'vertical', // 垂直排列 - top: 5, - right: 70 + // width: 550, // height: 50 }, @@ -448,27 +444,22 @@ const setEchart = () => { myTool1: { show: true, 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 => { - // console.log("🚀 ~ init ~ echartsData.value:", echartsData.value.options.series.map(item => item.data)) - - let list = echartsData.value.options.series?.map((item: any) => item.data) - let dataList = list[0]?.map((item: any, index: any) => { - let value = [item[0], item[1]] - 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: any) => item.name), - dataList, - '监测点指标趋势.csv' + icon: 'path://M642 673.1H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9s-8 17.9-17.9 17.9zM642 511.8H301.6c-9.9 0-17.9-8-17.9-17.9 0-9.9 8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9 0 9.9-8 17.9-17.9 17.9zM480.7 350.6H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9h179.2c9.9 0 17.9 8 17.9 17.9s-8.1 17.9-18 17.9zM874.9 350.6H695.7c-49.4 0-89.6-40.2-89.6-89.6V81.9c0-9.9 8-17.9 17.9-17.9 9.9 0 17.9 8 17.9 17.9V261c0 29.6 24.1 53.7 53.7 53.7h179.2c9.9 0 17.9 8 17.9 17.9s-7.9 18-17.8 18zM794.3 959.7H221c-49.4 0-89.6-40.2-89.6-89.6V153.5c0-49.4 40.2-89.6 89.6-89.6h403.1c4.8 0 9.3 1.9 12.7 5.2L887.6 320c3.4 3.4 5.2 7.9 5.2 12.7v537.5c0 52.7-51.9 89.5-98.5 89.5zM221 99.8c-29.6 0-53.7 24.1-53.7 53.7v716.6c0 29.6 24.1 53.7 53.7 53.7h573.3c29 0 62.7-23.5 62.7-53.7v-530L616.7 99.8H221z', + onclick: () => { + exportSeriesCSV( + echartsData.value.options.series, + `${titles.value || '监测点指标趋势'}.csv` ) } + }, + myTool2: { + show: true, + title: timeControl.value ? '关闭缺失数据' : '缺失数据', + icon: 'path://M832 512l-192-192v128H128v128h512v128l192-192zM192 512l192 192v-128h512v-128H384V320L192 512z', + iconStyle: timeControl.value ? { borderColor: '#409EFF' } : {}, + onclick: () => { + setTimeControl() + } } } }, diff --git a/src/components/cockpit/trendComparison/index.vue b/src/components/cockpit/trendComparison/index.vue index 142655a..4826a34 100644 --- a/src/components/cockpit/trendComparison/index.vue +++ b/src/components/cockpit/trendComparison/index.vue @@ -77,7 +77,7 @@ import { useConfig } from '@/stores/config' import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree' import { getListByIds } from '@/api/harmonic-boot/cockpit/cockpit' import { getTime } from '@/utils/formatTime' -import { yMethod, exportCSV } from '@/utils/echartMethod' +import { yMethod, exportSeriesCSV, completeTimeSeries } from '@/utils/echartMethod' import APFTree from '@/components/tree/govern/APFTree.vue' const prop = defineProps({ w: { type: [String, Number] }, @@ -110,6 +110,7 @@ const harmonicCountOptions = ref(Array.from({ length: 49 }, (_, i) => i + 2)) const indicatorList = ref() const echartList = ref() +const timeControl = ref(false) const headerHeight = ref(57) @@ -210,7 +211,7 @@ const setEchart = () => { const color = phaseColors[phase] || config.layout.elementUiPrimary[0] series.push({ - name: `治理前${phaseName}`, + name: `${phaseName}_治理前`, type: 'line', showSymbol: false, smooth: true, @@ -234,12 +235,12 @@ const setEchart = () => { const color = phaseColors[phase] || config.layout.elementUiPrimary[0] series.push({ - name: `治理后${phaseName}`, + name: `${phaseName}_治理后`, type: 'line', showSymbol: false, smooth: true, symbol: 'none', - data: afterGroupedByPhase[phase], + data: timeControl.value ? completeTimeSeries(afterGroupedByPhase[phase]) : afterGroupedByPhase[phase], itemStyle: { normal: { color: color @@ -255,9 +256,9 @@ const setEchart = () => { // 获取指标名称用于图表标题 let titleText = '治理前后对比' if (beforeData.length > 0 && beforeData[0].anotherName) { - titleText = beforeData[0].anotherName + titleText = beforeData[0].anotherName+'治理前后对比' } else if (afterData.length > 0 && afterData[0].anotherName) { - titleText = afterData[0].anotherName + titleText = afterData[0].anotherName+'治理前后对比' } // statisticalData @@ -371,10 +372,40 @@ const setEchart = () => { left: '10px', right: '20px' }, + toolbox: { + featureProps: { + myTool1: { + show: true, + title: '下载csv', + icon: 'path://M642 673.1H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9s-8 17.9-17.9 17.9zM642 511.8H301.6c-9.9 0-17.9-8-17.9-17.9 0-9.9 8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9 0 9.9-8 17.9-17.9 17.9zM480.7 350.6H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9h179.2c9.9 0 17.9 8 17.9 17.9s-8.1 17.9-18 17.9zM874.9 350.6H695.7c-49.4 0-89.6-40.2-89.6-89.6V81.9c0-9.9 8-17.9 17.9-17.9 9.9 0 17.9 8 17.9 17.9V261c0 29.6 24.1 53.7 53.7 53.7h179.2c9.9 0 17.9 8 17.9 17.9s-7.9 18-17.8 18zM794.3 959.7H221c-49.4 0-89.6-40.2-89.6-89.6V153.5c0-49.4 40.2-89.6 89.6-89.6h403.1c4.8 0 9.3 1.9 12.7 5.2L887.6 320c3.4 3.4 5.2 7.9 5.2 12.7v537.5c0 52.7-51.9 89.5-98.5 89.5zM221 99.8c-29.6 0-53.7 24.1-53.7 53.7v716.6c0 29.6 24.1 53.7 53.7 53.7h573.3c29 0 62.7-23.5 62.7-53.7v-530L616.7 99.8H221z', + iconStyle: timeControl.value ? { borderColor: '#409EFF' } : {}, + onclick: () => { + exportSeriesCSV( + echartList.value.series, + `${echartList.value.title?.text || '趋势对比'}.csv` + ) + } + }, + myTool2: { + show: true, + title: timeControl.value ? '关闭缺失数据' : '缺失数据', + icon: 'path://M832 512l-192-192v128H128v128h512v128l192-192zM192 512l192 192v-128h512v-128H384V320L192 512z', + iconStyle: timeControl.value ? { borderColor: '#409EFF' } : {}, + onclick: () => { + setTimeControl() + } + } + } + }, series: series } } +const setTimeControl = () => { + timeControl.value = !timeControl.value + setEchart() +} + const tableStore: any = new TableStore({ url: '/cs-device-boot/csGroup/sensitiveUserTrendData', method: 'POST', diff --git a/src/components/echarts/MyEchart.vue b/src/components/echarts/MyEchart.vue index 7ed4390..2b59a94 100644 --- a/src/components/echarts/MyEchart.vue +++ b/src/components/echarts/MyEchart.vue @@ -43,6 +43,7 @@ const initChart = () => { left: 'center', // textStyle: { color: '#000', + top: 5, textStyle: { color: '#000', fontSize: '15' @@ -66,7 +67,7 @@ const initChart = () => { }, toolbox: { right: 20, - top: 15, + top: props.options?.title?.text ? 20 : 0, feature: { saveAsImage: { title: '下载图片', @@ -78,10 +79,11 @@ const initChart = () => { ...(props.options?.toolbox || null) }, legend: { - right: 50, - top: 25, + right: 100, + top: props.options?.title?.text ? 25 : 5, itemGap: 10, itemStyle: {}, + type: 'scroll', // 开启滚动分页 // textStyle: { fontSize: 12, // padding: [2, 0, 0, 0], //[上、右、下、左] @@ -91,7 +93,7 @@ const initChart = () => { ...(props.options?.legend || null) }, grid: { - top: '50px', + top: props.options?.title?.text ? '50px' : '25px', left: '30px', right: '70px', bottom: props.options?.options?.dataZoom === null ? '10px' : '40px', diff --git a/src/utils/echartMethod.ts b/src/utils/echartMethod.ts index b91a3ad..b72a4f6 100644 --- a/src/utils/echartMethod.ts +++ b/src/utils/echartMethod.ts @@ -161,6 +161,41 @@ export const exportCSV = (title: object, data: any, filename: string) => { URL.revokeObjectURL(link.href) } +/** + * 将多条折线按时间对齐合并为 CSV 行(避免各 series 长度不一致时按索引对齐丢数据) + */ +export const buildSeriesCsvData = (seriesList: Array<{ name: string; data?: any[] }>) => { + if (!seriesList?.length) { + return { titles: [], rows: [] } + } + const titles = seriesList.map(s => s.name) + const timeMap = new Map() + + seriesList.forEach((series, seriesIndex) => { + series.data?.forEach((point: any) => { + const time = point?.[0] + if (!time) return + const timeKey = String(time) + if (!timeMap.has(timeKey)) { + timeMap.set(timeKey, [timeKey, ...Array(seriesList.length).fill(null)]) + } + const row = timeMap.get(timeKey)! + row[seriesIndex + 1] = point[1] ?? null + }) + }) + + const rows = Array.from(timeMap.values()).sort( + (a, b) => new Date(a[0] as string).getTime() - new Date(b[0] as string).getTime() + ) + return { titles, rows } +} + +export const exportSeriesCSV = (seriesList: Array<{ name: string; data?: any[] }>, filename: string) => { + const { titles, rows } = buildSeriesCsvData(seriesList) + if (!rows.length) return + exportCSV(titles, rows, filename) +} + /** * 补全时间序列数据中缺失的条目 * @param rawData 原始数据,格式为 [["时间字符串", "数值", "单位", "类型"], ...] diff --git a/src/views/govern/alarm/Device.vue b/src/views/govern/alarm/Device.vue index 16ebd10..3192ce5 100644 --- a/src/views/govern/alarm/Device.vue +++ b/src/views/govern/alarm/Device.vue @@ -108,6 +108,12 @@ const tableStore = new TableStore({ { title: '工程名称', field: 'engineeringName', align: 'center', minWidth: 120 }, // { title: '监测点名称', field: 'lineName', align: 'center', minWidth: 120 }, + + { + title: '事件描述', + minWidth: 300, + field: 'showName' + }, { title: '模块信息', field: 'moduleNo', @@ -117,6 +123,7 @@ const tableStore = new TableStore({ return row.cellValue ? row.cellValue : '/' } }, + { title: '告警代码', field: 'code', @@ -127,11 +134,6 @@ const tableStore = new TableStore({ }, sortable: true }, - { - title: '事件描述', - minWidth: 300, - field: 'showName' - }, { title: '级别', field: 'level', diff --git a/src/views/govern/alarm/Front.vue b/src/views/govern/alarm/Front.vue index 5a40bc0..4280042 100644 --- a/src/views/govern/alarm/Front.vue +++ b/src/views/govern/alarm/Front.vue @@ -80,8 +80,8 @@ const tableStore = new TableStore({ }, { title: '发生时刻', field: 'startTime', align: 'center', width: 180, sortable: true }, { title: '前置服务器名称', field: 'lineId', align: 'center', width: 150 }, - { title: '前置服务器ip', field: 'wavePath', align: 'center', width: 150 }, { title: '进程号', field: 'clDid', align: 'center', width: 70 }, + { title: '前置服务器ip', field: 'wavePath', align: 'center', width: 150 }, { title: '事件描述', diff --git a/src/views/govern/analyze/APF/APF.vue b/src/views/govern/analyze/APF/APF.vue index 6fea39b..013f41e 100644 --- a/src/views/govern/analyze/APF/APF.vue +++ b/src/views/govern/analyze/APF/APF.vue @@ -32,9 +32,6 @@ @@ -60,7 +57,7 @@ import { getDevCapacity } from '@/api/cs-device-boot/capacity' import { queryCommonStatisticalByTime } from '@/api/cs-harmonic-boot/stable' import DatePicker from '@/components/form/datePicker/index.vue' import MyEchart from '@/components/echarts/MyEchart.vue' -import { yMethod, completeTimeSeries } from '@/utils/echartMethod' +import { yMethod, exportSeriesCSV, completeTimeSeries } from '@/utils/echartMethod' import TableHeader from '@/components/table/header/index.vue' const timeControl = ref(false) @@ -147,7 +144,7 @@ const nodeClick = async (e: anyObj) => { } const lineStyle = [ { type: 'solid', width: 3 }, - { type: 'dotted', width: 3 }, + { type: 'dashed', width: 3 }, { type: 'dashed', width: 3 } ] const search = () => { @@ -305,7 +302,7 @@ const setEchart = () => { itemHeight: 20, itemStyle: { opacity: 0 }, //去圆点 type: 'scroll', // 开启滚动分页 - top: 25 + // top: 25 // data: legend }, grid: { @@ -316,8 +313,26 @@ const setEchart = () => { containLabel: true }, toolbox: { - feature: { - saveAsImage: {} + featureProps: { + myTool1: { + show: true, + title: '下载csv', + icon: 'path://M642 673.1H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9s-8 17.9-17.9 17.9zM642 511.8H301.6c-9.9 0-17.9-8-17.9-17.9 0-9.9 8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9 0 9.9-8 17.9-17.9 17.9zM480.7 350.6H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9h179.2c9.9 0 17.9 8 17.9 17.9s-8.1 17.9-18 17.9zM874.9 350.6H695.7c-49.4 0-89.6-40.2-89.6-89.6V81.9c0-9.9 8-17.9 17.9-17.9 9.9 0 17.9 8 17.9 17.9V261c0 29.6 24.1 53.7 53.7 53.7h179.2c9.9 0 17.9 8 17.9 17.9s-7.9 18-17.8 18zM794.3 959.7H221c-49.4 0-89.6-40.2-89.6-89.6V153.5c0-49.4 40.2-89.6 89.6-89.6h403.1c4.8 0 9.3 1.9 12.7 5.2L887.6 320c3.4 3.4 5.2 7.9 5.2 12.7v537.5c0 52.7-51.9 89.5-98.5 89.5zM221 99.8c-29.6 0-53.7 24.1-53.7 53.7v716.6c0 29.6 24.1 53.7 53.7 53.7h573.3c29 0 62.7-23.5 62.7-53.7v-530L616.7 99.8H221z', + onclick: () => { + const chartTitle = + zblist.value.filter(item => item.id == formInline.statisticalId)[0]?.name || 'APF数据' + exportSeriesCSV(echartsData.value.options.series, `${chartTitle}.csv`) + } + }, + myTool2: { + show: true, + title: timeControl.value ? '关闭缺失数据' : '缺失数据', + icon: 'path://M832 512l-192-192v128H128v128h512v128l192-192zM192 512l192 192v-128h512v-128H384V320L192 512z', + iconStyle: timeControl.value ? { borderColor: '#409EFF' } : {}, + onclick: () => { + setTimeControl() + } + } } }, color: color, diff --git a/src/views/govern/analyze/steadyState/components/chart.vue b/src/views/govern/analyze/steadyState/components/chart.vue index a935a97..74725e3 100644 --- a/src/views/govern/analyze/steadyState/components/chart.vue +++ b/src/views/govern/analyze/steadyState/components/chart.vue @@ -32,9 +32,6 @@ @@ -58,7 +55,7 @@ import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree' import { queryCommonStatisticalByTime } from '@/api/cs-harmonic-boot/stable' import DatePicker from '@/components/form/datePicker/index.vue' import MyEchart from '@/components/echarts/MyEchart.vue' -import { yMethod, completeTimeSeries } from '@/utils/echartMethod' +import { yMethod, exportSeriesCSV, completeTimeSeries } from '@/utils/echartMethod' import TableHeader from '@/components/table/header/index.vue' const MAX_CHECK = 2 @@ -308,7 +305,7 @@ const setEchart = () => { itemHeight: 20, itemStyle: { opacity: 0 }, type: 'scroll', - top: 25 + }, grid: { left: '20px', @@ -317,7 +314,29 @@ const setEchart = () => { top: '80px', containLabel: true }, - toolbox: { feature: { saveAsImage: {} } }, + toolbox: { + featureProps: { + myTool1: { + show: true, + title: '下载csv', + icon: 'path://M642 673.1H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9s-8 17.9-17.9 17.9zM642 511.8H301.6c-9.9 0-17.9-8-17.9-17.9 0-9.9 8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9 0 9.9-8 17.9-17.9 17.9zM480.7 350.6H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9h179.2c9.9 0 17.9 8 17.9 17.9s-8.1 17.9-18 17.9zM874.9 350.6H695.7c-49.4 0-89.6-40.2-89.6-89.6V81.9c0-9.9 8-17.9 17.9-17.9 9.9 0 17.9 8 17.9 17.9V261c0 29.6 24.1 53.7 53.7 53.7h179.2c9.9 0 17.9 8 17.9 17.9s-7.9 18-17.8 18zM794.3 959.7H221c-49.4 0-89.6-40.2-89.6-89.6V153.5c0-49.4 40.2-89.6 89.6-89.6h403.1c4.8 0 9.3 1.9 12.7 5.2L887.6 320c3.4 3.4 5.2 7.9 5.2 12.7v537.5c0 52.7-51.9 89.5-98.5 89.5zM221 99.8c-29.6 0-53.7 24.1-53.7 53.7v716.6c0 29.6 24.1 53.7 53.7 53.7h573.3c29 0 62.7-23.5 62.7-53.7v-530L616.7 99.8H221z', + onclick: () => { + const chartTitle = + zblist.value.filter(item => item.id == formInline.statisticalId)[0]?.name || '稳态数据' + exportSeriesCSV(echartsData.value.options.series, `${chartTitle}.csv`) + } + }, + myTool2: { + show: true, + title: timeControl.value ? '关闭缺失数据' : '缺失数据', + icon: 'path://M832 512l-192-192v128H128v128h512v128l192-192zM192 512l192 192v-128h512v-128H384V320L192 512z', + iconStyle: timeControl.value ? { borderColor: '#409EFF' } : {}, + onclick: () => { + setTimeControl() + } + } + } + }, color, xAxis: { name: '', diff --git a/src/views/govern/device/control/detail.vue b/src/views/govern/device/control/detail.vue index ed32ec1..ed54c73 100644 --- a/src/views/govern/device/control/detail.vue +++ b/src/views/govern/device/control/detail.vue @@ -249,7 +249,7 @@ const init = () => { show: true, 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', + icon: 'path://M642 673.1H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9s-8 17.9-17.9 17.9zM642 511.8H301.6c-9.9 0-17.9-8-17.9-17.9 0-9.9 8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9 0 9.9-8 17.9-17.9 17.9zM480.7 350.6H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9h179.2c9.9 0 17.9 8 17.9 17.9s-8.1 17.9-18 17.9zM874.9 350.6H695.7c-49.4 0-89.6-40.2-89.6-89.6V81.9c0-9.9 8-17.9 17.9-17.9 9.9 0 17.9 8 17.9 17.9V261c0 29.6 24.1 53.7 53.7 53.7h179.2c9.9 0 17.9 8 17.9 17.9s-7.9 18-17.8 18zM794.3 959.7H221c-49.4 0-89.6-40.2-89.6-89.6V153.5c0-49.4 40.2-89.6 89.6-89.6h403.1c4.8 0 9.3 1.9 12.7 5.2L887.6 320c3.4 3.4 5.2 7.9 5.2 12.7v537.5c0 52.7-51.9 89.5-98.5 89.5zM221 99.8c-29.6 0-53.7 24.1-53.7 53.7v716.6c0 29.6 24.1 53.7 53.7 53.7h573.3c29 0 62.7-23.5 62.7-53.7v-530L616.7 99.8H221z', onclick: (e) => { diff --git a/src/views/govern/device/control/tabs/electroplating.vue b/src/views/govern/device/control/tabs/electroplating.vue index a22cbbd..c8ac9a3 100644 --- a/src/views/govern/device/control/tabs/electroplating.vue +++ b/src/views/govern/device/control/tabs/electroplating.vue @@ -38,9 +38,6 @@ @@ -56,7 +53,7 @@ import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree' import { ref, onMounted } from 'vue' import MyEchart from '@/components/echarts/MyEchart.vue' import { useDictData } from '@/stores/dictData' -import { yMethod, exportCSV, completeTimeSeries } from '@/utils/echartMethod' +import { yMethod, exportSeriesCSV, completeTimeSeries } from '@/utils/echartMethod' import TableHeader from '@/components/table/header/index.vue' import { getTabsDataByType } from '@/api/cs-device-boot/EquipmentDelivery' import DatePicker from '@/components/form/datePicker/index.vue' @@ -231,8 +228,7 @@ const setEchart = () => { itemStyle: { opacity: 0 }, //去圆点 type: 'scroll', // 开启滚动分页 // orient: 'vertical', // 垂直排列 - top: 5, - right: 70 + // width: 550, // height: 50 }, @@ -292,26 +288,18 @@ const setEchart = () => { myTool1: { show: true, 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 => { - // console.log("🚀 ~ init ~ echartsData.value:", echartsData.value.options.series.map(item => item.data)) - - let list = echartsData.value.options.series?.map((item: any) => item.data) - let dataList = list[0]?.map((item: any, index: any) => { - let value = [item[0], item[1]] - 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: any) => item.name), - dataList, - '电度数据.csv' - ) + icon: 'path://M642 673.1H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9s-8 17.9-17.9 17.9zM642 511.8H301.6c-9.9 0-17.9-8-17.9-17.9 0-9.9 8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9 0 9.9-8 17.9-17.9 17.9zM480.7 350.6H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9h179.2c9.9 0 17.9 8 17.9 17.9s-8.1 17.9-18 17.9zM874.9 350.6H695.7c-49.4 0-89.6-40.2-89.6-89.6V81.9c0-9.9 8-17.9 17.9-17.9 9.9 0 17.9 8 17.9 17.9V261c0 29.6 24.1 53.7 53.7 53.7h179.2c9.9 0 17.9 8 17.9 17.9s-7.9 18-17.8 18zM794.3 959.7H221c-49.4 0-89.6-40.2-89.6-89.6V153.5c0-49.4 40.2-89.6 89.6-89.6h403.1c4.8 0 9.3 1.9 12.7 5.2L887.6 320c3.4 3.4 5.2 7.9 5.2 12.7v537.5c0 52.7-51.9 89.5-98.5 89.5zM221 99.8c-29.6 0-53.7 24.1-53.7 53.7v716.6c0 29.6 24.1 53.7 53.7 53.7h573.3c29 0 62.7-23.5 62.7-53.7v-530L616.7 99.8H221z', + onclick: () => { + exportSeriesCSV(echartsData.value.options.series, '电度数据.csv') + } + }, + myTool2: { + show: true, + title: timeControl.value ? '关闭缺失数据' : '缺失数据', + icon: 'path://M832 512l-192-192v128H128v128h512v128l192-192zM192 512l192 192v-128h512v-128H384V320L192 512z', + iconStyle: timeControl.value ? { borderColor: '#409EFF' } : {}, + onclick: () => { + setTimeControl() } } } diff --git a/src/views/govern/device/control/tabs/trend.vue b/src/views/govern/device/control/tabs/trend.vue index e371780..5a6250d 100644 --- a/src/views/govern/device/control/tabs/trend.vue +++ b/src/views/govern/device/control/tabs/trend.vue @@ -46,9 +46,6 @@ @@ -65,7 +62,7 @@ import { ref, onMounted, watch } from 'vue' import MyEchart from '@/components/echarts/MyEchart.vue' import { useDictData } from '@/stores/dictData' import { queryStatistical } from '@/api/system-boot/csstatisticalset' -import { yMethod, exportCSV, completeTimeSeries } from '@/utils/echartMethod' +import { yMethod, exportSeriesCSV, completeTimeSeries } from '@/utils/echartMethod' import TableHeader from '@/components/table/header/index.vue' import { getTabsDataByType } from '@/api/cs-device-boot/EquipmentDelivery' import DatePicker from '@/components/form/datePicker/index.vue' @@ -324,8 +321,7 @@ const setEchart = () => { itemStyle: { opacity: 0 }, //去圆点 type: 'scroll', // 开启滚动分页 // orient: 'vertical', // 垂直排列 - top: 5, - right: 70 + // width: 550, // height: 50 }, @@ -385,26 +381,18 @@ const setEchart = () => { myTool1: { show: true, 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 => { - // console.log("🚀 ~ init ~ echartsData.value:", echartsData.value.options.series.map(item => item.data)) - - let list = echartsData.value.options.series?.map((item: any) => item.data) - let dataList = list[0]?.map((item: any, index: any) => { - let value = [item[0], item[1]] - 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: any) => item.name), - dataList, - '历史趋势.csv' - ) + icon: 'path://M642 673.1H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9s-8 17.9-17.9 17.9zM642 511.8H301.6c-9.9 0-17.9-8-17.9-17.9 0-9.9 8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9 0 9.9-8 17.9-17.9 17.9zM480.7 350.6H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9h179.2c9.9 0 17.9 8 17.9 17.9s-8.1 17.9-18 17.9zM874.9 350.6H695.7c-49.4 0-89.6-40.2-89.6-89.6V81.9c0-9.9 8-17.9 17.9-17.9 9.9 0 17.9 8 17.9 17.9V261c0 29.6 24.1 53.7 53.7 53.7h179.2c9.9 0 17.9 8 17.9 17.9s-7.9 18-17.8 18zM794.3 959.7H221c-49.4 0-89.6-40.2-89.6-89.6V153.5c0-49.4 40.2-89.6 89.6-89.6h403.1c4.8 0 9.3 1.9 12.7 5.2L887.6 320c3.4 3.4 5.2 7.9 5.2 12.7v537.5c0 52.7-51.9 89.5-98.5 89.5zM221 99.8c-29.6 0-53.7 24.1-53.7 53.7v716.6c0 29.6 24.1 53.7 53.7 53.7h573.3c29 0 62.7-23.5 62.7-53.7v-530L616.7 99.8H221z', + onclick: () => { + exportSeriesCSV(echartsData.value.options.series, '历史趋势.csv') + } + }, + myTool2: { + show: true, + title: timeControl.value ? '关闭缺失数据' : '缺失数据', + icon: 'path://M832 512l-192-192v128H128v128h512v128l192-192zM192 512l192 192v-128h512v-128H384V320L192 512z', + iconStyle: timeControl.value ? { borderColor: '#409EFF' } : {}, + onclick: () => { + setTimeControl() } } } diff --git a/src/views/govern/device/planData/index.vue b/src/views/govern/device/planData/index.vue index af2ce8b..100e91c 100644 --- a/src/views/govern/device/planData/index.vue +++ b/src/views/govern/device/planData/index.vue @@ -166,13 +166,6 @@ 查询 - @@ -619,10 +612,19 @@ const setEchart = () => { myTool1: { show: true, 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 => { + icon: 'path://M642 673.1H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9s-8 17.9-17.9 17.9zM642 511.8H301.6c-9.9 0-17.9-8-17.9-17.9 0-9.9 8-17.9 17.9-17.9H642c9.9 0 17.9 8 17.9 17.9 0 9.9-8 17.9-17.9 17.9zM480.7 350.6H301.6c-9.9 0-17.9-8-17.9-17.9s8-17.9 17.9-17.9h179.2c9.9 0 17.9 8 17.9 17.9s-8.1 17.9-18 17.9zM874.9 350.6H695.7c-49.4 0-89.6-40.2-89.6-89.6V81.9c0-9.9 8-17.9 17.9-17.9 9.9 0 17.9 8 17.9 17.9V261c0 29.6 24.1 53.7 53.7 53.7h179.2c9.9 0 17.9 8 17.9 17.9s-7.9 18-17.8 18zM794.3 959.7H221c-49.4 0-89.6-40.2-89.6-89.6V153.5c0-49.4 40.2-89.6 89.6-89.6h403.1c4.8 0 9.3 1.9 12.7 5.2L887.6 320c3.4 3.4 5.2 7.9 5.2 12.7v537.5c0 52.7-51.9 89.5-98.5 89.5zM221 99.8c-29.6 0-53.7 24.1-53.7 53.7v716.6c0 29.6 24.1 53.7 53.7 53.7h573.3c29 0 62.7-23.5 62.7-53.7v-530L616.7 99.8H221z', + onclick: () => { handleExport() } + }, + myTool2: { + show: true, + title: timeControl.value ? '关闭缺失数据' : '缺失数据', + icon: 'path://M832 512l-192-192v128H128v128h512v128l192-192zM192 512l192 192v-128h512v-128H384V320L192 512z', + iconStyle: timeControl.value ? { borderColor: '#409EFF' } : {}, + onclick: () => { + setTimeControl() + } } } }, @@ -631,7 +633,7 @@ const setEchart = () => { itemHeight: 20, itemStyle: { opacity: 0 }, //去圆点 type: 'scroll', // 开启滚动分页 - right: 70 + // width: 550, // height: 50