自定义排序导出

This commit is contained in:
lai
2023-12-26 11:21:23 +08:00
parent b8e8c07704
commit 4f34b3bca9
2 changed files with 17 additions and 70 deletions

View File

@@ -48,6 +48,7 @@ let tableColumnsDnd = ref<ColumnsType>([]);
/**记录开始结束时间 */
let queryRangePicker = ref<[string, string]>(['', '']);
/**查询参数 */
let queryParams = reactive({
/**告警设备类型 */
@@ -168,6 +169,7 @@ let tableColumns: ColumnsType = [
title: t('views.faultManage.activeAlarm.origLevel'),
align: 'center',
key: 'origSeverity',
dataIndex:'origSeverity',
width: 5,
},
{
@@ -623,48 +625,21 @@ function fnShowSet() {
/**
* 导出全部
*/
function fnExportAll() {
function fnExportAll() {
Modal.confirm({
title: 'Tip',
content: t('views.faultManage.activeAlarm.exportSure'),
onOk() {
const key = 'exportAlarm';
message.loading({ content: t('common.loading'), key });
let sortArr:any=[];
tableColumnsDnd.value.forEach((item: any) => {
if(item.dataIndex) sortArr.push(item.dataIndex);
})
// 排序字段
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',
],
header:sortArr,
};
exportAll(queryParams).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {

View File

@@ -146,7 +146,7 @@ let tableColumns: ColumnsType = [
{
title: t('views.faultManage.activeAlarm.origLevel'),
align: 'left',
dataIndex: 'origLevel',
dataIndex: 'origSeverity',
key: 'origSeverity',
width: 5,
},
@@ -434,41 +434,13 @@ function fnExportAll() {
onOk() {
const key = 'exportAlarmHis';
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',
],
let sortArr:any=[];
tableColumnsDnd.value.forEach((item: any) => {
if(item.dataIndex) sortArr.push(item.dataIndex);
})
// 排序字段
const sortData = {
header:sortArr,
};
exportAll(queryParams).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {