From d9dfd804c5cc2604f9f35bd07ef62b8156185eff Mon Sep 17 00:00:00 2001 From: guanj Date: Tue, 16 Jun 2026 08:34:45 +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 --- src/components/cockpit/F47Curve/index.vue | 3 +- src/components/cockpit/ITICurve/index.vue | 3 +- .../cockpit/exceedanceLevel/index.vue | 78 +- .../cockpit/governanceReport/index.vue | 14 +- .../components/harmonicRatio‌.vue | 10 +- .../components/harmonicRatio‌.vue | 10 +- .../cockpit/indicatorFittingChart/index.vue | 6 +- .../listOfMainMonitoringPoints/index.vue | 19 +- .../cockpit/monitoringPointList/index.vue | 6 +- .../components/harmonicRatio‌.vue | 10 +- .../cockpit/sensitiveLoad/index.vue | 4 +- .../components/transientList.vue | 7 +- .../cockpit/transientDetails/index.vue | 18 +- .../components/transientStatisticsDetail.vue | 7 +- .../cockpit/trendComparison/index.vue | 1105 +++--- src/components/echarts/MyEchart.vue | 7 +- src/components/echarts/color.ts | 22 +- src/components/echarts/rmsboxi.vue | 6 +- src/components/echarts/shushiboxi.vue | 5 +- src/components/table/index.vue | 13 +- .../tree/govern/cloudDeviceEntryTree.vue | 1 + src/components/tree/govern/pointTree.vue | 2 +- src/components/tree/index.vue | 4 +- src/utils/echartMethod.ts | 60 +- src/utils/luckysheetHelper.ts | 14 +- src/views/govern/alarm/Device.vue | 53 +- src/views/govern/alarm/Transient.vue | 17 +- src/views/govern/alarm/eventStatistics.vue | 39 + .../govern/alarm/eventStatistics/F47.vue | 346 ++ .../govern/alarm/eventStatistics/ITIC.vue | 332 ++ .../alarm/eventStatistics/distribution.vue | 248 ++ src/views/govern/alarm/index.vue | 57 +- src/views/govern/analyze/APF/APF.vue | 11 +- src/views/govern/analyze/APF/index.vue | 4 +- src/views/govern/analyze/DVR/index.vue | 7 +- .../analyze/steadyState/components/chart.vue | 9 +- .../analyze/steadyState/components/report.vue | 15 +- .../components/monitoring.vue | 2932 ++++++++++++++++ src/views/govern/cloudDeviceEntry/index.vue | 2956 +---------------- src/views/govern/device/control/detail.vue | 11 +- src/views/govern/device/control/index.vue | 7 +- .../device/control/nearRealTimeData.vue | 13 +- .../device/control/tabs/electroplating.vue | 7 +- .../govern/device/control/tabs/event.vue | 7 +- .../govern/device/control/tabs/trend.vue | 20 +- src/views/govern/device/manage/index.vue | 9 +- .../device/planData/components/transient.vue | 7 +- src/views/govern/device/planData/index.vue | 24 +- src/views/govern/log/components/front.vue | 129 +- src/views/govern/log/debug.vue | 4 +- src/views/govern/log/opera.vue | 54 +- .../govern/manage/components/factoryForm.vue | 60 +- src/views/govern/manage/factory.vue | 40 +- src/views/govern/manage/monthly.vue | 3 +- .../govern/reportCore/lineReport/index.vue | 14 +- .../govern/reportCore/statistics/index.vue | 9 +- .../statisticsWx/components/report.vue | 9 +- .../statisticsWx/components/sheet.vue | 13 +- .../govern/reportCore/statisticsWx/index.vue | 17 +- .../reportCore/statisticsWx/index_zl.vue | 85 +- .../govern/sensitiveLoadMange/detail.vue | 6 +- src/views/govern/sensitiveLoadMange/index.vue | 4 +- ....timestamp-1781526221528-0257d9cd8498d.mjs | 119 + 63 files changed, 5289 insertions(+), 3842 deletions(-) create mode 100644 src/views/govern/alarm/eventStatistics.vue create mode 100644 src/views/govern/alarm/eventStatistics/F47.vue create mode 100644 src/views/govern/alarm/eventStatistics/ITIC.vue create mode 100644 src/views/govern/alarm/eventStatistics/distribution.vue create mode 100644 src/views/govern/cloudDeviceEntry/components/monitoring.vue create mode 100644 vite.config.ts.timestamp-1781526221528-0257d9cd8498d.mjs diff --git a/src/components/cockpit/F47Curve/index.vue b/src/components/cockpit/F47Curve/index.vue index aed511c..d8eee6d 100644 --- a/src/components/cockpit/F47Curve/index.vue +++ b/src/components/cockpit/F47Curve/index.vue @@ -455,7 +455,8 @@ const handleTolerableEventClick = async (row: any) => { persistTime: row.value[0], //持续时间 featureAmplitude: (row.value[1] / 100), //残余电压 startTime: row.value[2], //时间 - lineName: row.value[4] //监测点名称 + lineName: row.value[4], //监测点名称 + engineeringName: row.value[5], } boxoList.value.systemType = 'YPT' wp.value = res.data diff --git a/src/components/cockpit/ITICurve/index.vue b/src/components/cockpit/ITICurve/index.vue index 44bf1d4..fec39cb 100644 --- a/src/components/cockpit/ITICurve/index.vue +++ b/src/components/cockpit/ITICurve/index.vue @@ -387,7 +387,8 @@ const handleTolerableEventClick = async (row: any) => { persistTime: row.value[0], //持续时间 featureAmplitude: (row.value[1] / 100), //残余电压 startTime: row.value[2], //时间 - lineName: row.value[4] //监测点名称 + lineName: row.value[4], //监测点名称 + engineeringName: row.value[5], } boxoList.value.systemType = 'YPT' wp.value = res.data diff --git a/src/components/cockpit/exceedanceLevel/index.vue b/src/components/cockpit/exceedanceLevel/index.vue index 13480eb..d673e4d 100644 --- a/src/components/cockpit/exceedanceLevel/index.vue +++ b/src/components/cockpit/exceedanceLevel/index.vue @@ -82,15 +82,50 @@ const tableStore: any = new TableStore({ title: '指标名称', field: 'name', minWidth: 120 + }, { + title: '越限时间', + field: 'time', + minWidth: 100, + formatter: (row: any) => { + return row.cellValue || '/' + } }, { - title: '越限最高监测点', + title: '越限最高监测点名称', field: 'lineName', - minWidth: 120, + minWidth: 140, formatter: (row: any) => { return row.cellValue || '/' } }, + { + title: '越限程度(%)', + field: 'extent', + minWidth: 100, + formatter: (row: any) => { + return row.cellValue ? Math.floor(row.cellValue * 100) / 100 : '/' + } + }, + { + title: '越限最大值', + field: 'maxValue', + minWidth: 100, + render: 'customTemplate', + customTemplate: (row: any) => { + const extentValue = + row.maxValue !== null && row.maxValue !== undefined && row.maxValue !== '' + ? Math.floor(row.maxValue * 100) / 100 + : '/' + return extentValue == '/' ? '/' : `${extentValue}` + } + }, + { + title: '国标限值', + field: 'internationalValue', + minWidth: 100, formatter: (row: any) => { + return row.cellValue || '/' + } + }, { title: '设备名称', field: 'devName', minWidth: 130, align: 'center', formatter: (row: any) => { return row.cellValue || '/' @@ -106,42 +141,9 @@ const tableStore: any = new TableStore({ return row.cellValue || '/' } }, - { - title: '越限最大值', - field: 'maxValue', - minWidth: 100, - render: 'customTemplate', - customTemplate: (row: any) => { - const extentValue = - row.maxValue !== null && row.maxValue !== undefined && row.maxValue !== '' - ? Math.floor(row.maxValue * 100) / 100 - : '/' - return extentValue=='/' ? '/' : `${extentValue}` - } - }, - { - title: '国标限值', - field: 'internationalValue', - minWidth: 100, formatter: (row: any) => { - return row.cellValue || '/' - } - }, - { - title: '越限程度(%)', - field: 'extent', - minWidth: 100, - formatter: (row: any) => { - return row.cellValue? Math.floor(row.cellValue * 100) / 100 : '/' - } - }, - { - title: '越限时间', - field: 'time', - minWidth: 100, - formatter: (row: any) => { - return row.cellValue || '/' - } - }, + + + ], beforeSearchFun: () => { diff --git a/src/components/cockpit/governanceReport/index.vue b/src/components/cockpit/governanceReport/index.vue index f44ad42..6e6a7ea 100644 --- a/src/components/cockpit/governanceReport/index.vue +++ b/src/components/cockpit/governanceReport/index.vue @@ -46,6 +46,7 @@ import { ref, onMounted, onUnmounted, provide, reactive, watch, h, computed, nex import TableStore from '@/utils/tableStore' import { exportExcel } from '@/views/govern/reportForms/export.js' import { destroyLuckysheet, renderLuckysheetReport } from '@/utils/luckysheetHelper' +import { buildExportBaseName } from '@/utils/echartMethod' import TableHeader from '@/components/table/header/index.vue' import { querySysExcel } from '@/api/harmonic-boot/luckyexcel' import { getListByIds } from '@/api/harmonic-boot/cockpit/cockpit' @@ -72,6 +73,8 @@ const templateList = ref([]) const idList = ref() +const exportSubjectName = ref('') + const handleNodeClick = async (data: any) => { if (templateList.value.length == 0) { await querySysExcel({}).then(res => { @@ -83,6 +86,8 @@ const handleNodeClick = async (data: any) => { } if (data?.level == 3 || data?.level == 2) { + exportSubjectName.value = data.name || '' + tableStore.exportName = { subject: exportSubjectName.value, feature: '治理效果报表' } tableStore.table.params.sensitiveUserId = data.id await tableStore.index() } else { @@ -104,7 +109,14 @@ const templateListData = () => { } // 下载表格 const downloadExcel = () => { - exportExcel(luckysheet.getAllSheets(), '治理效果报表') + exportExcel( + luckysheet.getAllSheets(), + buildExportBaseName({ + subject: exportSubjectName.value, + feature: '治理效果报表', + date: tableStore.table.params.searchEndTime || tableStore.table.params.searchBeginTime + }) + ) } onMounted(() => { diff --git a/src/components/cockpit/gridSideStatistics/components/harmonicRatio‌.vue b/src/components/cockpit/gridSideStatistics/components/harmonicRatio‌.vue index b8f40e1..2fb1b24 100644 --- a/src/components/cockpit/gridSideStatistics/components/harmonicRatio‌.vue +++ b/src/components/cockpit/gridSideStatistics/components/harmonicRatio‌.vue @@ -343,6 +343,11 @@ const setEchart = () => { } echartsData.value = { + exportFileName: { + subject: trendRequestData.value?.lineName, + feature: '趋势图', + date: datePickerRef.value?.timeValue?.[1] || datePickerRef.value?.timeValue?.[0] + }, legend: { itemWidth: 20, itemHeight: 20, @@ -411,10 +416,7 @@ const setEchart = () => { 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: () => { - exportSeriesCSV( - echartsData.value.options.series, - `${dialogTitle.value || '监测点指标趋势'}.csv` - ) + exportSeriesCSV(echartsData.value.options.series, echartsData.value.exportFileName) } }, myTool2: { diff --git a/src/components/cockpit/indicatorFittingChart/components/harmonicRatio‌.vue b/src/components/cockpit/indicatorFittingChart/components/harmonicRatio‌.vue index 235dad6..d11e32e 100644 --- a/src/components/cockpit/indicatorFittingChart/components/harmonicRatio‌.vue +++ b/src/components/cockpit/indicatorFittingChart/components/harmonicRatio‌.vue @@ -342,6 +342,11 @@ const setEchart = () => { } echartsData.value = { + exportFileName: { + subject: trendRequestData.value?.lineName, + feature: '趋势图', + date: datePickerRef.value?.timeValue?.[1] || datePickerRef.value?.timeValue?.[0] + }, legend: { itemWidth: 20, itemHeight: 20, @@ -410,10 +415,7 @@ const setEchart = () => { 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: () => { - exportSeriesCSV( - echartsData.value.options.series, - `${dialogTitle.value || '历史趋势'}.csv` - ) + exportSeriesCSV(echartsData.value.options.series, echartsData.value.exportFileName) } }, myTool2: { diff --git a/src/components/cockpit/indicatorFittingChart/index.vue b/src/components/cockpit/indicatorFittingChart/index.vue index 289b0d5..ae01e8e 100644 --- a/src/components/cockpit/indicatorFittingChart/index.vue +++ b/src/components/cockpit/indicatorFittingChart/index.vue @@ -1,8 +1,8 @@ + + diff --git a/src/views/govern/cloudDeviceEntry/index.vue b/src/views/govern/cloudDeviceEntry/index.vue index 5af8946..a4437ea 100644 --- a/src/views/govern/cloudDeviceEntry/index.vue +++ b/src/views/govern/cloudDeviceEntry/index.vue @@ -1,2953 +1,23 @@ - - - + \ No newline at end of file diff --git a/src/views/govern/device/control/detail.vue b/src/views/govern/device/control/detail.vue index ed54c73..77997fc 100644 --- a/src/views/govern/device/control/detail.vue +++ b/src/views/govern/device/control/detail.vue @@ -118,6 +118,11 @@ const init = () => { }) let [min, max] = yMethod(arr.map((item: any) => item.statisticalData.toFixed(2))) echartsData.value = { + exportFileName: { + subject: props.detail.name?.split('(')[0], + feature: '历史趋势', + date: datePickerRef.value?.timeValue?.[1] || datePickerRef.value?.timeValue?.[0] + }, options: { legend: { @@ -261,7 +266,11 @@ const init = () => { return [item[0], item[1], value1, value2, value3]; }); - exportCSV(echartsData.value.options.series.map(item => item.name), dataList, echartsData.value.title.text + '.csv') + exportCSV( + echartsData.value.options.series.map(item => item.name), + dataList, + echartsData.value.exportFileName + ) } } diff --git a/src/views/govern/device/control/index.vue b/src/views/govern/device/control/index.vue index 6b7a642..8941956 100644 --- a/src/views/govern/device/control/index.vue +++ b/src/views/govern/device/control/index.vue @@ -377,6 +377,7 @@ import { getRawData } from '@/api/cs-device-boot/EquipmentDelivery' import { deviceHisData, deviceRtData, realTimeData, getTestData } from '@/api/cs-device-boot/csGroup' +import { buildExportFileName } from '@/utils/echartMethod' import { ref, reactive, onMounted, onUnmounted, inject, nextTick, onBeforeUnmount } from 'vue' import { ElMessage } from 'element-plus' import DatePicker from '@/components/form/datePicker/index.vue' @@ -1372,7 +1373,11 @@ const downloadTxt = () => { // 创建 标签并触发下载 const link = document.createElement('a') link.href = url - link.download = '实时数据.txt' // 文件名 + link.download = buildExportFileName({ + subject: (TrendList.value as any)?.name, + feature: '实时数据', + ext: 'txt' + }) link.click() // 释放 URL 对象 diff --git a/src/views/govern/device/control/nearRealTimeData.vue b/src/views/govern/device/control/nearRealTimeData.vue index ef9429e..847a705 100644 --- a/src/views/govern/device/control/nearRealTimeData.vue +++ b/src/views/govern/device/control/nearRealTimeData.vue @@ -210,15 +210,12 @@ const buildTMetric = (name: string, items: RawMetricItem[]): DisplayMetric => { return { name, otherName: name, - unit: sharedUnit, + unit: getSharedUnit(items), type: 't-multi', - subItems: items.map(item => { - const keyword = extractSubTitle(item.otherName || item.name || '') - return { - subTitle: unitsDiffer ? buildTitle(keyword, item.unit) : keyword, - value: item.data, - } - }), + subItems: items.map(item => ({ + subTitle: extractSubTitle(item.otherName || item.name || ''), + value: item.data, + })), } } diff --git a/src/views/govern/device/control/tabs/electroplating.vue b/src/views/govern/device/control/tabs/electroplating.vue index c8ac9a3..7defc48 100644 --- a/src/views/govern/device/control/tabs/electroplating.vue +++ b/src/views/govern/device/control/tabs/electroplating.vue @@ -222,6 +222,11 @@ const setEchart = () => { } echartsData.value = { + exportFileName: { + subject: (props.TrendList as any)?.name || trendRequestData.value?.name, + feature: '电度数据', + date: datePickerRef.value?.timeValue?.[1] || datePickerRef.value?.timeValue?.[0] + }, legend: { itemWidth: 20, itemHeight: 20, @@ -290,7 +295,7 @@ const setEchart = () => { 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: () => { - exportSeriesCSV(echartsData.value.options.series, '电度数据.csv') + exportSeriesCSV(echartsData.value.options.series, echartsData.value.exportFileName) } }, myTool2: { diff --git a/src/views/govern/device/control/tabs/event.vue b/src/views/govern/device/control/tabs/event.vue index f078f93..61e72fd 100644 --- a/src/views/govern/device/control/tabs/event.vue +++ b/src/views/govern/device/control/tabs/event.vue @@ -26,6 +26,7 @@ import { ArrowLeft, Message } from '@element-plus/icons-vue' import { ElMessage } from 'element-plus' import { analyseWave, getFileByEventId } from '@/api/common' import { getFileZip } from '@/api/cs-harmonic-boot/datatrend' +import { buildWaveExportFileName, getExportSubjectFromRow } from '@/utils/echartMethod' import { useDictData } from '@/stores/dictData' const emit=defineEmits(['fileRecall']) const tableParams: any = ref({}) @@ -108,12 +109,12 @@ const tableStore: any = new TableStore({ { field: 'showName', title: '触发类型', minWidth: 100 }, { title: '暂降原因', field: 'advanceReason', minWidth: 100, align: 'center', formatter: (row: any) => { - return ReasonList.find((item: any) => item.id == row.cellValue)?.name || '未知' + return ReasonList.find((item: any) => item.id == row.cellValue)?.name || '其他' } }, { title: '暂降类型', field: 'advanceType', minWidth: 100, align: 'center', formatter: (row: any) => { - return EventTypeList.find((item: any) => item.id == row.cellValue)?.name || '未知' + return EventTypeList.find((item: any) => item.id == row.cellValue)?.name || '其他' } }, { title: '电压等级(kV)', field: 'lineVoltage', minWidth: 120, align: 'center', sortable: true, }, @@ -206,7 +207,7 @@ const tableStore: any = new TableStore({ const url = window.URL.createObjectURL(blob) const link = document.createElement('a') // 创建a标签 link.href = url - link.download = row.wavePath.split('/')[2] || '波形文件' // 设置下载的文件名 + link.download = buildWaveExportFileName(getExportSubjectFromRow(row)) document.body.appendChild(link) link.click() //执行下载 document.body.removeChild(link) //释放标签 diff --git a/src/views/govern/device/control/tabs/trend.vue b/src/views/govern/device/control/tabs/trend.vue index 5a6250d..ac65812 100644 --- a/src/views/govern/device/control/tabs/trend.vue +++ b/src/views/govern/device/control/tabs/trend.vue @@ -62,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, exportSeriesCSV, completeTimeSeries } from '@/utils/echartMethod' +import { yMethod, exportSeriesCSV, completeTimeSeries, buildExportFileName } 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' @@ -283,6 +283,15 @@ const init = async () => { } } } +const getChartExportFileName = () => { + const obj = deviceData.value.records?.find((item: any) => item.id == activeName.value) + return { + subject: (props.TrendList as any)?.name, + feature: obj?.itemName || '历史趋势', + date: datePickerRef.value?.timeValue?.[1] || datePickerRef.value?.timeValue?.[0] + } +} + const setEchart = () => { loading.value = true echartsData.value = {} @@ -315,6 +324,7 @@ const setEchart = () => { } echartsData.value = { + exportFileName: getChartExportFileName(), legend: { itemWidth: 20, itemHeight: 20, @@ -383,7 +393,7 @@ const setEchart = () => { 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: () => { - exportSeriesCSV(echartsData.value.options.series, '历史趋势.csv') + exportSeriesCSV(echartsData.value.options.series, echartsData.value.exportFileName) } }, myTool2: { @@ -651,11 +661,7 @@ const handleExport = async () => { const blob = new Blob([csvs], { type: 'text/csv;charset=utf-8;' }) const link = document.createElement('a') link.href = URL.createObjectURL(blob) - let obj = deviceData.value.records.find((item: any) => { - return item.id == activeName.value - }) - const date = window.XEUtils.toDateString(new Date(), 'yyyyMMdd HHmmss').replace(' ', '_') - link.download = `${deviceData.value.itemName}_${obj?.itemName}_${date}.csv` + link.download = buildExportFileName(echartsData.value?.exportFileName || getChartExportFileName()) link.click() return } diff --git a/src/views/govern/device/manage/index.vue b/src/views/govern/device/manage/index.vue index 2b33913..5c1baf2 100644 --- a/src/views/govern/device/manage/index.vue +++ b/src/views/govern/device/manage/index.vue @@ -104,6 +104,7 @@ import DeviceTree from '@/components/tree/govern/deviceTree.vue' import { mainHeight } from '@/utils/layout' import { queryByCode, queryByid, queryCsDictTree } from '@/api/system-boot/dictTree' import { getDeviceData } from '@/api/cs-device-boot/EquipmentDelivery' +import { buildExportBaseName } from '@/utils/echartMethod' import { getTargetById } from '@/api/cs-device-boot/csDataArray' import { getGroup } from '@/api/cs-device-boot/csGroup' import { ref } from 'vue' @@ -135,6 +136,7 @@ const deviceTypeChange = (val: any, obj: any) => { deviceType.value = val nodeClick(obj) } +const exportSubjectName = ref('') // 树节点点击 const nodeClick = (e: anyObj) => { if (!e) { @@ -142,6 +144,7 @@ const nodeClick = (e: anyObj) => { return } if (e.level == 2 || e.level == 3) { + exportSubjectName.value = e.name || '' pName.value = e.pName nDid.value = e.ndid loading.value = true @@ -288,8 +291,12 @@ const handleRestartDevice = () => { }) } const exportData = () => { + const dataSetName = deviceData.value.dataSetList.filter((item: any) => item.id == dataSet.value)[0]?.name xTableRef.value.exportData({ - filename: deviceData.value.dataSetList.filter((item: any) => item.id == dataSet.value)[0]?.name, // 文件名字 + filename: buildExportBaseName({ + subject: exportSubjectName.value || deviceData.value?.name, + feature: dataSetName || '数据集' + }), // 文件名字 sheetName: 'Sheet1', type: 'xlsx', //导出文件类型 xlsx 和 csv useStyle: true, diff --git a/src/views/govern/device/planData/components/transient.vue b/src/views/govern/device/planData/components/transient.vue index 030a308..e9062b5 100644 --- a/src/views/govern/device/planData/components/transient.vue +++ b/src/views/govern/device/planData/components/transient.vue @@ -34,6 +34,7 @@ import waveFormAnalysis from '@/views/govern/device/control/tabs/components/wave import { analyseWave, getFileByEventId } from '@/api/common' import { mainHeight } from '@/utils/layout' import { getFileZip } from '@/api/cs-harmonic-boot/datatrend' +import { buildWaveExportFileName, getExportSubjectFromRow } from '@/utils/echartMethod' import { queryByCode, queryByid, queryCsDictTree } from '@/api/system-boot/dictTree' import analysisList from '@/views/govern/device/control/analysisList/index.vue' @@ -109,12 +110,12 @@ const tableStore = new TableStore({ { field: 'showName', title: '触发类型', minWidth: 100 }, { title: '暂降原因', field: 'advanceReason', minWidth: 100, align: 'center', formatter: (row: any) => { - return ReasonList.find((item: any) => item.id == row.cellValue)?.name || '未知' + return ReasonList.find((item: any) => item.id == row.cellValue)?.name || '其他' } }, { title: '暂降类型', field: 'advanceType', minWidth: 100, align: 'center', formatter: (row: any) => { - return EventTypeList.find((item: any) => item.id == row.cellValue)?.name || '未知' + return EventTypeList.find((item: any) => item.id == row.cellValue)?.name || '其他' } }, { title: '监测点名称', field: 'lineName', minWidth: 120, align: 'center' }, @@ -204,7 +205,7 @@ const tableStore = new TableStore({ const url = window.URL.createObjectURL(blob) const link = document.createElement('a') // 创建a标签 link.href = url - link.download = row.wavePath.split('/')[2] || '波形文件' // 设置下载的文件名 + link.download = buildWaveExportFileName(getExportSubjectFromRow(row)) document.body.appendChild(link) link.click() //执行下载 document.body.removeChild(link) //释放标签 diff --git a/src/views/govern/device/planData/index.vue b/src/views/govern/device/planData/index.vue index 100e91c..10bea94 100644 --- a/src/views/govern/device/planData/index.vue +++ b/src/views/govern/device/planData/index.vue @@ -26,9 +26,9 @@ :name="item.id" :key="index"> @@ -203,7 +203,7 @@ import { getTestRecordInfo, getHistoryTrend } from '@/api/cs-device-boot/planDat import { useDictData } from '@/stores/dictData' import { queryStatistical } from '@/api/system-boot/csstatisticalset' import { TrendCharts, Plus, Platform } from '@element-plus/icons-vue' -import { yMethod, completeTimeSeries } from '@/utils/echartMethod' +import { yMethod, completeTimeSeries, buildExportFileName } from '@/utils/echartMethod' import { color, gradeColor3 } from '@/components/echarts/color' import TableHeader from '@/components/table/header/index.vue' import { useConfig } from '@/stores/config' @@ -341,10 +341,12 @@ const handleClickTabs = async () => { transientRef.value && transientRef.value.init() }, 100) } +const exportSubjectName = ref('') const nodeClick = async (e: anyObj) => { if (e == undefined) { return } + exportSubjectName.value = e.name || '' // onIndexChange([]) deviceData.value = [] historyDevId.value = e?.children && e?.children.length != 0 ? e?.children[0].id : e?.id @@ -567,6 +569,15 @@ const init = (flag: boolean) => { } } +const getChartExportFileName = () => { + const obj = deviceData.value.records?.find((item: any) => item.id == activeName.value) + return { + subject: exportSubjectName.value, + feature: obj?.itemName || '预案数据', + date: obj?.endTime || obj?.startTime + } +} + const setEchart = () => { loading.value = true echartsData.value = {} @@ -597,6 +608,7 @@ const setEchart = () => { } echartsData.value = { + exportFileName: getChartExportFileName(), // title: { // text: chartTitle.value, // left: '0', @@ -919,11 +931,7 @@ const handleExport = async () => { const blob = new Blob([csvs], { type: 'text/csv;charset=utf-8;' }) const link = document.createElement('a') link.href = URL.createObjectURL(blob) - let obj = deviceData.value.records.find((item: any) => { - return item.id == activeName.value - }) - const date = window.XEUtils.toDateString(new Date(), 'yyyyMMdd HHmmss').replace(' ', '_') - link.download = `${deviceData.value.itemName}_${obj?.itemName}_${date}.csv` + link.download = buildExportFileName(echartsData.value?.exportFileName || getChartExportFileName()) link.click() return } diff --git a/src/views/govern/log/components/front.vue b/src/views/govern/log/components/front.vue index 274eae1..5e1578d 100644 --- a/src/views/govern/log/components/front.vue +++ b/src/views/govern/log/components/front.vue @@ -2,13 +2,15 @@
@@ -25,8 +27,44 @@ import TableHeader from '@/components/table/header/index.vue' defineOptions({ name: 'govern/log/debug' }) +const rankOptions = ref([ + // { + // value: '1', + // label: '1级' + // }, + // { + // value: '2', + // label: '2级' + // }, + // { + // value: '3', + // label: '3级' + // }, + // { + // value: '3', + // label: '3级' + // }, + { + value: '4', + label: 'DEBUG' + }, + { + value: '5', + label: 'NORMAL' + }, + { + value: '6', + label: 'WARN' + }, + { + value: '7', + label: 'ERROR' + } + +]) +const levelFilter = ref([]) const tableStore = new TableStore({ - url: '/cs-device-boot/process/queryPage', + url: '/cs-harmonic-boot/event/getFrontDebugLogs', method: 'POST', publicHeight: 65, column: [ @@ -38,36 +76,65 @@ const tableStore = new TableStore({ return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1 } }, - { title: '设备名称', field: 'devName', align: 'center' }, - { title: '操作用户', field: 'operatorName', align: 'center' }, + { title: '调试时间', field: 'startTime', align: 'center', sortable: true, width: 180 }, + { title: '设备名称', field: 'deviceName', align: 'center', width: 180 }, { - title: '操作内容', - field: 'process', - align: 'center', - formatter: (row: any) => { - return row.cellValue == 1 - ? '设备登记' - : row.cellValue == 2 - ? '功能调试' - : row.cellValue == 3 - ? '出厂调试' - : row.cellValue == 4 - ? '设备投运' - : '' + title: '监测点名称', field: 'lineName', align: 'center', width: 180, formatter: (row: any) => { + return row.cellValue ? row.cellValue : '/' } }, - { title: '开始时间', field: 'startTime', align: 'center', sortable: true }, + + // { title: '操作用户', field: 'operatorName', align: 'center' }, { - title: '结束时间', - field: 'endTime', + title: '调试内容', + field: 'event', align: 'center', - sortable: true, - formatter: (row: any) => { - return row.cellValue || '/' + minWidth: 250, + + }, + { + title: '级别', + field: 'level', + width: 110, + render: 'tag', + custom: { + // 1:Ⅰ级 2:Ⅱ级 3:Ⅲ级 4:DEBUG 5:NORMAL 6:WARN 7:ERROR + + // 1: 'danger', + // 2: 'warning', + // 3: 'success', + 4: 'success', + 5: 'success', + 6: 'warning', + 7: 'danger' + }, + replaceValue: { + // 1: '1级', + // 2: '2级', + // 3: '3级', + 4: 'DEBUG', + 5: 'NORMAL', + 6: 'WARN', + 7: 'ERROR' } } + // { + // title: '结束时间', + // field: 'endTime', + // align: 'center', + // sortable: true, + // formatter: (row: any) => { + // return row.cellValue || '/' + // } + // } ], + beforeSearchFun: () => { + tableStore.table.params.level = levelFilter.value.length ? levelFilter.value.join(',') : '' + }, + resetCallback: () => { + levelFilter.value = [] + }, loadCallback: () => { tableStore.table.data.forEach((item: any) => { item.result = item.result === 1 ? '成功' : '失败' @@ -88,6 +155,6 @@ tableStore.table.params.searchValue = '' onMounted(() => { tableStore.index() }) - -const addMenu = () => {} +tableStore.table.params.level = '' +const addMenu = () => { } diff --git a/src/views/govern/log/debug.vue b/src/views/govern/log/debug.vue index 8932371..1dbd6bd 100644 --- a/src/views/govern/log/debug.vue +++ b/src/views/govern/log/debug.vue @@ -1,10 +1,10 @@