新增导出插件的可排序功能

This commit is contained in:
lai
2023-12-26 10:03:00 +08:00
parent dd14a32329
commit 7c69967148
4 changed files with 102 additions and 10 deletions

View File

@@ -630,6 +630,42 @@ function fnExportAll() {
onOk() {
const key = 'exportAlarm';
message.loading({ content: t('common.loading'), key });
// 排序字段
const sortData = {
header: [
'id',
'neId',
'neName',
'neType',
'ackState',
'ackTime',
'ackUser',
'addInfo',
'alarmCode',
'alarmId',
'alarmSeq',
'alarmStatus',
'alarmTitle',
'alarmType',
'clearTime',
'clearType',
'clearUser',
'counter',
'eventTime',
'latestEventTime',
'locationInfo',
'objectName',
'objectType',
'objectUid',
'origSeverity',
'perceivedSeverity',
'province',
'pvFlag',
'specificProblem',
'specificProblemId',
'timestamp',
],
};
exportAll(queryParams).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
@@ -637,7 +673,7 @@ function fnExportAll() {
key,
duration: 3,
});
writeSheet(res.data, 'alarm').then(fileBlob =>
writeSheet(res.data, 'alarm', sortData).then(fileBlob =>
saveAs(fileBlob, `alarm_${Date.now()}.xlsx`)
);
} else {