refactor: reorganize files
This commit is contained in:
@@ -1,17 +1,29 @@
|
||||
<script setup lang="ts">
|
||||
import type { NdmDeviceAlarmLogResultVO } from '@/apis/models';
|
||||
import { ndmDeviceAlarmLogDefaultExportByTemplate, postNdmDeviceAlarmLogPage, putNdmDeviceAlarmLog } from '@/apis/requests';
|
||||
import { renderAlarmDateCell, renderAlarmTypeCell, renderDeviceTypeCell, renderFaultLevelCell } from '@/components/helper';
|
||||
import { AlarmType } from '@/enums/alarm-type';
|
||||
import { DeviceType, DeviceTypeCode, DeviceTypeName, type DeviceTypeVal } from '@/enums/device-type';
|
||||
import { FaultLevel } from '@/enums/fault-level';
|
||||
import { useCurrentAlarmsStore } from '@/stores/current-alarms';
|
||||
import { useStationStore } from '@/stores/station';
|
||||
import { downloadByData } from '@/utils/download';
|
||||
import { ndmDeviceAlarmLogDefaultExportByTemplate, postNdmDeviceAlarmLogPage, putNdmDeviceAlarmLog, type NdmDeviceAlarmLogResultVO } from '@/apis';
|
||||
import { renderAlarmDateCell, renderAlarmTypeCell, renderDeviceTypeCell, renderFaultLevelCell } from '@/components';
|
||||
import { AlarmType, DeviceType, DeviceTypeCode, DeviceTypeName, FaultLevel, type DeviceTypeVal } from '@/enums';
|
||||
import { useCurrentAlarmsStore, useStationStore } from '@/stores';
|
||||
import { downloadByData } from '@/utils';
|
||||
import { useMutation } from '@tanstack/vue-query';
|
||||
import dayjs from 'dayjs';
|
||||
import type { DataTableColumns, DataTableRowData, PaginationProps, SelectOption } from 'naive-ui';
|
||||
import { NForm, NInput, NButton, NSpace, NDataTable, NFormItemGi, NGrid, NSelect, NGridItem, NDatePicker, NTag, NPopconfirm } from 'naive-ui';
|
||||
import {
|
||||
NForm,
|
||||
NInput,
|
||||
NButton,
|
||||
NSpace,
|
||||
NDataTable,
|
||||
NFormItemGi,
|
||||
NGrid,
|
||||
NSelect,
|
||||
NGridItem,
|
||||
NDatePicker,
|
||||
NTag,
|
||||
NPopconfirm,
|
||||
type SelectOption,
|
||||
type DataTableColumns,
|
||||
type DataTableRowData,
|
||||
type PaginationProps,
|
||||
} from 'naive-ui';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ref, reactive, onBeforeMount, h, computed, watch } from 'vue';
|
||||
|
||||
@@ -183,16 +195,16 @@ const tablePagination = reactive<PaginationProps>({
|
||||
},
|
||||
onUpdatePage: (page: number) => {
|
||||
tablePagination.page = page;
|
||||
getAlarmList();
|
||||
getTableData();
|
||||
},
|
||||
onUpdatePageSize: (pageSize: number) => {
|
||||
tablePagination.pageSize = pageSize;
|
||||
tablePagination.page = 1;
|
||||
getAlarmList();
|
||||
getTableData();
|
||||
},
|
||||
});
|
||||
|
||||
const { mutate: getAlarmList, isPending: tableLoading } = useMutation({
|
||||
const { mutate: getTableData, isPending: tableLoading } = useMutation({
|
||||
mutationFn: async () => {
|
||||
const res = await postNdmDeviceAlarmLogPage('', {
|
||||
model: {},
|
||||
@@ -221,7 +233,7 @@ const onClickReset = () => {
|
||||
tablePagination.page = 1;
|
||||
tablePagination.pageSize = 10;
|
||||
tablePagination.itemCount = 0;
|
||||
getAlarmList();
|
||||
getTableData();
|
||||
};
|
||||
const onClickQuery = () => {
|
||||
if (searchFieldsChanged.value) {
|
||||
@@ -229,7 +241,7 @@ const onClickQuery = () => {
|
||||
tablePagination.pageSize = 10;
|
||||
searchFieldsChanged.value = false;
|
||||
}
|
||||
getAlarmList();
|
||||
getTableData();
|
||||
};
|
||||
|
||||
const { mutate: confirmAlarm } = useMutation({
|
||||
@@ -274,7 +286,7 @@ const { mutate: exportTableData, isPending: exporting } = useMutation({
|
||||
},
|
||||
});
|
||||
|
||||
onBeforeMount(() => getAlarmList());
|
||||
onBeforeMount(() => getTableData());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { NdmCallLogResultVO, NdmCallLogVO, PageQueryExtra } from '@/apis/models';
|
||||
import { ndmCallLogDefaultExportByTemplate, postNdmCallLogPage } from '@/apis/requests';
|
||||
import { useStationStore } from '@/stores/station';
|
||||
import { downloadByData } from '@/utils/download';
|
||||
import { ndmCallLogDefaultExportByTemplate, postNdmCallLogPage, type NdmCallLogResultVO, type NdmCallLogVO, type PageQueryExtra } from '@/apis';
|
||||
import { useStationStore } from '@/stores';
|
||||
import { downloadByData } from '@/utils';
|
||||
import { useMutation } from '@tanstack/vue-query';
|
||||
import dayjs from 'dayjs';
|
||||
import {
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import { ndmExportDevices } from '@/apis/requests';
|
||||
import { useLineAlarmsQuery, useLineDevicesQuery } from '@/composables/query';
|
||||
import { useLineDevicesStore } from '@/stores/line-devices';
|
||||
import { useStationStore } from '@/stores/station';
|
||||
import { downloadByData } from '@/utils/download';
|
||||
import { ndmExportDevices } from '@/apis';
|
||||
import { DeviceStatisticCard } from '@/components';
|
||||
import { useLineAlarmsQuery, useLineDevicesQuery } from '@/composables';
|
||||
import { useLineDevicesStore, useStationStore } from '@/stores';
|
||||
import { downloadByData } from '@/utils';
|
||||
import { useMutation } from '@tanstack/vue-query';
|
||||
import dayjs from 'dayjs';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { watch } from 'vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import DeviceStatisticCard from '@/components/dashboard-page/device-statistic-card.vue';
|
||||
|
||||
const stationStore = useStationStore();
|
||||
const { stationList } = storeToRefs(stationStore);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { useQueryControlStore } from '@/stores/query-control';
|
||||
import { useQueryControlStore } from '@/stores';
|
||||
import { NLayout, NLayoutContent } from 'naive-ui';
|
||||
import { onBeforeUnmount } from 'vue';
|
||||
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import { useDeviceSelection } from '@/composables/device';
|
||||
import { useLineDevicesQuery } from '@/composables/query';
|
||||
import { useLineDevicesStore } from '@/stores/line-devices';
|
||||
import { useStationStore } from '@/stores/station';
|
||||
import { DeviceRenderer, DeviceTree } from '@/components';
|
||||
import { useDeviceSelection, useLineDevicesQuery } from '@/composables';
|
||||
import { useLineDevicesStore, useStationStore } from '@/stores';
|
||||
import { ChevronBack } from '@vicons/ionicons5';
|
||||
import { watchDebounced } from '@vueuse/core';
|
||||
import { NEmpty, NIcon, NLayout, NLayoutContent, NLayoutSider, NPageHeader, NScrollbar, NSpin } from 'naive-ui';
|
||||
import { NEmpty, NIcon, NLayout, NLayoutContent, NLayoutSider, NPageHeader, NScrollbar } from 'naive-ui';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { onMounted, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
import DeviceTree from '@/components/device-page/device-tree.vue';
|
||||
import DeviceRenderer from '@/components/device-page/device-renderer.vue';
|
||||
|
||||
// 数据获取
|
||||
const { error: lineDevicesQueryError } = useLineDevicesQuery();
|
||||
const stationStore = useStationStore();
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { userClient } from '@/apis/client';
|
||||
import type { LoginParams } from '@/apis/models';
|
||||
import ThemeSwitch from '@/components/global/theme-switch.vue';
|
||||
import { useUserStore } from '@/stores/user';
|
||||
import { randomNum } from '@/utils/random-num';
|
||||
import { userClient, type LoginParams } from '@/apis';
|
||||
import { ThemeSwitch } from '@/components';
|
||||
import { useUserStore } from '@/stores';
|
||||
import { randomNum } from '@/utils';
|
||||
import { useMutation } from '@tanstack/vue-query';
|
||||
import { NLayout, NCard, NForm, NFormItem, NInput, NButton, NFlex } from 'naive-ui';
|
||||
import { reactive } from 'vue';
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import type { Station } from '@/apis/domains';
|
||||
import { useLineAlarmsQuery, useLineDevicesQuery } from '@/composables/query';
|
||||
import { useLayoutStore } from '@/stores/layout';
|
||||
import { useLineAlarmsStore } from '@/stores/line-alarms';
|
||||
import { useLineDevicesStore } from '@/stores/line-devices';
|
||||
import { useStationStore } from '@/stores/station';
|
||||
import type { Station } from '@/apis';
|
||||
import { DeviceAlarmDetailModal, DeviceParamsConfigModal, OfflineDeviceDetailModal, StationCard } from '@/components';
|
||||
import { useLineAlarmsQuery, useLineDevicesQuery } from '@/composables';
|
||||
import { useLayoutStore, useLineAlarmsStore, useLineDevicesStore, useStationStore } from '@/stores';
|
||||
import { NGrid, NGi } from 'naive-ui';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
import DeviceAlarmDetailModal from '@/components/dashboard-page/device-alarm-detail-modal.vue';
|
||||
import DeviceParamsConfigModal from '@/components/dashboard-page/device-params-config-modal.vue';
|
||||
import OfflineDeviceDetailModal from '@/components/dashboard-page/offline-device-detail-modal.vue';
|
||||
import StationCard from '@/components/dashboard-page/station-card.vue';
|
||||
|
||||
const stationStore = useStationStore();
|
||||
const { stationList } = storeToRefs(stationStore);
|
||||
const lineDevicesStore = useLineDevicesStore();
|
||||
|
||||
Reference in New Issue
Block a user