From 6224398d6ac2db27c33fb5a950cdab2b8e189814 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期二, 10 十二月 2024 15:21:23 +0800 Subject: [PATCH] # --- zy-acs-flow/src/map/tool.js | 40 ++++++++++++++++++++++++---------------- 1 files changed, 24 insertions(+), 16 deletions(-) diff --git a/zy-acs-flow/src/map/tool.js b/zy-acs-flow/src/map/tool.js index 09d3ded..bdd7690 100644 --- a/zy-acs-flow/src/map/tool.js +++ b/zy-acs-flow/src/map/tool.js @@ -489,22 +489,30 @@ effectCircle.position.set(selectedSprite.x, selectedSprite.y); }; -export const showRoutes = (curZone, setShowRoutes) => { - setShowRoutes(true); - getRouteList(curZone, (routeList) => { - routeList.forEach(route => { - const startPoint = querySprite(DEVICE_TYPE.POINT, route.startCodeStr); - const endPoint = querySprite(DEVICE_TYPE.POINT, route.endCodeStr); - const pointRoute = new PointRoute(POINT_ROUTE_DIRECTION[route.direction]); - pointRoute.setPoint(startPoint, endPoint); - pointRoute.clear(); - pointRoute.lineStyle(Math.max(7, 2 * (1 / mapContainer.scale.x)), themeMode === 'light' ? '#ced6e0' : '#535c68'); - pointRoute.moveTo(startPoint.position.x, startPoint.position.y); - pointRoute.lineTo(endPoint.position.x, endPoint.position.y); - pointRoute.alpha = 1; - mapContainer.addChild(pointRoute); - }) - }) +export const showRoutes = (curZone, setShowRoutes, setLoading) => { + setLoading(true); + getRouteList( + curZone, + (routeList) => { + routeList.forEach(route => { + const startPoint = querySprite(DEVICE_TYPE.POINT, route.startCodeStr); + const endPoint = querySprite(DEVICE_TYPE.POINT, route.endCodeStr); + const pointRoute = new PointRoute(POINT_ROUTE_DIRECTION[route.direction]); + pointRoute.setPoint(startPoint, endPoint); + pointRoute.clear(); + pointRoute.lineStyle(Math.max(7, 2 * (1 / mapContainer.scale.x)), themeMode === 'light' ? '#ced6e0' : '#535c68'); + pointRoute.moveTo(startPoint.position.x, startPoint.position.y); + pointRoute.lineTo(endPoint.position.x, endPoint.position.y); + pointRoute.alpha = 1; + mapContainer.addChild(pointRoute); + }) + setLoading(false); + setShowRoutes(true); + }, + () => { + setLoading(false); + }, + ) }; export const hideRoutes = (curZone, setShowRoutes) => { -- Gitblit v1.9.1