From b08e818d215185f32b270947eeee1f92da5aead9 Mon Sep 17 00:00:00 2001 From: yangsy Date: Fri, 14 Nov 2025 16:42:30 +0800 Subject: [PATCH] format: DataTable function --- .../dashboard-page/device-alarm-detail-modal.vue | 12 ++++-------- src/pages/alarm-page.vue | 12 +++++------- src/pages/vimp-log-page.vue | 12 +++++------- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/components/dashboard-page/device-alarm-detail-modal.vue b/src/components/dashboard-page/device-alarm-detail-modal.vue index cf0f090..3a83a5e 100644 --- a/src/components/dashboard-page/device-alarm-detail-modal.vue +++ b/src/components/dashboard-page/device-alarm-detail-modal.vue @@ -155,10 +155,6 @@ const tablePagination = reactive({ const tableData = ref([]); -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({
今日设备告警列表
- 导出 + 导出
({ }, }); -const { mutate: getAlarmList, isPending: isTableLoading } = useMutation({ +const { mutate: getAlarmList, isPending: tableLoading } = useMutation({ mutationFn: async () => { const res = await postNdmDeviceAlarmLogPage('', { model: {}, @@ -252,7 +252,7 @@ const { mutate: confirmAlarm } = useMutation({ }, }); -const { mutate: downloadTableData, isPending: isDownloading } = useMutation({ +const { mutate: exportTableData, isPending: exporting } = useMutation({ mutationFn: async () => { const data = await ndmDeviceAlarmLogDefaultExportByTemplate('', { model: {}, @@ -274,8 +274,6 @@ const { mutate: downloadTableData, isPending: isDownloading } = useMutation({ }, }); -const exportTableData = () => downloadTableData(); - onBeforeMount(() => getAlarmList()); @@ -349,7 +347,7 @@ onBeforeMount(() => getAlarmList()); 重置 - 查询 + 查询 @@ -360,13 +358,13 @@ onBeforeMount(() => getAlarmList());
设备告警列表
- 导出 + 导出
- +
diff --git a/src/pages/vimp-log-page.vue b/src/pages/vimp-log-page.vue index 64ad62f..849123c 100644 --- a/src/pages/vimp-log-page.vue +++ b/src/pages/vimp-log-page.vue @@ -185,7 +185,7 @@ const tablePagination = reactive({ }, }); -const { mutate: getVimpLogList, isPending: isTableLoading } = useMutation({ +const { mutate: getVimpLogList, isPending: tableLoading } = useMutation({ mutationFn: async () => { if (!searchFields.stationCode) throw Error('请选择车站'); const res = await postNdmVimpLogPage(searchFields.stationCode, { @@ -226,7 +226,7 @@ const onClickQuery = () => { getVimpLogList(); }; -const { mutate: downloadTableData, isPending: isDownloading } = useMutation({ +const { mutate: exportTableData, isPending: exporting } = useMutation({ mutationFn: async () => { if (!searchFields.stationCode) throw Error('请选择车站'); const data = await ndmVimpLogDefaultExportByTemplate(searchFields.stationCode, { @@ -249,8 +249,6 @@ const { mutate: downloadTableData, isPending: isDownloading } = useMutation({ }, }); -const exportTableData = () => downloadTableData(); - // 进入页面时选择首个在线的车站 onMounted(() => { // if (onlineStationList.value.length > 0) { @@ -314,7 +312,7 @@ watchEffect(() => { 重置 - 查询 + 查询 @@ -325,13 +323,13 @@ watchEffect(() => {
视频平台日志
- 导出 + 导出
- +