format: DataTable function
This commit is contained in:
@@ -155,10 +155,6 @@ const tablePagination = reactive<PaginationProps>({
|
||||
|
||||
const tableData = ref<DataTableRowData[]>([]);
|
||||
|
||||
const exportTableData = () => {
|
||||
downloadTableData();
|
||||
};
|
||||
|
||||
const onAfterModalEnter = () => {
|
||||
getStaionAlarmList();
|
||||
};
|
||||
@@ -183,7 +179,7 @@ const onUpdateFilters: DataTableProps['onUpdateFilters'] = (filterState) => {
|
||||
getStaionAlarmList();
|
||||
};
|
||||
|
||||
const { mutate: getStaionAlarmList, isPending: isTableLoading } = useMutation({
|
||||
const { mutate: getStaionAlarmList, isPending: tableLoading } = useMutation({
|
||||
mutationFn: async () => {
|
||||
const now = dayjs();
|
||||
const res = await postNdmDeviceAlarmLogPage(station.value?.code ?? '', {
|
||||
@@ -218,7 +214,7 @@ const { mutate: getStaionAlarmList, isPending: isTableLoading } = useMutation({
|
||||
},
|
||||
});
|
||||
|
||||
const { mutate: downloadTableData, isPending: isDownloading } = useMutation({
|
||||
const { mutate: exportTableData, isPending: exporting } = useMutation({
|
||||
mutationFn: async () => {
|
||||
const now = dayjs();
|
||||
const data = await ndmDeviceAlarmLogDefaultExportByTemplate(station.value?.code ?? '', {
|
||||
@@ -275,12 +271,12 @@ const { mutate: downloadTableData, isPending: isDownloading } = useMutation({
|
||||
<div style="flex: 0 0 auto; display: flex; align-items: center; padding: 8px 0">
|
||||
<div style="font-size: medium">今日设备告警列表</div>
|
||||
<NSpace style="margin-left: auto">
|
||||
<NButton type="primary" :loading="isDownloading" @click="exportTableData">导出</NButton>
|
||||
<NButton type="primary" :loading="exporting" @click="() => exportTableData()">导出</NButton>
|
||||
</NSpace>
|
||||
</div>
|
||||
<div style="flex: 1 1 auto; min-height: 0">
|
||||
<NDataTable
|
||||
:loading="isTableLoading"
|
||||
:loading="tableLoading"
|
||||
:columns="tableColumns"
|
||||
:data="tableData"
|
||||
:pagination="tablePagination"
|
||||
|
||||
Reference in New Issue
Block a user