refactor: 简化设备树的自动定位逻辑
This commit is contained in:
@@ -3,7 +3,7 @@ import { tryGetDeviceType, type DeviceType } from '@/enums';
|
||||
import { useDeviceStore } from '@/stores';
|
||||
import { watchDebounced } from '@vueuse/core';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
export const useDeviceSelection = () => {
|
||||
@@ -17,8 +17,6 @@ export const useDeviceSelection = () => {
|
||||
const selectedDeviceType = ref<DeviceType>();
|
||||
const selectedDevice = ref<NdmDeviceResultVO>();
|
||||
|
||||
const hasFromPage = computed(() => !!route.query['fromPage']);
|
||||
|
||||
const initFromRoute = (lineDevices: LineDevices) => {
|
||||
const { stationCode, deviceType, deviceDbId } = route.query;
|
||||
if (stationCode) {
|
||||
@@ -107,8 +105,6 @@ export const useDeviceSelection = () => {
|
||||
selectedDeviceType,
|
||||
selectedDevice,
|
||||
|
||||
hasFromPage,
|
||||
|
||||
initFromRoute,
|
||||
selectDevice,
|
||||
routeDevice,
|
||||
|
||||
Reference in New Issue
Block a user