refactor: reorganize files
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { getDeviceDetailApi, probeDeviceApi, type NdmDeviceResultVO } from '@/apis';
|
||||
import { detailDeviceApi, probeDeviceApi, type NdmDeviceResultVO } from '@/apis';
|
||||
import { DeviceType, DeviceTypeName, tryGetDeviceTypeVal, type DeviceTypeVal } from '@/enums';
|
||||
import { useLineDevicesStore } from '@/stores';
|
||||
import { useMutation } from '@tanstack/vue-query';
|
||||
@@ -48,7 +48,7 @@ const canProbe = computed(() => device.value.snmpEnabled);
|
||||
|
||||
const { mutate: probeDevice, isPending: probing } = useMutation({
|
||||
mutationFn: async () => {
|
||||
await probeDeviceApi(stationCode.value, device.value);
|
||||
await probeDeviceApi(device.value, { stationCode: stationCode.value });
|
||||
},
|
||||
onError: (error) => {
|
||||
console.error(error);
|
||||
@@ -58,8 +58,7 @@ const { mutate: probeDevice, isPending: probing } = useMutation({
|
||||
|
||||
const { mutate: getDeviceDetail, isPending: loading } = useMutation({
|
||||
mutationFn: async () => {
|
||||
const { id, deviceType } = device.value;
|
||||
return await getDeviceDetailApi(stationCode.value, id, tryGetDeviceTypeVal(deviceType));
|
||||
return await detailDeviceApi(device.value, { stationCode: stationCode.value });
|
||||
},
|
||||
onSuccess: (device) => {
|
||||
if (device) {
|
||||
|
||||
Reference in New Issue
Block a user