From beb95fb5fc166804056abafd70fc01ac27de7621 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 26 Jan 2026 09:11:00 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue | 68 ++++++++++++++++++++++++----------
1 files changed, 48 insertions(+), 20 deletions(-)
diff --git a/applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue b/applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue
index e787566..79a1287 100644
--- a/applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue
+++ b/applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue
@@ -21,9 +21,13 @@
</div>
<div class="right-container">
- <div class="header">{{ formTitle }}</div>
+ <div class="header">
+ <span>{{ formTitle }}</span>
+
+ <el-icon class="close-btn" @click.stop="visible = false"><Close /></el-icon>
+ </div>
- <div class="dialog-container" v-if="dialogReadonly">
+ <div class="content" v-if="dialogReadonly">
<el-row>
<el-col :span="24">
<div class="label">侦测设备</div>
@@ -31,7 +35,7 @@
</el-col>
<el-col :span="24">
<div class="label">设备类型</div>
- <div class="val">{{ getDeviceTypeLabel(formData.deviceType) }}</div>
+ <div class="val">{{ getDictLabel(formData.deviceType, dictObj.deviceType) }}</div>
</el-col>
<el-col :span="24">
<div class="label">设备位置</div>
@@ -55,10 +59,11 @@
<el-form v-else ref="formRef" class="dialog-form" :model="formData" :rules="rules" label-width="110px">
<el-form-item label="侦测设备" prop="deviceId">
<el-select
- class="command-data-cockpit-select"
- popper-class="command-data-cockpit-select-popper"
+ class="command-select"
+ popper-class="command-select-popper"
v-model="formData.deviceId"
placeholder="请选择"
+ :disabled="dialogMode === 'edit'"
clearable
@change="handleDeviceChange"
>
@@ -67,9 +72,10 @@
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-select
- class="command-data-cockpit-select"
- popper-class="command-data-cockpit-select-popper"
+ class="command-select"
+ popper-class="command-select-popper"
v-model="formData.deviceType"
+ disabled
placeholder="请选择"
clearable
>
@@ -83,7 +89,7 @@
</el-form-item>
<el-form-item label="设备位置" prop="deployLocation">
<el-input
- class="command-data-cockpit-search-input"
+ class="command-input"
v-model="formData.deployLocation"
disabled
placeholder="请选择位置"
@@ -95,23 +101,25 @@
</el-form-item>
<el-form-item label="设备编号" prop="deviceSn">
<el-input
- class="command-data-cockpit-search-input"
+ class="command-input"
v-model="formData.deviceSn"
+ disabled
placeholder="请输入"
clearable
/>
</el-form-item>
<el-form-item label="设备型号" prop="deviceModel">
<el-input
- class="command-data-cockpit-search-input"
+ class="command-input"
v-model="formData.deviceModel"
+ disabled
placeholder="请输入"
clearable
/>
</el-form-item>
<el-form-item label="覆盖范围(m)" prop="effectiveRangeKm">
<el-input-number
- class="command-data-cockpit-search-input"
+ class="command-input"
v-model="formData.effectiveRangeKm"
:min="0"
:precision="2"
@@ -121,7 +129,7 @@
</el-form-item>
</el-form>
<div class="footer">
- <el-button color="#2B2B4C" @click="handleCancel">{{ dialogReadonly ? '关闭' : '取消' }}</el-button>
+ <el-button v-if="dialogMode != 'view'" color="#2B2B4C" @click="handleCancel">{{ dialogReadonly ? '关闭' : '取消' }}</el-button>
<el-button
color="#284FE3"
v-if="!dialogReadonly"
@@ -139,6 +147,10 @@
</template>
<script setup>
+import { getDictLabel } from '@ztzf/utils'
+
+import { Close } from '@element-plus/icons-vue'
+
import { computed, inject, nextTick, ref, watch } from 'vue'
import { ElMessage } from 'element-plus'
import {
@@ -148,7 +160,10 @@
} from '@/api/detectionCountermeasure/detectionRange'
import CommonCesiumMap from '@/components/map-container/common-cesium-map.vue'
import * as Cesium from 'cesium'
-import deviceZcImg from '@/assets/images/dataCockpit/device-zc.svg'
+import { saveOperationLog } from '@ztzf/apis'
+import { useRoute } from 'vue-router'
+
+import equipment from '@/assets/images/dataCockpit/legend/equipment.png'
const initForm = () => ({
deviceId: '', // 侦测设备ID
@@ -170,6 +185,7 @@
const deviceOptions = ref([])
const dialogReadonly = computed(() => dialogMode.value === 'view')
const mapRef = ref(null)
+const route = useRoute()
let viewer
let redPointEntity
let rangeCircleEntity
@@ -225,13 +241,25 @@
if (!isValid) return
submitting.value = true
try {
+ const {longitude, latitude} = parseDeployLocation(formData.value.deployLocation)
+
const payload = {
- ...formData.value,
id: formData.value.id || formData.value.deviceId || undefined,
effectiveRangeKmIsNotNull: formData.value.effectiveRangeKm ? 1 : 2,
+ effectiveRangeKm: formData.value.effectiveRangeKm,
+ longitude,
+ latitude
}
delete payload.deviceId
await detectionRangeSubmitApi(payload)
+
+ const actionText = dialogMode.value === 'add' ? '新增' : '修改'
+ saveOperationLog({
+ requestUri: route.path,
+ title: `${route.name || '侦测范围管理'}-${actionText}`,
+ type: 1
+ })
+
ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功')
visible.value = false
emit('success')
@@ -276,16 +304,16 @@
redPointEntity = viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(longitude, latitude),
billboard: {
- image: deviceZcImg, // 这里替换为你的图片路径或变量 deviceZcImg
- width: 30, // 可选:设置图片宽度
- height: 42, // 可选:设置图片高度
+ image: equipment, // 这里替换为你的图片路径或变量 deviceZcImg
+ width: 40,
+ height: 56,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM, // 设置图片底部对齐坐标点
},
label: {
text: `${longitude.toFixed(6)}, ${latitude.toFixed(6)}`,
font: '16px',
fillColor: Cesium.Color.WHITE,
- backgroundColor: Cesium.Color.BLACK.withAlpha(0.45),
+ backgroundColor: Cesium.Color.BLACK.withAlpha(0.6),
backgroundPadding: new Cesium.Cartesian2(5, 5),
showBackground: true,
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
@@ -293,7 +321,7 @@
verticalOrigin: Cesium.VerticalOrigin.CENTER,
outlineWidth: 1,
outlineColor: Cesium.Color.WHITE,
- pixelOffset: new Cesium.Cartesian2(0, -60),
+ pixelOffset: new Cesium.Cartesian2(0, -72),
eyeOffset: new Cesium.Cartesian3(0, 0, -20),
},
})
@@ -335,7 +363,7 @@
material: Cesium.Color.fromCssColorString('#6b9ca8').withAlpha(0.6),
outline: true,
outlineColor: Cesium.Color.fromCssColorString('#6b9ca8').withAlpha(0.6),
- heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+ heightReference: Cesium.HeightReference.NONE,
},
})
return
--
Gitblit v1.9.3