Browse Source

功能修改20250321-04

zhiyuan-007 1 week ago
parent
commit
22c8677599

+ 1 - 1
src/components/MapView.vue

@@ -25,7 +25,7 @@ export default {
 			}, 2500)
 			myBridge.bridgeContent = bridge = new CityGis.Bridge({
 				id: 'i_map',
-				//url: 'http://localhost:5173/map-tool-widget/',
+				// url: 'http://localhost:5173/map-tool-widget/',
 				// url: 'https://cimweb.zjw.sh.cegn.cn:2007/map-tool-widget/#/',
 				url: 'http://172.16.8.41:9250/map-tool-widget/#/jk_map',
 				onReady: function () {

+ 0 - 1
src/views/home/cpns/FloatPanelKysg.vue

@@ -316,7 +316,6 @@ function getMesh(status) {
 	for (let i = 0; i < rings[0].length; i++) {
 		tempRings.push([rings[0][i][0], rings[0][i][1], h1 - 0.01])
 	}
-	debugger
 	geometryMeshEffect({
 		id: 'sgzy_mesh',
 		status: 'show',

+ 0 - 4
src/views/home/cpns/PanelHxhs.vue

@@ -370,7 +370,6 @@ function clearResults() {
 
 function formatResult(res) {
 	clearResults()
-	debugger
 	if (res != null && res != undefined) {
 		const { groundSafety, lineConflictArray, obstacle, spaceConflictArray, spaceRisk, lineRisk } = res
 
@@ -572,7 +571,6 @@ function showOriginPath() {
 	if (form.value.fromPort && form.value.toPort) {
 		let formPoint = JSON.parse(portOptions.find((item) => item.value == form.value.fromPort).shape).point
 		let toPoint = JSON.parse(portOptions.find((item) => item.value == form.value.toPort).shape).point
-		debugger
 		currentPath = [
 			[formPoint.x, formPoint.y, formPoint.z],
 			[formPoint.x, formPoint.y, (form.value.height1 * 1 + form.value.height2 * 1) / 2],
@@ -662,7 +660,6 @@ function getAutoPath() {
 		paths: paramsPaths,
 	})
 		.then((res) => {
-			debugger
 			if (res.data.code !== 200) {
 				ElMessage({ type: 'error', message: res.data.msg })
 				currentStep.value = 0
@@ -877,7 +874,6 @@ watch(
 watch(
 	() => mapStore.cubeResult,
 	(val) => {
-		debugger
 		if (val.data == 'error') {
 			ElMessage({ type: 'error', message: '核查结果为空' })
 		}

+ 0 - 1
src/views/home/cpns/PanelKyhs.vue

@@ -378,7 +378,6 @@ function clearResults() {
 function formatResult(res) {
 	clearResults()
 	clearAllCubeDetail()
-	debugger
 	if (res != null && res != undefined) {
 		const { groundSafety, lineConflictArray, obstacle, spaceConflictArray, spaceRisk, lineRisk } = res
 

+ 129 - 127
src/views/home/cpns/PanelKypm.vue

@@ -1,178 +1,180 @@
 <!-- 空域剖面分析 -->
 <template>
-  <div class="flex flex-col aside-left-inner">
-    <div class="title-main">空域剖面分析</div>
-
-    <el-form ref="formRef" class="p-form mt-7" :model="form" :rules="rules" label-position="left" size="large">
-      <el-form-item label="计算层级" prop="level">
-        <el-select v-model="form.level" placeholder="">
-          <el-option label="23级" value="23" />
-          <el-option label="24级" value="24" />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="高度" prop="height">
-        <el-input v-model="form.height" type="number" class="flex-1"></el-input>
-        <el-button class="btn-secondary ml-3 -mb-1" @click="handleDraw">绘制剖面</el-button>
-      </el-form-item>
-      <el-form-item label="评价系数">
-        <el-checkbox v-model="form.evaluation">展示</el-checkbox>
-      </el-form-item>
-    </el-form>
-
-    <table class="table-default stripe mb-6">
-      <thead>
-        <tr>
-          <th class="w-16">序号</th>
-          <th>经度</th>
-          <th>纬度</th>
-          <th class="w-24">海拔高/m</th>
-        </tr>
-      </thead>
-      <tbody style="max-height: 580px;">
-        <tr v-for="(row, index) in tableData">
-          <td class="w-16">{{ index + 1 }}</td>
-          <td>{{ row[0] }}</td>
-          <td>{{ row[1] }}</td>
-          <td class="w-24">{{ row[2] }}</td>
-        </tr>
-      </tbody>
-    </table>
-
-    <div class="text-center">
-      <el-button class="btn-main" @click="handleCalc" :loading="loading.calc">开始计算</el-button>
-      <el-button class="btn-main" @click="handleClear(true)">清空结果</el-button>
-    </div>
-  </div>
+	<div class="flex flex-col aside-left-inner">
+		<div class="title-main">空域剖面分析</div>
+
+		<el-form ref="formRef" class="p-form mt-7" :model="form" :rules="rules" label-position="left" size="large">
+			<el-form-item label="计算层级" prop="level">
+				<el-select v-model="form.level" placeholder="">
+					<el-option label="23级" value="23" />
+					<el-option label="24级" value="24" />
+				</el-select>
+			</el-form-item>
+			<el-form-item label="高度" prop="height">
+				<el-input v-model="form.height" type="number" class="flex-1"></el-input>
+				<el-button class="btn-secondary ml-3 -mb-1" @click="handleDraw">绘制剖面</el-button>
+			</el-form-item>
+			<el-form-item label="评价系数">
+				<el-checkbox v-model="form.evaluation">展示</el-checkbox>
+			</el-form-item>
+		</el-form>
+
+		<table class="table-default stripe mb-6">
+			<thead>
+				<tr>
+					<th class="w-16">序号</th>
+					<th>经度</th>
+					<th>纬度</th>
+					<th class="w-24">海拔高/m</th>
+				</tr>
+			</thead>
+			<tbody style="max-height: 580px">
+				<tr v-for="(row, index) in tableData">
+					<td class="w-16">{{ index + 1 }}</td>
+					<td>{{ row[0] }}</td>
+					<td>{{ row[1] }}</td>
+					<td class="w-24">{{ row[2] }}</td>
+				</tr>
+			</tbody>
+		</table>
+
+		<div class="text-center">
+			<el-button class="btn-main" @click="handleCalc" :loading="loading.calc">开始计算</el-button>
+			<el-button class="btn-main" @click="handleClear(true)">清空结果</el-button>
+		</div>
+	</div>
 </template>
 
 <script setup>
-import { onBeforeUnmount, ref, watch, onBeforeMount, reactive } from 'vue';
+import { onBeforeUnmount, ref, watch, onBeforeMount, reactive } from 'vue'
 import { DrawPolygon, QueryCube, clearDraw } from '@/utils/map/addLayer'
-import { useMapStore } from '@/store/map';
-import usePanelStore from '@/store/panel';
-import {geometryMeshEffect} from "@/utils/map/addTool.js";
+import { useMapStore } from '@/store/map'
+import usePanelStore from '@/store/panel'
+import { geometryMeshEffect } from '@/utils/map/addTool.js'
 
 const panelStore = usePanelStore()
 const mapStore = useMapStore()
 
 onBeforeMount(() => {
-  handleRestoreChecked()
+	handleRestoreChecked()
 })
 
 function handleRestoreChecked() {
-  const temp = panelStore.kypm
-  if (!Object.keys(temp).length) return
-  form.value = temp.form
-  tableData.value = temp.tableData
+	const temp = panelStore.kypm
+	if (!Object.keys(temp).length) return
+	form.value = temp.form
+	tableData.value = temp.tableData
 }
 
 const form = ref({
-  level: '23',
-  height: '50',
-  evaluation: false
+	level: '23',
+	height: '50',
+	evaluation: false,
 })
 
 const rules = []
 
 function handleDraw() {
-  DrawPolygon({ hasZ: true })
+	DrawPolygon({ hasZ: true })
 }
 
 let drawResult = []
 const tableData = ref([])
 
-watch(() => mapStore.draw_geometry, (val) => {
-  drawResult = val?.rings
-  tableData.value = drawResult.flat()
-}, { deep: true })
+watch(
+	() => mapStore.draw_geometry,
+	(val) => {
+		drawResult = val?.rings
+		tableData.value = drawResult.flat()
+	},
+	{ deep: true }
+)
 
 function handleClear(clearAll) {
-  clearDraw();
-  getMesh("hide");
-  if(clearAll) {
-    tableData.value = []
-  }
-  QueryCube({
-    show: false,
-  })
+	clearDraw()
+	getMesh('hide')
+	if (clearAll) {
+		tableData.value = []
+	}
+	QueryCube({
+		show: false,
+	})
 }
 
 //获取带高度三维体
-function getMesh(status){
-  if(status == "hide"){
-    geometryMeshEffect({
-      id: 'sgzy_mesh',
-      status: "hide"
-    })
-    return
-  }
-
-
-  let height = 0.02
-  let rings = [];
-  for(let i = 0; i < drawResult[0].length; i++){
-    rings.push([drawResult[0][i][0],drawResult[0][i][1],Number(form.value.height) - 0.01])
-  }
-  debugger
-  geometryMeshEffect({
-    id: 'sgzy_mesh',
-    status:"show",
-    data: [{
-      type: 'polygon',
-      shape: {
-        height: height,
-        rings: [rings],
-        color: [0,255,0,0.1]
-      }
-    }]
-  })
-
+function getMesh(status) {
+	if (status == 'hide') {
+		geometryMeshEffect({
+			id: 'sgzy_mesh',
+			status: 'hide',
+		})
+		return
+	}
+
+	let height = 0.02
+	let rings = []
+	for (let i = 0; i < drawResult[0].length; i++) {
+		rings.push([drawResult[0][i][0], drawResult[0][i][1], Number(form.value.height) - 0.01])
+	}
+	geometryMeshEffect({
+		id: 'sgzy_mesh',
+		status: 'show',
+		data: [
+			{
+				type: 'polygon',
+				shape: {
+					height: height,
+					rings: [rings],
+					color: [0, 255, 0, 0.1],
+				},
+			},
+		],
+	})
 }
 
 const loading = reactive({
-  calc: false
+	calc: false,
 })
 
 function handleCalc() {
-  if (!drawResult) return
-  if (!form.value.height) return
-  // loading.calc = true
-  handleClear();
-  getMesh("show");
-  setTimeout(() => {
-    QueryCube({
-      ...form.value,
-      minZ: Number(form.value.height) - 0.01,
-      maxZ: Number(form.value.height) + 0.01,
-      show: true,
-      level: Number(form.value.level),
-      rings: drawResult
-    })
-  }, 300);
+	if (!drawResult) return
+	if (!form.value.height) return
+	// loading.calc = true
+	handleClear()
+	getMesh('show')
+	setTimeout(() => {
+		QueryCube({
+			...form.value,
+			minZ: Number(form.value.height) - 0.01,
+			maxZ: Number(form.value.height) + 0.01,
+			show: true,
+			level: Number(form.value.level),
+			rings: drawResult,
+		})
+	}, 300)
 }
 
 function handleStoreChecked() {
-  if(!tableData.value.length) {
-    panelStore.setKypm({})
-    return
-  }
-  panelStore.setKypm({
-    form: form.value,
-    tableData: tableData.value,
-  })
+	if (!tableData.value.length) {
+		panelStore.setKypm({})
+		return
+	}
+	panelStore.setKypm({
+		form: form.value,
+		tableData: tableData.value,
+	})
 }
 
 onBeforeUnmount(() => {
-  //handleClear(true)
-  handleStoreChecked()
+	//handleClear(true)
+	handleStoreChecked()
 })
-
 </script>
 
 <style lang="scss" scoped>
 :deep(.p-form) {
-  .el-form-item__label {
-    width: 105px;
-  }
+	.el-form-item__label {
+		width: 105px;
+	}
 }
 </style>

+ 130 - 127
src/views/home/cpns/PanelSgzy.vue

@@ -1,183 +1,186 @@
 <!-- 栅格占用查询 -->
 <template>
-  <div class="flex flex-col aside-left-inner">
-    <div class="title-main">立体空域网格占用查询</div>
-
-    <el-form ref="formRef" class="p-form mt-7" :model="form" :rules="rules" label-position="left" size="large">
-      <el-form-item label="计算层级" prop="level">
-        <el-select v-model="form.level" placeholder="">
-          <el-option label="23级" value="23" />
-          <el-option label="24级" value="24" />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="高度" prop="height">
-        <el-input v-model="form.minZ" :max="form.maxZ" type="number" class="flex-1"></el-input>
-        <div class="mx-2">--</div>
-        <el-input v-model="form.maxZ" :min="form.minZ" type="number" class="flex-1"></el-input>
-        <el-button class="btn-secondary ml-3 -mb-1" @click="handleDraw">绘制区域</el-button>
-      </el-form-item>
-      <el-form-item label="评价系数">
-        <el-checkbox v-model="form.evaluation">展示</el-checkbox>
-      </el-form-item>
-    </el-form>
-
-    <table class="table-default stripe mb-6">
-      <thead>
-        <tr>
-          <th class="w-16">序号</th>
-          <th>经度</th>
-          <th>纬度</th>
-          <th class="w-24">海拔高/m</th>
-        </tr>
-      </thead>
-      <tbody style="max-height: 580px;">
-        <tr v-for="(row, index) in tableData">
-          <td class="w-16">{{ index + 1 }}</td>
-          <td>{{ row[0] }}</td>
-          <td>{{ row[1] }}</td>
-          <td class="w-24">{{ row[2] }}</td>
-        </tr>
-      </tbody>
-    </table>
-
-    <div class="text-center">
-      <el-button class="btn-main" @click="handleCalc" :loading="loading.calc">开始计算</el-button>
-      <el-button class="btn-main" @click="handleClear(true)">清空结果</el-button>
-    </div>
-  </div>
+	<div class="flex flex-col aside-left-inner">
+		<div class="title-main">立体空域网格占用查询</div>
+
+		<el-form ref="formRef" class="p-form mt-7" :model="form" :rules="rules" label-position="left" size="large">
+			<el-form-item label="计算层级" prop="level">
+				<el-select v-model="form.level" placeholder="">
+					<el-option label="23级" value="23" />
+					<el-option label="24级" value="24" />
+				</el-select>
+			</el-form-item>
+			<el-form-item label="高度" prop="height">
+				<el-input v-model="form.minZ" :max="form.maxZ" type="number" class="flex-1"></el-input>
+				<div class="mx-2">--</div>
+				<el-input v-model="form.maxZ" :min="form.minZ" type="number" class="flex-1"></el-input>
+				<el-button class="btn-secondary ml-3 -mb-1" @click="handleDraw">绘制区域</el-button>
+			</el-form-item>
+			<el-form-item label="评价系数">
+				<el-checkbox v-model="form.evaluation">展示</el-checkbox>
+			</el-form-item>
+		</el-form>
+
+		<table class="table-default stripe mb-6">
+			<thead>
+				<tr>
+					<th class="w-16">序号</th>
+					<th>经度</th>
+					<th>纬度</th>
+					<th class="w-24">海拔高/m</th>
+				</tr>
+			</thead>
+			<tbody style="max-height: 580px">
+				<tr v-for="(row, index) in tableData">
+					<td class="w-16">{{ index + 1 }}</td>
+					<td>{{ row[0] }}</td>
+					<td>{{ row[1] }}</td>
+					<td class="w-24">{{ row[2] }}</td>
+				</tr>
+			</tbody>
+		</table>
+
+		<div class="text-center">
+			<el-button class="btn-main" @click="handleCalc" :loading="loading.calc">开始计算</el-button>
+			<el-button class="btn-main" @click="handleClear(true)">清空结果</el-button>
+		</div>
+	</div>
 </template>
 
 <script setup>
-import { onBeforeMount, onBeforeUnmount, reactive, ref, watch } from 'vue';
+import { onBeforeMount, onBeforeUnmount, reactive, ref, watch } from 'vue'
 import { DrawPolygon, QueryCube, clearDraw } from '@/utils/map/addLayer'
-import { useMapStore } from '@/store/map';
-import usePanelStore from '@/store/panel';
-import { geometryMeshEffect } from "@/utils/map/addTool.js";
+import { useMapStore } from '@/store/map'
+import usePanelStore from '@/store/panel'
+import { geometryMeshEffect } from '@/utils/map/addTool.js'
 
 const mapStore = useMapStore()
 const panelStore = usePanelStore()
 
 onBeforeMount(() => {
-  handleRestoreChecked()
+	handleRestoreChecked()
 })
 
 function handleRestoreChecked() {
-  const temp = panelStore.sgzy
-  if (!Object.keys(temp).length) return
-  form.value = temp.form
-  tableData.value = temp.tableData
+	const temp = panelStore.sgzy
+	if (!Object.keys(temp).length) return
+	form.value = temp.form
+	tableData.value = temp.tableData
 }
 
 const form = ref({
-  level: '23',
-  minZ: '0',
-  maxZ: '120',
-  evaluation: false
+	level: '23',
+	minZ: '0',
+	maxZ: '120',
+	evaluation: false,
 })
 
 const rules = []
 
 function handleDraw() {
-  DrawPolygon({ hasZ: true })
+	DrawPolygon({ hasZ: true })
 }
 
 let drawResult = []
 const tableData = ref([])
 
-watch(() => mapStore.draw_geometry, (val) => {
-  drawResult = val?.rings
-  tableData.value = drawResult.flat()
-}, { deep: true })
+watch(
+	() => mapStore.draw_geometry,
+	(val) => {
+		drawResult = val?.rings
+		tableData.value = drawResult.flat()
+	},
+	{ deep: true }
+)
 
 // watch(() => mapStore.queryResult, () => {
 //   loading.calc = false
 // }, { deep: true })
 
 function handleClear(clearAll) {
-  //开始计算之后取消绘制功能,转而使用带高度三维体显示
-  clearDraw()
-  getMesh("hide")
-  if (clearAll) {
-    tableData.value = []
-  }
-  QueryCube({
-    show: false,
-  })
+	//开始计算之后取消绘制功能,转而使用带高度三维体显示
+	clearDraw()
+	getMesh('hide')
+	if (clearAll) {
+		tableData.value = []
+	}
+	QueryCube({
+		show: false,
+	})
 }
 
 //获取带高度三维体
 function getMesh(status) {
-  if (status == "hide") {
-    geometryMeshEffect({
-      id: 'sgzy_mesh',
-      status: "hide"
-    })
-    return
-  }
-  let height = form.value.maxZ * 1 - form.value.minZ * 1
-  let rings = [];
-  for (let i = 0; i < drawResult[0].length; i++) {
-    rings.push([drawResult[0][i][0], drawResult[0][i][1], form.value.minZ * 1])
-  }
-  debugger
-  geometryMeshEffect({
-    id: 'sgzy_mesh',
-    status: "show",
-    data: [{
-      type: 'polygon',
-      shape: {
-        height: height,
-        rings: [rings],
-        color: [0, 255, 0, 0.2]
-      }
-    }]
-  })
-
+	if (status == 'hide') {
+		geometryMeshEffect({
+			id: 'sgzy_mesh',
+			status: 'hide',
+		})
+		return
+	}
+	let height = form.value.maxZ * 1 - form.value.minZ * 1
+	let rings = []
+	for (let i = 0; i < drawResult[0].length; i++) {
+		rings.push([drawResult[0][i][0], drawResult[0][i][1], form.value.minZ * 1])
+	}
+	geometryMeshEffect({
+		id: 'sgzy_mesh',
+		status: 'show',
+		data: [
+			{
+				type: 'polygon',
+				shape: {
+					height: height,
+					rings: [rings],
+					color: [0, 255, 0, 0.2],
+				},
+			},
+		],
+	})
 }
 
 const loading = reactive({
-  calc: false
+	calc: false,
 })
 
 function handleCalc() {
-  const { maxZ, minZ } = form.value
-  if (!drawResult) return
-  if (!minZ || !maxZ) return
-  // loading.calc = true
-  handleClear();
-  getMesh("show");
-  setTimeout(() => {
-    QueryCube({
-      ...form.value,
-      show: true,
-      level: Number(form.value.level),
-      rings: drawResult
-    })
-  }, 300);
+	const { maxZ, minZ } = form.value
+	if (!drawResult) return
+	if (!minZ || !maxZ) return
+	// loading.calc = true
+	handleClear()
+	getMesh('show')
+	setTimeout(() => {
+		QueryCube({
+			...form.value,
+			show: true,
+			level: Number(form.value.level),
+			rings: drawResult,
+		})
+	}, 300)
 }
 
 function handleStoreChecked() {
-  if (!tableData.value.length) {
-    panelStore.setSgzy({})
-    return
-  }
-  panelStore.setSgzy({
-    form: form.value,
-    tableData: tableData.value,
-  })
+	if (!tableData.value.length) {
+		panelStore.setSgzy({})
+		return
+	}
+	panelStore.setSgzy({
+		form: form.value,
+		tableData: tableData.value,
+	})
 }
 
 onBeforeUnmount(() => {
-  //handleClear(true)
-  handleStoreChecked()
+	//handleClear(true)
+	handleStoreChecked()
 })
-
 </script>
 
 <style lang="scss" scoped>
 :deep(.p-form) {
-  .el-form-item__label {
-    width: 105px;
-  }
+	.el-form-item__label {
+		width: 105px;
+	}
 }
 </style>

+ 17 - 2
src/views/home/cpns/PanelSjwg.vue

@@ -96,11 +96,12 @@ import { airSpaceTypes } from '@/utils/options'
 import { getAssetsFile, getData } from '@/utils/require'
 import { hexToRgb } from '@/utils/tools'
 import { renderShapes } from '@/utils/ueActions'
-import { onBeforeMount, onBeforeUnmount, reactive, ref } from 'vue'
+import { onBeforeMount, onBeforeUnmount, reactive, ref, watch } from 'vue'
+import { useMapStore } from '@/store/map.js'
 
 const panelStore = usePanelStore()
 const layoutStore = useLayoutStore()
-
+const mapStore = useMapStore()
 let shifeiStatus = false
 
 onBeforeMount(() => {
@@ -402,6 +403,9 @@ function handleDelete(item, type) {
 
 function handleMesh(item, type) {
 	item.mesh = !item.mesh
+	if (item.mesh) {
+		layoutStore.toggleGlobalLoading(true)
+	}
 	InspectCube({
 		id: item.id,
 		show: item.mesh,
@@ -482,6 +486,17 @@ const vCollapse = {
 		el.style.height = '0'
 	},
 }
+
+watch(
+	() => mapStore.cubeResult,
+	(val) => {
+		if (val.data == 'error') {
+			ElMessage({ type: 'error', message: '核查结果为空' })
+		}
+		layoutStore.toggleGlobalLoading(false)
+	},
+	{ deep: true }
+)
 </script>
 
 <style lang="scss" scoped>