From 6d3e592886edf035177430291f21372c3a86e301 Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Thu, 1 Feb 2024 14:03:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=A4=9A=E4=BD=99=E5=88=97,?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=96=87=E4=BB=B6=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/faultManage/active-alarm/index.vue | 10 ++-- src/views/faultManage/history-alarm/index.vue | 54 +++++++++++++++---- 2 files changed, 50 insertions(+), 14 deletions(-) diff --git a/src/views/faultManage/active-alarm/index.vue b/src/views/faultManage/active-alarm/index.vue index 8236d53a..18b38d5a 100644 --- a/src/views/faultManage/active-alarm/index.vue +++ b/src/views/faultManage/active-alarm/index.vue @@ -48,8 +48,6 @@ let tableColumnsDnd = ref([]); /**记录开始结束时间 */ let queryRangePicker = ref<[string, string]>(['', '']); - - /**查询参数 */ let queryParams = reactive({ /**告警设备类型 */ @@ -120,7 +118,7 @@ type TabeStateType = { let tableState: TabeStateType = reactive({ loading: false, size: 'middle', - seached: true, + seached: false, data: [], selectedRowKeys: [], }); @@ -639,6 +637,11 @@ function fnExportAll() { filteredObj[key] = objA[key]; } }); + dict.activeAckState.map((item: any) => { + if (item.value === `${filteredObj.ackState}`) + filteredObj.ackState = item.label; + }); + return filteredObj; }); message.success({ @@ -692,7 +695,6 @@ function fnGetList(pageNum?: number) { filterState.sql = sql; } listAct(toRaw(queryParams), filterState.sql).then((res: any) => { - console.log(res); if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { // 取消勾选 if (state.selectedRowKeys.length > 0) { diff --git a/src/views/faultManage/history-alarm/index.vue b/src/views/faultManage/history-alarm/index.vue index 4d01413c..61942e01 100644 --- a/src/views/faultManage/history-alarm/index.vue +++ b/src/views/faultManage/history-alarm/index.vue @@ -112,7 +112,7 @@ type TabeStateType = { let tableState: TabeStateType = reactive({ loading: false, size: 'middle', - seached: true, + seached: false, data: [], selectedRowKeys: [], }); @@ -444,6 +444,30 @@ function fnExportAll() { }; exportAll(queryParams).then(res => { if (res.code === RESULT_CODE_SUCCESS) { + res.data = res.data.map((objA: any) => { + let filteredObj: any = {}; + sortArr.forEach((key: any) => { + if (objA.hasOwnProperty(key)) { + filteredObj[key] = objA[key]; + } + }); + + const mapProps = (dict: any, key: string) => { + const item = dict.find( + (item: any) => item.value === `${filteredObj[key]}` + ); + if (item) { + filteredObj[key] = item.label; + } + }; + + mapProps(dict.activeAckState, 'ackState'); + mapProps(dict.activeClearType, 'clearType'); + mapProps(dict.activeAlarmSeverity, 'origSeverity'); + mapProps(dict.activeAlarmType, 'alarmType'); + + return filteredObj; + }); message.success({ content: t('common.msgSuccess', { msg: t('common.export') }), key, @@ -494,7 +518,11 @@ function fnGetList(pageNum?: number) { } tablePagination.total = res.total; tableState.data = res.rows; - if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) { + if ( + tablePagination.total <= + (queryParams.pageNum - 1) * tablePagination.pageSize && + queryParams.pageNum !== 1 + ) { tableState.loading = false; fnGetList(queryParams.pageNum - 1); } @@ -673,7 +701,11 @@ onMounted(() => { {{ t('views.faultManage.activeAlarm.updateConfirm') }} - + {{ t('views.faultManage.activeAlarm.exportAll') }} @@ -797,7 +829,11 @@ onMounted(() => { :ok-text="t('views.faultManage.activeAlarm.confirm')" @cancel="fnModalCancel" > - + { {{ modalState.from.locationInfo }} @@ -923,15 +959,14 @@ onMounted(() => { {{ modalState.from.addInfo }} {{ modalState.from.specificProblemId }} @@ -939,8 +974,7 @@ onMounted(() => { {{ modalState.from.specificProblem }}