fix: polling doesnot resumed after router.push

This commit is contained in:
yangsy
2025-08-17 02:06:21 +08:00
parent d14e290990
commit 22f57773e2

View File

@@ -51,12 +51,9 @@ watch(show, (newValue) => {
const searchPattern = ref(''); const searchPattern = ref('');
const searchFilter: (pattern: string, node: TreeOption) => boolean = (pattern, node) => { const searchFilter: (pattern: string, node: TreeOption) => boolean = (pattern, node) => {
if (node.children) {
return node.children.some((child) => searchFilter(pattern, child));
}
const device = node['device'] as NdmDeviceVO; const device = node['device'] as NdmDeviceVO;
const { name, ipAddress } = device; const { name, ipAddress } = device;
return name?.includes(pattern) || ipAddress?.includes(pattern); return (name ?? '').includes(pattern) || (ipAddress ?? '').includes(pattern);
}; };
const offlineDeviceCount = computed(() => { const offlineDeviceCount = computed(() => {
@@ -89,6 +86,8 @@ const nodeProps = ({ option }: { option: TreeOption }) => {
return { return {
ondblclick: () => { ondblclick: () => {
if (option.isLeaf) { if (option.isLeaf) {
const queryControlStore = useQueryControlStore();
queryControlStore.enablePolling();
const device = option['device'] as NdmDeviceVO; const device = option['device'] as NdmDeviceVO;
router.push({ router.push({
path: '/device', path: '/device',