gr 1 week ago
parent
commit
caf4dd3b24

+ 5 - 3
src/components/UeVideo.vue

@@ -12,8 +12,10 @@ import { onMounted, ref, getCurrentInstance, onBeforeUnmount } from 'vue'
 import axios from 'axios'
 import baseUrl from '@/utils/peer-stream'
 import useLayoutStore from '@/store/layout'
+import useUeStore from '@/store/ue'
 
 const layoutStore = useLayoutStore()
+const ueStore = useUeStore()
 
 const { proxy } = getCurrentInstance()
 
@@ -48,7 +50,7 @@ const wsConnect = (sceneId, view_mode, token) => {
 		peerStreamRef.value.addEventListener('playing', () => {
 			// layoutStore.sceneLoading = false
 			connectStatus.value = '连接成功'
-			proxy.$bus.emit('ueConnected')
+			ueStore.sceneReady = true
 		})
 		peerStreamRef.value.addEventListener('disConnected', () => (connectStatus.value = '连接断开'))
 		peerStreamRef.value.addEventListener('message', (e) => {
@@ -77,8 +79,8 @@ function handleConnect() {
 		method: 'post',
 		url: `http://${baseUrl}/auth/login`,
 		data: {
-			userName: 'admin',
-			password: '123',
+			username: 'dktest',
+			password: '123456',
 		},
 		timeout: 5000,
 	})

+ 52 - 0
src/service/map.js

@@ -164,3 +164,55 @@ export function gridBaseInfo(params) {
 		},
 	})
 }
+
+// 网格核查(起降场、空域)
+export function getInspectionData(params, shapeType) {
+	switch (shapeType) {
+		case 'polygon': {
+			return requestNetPost({
+				url: '/DataSearch/grid/search/cutPrism',
+				data: {
+					geoShapeQuery: {
+						fieldName: 'locationPoint',
+						relation: 'intersects',
+						shape: {
+							type: 'Polygon',
+							coordinates: params.rings,
+						},
+					},
+					minZ: 0,
+					maxZ: params.height * 1,
+					level: params.level,
+				},
+			})
+		}
+		case 'funnel': {
+			return requestNetPost({
+				url: '/DataSearch/grid/search/cutUsingFunnel',
+				data: params,
+			})
+		}
+		case 'frustum-cone': {
+			return requestNetPost({
+				url: '/DataSearch/grid/search/cutUsingFrustum',
+				data: params,
+			})
+		}
+		case 'inverted-cone': {
+			return requestNetPost({
+				url: '/DataSearch/grid/search/cutUsingCone',
+				data: params,
+			})
+		}
+		case 'polyline': {
+			return requestNetPost({
+				url: '/DataSearch/grid/search/cutUsingCylinderForPath',
+				data: {
+					paths: params.paths,
+					radius: params.radius,
+					level: params.level,
+				},
+			})
+		}
+	}
+}

+ 1 - 1
src/store/layout.js

@@ -18,7 +18,7 @@ const useLayoutStore = defineStore('layout', {
 		leftCollapse: false, // 左侧面板收缩状态
 		rightCollapse: false, // 左侧面板收缩状态
 		footerCollapse: false, // 底部收缩状态
-		sceneType: 'gis', // 场景类型 'ue' | 'gis'
+		sceneType: 'ue', // 场景类型 'ue' | 'gis'
 		mapScene: 'rs', // 底图类型 'light' | 'dark' | 'rs'
 		leftPanelType: 'default', // 左侧面板显示的内容
 		floatPanels: {

+ 11 - 0
src/store/ue.js

@@ -0,0 +1,11 @@
+import { defineStore } from 'pinia'
+
+const useUeStore = defineStore('ue', {
+	state: () => ({
+		sceneReady: false,
+	}),
+	getters: {},
+	actions: {},
+})
+
+export default useUeStore

File diff suppressed because it is too large
+ 884 - 911
src/utils/peer-stream.js


+ 8 - 0
src/utils/tools.js

@@ -35,3 +35,11 @@ export function getCookie(name) {
 	}
 	return null
 }
+
+export function wait(time) {
+	return new Promise((resolve) => {
+		setTimeout(() => {
+			resolve()
+		}, time)
+	})
+}

+ 91 - 2
src/utils/ueActions.js

@@ -169,11 +169,24 @@ export function setWeather({ RealTime = true, UpdateTime, WeatherType }) {
 	})
 }
 
