抽象统一定位方法,支持多种地理要素
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user