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 @@
- + - + - + - +
@@ -28,6 +28,7 @@ defineOptions({ }) const deviceTree = ref([]) const activeName = ref('1') +const key = ref(0) getDeviceTree().then(res => { res.data.forEach((item: any) => { item.value = item.id @@ -43,6 +44,7 @@ getDeviceTree().then(res => { }) }) deviceTree.value = res.data + key.value += 1 }) onMounted(() => { }) diff --git a/src/views/govern/analyze/APF/index.vue b/src/views/govern/analyze/APF/index.vue index a39d706..40fe52a 100644 --- a/src/views/govern/analyze/APF/index.vue +++ b/src/views/govern/analyze/APF/index.vue @@ -86,7 +86,7 @@ const zblist = ref([]) const init = () => { return new Promise((resolve, reject) => { queryByCode('Harmonic_Type').then(res => { - queryCsDictTree(res.data.id).then(res => { + queryCsDictTree(res.data?.id).then(res => { zblist.value = res.data.map((item: any) => { return { value: item.id, @@ -302,11 +302,11 @@ const search = () => { } else { echartsData.value = null } - - }) - setTimeout(() => { loading.value = false - }, 0) + }).catch(() => { + loading.value = false + }) + } diff --git a/src/views/govern/analyze/DVR/index.vue b/src/views/govern/analyze/DVR/index.vue index 7712db29..594972c 100644 --- a/src/views/govern/analyze/DVR/index.vue +++ b/src/views/govern/analyze/DVR/index.vue @@ -1,13 +1,15 @@ diff --git a/src/views/govern/reportForms/luckysheet.vue b/src/views/govern/reportForms/luckysheet.vue index eff9e43..f428005 100644 --- a/src/views/govern/reportForms/luckysheet.vue +++ b/src/views/govern/reportForms/luckysheet.vue @@ -1,19 +1,13 @@