修改了从养护站页面跳转过去是 筛选逻辑

This commit is contained in:
huangchenhao 2025-11-21 15:18:37 +08:00
parent 4001c4942f
commit 8488a2c547
3 changed files with 13 additions and 6 deletions

View File

@ -456,8 +456,8 @@ export default () => {
nextTick(() => { nextTick(() => {
setTimeout(() => { setTimeout(() => {
const visibleNodes = getFilteredVisibleNodes() const visibleNodes = getFilteredVisibleNodes()
if (visibleNodes.length === 2) { if (visibleNodes.length === 3) {
handleAutoClickNode(visibleNodes[1]) handleAutoClickNode(visibleNodes[0])
} }
}, 100) // 增加 100ms 延迟确保过滤完成 }, 100) // 增加 100ms 延迟确保过滤完成
}) })

View File

@ -162,6 +162,7 @@ const handleNodeClick = (data, node) => {
console.log('你点击的是全部') console.log('你点击的是全部')
yhzid.value = ''; // 重置养护站id yhzid.value = ''; // 重置养护站id
qxmc.value = ''; // 重置区县名称 qxmc.value = ''; // 重置区县名称
yhzData.value = null; // 重置养护站信息
return; return;
}; };
// if (data.type === 'area' && node.expanded === false) { // if (data.type === 'area' && node.expanded === false) {
@ -174,12 +175,18 @@ const handleNodeClick = (data, node) => {
console.log('你点击的是区县', data.rawName) console.log('你点击的是区县', data.rawName)
yhzid.value = ''; // 重置养护站id yhzid.value = ''; // 重置养护站id
qxmc.value = data.rawName; // 保存区县名称 qxmc.value = data.rawName; // 保存区县名称
yhzData.value = null; // 重置养护站信息
return; return;
} }
if (data.type === 'site') { if (data.type === 'site') {
console.log('你点击的是站点', data.name) console.log('你点击的是站点', data.name)
yhzid.value = data.id; // 保存养护站id yhzid.value = data.id; // 保存养护站id
qxmc.value = ''; // 重置区县名称 qxmc.value = ''; // 重置区县名称
yhzData.value = {
jd: data.jd,
wd: data.wd,
rawName: data.rawName,
}
return; return;
} }
}; };
@ -448,8 +455,8 @@ export default () => {
nextTick(() => { nextTick(() => {
setTimeout(() => { setTimeout(() => {
const visibleNodes = getFilteredVisibleNodes() const visibleNodes = getFilteredVisibleNodes()
if (visibleNodes.length === 2) { if (visibleNodes.length === 3) {
handleAutoClickNode(visibleNodes[1]) handleAutoClickNode(visibleNodes[0])
} }
}, 100) // 增加 100ms 延迟确保过滤完成 }, 100) // 增加 100ms 延迟确保过滤完成
}) })

View File

@ -403,8 +403,8 @@ export default () => {
nextTick(() => { nextTick(() => {
setTimeout(() => { setTimeout(() => {
const visibleNodes = getFilteredVisibleNodes() const visibleNodes = getFilteredVisibleNodes()
if (visibleNodes.length === 2) { if (visibleNodes.length === 3) {
handleAutoClickNode(visibleNodes[1]) handleAutoClickNode(visibleNodes[0])
} }
}, 100) // 增加 100ms 延迟确保过滤完成 }, 100) // 增加 100ms 延迟确保过滤完成
}) })