gr 1 ماه پیش
والد
کامیت
b8e13979d0
2فایلهای تغییر یافته به همراه48 افزوده شده و 44 حذف شده
  1. 44 43
      src/views/home/cpns/FloatPanelFcky.vue
  2. 4 1
      src/views/home/cpns/FloatPanelTsjs.vue

+ 44 - 43
src/views/home/cpns/FloatPanelFcky.vue

@@ -240,53 +240,53 @@ function toggleSingleLayer(data, show = true) {
 	}
 }
 
-let timer_handleLayering
+// let timer_handleLayering
 let lastBigLayers = []
 let lastSmallLayers = []
 function handleLayering() {
-	if (timer_handleLayering) {
-		clearTimeout(timer_handleLayering)
+	// if (timer_handleLayering) {
+	// 	clearTimeout(timer_handleLayering)
+	// }
+	// timer_handleLayering = setTimeout(() => {
+	const { layeringType, layersBig, layersSmall, rangeType, range } = form.value
+	const rings = rangeType === '自定义绘制' ? drawResult : queryResult
+	if (!rings) return
+	console.log('start draw')
+	console.log('range', range)
+
+	if (layeringType === '广域分层') {
+		layersListSmall.value.forEach((i) => {
+			if (lastSmallLayers.includes(i.value)) {
+				toggleSingleLayer({ id: i.id, value: i.value }, false)
+			}
+		})
+		lastSmallLayers = []
+		layersListBig.forEach((i) => {
+			if (layersBig.includes(i.value) && !lastBigLayers.includes(i.value)) {
+				toggleSingleLayer({ ...i, rings }, true)
+			} else if (!layersBig.includes(i.value) && lastBigLayers.includes(i.value)) {
+				toggleSingleLayer({ ...i }, false)
+			}
+		})
+		lastBigLayers = JSON.parse(JSON.stringify(layersBig))
+	} else {
+		// 细微分层
+		layersListBig.forEach((i) => {
+			if (lastBigLayers.includes(i.value)) {
+				toggleSingleLayer({ id: i.id, value: i.value }, false)
+			}
+		})
+		lastBigLayers = []
+		layersListSmall.value.forEach((i) => {
+			if (layersSmall.includes(i.value) && !lastSmallLayers.includes(i.value)) {
+				toggleSingleLayer({ ...i, rings }, true)
+			} else if (!layersSmall.includes(i.value) && lastSmallLayers.includes(i.value)) {
+				toggleSingleLayer({ ...i }, false)
+			}
+		})
+		lastSmallLayers = JSON.parse(JSON.stringify(layersSmall))
 	}
-	timer_handleLayering = setTimeout(() => {
-		const { layeringType, layersBig, layersSmall, rangeType, range } = form.value
-		const rings = rangeType === '自定义绘制' ? drawResult : queryResult
-		if (!rings) return
-		console.log('start draw')
-		console.log('range', range)
-
-		if (layeringType === '广域分层') {
-			layersListSmall.value.forEach((i) => {
-				if (lastSmallLayers.includes(i.value)) {
-					toggleSingleLayer({ id: i.id, value: i.value }, false)
-				}
-			})
-			lastSmallLayers = []
-			layersListBig.forEach((i) => {
-				if (layersBig.includes(i.value) && !lastBigLayers.includes(i.value)) {
-					toggleSingleLayer({ ...i, rings }, true)
-				} else if (!layersBig.includes(i.value) && lastBigLayers.includes(i.value)) {
-					toggleSingleLayer({ ...i }, false)
-				}
-			})
-			lastBigLayers = JSON.parse(JSON.stringify(layersBig))
-		} else {
-			// 细微分层
-			layersListBig.forEach((i) => {
-				if (lastBigLayers.includes(i.value)) {
-					toggleSingleLayer({ id: i.id, value: i.value }, false)
-				}
-			})
-			lastBigLayers = []
-			layersListSmall.value.forEach((i) => {
-				if (layersSmall.includes(i.value) && !lastSmallLayers.includes(i.value)) {
-					toggleSingleLayer({ ...i, rings }, true)
-				} else if (!layersSmall.includes(i.value) && lastSmallLayers.includes(i.value)) {
-					toggleSingleLayer({ ...i }, false)
-				}
-			})
-			lastSmallLayers = JSON.parse(JSON.stringify(layersSmall))
-		}
-	}, 1000)
+	// }, 1000)
 }
 
 const layersListBig = [
@@ -386,6 +386,7 @@ function clearAll(all = false) {
 		Object.keys(indeterminate).forEach((k) => (indeterminate[k] = false))
 		form.value.layersBig = []
 		form.value.layersSmall = []
+		form.value.range = null
 		drawResult = null
 		queryResult = null
 	}

+ 4 - 1
src/views/home/cpns/FloatPanelTsjs.vue

@@ -201,7 +201,10 @@ let currentLineId
 const showSingleLine = ref(false)
 
 watch(showSingleLine, (val) => {
+	// console.log(routeList.map(r => r.id))
 	const targetLine = routeList.find((r) => r.id === currentLineId)
+	console.log('currentLineId', currentLineId)
+	console.log('targetLine', targetLine)
 	if (!targetLine) return
 	renderShapes({
 		id: 'single_' + currentLineId,
@@ -228,7 +231,7 @@ onBeforeMount(() => {
 				baseInfo.value.battery = msg.Data.electricity
 				baseInfo.value.height = msg.Data.height.toFixed(2) + 'm'
 				baseInfo.value.velocity = msg.Data.speed.toFixed(2) + 'm/s'
-				currentLineId = msg.Data.TravelId
+				currentLineId = msg.Data.travelId
 
 				const { electricityWarning, weatherWarning, collision, noFlyZone, clearZone, nearstAircraft, routeDeviate } =
 					msg.Data.flightDataStatus