去除多余列,导出文件国际化
This commit is contained in:
@@ -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(() => {
|
||||
</template>
|
||||
{{ t('views.faultManage.activeAlarm.updateConfirm') }}
|
||||
</a-button>
|
||||
<a-button type="primary" @click.prevent="fnExportAll()">
|
||||
<a-button
|
||||
type="primary"
|
||||
@click.prevent="fnExportAll()"
|
||||
:disabled="tableState.data.length <= 0"
|
||||
>
|
||||
<template #icon> <export-outlined /> </template>
|
||||
{{ t('views.faultManage.activeAlarm.exportAll') }}
|
||||
</a-button>
|
||||
@@ -797,7 +829,11 @@ onMounted(() => {
|
||||
:ok-text="t('views.faultManage.activeAlarm.confirm')"
|
||||
@cancel="fnModalCancel"
|
||||
>
|
||||
<a-form name="modalStateFrom" layout="horizontal" :label-col="{span:8}">
|
||||
<a-form
|
||||
name="modalStateFrom"
|
||||
layout="horizontal"
|
||||
:label-col="{ span: 8 }"
|
||||
>
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
@@ -897,7 +933,7 @@ onMounted(() => {
|
||||
<a-form-item
|
||||
:label="t('views.faultManage.activeAlarm.locationInfo')"
|
||||
name="locationInfo"
|
||||
:label-col="{span:4}"
|
||||
:label-col="{ span: 4 }"
|
||||
>
|
||||
{{ modalState.from.locationInfo }}
|
||||
</a-form-item>
|
||||
@@ -923,15 +959,14 @@ onMounted(() => {
|
||||
<a-form-item
|
||||
:label="t('views.faultManage.activeAlarm.addInfo')"
|
||||
name="addInfo"
|
||||
:label-col="{span:4}"
|
||||
:label-col="{ span: 4 }"
|
||||
>
|
||||
{{ modalState.from.addInfo }}
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:label="t('views.faultManage.activeAlarm.specificProblemId')"
|
||||
name="specificProblemId"
|
||||
:label-col="{span:4}"
|
||||
|
||||
:label-col="{ span: 4 }"
|
||||
>
|
||||
{{ modalState.from.specificProblemId }}
|
||||
</a-form-item>
|
||||
@@ -939,8 +974,7 @@ onMounted(() => {
|
||||
<a-form-item
|
||||
:label="t('views.faultManage.activeAlarm.specificProblem')"
|
||||
name="specificProblem"
|
||||
:label-col="{span:4}"
|
||||
|
||||
:label-col="{ span: 4 }"
|
||||
>
|
||||
{{ modalState.from.specificProblem }}
|
||||
</a-form-item>
|
||||
|
||||
Reference in New Issue
Block a user