+// 场景演示初始化
+export function initSceneDemo() {
+	sendMessage({
+		ModuleName: 'BluePrint',
+		ActionName: '',
+		Params: {
+			ModuleName: 'Uav',
+			ActionName: 'InitStatusDemoScene',
+		},
+	})
+}
+
 /**
  * 场景演示
  * @param {'Near' | 'Yaw' | 'Electricity' | 'BreakInto' | 'Weather'} type
  */
 export function startSceneDemo(type) {
+	initSceneDemo()
 	sendMessage({
 		ModuleName: 'BluePrint',
 		ActionName: '',
@@ -199,27 +212,103 @@ export function startSceneDemo(type) {
 
 	switch (type) {
 		case 'Near': {
+			sendMessage({
+				ModuleName: 'Roam',
+				ActionName: 'Goto',
+				Params: {
+					Type: 'StraightLine',
+					X: 226362.189418,
+					Y: -597424.387253,
+					Z: 6082.809803,
+					Pitch: -38.200001,
+					Yaw: -53.600001,
+					Roll: 0,
+					Duration: 0.1,
+				},
+			})
 			setUav('E5C734B81F9044FC99E54B361D67C487')
 			break
 		}
 		case 'Yaw': {
+			sendMessage({
+				ModuleName: 'Roam',
+				ActionName: 'Goto',
+				Params: {
+					Type: 'StraightLine',
+					X: 226362.189418,
+					Y: -597424.387253,
+					Z: 6082.809803,
+					Pitch: -38.200001,
+					Yaw: -53.600001,
+					Roll: 0,
+					Duration: 0.1,
+				},
+			})
 			setUav('3C50F681255941F88D7B6E5EE7F6AC63')
 			followUav('3C50F681255941F88D7B6E5EE7F6AC63')
 			break
 		}
 		case 'BreakInto': {
-			followUav('bdb8859e-b366-4c1a-a964-1e16ba15237a')
+			setTimeout(() => {
+				sendMessage({
+					ModuleName: 'Roam',
+					ActionName: 'Goto',
+					Params: {
+						Type: 'StraightLine',
+						X: 226362.189418,
+						Y: -597424.387253,
+						Z: 6082.809803,
+						Pitch: -38.200001,
+						Yaw: -53.600001,
+						Roll: 0,
+						Duration: 0.1,
+					},
+				})
+				setUav('bdb8859e-b366-4c1a-a964-1e16ba15237a')
+				followUav('bdb8859e-b366-4c1a-a964-1e16ba15237a')
+			})
 			break
 		}
 		case 'Weather': {
 			setTimeout(() => {
+				sendMessage({
+					ModuleName: 'Roam',
+					ActionName: 'Goto',
+					Params: {
+						Type: 'StraightLine',
+						X: 226362.189418,
+						Y: -597424.387253,
+						Z: 6082.809803,
+						Pitch: -38.200001,
+						Yaw: -53.600001,
+						Roll: 0,
+						Duration: 0.1,
+					},
+				})
 				setUav('469193E4D239436BB50767009CC8B29F')
 				followUav('469193E4D239436BB50767009CC8B29F')
 			}, 2000)
 			break
 		}
 		case 'Electricity': {
-			followUav('bdb8859e-b366-4c1a-a964-1e16ba15237a')
+			setTimeout(() => {
+				sendMessage({
+					ModuleName: 'Roam',
+					ActionName: 'Goto',
+					Params: {
+						Type: 'StraightLine',
+						X: 226362.189418,
+						Y: -597424.387253,
+						Z: 6082.809803,
+						Pitch: -38.200001,
+						Yaw: -53.600001,
+						Roll: 0,
+						Duration: 0.1,
+					},
+				})
+				setUav('D0CECFB45F494D39ADABB5AF7A7DFEE7')
+				followUav('D0CECFB45F494D39ADABB5AF7A7DFEE7')
+			}, 2000)
 			break
 		}
 	}

+ 4 - 1
src/views/home/Home.vue

@@ -125,7 +125,10 @@
 
 		<!-- 无人机详情 -->
 		<Transition name="emerge-left">
-			<FloatPanelUav v-if="layoutStore.floatPanels.uav" />
+			<FloatPanelUav
+				class="f-panel-left"
+				v-if="layoutStore.floatPanels.uav"
+				@close="layoutStore.toggleFloatPanel('uav', false)" />
 		</Transition>
 
 		<!-- 空域栅格 -->

+ 126 - 2
src/views/home/cpns/FloatPanelTsjs.vue

@@ -21,13 +21,29 @@
 				<i :class="{ on: options.track }"></i>
 			</div>
 		</div>
+
+		<Transition name="emerge-left">
+			<FloatPanelUav class="uav-demo" v-if="uavInfoShow" :alert="alertInfo" @close="uavInfoShow = false" />
+		</Transition>
 	</div>
 </template>
 
 <script setup>
+import { GetRouteList } from '@/service/http'
+import useLayoutStore from '@/store/layout'
+import useUeStore from '@/store/ue'
 import { getAssetsFile } from '@/utils/require'
-import { startSceneDemo } from '@/utils/ueActions'
-import { reactive, ref, onBeforeMount } from 'vue'
+import { clearAllShapes, startSceneDemo, toggleUav } from '@/utils/ueActions'
+import { getCurrentInstance, onBeforeMount, onBeforeUnmount, reactive, ref, watch } from 'vue'
+import FloatPanelUav from './FloatPanelUav.vue'
+import { hexToRgb } from '@/utils/tools'
+
+const { proxy } = getCurrentInstance()
+
+const ueStore = useUeStore()
+const layoutStore = useLayoutStore()
+
+const uavInfoShow = ref(false)
 
 const listData = ref([
 	{ label: '偏航预警', value: 'Yaw', pic: 'ph', count: 0 },
@@ -39,6 +55,7 @@ const listData = ref([
 
 function handleDemo(item) {
 	startSceneDemo(item.value)
+	uavInfoShow.value = true
 }
 
 const options = reactive({
@@ -48,14 +65,110 @@ const options = reactive({
 
 function toggleOption(target) {
 	options[target] = !options[target]
+	if (target === 'airLine') {
+		if (!routeList.length) return
+		if (options.airLine) {
+			routeList.forEach((item) => {
+				const data = [
+					{
+						type: item.type,
+						shape: {
+							...JSON.parse(item.shape),
+							color: hexToRgb('#ffff00', 0.5),
+						},
+					},
+				]
+				renderShapes({
+					id: item.id,
+					data: data,
+				})
+			})
+		} else {
+			clearAllShapes()
+		}
+	} else {
+		toggleTrackLine(options.track)
+	}
 }
 
+let routeList = []
+
 function getData() {
 	listData.value.forEach((row) => (row.count = 5))
+
+	GetRouteList()
+		.then((res) => {
+			if (!Array.isArray(res.data.data)) {
+				showWarning('航线信息查询失败')
+				return
+			}
+			routeList = res.data.data
+		})
+		.catch(() => {
+			showWarning('航线信息查询失败')
+		})
 }
 
+watch(
+	() => ueStore.sceneReady,
+	(val) => {
+		if (val) {
+			toggleUav(true)
+		}
+	},
+	{ immediate: true }
+)
+
+const alertInfo = ref({
+	collision: {
+		distance: 20,
+	},
+	offCourse: {
+		distance: 20,
+		lineCode: 'MG22100WRJ',
+	},
+	power: {
+		battery: 27,
+		distance: 310,
+		estimation: 720,
+	},
+	area: {
+		type: '禁飞区',
+		name: '禁飞区11',
+	},
+	weather: {
+		type: '',
+	},
+})
+
 onBeforeMount(() => {
 	getData()
+	proxy.$bus.on('ueMsgReceived', (msg) => {
+		if (msg.ModuleName !== 'DemoScene') return
+		switch (msg.ActionName) {
+			case 'AlarmDetail': {
+				break
+			}
+			case 'Weather': {
+				alertInfo.value.weather.type = msg.data.weather
+				break
+			}
+			case 'Electricity': {
+				const { battery, distance, destination } = msg.data
+				alertInfo.value.power = {
+					battery: battery,
+					estimation: distance,
+					distance: destination,
+				}
+				break
+			}
+		}
+	})
+})
+
+onBeforeUnmount(() => {
+	toggleUav(false)
+	clearAllShapes()
 })
 </script>
 
@@ -145,4 +258,15 @@ onBeforeMount(() => {
 		}
 	}
 }
+
+.uav-demo {
+	position: absolute;
+	left: 220px;
+	top: var(--panel-gap);
+	visibility: visible;
+	transition:
+		opacity 0.3s ease,
+		transform 0.3s ease-out,
+		left 0.5s ease-out;
+}
 </style>

+ 65 - 67
src/views/home/cpns/FloatPanelUav.vue

@@ -1,30 +1,30 @@
 <template>
 	<Transition name="fade">
-		<div class="f-panel-left panel-uav" :class="{ collapse: layoutStore.leftCollapse, spread: hasAlert }">
+		<div class="panel-uav" :class="{ collapse: layoutStore.leftCollapse, spread: hasAlert }">
 			<i @click="handleClose" class="absolute right-4 top-4 text-white size-6 cursor-pointer hover:scale-110">
 				<img src="@/assets/images/svg/close.svg" alt="" />
 			</i>
 
-			<h2 class="u-title">{{ data.name }}</h2>
+			<h2 class="u-title">{{ base.name }}</h2>
 
 			<ul class="des-list mt-3">
 				<li>
-					<span>序列号:</span><span class="value">{{ data.seriesCode }}</span>
+					<span>序列号:</span><span class="value">{{ base.seriesCode }}</span>
 				</li>
 				<li>
-					<span>实名登记号:</span><span class="value">{{ data.regCode }}</span>
+					<span>实名登记号:</span><span class="value">{{ base.regCode }}</span>
 				</li>
 				<li>
-					<span>厂商:</span><span class="value">{{ data.manufacturer }}</span>
+					<span>厂商:</span><span class="value">{{ base.manufacturer }}</span>
 				</li>
 				<li>
-					<span>大小:</span><span class="value">{{ data.size }}</span>
+					<span>大小:</span><span class="value">{{ base.size }}</span>
 				</li>
 				<li>
-					<span>类型:</span><span class="value">{{ data.type }}</span>
+					<span>类型:</span><span class="value">{{ base.type }}</span>
 				</li>
 				<li>
-					<span>型号:</span><span class="value">{{ data.model }}</span>
+					<span>型号:</span><span class="value">{{ base.model }}</span>
 				</li>
 			</ul>
 
@@ -32,45 +32,45 @@
 			<ul class="des-list">
 				<li>
 					<div class="flex-1 flex">
-						<span>航空器状态:</span><span class="value">{{ data.status }}</span>
+						<span>航空器状态:</span><span class="value">{{ base.status }}</span>
 					</div>
 					<div class="flex-1 flex">
-						<span>电量:</span><span class="value">{{ data.battery }}</span>
+						<span>电量:</span><span class="value">{{ base.battery }}</span>
 					</div>
 				</li>
 				<li>
 					<div class="flex-1 flex">
-						<span>高度:</span><span class="value">{{ data.height }}</span>
+						<span>高度:</span><span class="value">{{ base.height }}</span>
 					</div>
 					<div class="flex-1 flex">
-						<span>速度:</span><span class="value">{{ data.velocity }}</span>
+						<span>速度:</span><span class="value">{{ base.velocity }}</span>
 					</div>
 				</li>
 				<li>
-					<span>任务性质:</span><span class="value">{{ data.taskType }}</span>
+					<span>任务性质:</span><span class="value">{{ base.taskType }}</span>
 				</li>
 				<li>
-					<span>更新时间:</span><span class="value">{{ data.updateTime }}</span>
+					<span>更新时间:</span><span class="value">{{ base.updateTime }}</span>
 				</li>
 			</ul>
 
 			<div class="title-sub my-2">运营人信息</div>
 			<ul class="des-list">
 				<li>
-					<span>飞行单位:</span><span class="value">{{ data.unit }}</span>
+					<span>飞行单位:</span><span class="value">{{ base.unit }}</span>
 				</li>
 				<li>
-					<span>飞行计划负责人:</span><span class="value">{{ data.manager }}</span>
+					<span>飞行计划负责人:</span><span class="value">{{ base.manager }}</span>
 				</li>
 				<li>
-					<span>负责人电话:</span><span class="value">{{ data.tel }}</span>
+					<span>负责人电话:</span><span class="value">{{ base.tel }}</span>
 				</li>
 			</ul>
 
 			<ul class="alerts flex justify-center mt-5 mb-1">
 				<template v-for="item in alertTypes">
 					<li
-						v-if="Object.keys(data.alertInfo).includes(item.id)"
+						v-if="Object.keys(alert).includes(item.id)"
 						:class="{ active: currentActive === item.id }"
 						@click="handlePickAlert(item)">
 						<img
@@ -83,12 +83,10 @@
 			</ul>
 			<div class="alert-detail flex-1 flex flex-col justify-center items-center">
 				<div v-if="currentActive === 'collision'">
-					<span class="text-lg" v-if="data.alertInfo.collision.distance === 0">
-						警告:无人机发生碰撞,预警提示请关注
-					</span>
+					<span class="text-lg" v-if="alert.collision.distance === 0"> 警告:无人机发生碰撞,预警提示请关注 </span>
 					<p v-else class="text-lg whitespace-pre-wrap">
 						半径
-						<span class="text-red-500 text-2xl">{{ data.alertInfo.collision.distance }}m</span>
+						<span class="text-red-500 text-2xl">{{ alert.collision.distance }}m</span>
 						有无人机飞行,<br />请注意安全飞行!
 					</p>
 				</div>
@@ -96,37 +94,33 @@
 				<div v-if="currentActive === 'offCourse'">
 					<div class="flex justify-center items-end text-lg">
 						<span class="text-xl">偏离距离</span>
-						<span class="key-num">{{ data.alertInfo.offCourse.distance }}</span>
+						<span class="key-num">{{ alert.offCourse.distance }}</span>
 						<span class="text-xs mb-1">米</span>
 					</div>
-					<span class="block text-red-500 text-lg my-3 text-center"
-						>飞行航线偏移{{ data.alertInfo.offCourse.lineCode }}</span
-					>
+					<span class="block text-red-500 text-lg my-3 text-center">飞行航线偏移{{ alert.offCourse.lineCode }}</span>
 					<p class="text-sm text-gray-200">无人机正在偏离计划航线飞行,预警提示请关注。</p>
 				</div>
 
 				<div v-if="currentActive === 'area'">
-					<span class="block text-red-500 text-lg mb-5">{{
-						data.alertInfo.area.type + ': ' + data.alertInfo.area.name
-					}}</span>
-					<p class="text-sm text-gray-200">无人机闯入{{ data.alertInfo.area.type }} ,预警提示请关注。</p>
+					<span class="block text-red-500 text-lg mb-5">{{ alert.area.type + ': ' + alert.area.name }}</span>
+					<p class="text-sm text-gray-200">无人机闯入{{ alert.area.type }} ,预警提示请关注。</p>
 				</div>
 
 				<div v-if="currentActive === 'weather'" class="ad-weather flex items-center">
-					<img v-if="data.alertInfo.weather.type === '雨'" src="@/assets/images/weather/alert-rain.png" alt="" />
-					<img v-if="data.alertInfo.weather.type === '大风'" src="@/assets/images/weather/alert-wind.png" alt="" />
-					<img v-if="data.alertInfo.weather.type === '雾霾'" src="@/assets/images/weather/alert-haze.png" alt="" />
-					<p class="whitespace-pre-wrap">{{ genWeatherDes(data.alertInfo.weather.type) }}</p>
+					<img v-if="alert.weather.type === '雨'" src="@/assets/images/weather/alert-rain.png" alt="" />
+					<img v-if="alert.weather.type === '大风'" src="@/assets/images/weather/alert-wind.png" alt="" />
+					<img v-if="alert.weather.type === '雾霾'" src="@/assets/images/weather/alert-haze.png" alt="" />
+					<p class="whitespace-pre-wrap">{{ genWeatherDes(alert.weather.type) }}</p>
 				</div>
 
 				<div v-if="currentActive === 'power'">
 					<span>低电量警告</span>
 					<div class="flex mt-2 items-center">
 						<ul class="battery flex-1">
-							<li v-for="item in Math.floor((data.alertInfo.power.battery * 15) / 100)"></li>
+							<li v-for="item in Math.floor((alert.power.battery * 15) / 100)"></li>
 						</ul>
 						<div class="num-zh">
-							{{ data.alertInfo.power.battery }}
+							{{ alert.power.battery }}
 							<span class="text-sm">%</span>
 						</div>
 					</div>
@@ -135,7 +129,7 @@
 							<img src="@/assets/images/page/icon-flag.png" alt="" />
 							<div>
 								<div>
-									{{ data.alertInfo.power.distance }}
+									{{ alert.power.distance }}
 									<span class="text-sm">m</span>
 								</div>
 								<span>距离目的地</span>
@@ -146,7 +140,7 @@
 							<div>
 								<div>
-									{{ data.alertInfo.power.estimation }}
+									{{ alert.power.estimation }}
 									<span class="text-sm">m</span>
 								</div>
 								<span>剩余电量飞行距离</span>
@@ -167,7 +161,7 @@ import { ref, watch } from 'vue'
 const layoutStore = useLayoutStore()
 
 const props = defineProps({
-	data: {
+	base: {
 		type: Object,
 		default: {
 			name: '美团001',
@@ -188,29 +182,31 @@ const props = defineProps({
 			unit: '深圳市大疆创新科技有限公司',
 			manager: '深圳市大疆创新科技有限公司',
 			tel: '18000000000',
-
-			alertInfo: {
-				collision: {
-					distance: 20,
-				},
-				offCourse: {
-					distance: 20,
-					lineCode: 'MG22100WRJ',
-				},
-				power: {
-					battery: 27,
-					distance: 310,
-					estimation: 720,
-				},
-				area: {
-					type: '禁飞区',
-					name: '禁飞区11',
-				},
-				weather: {
-					// type: '大风',
-					// type: '雨',
-					type: '雾霾',
-				},
+		},
+	},
+	alert: {
+		type: Object,
+		default: {
+			collision: {
+				distance: 20,
+			},
+			offCourse: {
+				distance: 20,
+				lineCode: 'MG22100WRJ',
+			},
+			power: {
+				battery: 27,
+				distance: 310,
+				estimation: 720,
+			},
+			area: {
+				type: '禁飞区',
+				name: '禁飞区11',
+			},
+			weather: {
+				// type: '大风',
+				// type: '大雨',
+				type: '雾霾',
 			},
 		},
 	},
@@ -237,19 +233,21 @@ function genWeatherDes(type) {
 		case '大风':
 		case '雾霾':
 			return `当前${type}天气,\n 预警提示请关注!`
-		case '雨':
+		case '雨':
 			return '当前天气有雨,\n 预警提示请关注!'
 	}
 }
 
+const emit = defineEmits(['close'])
+
 function handleClose() {
-	layoutStore.toggleFloatPanel('uav', false)
+	emit('close')
 }
 
 watch(
-	() => props.data,
-	() => {
-		const alertKeys = Object.keys(props.data.alertInfo)
+	() => props.alert,
+	(val) => {
+		const alertKeys = Object.keys(val)
 		hasAlert.value = alertKeys.length > 0
 		currentActive.value = alertTypes.value.find((i) => alertKeys.includes(i.id)).id
 	},

+ 30 - 8
src/views/home/cpns/PanelHxhs.vue

@@ -591,6 +591,26 @@ function showOriginPath() {
 	}
 }
 
+function handleInspect(level) {
+	const params = {
+		paths: [currentPath],
+		radius: '10',
+		level,
+	}
+	layoutStore.toggleGlobalLoading(true)
+	getInspectionData(params, 'polyline')
+		.then((res) => {
+			const conflict = res.data?.data?.gridConflict
+			if (!conflict) {
+				clearResults()
+			}
+			formatResult(conflict)
+		})
+		.finally(() => {
+			layoutStore.toggleGlobalLoading(false)
+		})
+}
+
 //查询网格
 function queryCube() {
 	layoutStore.toggleGlobalLoading(true)
@@ -598,6 +618,7 @@ function queryCube() {
 		status: 'show',
 		paths: [currentPath],
 	})
+	handleInspect('23')
 }
 
 //查询网格
@@ -607,6 +628,7 @@ function queryCube24() {
 		status: 'show',
 		paths: [currentPath],
 	})
+	handleInspect('24')
 }
 
 //关闭网格
@@ -845,14 +867,14 @@ watch(
 	}
 )
 
-watch(
-	() => mapStore.cubeResult,
-	(val) => {
-		formatResult(val.data)
-		layoutStore.toggleGlobalLoading(false)
-	},
-	{ deep: true }
-)
+// watch(
+// 	() => mapStore.cubeResult,
+// 	(val) => {
+// 		formatResult(val.data)
+// 		layoutStore.toggleGlobalLoading(false)
+// 	},
+// 	{ deep: true }
+// )
 
 onBeforeUnmount(() => {
 	toPrev()

+ 25 - 11
src/views/home/cpns/PanelKyhs.vue

@@ -302,14 +302,28 @@ function getShapeInfo() {
 }
 
 function handleInspect(show = true) {
+	let shape = {}
+	const shapeType = drawTypes.find((i) => i.value === form.value.drawType).shapeType
 	if (show) {
 		layoutStore.toggleGlobalLoading(true)
+		shape = getShapeInfo()
+		getInspectionData(shape, shapeType)
+			.then((res) => {
+				const conflict = res.data?.data?.gridConflict
+				if (!conflict) {
+					clearResults()
+				}
+				formatResult(conflict)
+			})
+			.finally(() => {
+				layoutStore.toggleGlobalLoading(false)
+			})
 	}
 	InspectCube({
-		type: drawTypes.find((i) => i.value === form.value.drawType).shapeType,
+		type: shapeType,
 		id: 'inspect_kyhs',
 		show,
-		shape: show ? getShapeInfo() : {},
+		shape,
 	})
 }
 
@@ -325,14 +339,14 @@ watch(
 	{ deep: true }
 )
 
-watch(
-	() => mapStore.cubeResult,
-	(val) => {
-		console.log('cubeResult:', val)
-		formatResult(val.data)
-	},
-	{ deep: true }
-)
+// watch(
+// 	() => mapStore.cubeResult,
+// 	(val) => {
+// 		console.log('cubeResult:', val)
+// 		formatResult(val.data)
+// 	},
+// 	{ deep: true }
+// )
 
 function clearResults() {
 	results.value.forEach((v) => {
@@ -426,7 +440,7 @@ function formatResult(res) {
 	} else {
 		ElMessage({ type: 'error', message: '核查结果为空' })
 	}
-	layoutStore.toggleGlobalLoading(false)
+	// layoutStore.toggleGlobalLoading(false)
 }
 
 function handleDisplay(row, val) {

+ 16 - 2
src/views/home/cpns/PanelQjchs.vue

@@ -319,14 +319,28 @@ function getShapeInfo() {
 }
 
 function handleInspect(show = true) {
+	let shape = {}
+	const shapeType = drawTypes.find((i) => i.value === form.value.drawType).shapeType
 	if (show) {
 		layoutStore.toggleGlobalLoading(true)
+		shape = getShapeInfo()
+		getInspectionData(shape, shapeType)
+			.then((res) => {
+				const conflict = res.data?.data?.gridConflict
+				if (!conflict) {
+					clearResults()
+				}
+				formatResult(conflict)
+			})
+			.finally(() => {
+				layoutStore.toggleGlobalLoading(false)
+			})
 	}
 	InspectCube({
-		type: drawTypes.find((i) => i.value === form.value.drawType).shapeType,
+		type: shapeType,
 		id: 'inspect_qjchs',
 		show,
-		shape: show ? getShapeInfo() : {},
+		shape,
 	})
 }
 

+ 8 - 4
src/views/home/cpns/PanelSjwg.vue

@@ -613,23 +613,23 @@ const vCollapse = {
 	position: absolute;
 	bottom: var(--panel-gap);
 	left: calc(var(--panel-left) - var(--panel-gap));
-	width: 150px;
+	width: 130px;
 	padding: 10px 15px 15px;
 	background-color: rgba(0, 17, 50, 0.5);
 	border: 1px solid #055f8d;
 	border-radius: 5px;
 
 	.title-sub {
-		margin-left: -5px;
+		margin-left: -7px;
 	}
 
 	ul {
-		margin-top: 10px;
+		margin-top: 5px;
 		li {
 			display: flex;
 			align-items: center;
 			&:not(:last-child) {
-				margin-bottom: 5px;
+				margin-bottom: 2px;
 			}
 			i {
 				display: block;
@@ -638,6 +638,10 @@ const vCollapse = {
 				margin-right: 10px;
 				opacity: 0.6;
 			}
+			span {
+				font-size: 14px;
+				color: #ccc;
+			}
 		}
 	}
 }