抽象统一定位方法,支持多种地理要素

This commit is contained in:
2026-04-03 13:45:37 +08:00
parent d610a09c14
commit c484aad1d3
6 changed files with 252 additions and 48 deletions
+5 -3
View File
@@ -11,8 +11,7 @@ import {
* ```ts
* useChatToolActionHandler((action) => {
* switch (action.type) {
* case "locate_nodes": handleLocateNodes(action.ids); break;
* case "locate_pipes": handleLocatePipes(action.ids); break;
* case "locate_features": handleLocateFeatures(action.ids, action.layer, action.geometryKind); break;
* case "view_history": openHistoryPanel(action.featureInfos, action.dataType); break;
* case "view_scada": openScadaPanel(action.featureInfos); break;
* }
@@ -23,7 +22,10 @@ export function useChatToolActionHandler(
handler: (action: ChatToolAction) => void,
) {
const handlerRef = useRef(handler);
handlerRef.current = handler;
useEffect(() => {
handlerRef.current = handler;
}, [handler]);
useEffect(() => {
const unsubscribe = useChatToolStore.subscribe(