新增导出插件的可排序功能
This commit is contained in:
@@ -39,6 +39,9 @@ let dict: {
|
||||
/**记录开始结束时间 */
|
||||
let queryRangePicker = ref<[string, string]>(['', '']);
|
||||
|
||||
/**表格字段列排序 */
|
||||
let tableColumnsDnd = ref<ColumnsType>([]);
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**告警设备类型 */
|
||||
@@ -431,6 +434,42 @@ 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',
|
||||
],
|
||||
};
|
||||
exportAll(queryParams).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
@@ -438,7 +477,7 @@ function fnExportAll() {
|
||||
key,
|
||||
duration: 3,
|
||||
});
|
||||
writeSheet(res.data, 'alarm').then(fileBlob =>
|
||||
writeSheet(res.data, 'alarm',sortData).then(fileBlob =>
|
||||
saveAs(fileBlob, `history-alarm_${Date.now()}.xlsx`)
|
||||
);
|
||||
} else {
|
||||
@@ -707,6 +746,10 @@ onMounted(() => {
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</a-tooltip>
|
||||
<TableColumnsDnd
|
||||
:columns="tableColumns"
|
||||
v-model:columns-dnd="tableColumnsDnd"
|
||||
></TableColumnsDnd>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
@@ -714,7 +757,7 @@ onMounted(() => {
|
||||
<a-table
|
||||
class="table"
|
||||
row-key="id"
|
||||
:columns="tableColumns"
|
||||
:columns="tableColumnsDnd"
|
||||
:loading="tableState.loading"
|
||||
:data-source="tableState.data"
|
||||
:size="tableState.size"
|
||||
|
||||
Reference in New Issue
Block a user