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