refactor(stores): simplify stores

This commit is contained in:
yangsy
2025-11-25 16:51:20 +08:00
parent 2dd599d2eb
commit 5e464f6e80
39 changed files with 195 additions and 212 deletions

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { detailDeviceApi, probeDeviceApi, type NdmDeviceResultVO } from '@/apis';
import { DeviceType, DeviceTypeName, tryGetDeviceTypeVal, type DeviceTypeVal } from '@/enums';
import { useLineDevicesStore } from '@/stores';
import { useDeviceStore } from '@/stores';
import { useMutation } from '@tanstack/vue-query';
import { ApiOutlined, ReloadOutlined } from '@vicons/antd';
import { NButton, NCard, NFlex, NIcon, NTag, NTooltip } from 'naive-ui';
@@ -62,7 +62,7 @@ const { mutate: getDeviceDetail, isPending: loading } = useMutation({
},
onSuccess: (device) => {
if (device) {
useLineDevicesStore().patch(stationCode.value, device);
useDeviceStore().patch(stationCode.value, device);
}
},
onError: (error) => {