From 6a066525320b23faf7585185c3225159d795c7f8 Mon Sep 17 00:00:00 2001 From: GGJ <357021191@qq.com> Date: Mon, 30 Dec 2024 10:07:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9mqtt=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 29 ++++++-- src/components/echarts/rmsboxi.vue | 2 +- src/components/echarts/shushiboxi.vue | 2 +- src/utils/echartMethod.ts | 65 +++++++++--------- src/utils/tableStore.ts | 7 +- src/views/govern/alarm/index.vue | 10 +-- src/views/govern/analyze/APF/index.vue | 10 +-- src/views/govern/analyze/DVR/index.vue | 67 ++++++++++++++----- src/views/govern/device/control/index.vue | 4 +- .../currentDevice.vue | 2 +- .../tabs/components/waveFormAnalysis.vue | 6 +- .../govern/device/control/tabs/event.vue | 6 +- src/views/govern/device/fileService/index.vue | 2 +- .../device/planData/components/transient.vue | 4 +- src/views/govern/manage/factory.vue | 6 +- src/views/govern/reportForms/form.vue | 7 +- src/views/govern/reportForms/luckysheet.vue | 23 ++++--- src/views/system/reportForms/form.vue | 5 +- src/views/system/reportForms/luckysheet.vue | 9 +++ 19 files changed, 173 insertions(+), 93 deletions(-) diff --git a/src/App.vue b/src/App.vue index cd53d16..ac5cde6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,15 +7,30 @@ diff --git a/src/components/echarts/rmsboxi.vue b/src/components/echarts/rmsboxi.vue index dd2d2e8..1b84115 100644 --- a/src/components/echarts/rmsboxi.vue +++ b/src/components/echarts/rmsboxi.vue @@ -1466,7 +1466,7 @@ export default { //minInterval: 1, type: "value", axisLine: { - show: false, + show: true, lineStyle: { color: _this.DColor ? "#fff" : echartsColor.thread, }, diff --git a/src/components/echarts/shushiboxi.vue b/src/components/echarts/shushiboxi.vue index b834b11..dc496f6 100644 --- a/src/components/echarts/shushiboxi.vue +++ b/src/components/echarts/shushiboxi.vue @@ -188,7 +188,7 @@ export default { ' 暂降(骤升)幅值:' + (featureAmplitude) + '% 持续时间:' + - (this.boxoList.persistTime ? this.boxoList.persistTime.toFixed(2) : '-') + + (this.boxoList.persistTime || this.boxoList.evtParamTm || '-') + 's' } else { this.titles = diff --git a/src/utils/echartMethod.ts b/src/utils/echartMethod.ts index 4aecb63..17843d6 100644 --- a/src/utils/echartMethod.ts +++ b/src/utils/echartMethod.ts @@ -1,49 +1,46 @@ const dataProcessing = (arr: any[]) => { return arr - .filter(item => typeof item == 'number' || (typeof item == 'string' && !isNaN(parseFloat(item)))) - .map(item => (typeof item == 'number' ? item : parseFloat(item))) + .filter(item => typeof item === 'number' || (typeof item === 'string' && !isNaN(parseFloat(item)))) + .map(item => (typeof item === 'number' ? item : parseFloat(item))) } // 处理y轴最大最小值 export const yMethod = (arr: any) => { - const numList = dataProcessing(arr); - const maxValue = Math.max(...numList); - const minValue = Math.min(...numList); - - const calculateBoundary = (value: number, base: number) => { - return Math[value > 0? 'ceil' : 'floor'](value / base) * base; - }; - - let max: number; - let min: number; + let numList = dataProcessing(arr) + let maxValue = 0 + let minValue = 0 + let max = 0 + let min = 0 + maxValue = Math.max(...numList) + minValue = Math.min(...numList) if (maxValue > 1000 || minValue < -1000) { - max = calculateBoundary(maxValue, 100); - min = minValue == 0? 0 : calculateBoundary(minValue, 100); - } else if (maxValue < 60 && minValue > 40) { - max = 60; - min = 40; - } else if (maxValue == minValue) { - if (maxValue < 10 && minValue > 0) { - max = calculateBoundary(maxValue, 10); - min = calculateBoundary(minValue, 10); - } else if (maxValue!== 0 && minValue!== 0) { - max = calculateBoundary(maxValue / 10 + 1, 10); - min = calculateBoundary(minValue / 10 - 1, 10); + max = Math.ceil(maxValue / 100) * 100 + if (minValue == 0) { + min = 0 + } else { + min = Math.floor(minValue / 100) * 100 } + } else if (maxValue < 60 && minValue > 40) { + max = 60 + min = 40 + } else if (maxValue == minValue && maxValue < 10 && minValue > 0) { + max = Math.ceil(maxValue / 10) * 10 + min = Math.floor(minValue / 10) * 10 + } else if (maxValue == minValue && maxValue != 0 && minValue != 0) { + max = Math.ceil(maxValue / 10 + 1) * 10 + min = Math.floor(minValue / 10 - 1) * 10 } else { - max = calculateBoundary(maxValue, 10); - min = calculateBoundary(minValue, 10); + max = Math.ceil(maxValue / 10) * 10 + min = Math.floor(minValue / 10) * 10 } if (maxValue > 0 && maxValue < 1) { - max = 1; + max = 1 + } else if (max == 0 && minValue > -1 && minValue < 0) { + min = -1 } - if (max == 0 && minValue > -1 && minValue < 0) { - min = -1; - } - - return [min, max]; -}; + return [min, max] +} /** * title['A相','B相',] @@ -51,7 +48,7 @@ export const yMethod = (arr: any) => { */ // 导出csv文件 const convertToCSV = (title: object, data: any) => { - // console.log('🚀 ~ convertToCSV ~ data:', data) + console.log('🚀 ~ convertToCSV ~ data:', data) let csv = '' // 添加列头 csv += ',' + title.join(',') + '\n' diff --git a/src/utils/tableStore.ts b/src/utils/tableStore.ts index b7a4610..ff719b9 100644 --- a/src/utils/tableStore.ts +++ b/src/utils/tableStore.ts @@ -4,7 +4,7 @@ import { requestPayload } from '@/utils/request' import { Method } from 'axios' import { mainHeight } from '@/utils/layout' import { filtration } from './tableMethod' - +import { ElMessage } from 'element-plus' interface TableStoreParams { url: string // 请求地址 pk?: string @@ -183,6 +183,11 @@ export default class TableStore { 'export', () => { // this.index() + ElMessage({ + message: '正在导出,请稍等...', + type: 'info', + duration: 1000 + }) let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total } createAxios( Object.assign( diff --git a/src/views/govern/alarm/index.vue b/src/views/govern/alarm/index.vue index 429eb9c..ae356d9 100644 --- a/src/views/govern/alarm/index.vue +++ b/src/views/govern/alarm/index.vue @@ -2,16 +2,16 @@