去除多余列,导出文件国际化
This commit is contained in:
@@ -48,8 +48,6 @@ let tableColumnsDnd = ref<ColumnsType>([]);
|
|||||||
/**记录开始结束时间 */
|
/**记录开始结束时间 */
|
||||||
let queryRangePicker = ref<[string, string]>(['', '']);
|
let queryRangePicker = ref<[string, string]>(['', '']);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**查询参数 */
|
/**查询参数 */
|
||||||
let queryParams = reactive({
|
let queryParams = reactive({
|
||||||
/**告警设备类型 */
|
/**告警设备类型 */
|
||||||
@@ -120,7 +118,7 @@ type TabeStateType = {
|
|||||||
let tableState: TabeStateType = reactive({
|
let tableState: TabeStateType = reactive({
|
||||||
loading: false,
|
loading: false,
|
||||||
size: 'middle',
|
size: 'middle',
|
||||||
seached: true,
|
seached: false,
|
||||||
data: [],
|
data: [],
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
});
|
});
|
||||||
@@ -639,6 +637,11 @@ function fnExportAll() {
|
|||||||
filteredObj[key] = objA[key];
|
filteredObj[key] = objA[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
dict.activeAckState.map((item: any) => {
|
||||||
|
if (item.value === `${filteredObj.ackState}`)
|
||||||
|
filteredObj.ackState = item.label;
|
||||||
|
});
|
||||||
|
|
||||||
return filteredObj;
|
return filteredObj;
|
||||||
});
|
});
|
||||||
message.success({
|
message.success({
|
||||||
@@ -692,7 +695,6 @@ function fnGetList(pageNum?: number) {
|
|||||||
filterState.sql = sql;
|
filterState.sql = sql;
|
||||||
}
|
}
|
||||||
listAct(toRaw(queryParams), filterState.sql).then((res: any) => {
|
listAct(toRaw(queryParams), filterState.sql).then((res: any) => {
|
||||||
console.log(res);
|
|
||||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||||
// 取消勾选
|
// 取消勾选
|
||||||
if (state.selectedRowKeys.length > 0) {
|
if (state.selectedRowKeys.length > 0) {
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ type TabeStateType = {
|
|||||||
let tableState: TabeStateType = reactive({
|
let tableState: TabeStateType = reactive({
|
||||||
loading: false,
|
loading: false,
|
||||||
size: 'middle',
|
size: 'middle',
|
||||||
seached: true,
|
seached: false,
|
||||||
data: [],
|
data: [],
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
});
|
});
|
||||||
@@ -444,6 +444,30 @@ function fnExportAll() {
|
|||||||
};
|
};
|
||||||
exportAll(queryParams).then(res => {
|
exportAll(queryParams).then(res => {
|
||||||
if (res.code === RESULT_CODE_SUCCESS) {
|
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({
|
message.success({
|
||||||
content: t('common.msgSuccess', { msg: t('common.export') }),
|
content: t('common.msgSuccess', { msg: t('common.export') }),
|
||||||
key,
|
key,
|
||||||
@@ -494,7 +518,11 @@ function fnGetList(pageNum?: number) {
|
|||||||
}
|
}
|
||||||
tablePagination.total = res.total;
|
tablePagination.total = res.total;
|
||||||
tableState.data = res.rows;
|
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;
|
tableState.loading = false;
|
||||||
fnGetList(queryParams.pageNum - 1);
|
fnGetList(queryParams.pageNum - 1);
|
||||||
}
|
}
|
||||||
@@ -673,7 +701,11 @@ onMounted(() => {
|
|||||||
</template>
|
</template>
|
||||||
{{ t('views.faultManage.activeAlarm.updateConfirm') }}
|
{{ t('views.faultManage.activeAlarm.updateConfirm') }}
|
||||||
</a-button>
|
</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>
|
<template #icon> <export-outlined /> </template>
|
||||||
{{ t('views.faultManage.activeAlarm.exportAll') }}
|
{{ t('views.faultManage.activeAlarm.exportAll') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
@@ -797,7 +829,11 @@ onMounted(() => {
|
|||||||
:ok-text="t('views.faultManage.activeAlarm.confirm')"
|
:ok-text="t('views.faultManage.activeAlarm.confirm')"
|
||||||
@cancel="fnModalCancel"
|
@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-row :gutter="16">
|
||||||
<a-col :lg="12" :md="12" :xs="24">
|
<a-col :lg="12" :md="12" :xs="24">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
@@ -897,7 +933,7 @@ onMounted(() => {
|
|||||||
<a-form-item
|
<a-form-item
|
||||||
:label="t('views.faultManage.activeAlarm.locationInfo')"
|
:label="t('views.faultManage.activeAlarm.locationInfo')"
|
||||||
name="locationInfo"
|
name="locationInfo"
|
||||||
:label-col="{span:4}"
|
:label-col="{ span: 4 }"
|
||||||
>
|
>
|
||||||
{{ modalState.from.locationInfo }}
|
{{ modalState.from.locationInfo }}
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -923,15 +959,14 @@ onMounted(() => {
|
|||||||
<a-form-item
|
<a-form-item
|
||||||
:label="t('views.faultManage.activeAlarm.addInfo')"
|
:label="t('views.faultManage.activeAlarm.addInfo')"
|
||||||
name="addInfo"
|
name="addInfo"
|
||||||
:label-col="{span:4}"
|
:label-col="{ span: 4 }"
|
||||||
>
|
>
|
||||||
{{ modalState.from.addInfo }}
|
{{ modalState.from.addInfo }}
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label="t('views.faultManage.activeAlarm.specificProblemId')"
|
:label="t('views.faultManage.activeAlarm.specificProblemId')"
|
||||||
name="specificProblemId"
|
name="specificProblemId"
|
||||||
:label-col="{span:4}"
|
:label-col="{ span: 4 }"
|
||||||
|
|
||||||
>
|
>
|
||||||
{{ modalState.from.specificProblemId }}
|
{{ modalState.from.specificProblemId }}
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -939,8 +974,7 @@ onMounted(() => {
|
|||||||
<a-form-item
|
<a-form-item
|
||||||
:label="t('views.faultManage.activeAlarm.specificProblem')"
|
:label="t('views.faultManage.activeAlarm.specificProblem')"
|
||||||
name="specificProblem"
|
name="specificProblem"
|
||||||
:label-col="{span:4}"
|
:label-col="{ span: 4 }"
|
||||||
|
|
||||||
>
|
>
|
||||||
{{ modalState.from.specificProblem }}
|
{{ modalState.from.specificProblem }}
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|||||||
Reference in New Issue
Block a user