From affb54c33083cb09cd0ef9da137b446cafdfd0fb Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 27 Jan 2026 16:47:08 +0800
Subject: [PATCH] feat:用户管理、部门管理调整

---
 applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue |   32 ++++++++++++++++++++++++++------
 1 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue b/applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue
index 176171b..a939219 100644
--- a/applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue
+++ b/applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue
@@ -122,14 +122,15 @@
 							class="command-input"
 							v-model="formData.effectiveRangeKm"
 							:min="0"
-							:precision="2"
+							:precision="0"
+							:step="1"
 							:controls="false"
 							placeholder="请输入"
 						/>
 					</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"
@@ -227,7 +228,14 @@
 
 function formatRange(value) {
 	if (value == null || value === '') return '-'
-	return `${value}`
+	const normalized = normalizeRange(value)
+	return normalized == null ? '-' : `${normalized}`
+}
+
+function normalizeRange(value) {
+	const numeric = Number(value)
+	if (!Number.isFinite(numeric)) return null
+	return Math.trunc(numeric)
 }
 
 // 关闭弹框
@@ -242,14 +250,16 @@
 	submitting.value = true
 	try {
 		const {longitude, latitude} = parseDeployLocation(formData.value.deployLocation)
+		const normalizedRange = normalizeRange(formData.value.effectiveRangeKm)
 
 		const payload = {
 			id: formData.value.id || formData.value.deviceId || undefined,
-			effectiveRangeKmIsNotNull: formData.value.effectiveRangeKm ? 1 : 2,
-			effectiveRangeKm: formData.value.effectiveRangeKm,
+			effectiveRangeKmIsNotNull: normalizedRange != null ? 1 : 2,
+			effectiveRangeKm: normalizedRange,
 			longitude,
 			latitude
 		}
+		formData.value.effectiveRangeKm = normalizedRange
 		delete payload.deviceId
 		await detectionRangeSubmitApi(payload)
 
@@ -280,6 +290,7 @@
 		current: 1,
 		size: 200,
 		effectiveRangeKmIsNotNull: 2,
+		isTrack: 1
 	})
 	const records = res?.data?.data?.records ?? []
 	deviceOptions.value = records.map(item => ({
@@ -432,9 +443,18 @@
 watch(
 	() => formData.value.effectiveRangeKm,
 	value => {
+		const normalized = normalizeRange(value)
+		if (value != null && normalized == null) {
+			formData.value.effectiveRangeKm = null
+			return
+		}
+		if (value != null && normalized !== value) {
+			formData.value.effectiveRangeKm = normalized
+			return
+		}
 		const parsed = parseDeployLocation(formData.value.deployLocation)
 		if (!parsed) return
-		updateRangeCircle(parsed.longitude, parsed.latitude, value)
+		updateRangeCircle(parsed.longitude, parsed.latitude, normalized)
 	}
 )
 </script>

--
Gitblit v1.9.3