diff --git a/src/components/dashboard-page/device-params-config-modal.vue b/src/components/dashboard-page/device-params-config-modal.vue index e80d92f..5a97f17 100644 --- a/src/components/dashboard-page/device-params-config-modal.vue +++ b/src/components/dashboard-page/device-params-config-modal.vue @@ -72,7 +72,7 @@ import type { Station } from '@/apis/domains'; import { postDefParameterPage, putDefParameter } from '@/apis/requests'; import { useQueryControlStore } from '@/stores/query-control'; import { useMutation } from '@tanstack/vue-query'; -import { NForm, NFormItemGi, NGrid, NInputNumber, NModal, NTabPane, NTabs, NTimePicker } from 'naive-ui'; +import { NForm, NFormItemGi, NGrid, NInputNumber, NModal, NTabPane, NTabs, NTimePicker, NSpin, NFlex } from 'naive-ui'; import { ref, toRefs, watch } from 'vue'; const props = defineProps<{ @@ -134,11 +134,12 @@ const onAfterModalEnter = () => { const onBeforeModalLeave = () => { saveDeviceParams({ tabName: activeTabName.value, params: deviceConfigParams.value }); activeTabName.value = DeviceConfigParamPrefix.Switch; + deviceConfigParams.value = []; }; const deviceConfigParams = ref([]); -const { mutate: getDeviceParams } = useMutation({ +const { mutate: getDeviceParams, isPending: paramsLoading } = useMutation({ mutationFn: async ({ deviceKeyPrefix }: { deviceKeyPrefix: string }) => { if (!station.value) throw new Error('请先选择车站'); const { records } = await postDefParameterPage(station.value.code, { @@ -220,7 +221,10 @@ const { mutate: saveDeviceParams } = useMutation({ > - + + + +