From 0994a52699f272113b95514b7c8a7ae93398ca56 Mon Sep 17 00:00:00 2001 From: GGJ <357021191@qq.com> Date: Fri, 27 Dec 2024 08:47:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=B7=BB=E5=8A=A0=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E8=A1=A8=E6=A0=BC=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/echarts/rmsboxi.vue | 8 +- src/components/echarts/shushiboxi.vue | 8 +- src/components/echarts/waveForm.vue | 1 - src/components/table/defaultAttribute.ts | 1 + src/components/table/header/index.vue | 12 +- src/components/table/index.vue | 82 +- src/utils/tableMethod.ts | 35 + src/utils/tableStore.ts | 22 + .../area/TransientEventList/index.vue | 2 +- .../area/onlinerate/index.vue | 2 +- .../detailed/alarmStatistics/index.vue | 2 +- .../detailed/overLabelDetails/index.vue | 2 +- .../detailed/regionalStatistics/index.vue | 2 +- .../online/wentaishujufenxi/index.vue | 111 +- .../online/wentaishujufenxi/index1.vue | 1716 +++++++++++++++++ .../reportForms/passing/index.vue | 4 +- .../runManage/monitoringPoints/index.vue | 20 +- .../quantitativeStatistics/index.vue | 169 +- .../quantitativeStatistics/index2.vue | 1147 +++++++++++ .../runManage/terminalLedger/index.vue | 6 +- .../components/undocumented/detail.vue | 59 +- .../Region/transientList/index.vue | 2 +- .../analyse/eventCorrelation/index.vue | 2 +- .../voltageSags/analyse/impactscope/index.vue | 4 +- .../online/eventStudy/index.vue | 29 +- .../TerminalOperation/index.vue | 6 +- .../voltageSags/report/eventReports/index.vue | 8 +- types/table.d.ts | 2 + 28 files changed, 3264 insertions(+), 200 deletions(-) create mode 100644 src/utils/tableMethod.ts create mode 100644 src/views/pqs/harmonicMonitoring/monitoringPoint/online/wentaishujufenxi/index1.vue create mode 100644 src/views/pqs/harmonicMonitoring/runManage/quantitativeStatistics/index2.vue diff --git a/src/components/echarts/rmsboxi.vue b/src/components/echarts/rmsboxi.vue index 67e1ddf1..9420ddcc 100644 --- a/src/components/echarts/rmsboxi.vue +++ b/src/components/echarts/rmsboxi.vue @@ -1072,13 +1072,13 @@ export default { height: 13, start: 0, bottom: "20px", - end: 15, + end: 100, }, { start: 0, height: 13, bottom: "20px", - end: 15, + end: 100, }, ], series: [ @@ -1492,13 +1492,13 @@ export default { height: 13, start: 0, bottom: "20px", - end: 15, + end: 100, }, { start: 0, height: 13, bottom: "20px", - end: 15, + end: 100, }, ], series: [ diff --git a/src/components/echarts/shushiboxi.vue b/src/components/echarts/shushiboxi.vue index c243458c..2e389292 100644 --- a/src/components/echarts/shushiboxi.vue +++ b/src/components/echarts/shushiboxi.vue @@ -733,13 +733,13 @@ export default { height: 13, start: 0, bottom: '20px', - end: 15 + end: 100 }, { start: 0, height: 13, bottom: '20px', - end: 15 + end: 100 } ], series: [ @@ -1095,13 +1095,13 @@ export default { height: 13, start: 0, bottom: '20px', - end: 15 + end: 100 }, { start: 0, height: 13, bottom: '20px', - end: 15 + end: 100 } ], series: [ diff --git a/src/components/echarts/waveForm.vue b/src/components/echarts/waveForm.vue index b99e888e..47b4cd18 100644 --- a/src/components/echarts/waveForm.vue +++ b/src/components/echarts/waveForm.vue @@ -122,7 +122,6 @@ const backbxlb = () => { wp.value = null if (shushiboxiRef.value) shushiboxiRef.value.backbxlb() if (rmsboxiRef.value) rmsboxiRef.value.backbxlb() - console.log("🚀 ~ backbxlb ~ rmsboxiRef.value:", rmsboxiRef.value) emit('backbxlb') } diff --git a/src/components/table/defaultAttribute.ts b/src/components/table/defaultAttribute.ts index 006b8d86..eaf8144c 100644 --- a/src/components/table/defaultAttribute.ts +++ b/src/components/table/defaultAttribute.ts @@ -13,5 +13,6 @@ export const defaultAttribute: VxeTableProps = { treeConfig: { reserve: true }, + showOverflow: true } diff --git a/src/components/table/header/index.vue b/src/components/table/header/index.vue index 3765494f..172d3e54 100644 --- a/src/components/table/header/index.vue +++ b/src/components/table/header/index.vue @@ -21,6 +21,9 @@ :icon="Search">查询 重置 + 导出 + @@ -55,6 +58,8 @@ interface Props { nextFlag?: boolean //控制时间是否可以往后推 theCurrentTime?: boolean //控制时间前3天展示上个月时间 showReset?: boolean //控制时间前3天展示上个月时间 + showExport?: boolean //导出控制 + } const props = withDefaults(defineProps(), { @@ -63,7 +68,8 @@ const props = withDefaults(defineProps(), { showSearch: true, nextFlag: false, theCurrentTime: false, - showReset: true + showReset: true, + showExport:false }) // 动态计算table高度 const resizeObserver = new ResizeObserver(entries => { @@ -169,6 +175,10 @@ const onResetForm = () => { const setTheDate = (val: any) => { datePickerRef.value.setTheDate(val) } +// 导出 +const onExport = () => { + tableStore.onTableAction('export', {showAllFlag:true}) +} defineExpose({ onComSearch, areaRef, setDatePicker, setTheDate, datePickerRef, showSelectChange }) diff --git a/src/components/table/index.vue b/src/components/table/index.vue index 9174978d..883fabdc 100644 --- a/src/components/table/index.vue +++ b/src/components/table/index.vue @@ -1,41 +1,23 @@ @@ -67,12 +44,13 @@ import Column from '@/components/table/column/index.vue' import GroupColumn from '@/components/table/column/groupColumn.vue' import { useConfig } from '@/stores/config' import type TableStoreClass from '@/utils/tableStore' - +import { useRouter } from 'vue-router' import { defaultAttribute } from '@/components/table/defaultAttribute' const config = useConfig() const tableRef = ref() const tableStore = inject('tableStore') as TableStoreClass +const router = useRouter() interface Props extends /* @vue-ignore */ Partial> { isGroup?: boolean @@ -116,12 +94,38 @@ const selectChangeEvent: VxeTableEvents.CheckboxChange = ({ checked }) => { const getRef = () => { return tableRef.value } +watch( + () => tableStore.table.allFlag, + newVal => { + + + if (tableStore.table.allFlag) { + + tableRef.value?.exportData({ + filename: document.querySelectorAll('.ba-nav-tab.active')[0].textContent || '', // 文件名字 + sheetName: 'Sheet1', + type: 'xlsx', //导出文件类型 xlsx 和 csv + useStyle: true, + data: tableStore.table.allData, // 数据源 // 过滤那个字段导出 + columnFilterMethod: function (column: any) { + + return !(column.column.title === undefined || column.column.title === '序号' || column.column.title === '操作') + } + }) + tableStore.table.allFlag = false + + } + + + } +) watch( () => tableStore.table.data, newVal => { tableStore.onTableAction('selection-change', []) } ) + defineExpose({ getRef }) diff --git a/src/utils/tableMethod.ts b/src/utils/tableMethod.ts new file mode 100644 index 00000000..bbfc8c16 --- /dev/null +++ b/src/utils/tableMethod.ts @@ -0,0 +1,35 @@ +// 过滤表格导出数据 +export const filtration = (arr: Array<{ dealFlag?: number; fileFlag?: number; onlineEvaluate?: number }>) => { + const dealFlagMap: Record = { + 0: '未处理', + 1: '已处理', + 2: '已处理,无结果', + 3: '计算失败' + } + const fileFlagMap: Record = { + 0: '不存在', + 1: '存在' + } + + arr.forEach((item: any) => { + if (item.dealFlag !== undefined) { + item.dealFlag = dealFlagMap[item.dealFlag] || '' + } + if (item.fileFlag !== undefined) { + item.fileFlag = fileFlagMap[item.fileFlag] || '' + } + if (item.onlineEvaluate !== undefined) { + if (item.onlineEvaluate == null) { + } else if (item.onlineEvaluate == 3.14159) { + item.onlineEvaluate = '/' + } else if (item.onlineEvaluate * 100 > 90) { + item.onlineEvaluate = '优' + } else if (item.onlineEvaluate * 100 > 60) { + item.onlineEvaluate = '良' + } else { + item.onlineEvaluate = '差' + } + } + }) + return arr +} diff --git a/src/utils/tableStore.ts b/src/utils/tableStore.ts index e397f005..b7a46106 100644 --- a/src/utils/tableStore.ts +++ b/src/utils/tableStore.ts @@ -3,6 +3,7 @@ import createAxios from '@/utils/request' import { requestPayload } from '@/utils/request' import { Method } from 'axios' import { mainHeight } from '@/utils/layout' +import { filtration } from './tableMethod' interface TableStoreParams { url: string // 请求地址 @@ -31,6 +32,8 @@ export default class TableStore { ref: null, selection: [], data: [], + allData: [], + allFlag: false, webPagingData: [], total: 0, params: { @@ -175,6 +178,25 @@ export default class TableStore { () => { console.warn('No action defined') } + ], + [ + 'export', + () => { + // this.index() + let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total } + createAxios( + Object.assign( + { + url: this.url, + method: this.method + }, + requestPayload(this.method, params, this.paramsPOST) + ) + ).then(res => { + this.table.allData = filtration(res.data.records || res.data) + this.table.allFlag = data.showAllFlag || true + }) + } ] ]) const action = actionFun.get(event) || actionFun.get('default') diff --git a/src/views/pqs/harmonicMonitoring/area/TransientEventList/index.vue b/src/views/pqs/harmonicMonitoring/area/TransientEventList/index.vue index cbf6baa4..3826abe9 100644 --- a/src/views/pqs/harmonicMonitoring/area/TransientEventList/index.vue +++ b/src/views/pqs/harmonicMonitoring/area/TransientEventList/index.vue @@ -1,7 +1,7 @@