From baa73d35c4fe932515e7332ae4ff18481d8963e9 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Sat, 17 Jan 2026 16:36:58 +0800
Subject: [PATCH] feat:数据驾驶仓,右侧面板,历史数据弹窗中搜索栏调整

---
 applications/drone-command/src/styles/common/cockpit.scss                           |    2 
 applications/drone-command/src/views/api.txt                                        |  343 +++++++-----------------------------------
 applications/drone-command/src/views/dataCockpit/components/DeviceHistoryDialog.vue |   67 +++++---
 applications/drone-command/src/api/dataCockpit/index.js                             |    9 +
 4 files changed, 111 insertions(+), 310 deletions(-)

diff --git a/applications/drone-command/src/api/dataCockpit/index.js b/applications/drone-command/src/api/dataCockpit/index.js
index 553d692..991b00c 100644
--- a/applications/drone-command/src/api/dataCockpit/index.js
+++ b/applications/drone-command/src/api/dataCockpit/index.js
@@ -52,3 +52,12 @@
 		method: 'get'
 	})
 }
+
+// 区域列表
+export const areaDivideListApi = (params) => {
+	return request({
+		url: '/drone-fw/area/fwAreaDivide/list',
+		method: 'get',
+		params
+	})
+}
diff --git a/applications/drone-command/src/styles/common/cockpit.scss b/applications/drone-command/src/styles/common/cockpit.scss
index a27aa80..2017c60 100644
--- a/applications/drone-command/src/styles/common/cockpit.scss
+++ b/applications/drone-command/src/styles/common/cockpit.scss
@@ -299,7 +299,7 @@
 
 .command-data-cockpit-select {
     .el-select__input {
-        color: #8ac3fd !important;
+        color: #ffffff !important;
     }
 
     .el-select__wrapper {
diff --git a/applications/drone-command/src/views/api.txt b/applications/drone-command/src/views/api.txt
index 716ca76..b82372a 100644
--- a/applications/drone-command/src/views/api.txt
+++ b/applications/drone-command/src/views/api.txt
@@ -1,9 +1,9 @@
 
 
-## 分页
+## 列表
 
 
-**接口地址**:`/device/fwDevice/page`
+**接口地址**:`/drone-fw/area/fwAreaDivide/list`
 
 
 **请求方式**:`GET`
@@ -15,7 +15,7 @@
 **响应数据类型**:`*/*`
 
 
-**接口描述**:<p>传入fwDevice</p>
+**接口描述**:<p>传入filterSelected或sceneId</p>
 
 
 
@@ -27,12 +27,8 @@
 
 | 参数名称 | 参数说明 | 请求类型    | 是否必须 | 数据类型 | schema |
 | -------- | -------- | ----- | -------- | -------- | ------ |
-|belongDept|所属部门|query|false|integer(int64)||
-|current|当前页|query|false|integer(int32)||
-|deviceName|设备名称|query|false|string||
-|deviceType|设备类型(察打一体/便捷侦测箱/反制枪)|query|false|string||
-|effectiveRangeKmIsNotNull|有效范围是否为空:0-不处理 1-不为空 2-为空|query|false|integer(int32)||
-|size|每页的数量|query|false|integer(int32)||
+|filterSelected|是否过滤已被选择的数据(1过滤 0不过滤)|query|false|integer(int32)||
+|sceneId|场景id|query|false|integer(int64)||
 
 
 **响应状态**:
@@ -40,7 +36,7 @@
 
 | 状态码 | 说明 | schema |
 | -------- | -------- | ----- | 
-|200|OK|R«IPage«FwDeviceVO»»|
+|200|OK|R«List«FwAreaDivide对象»»|
 |401|Unauthorized||
 |403|Forbidden||
 |404|Not Found||
@@ -52,152 +48,32 @@
 | 参数名称 | 参数说明 | 类型 | schema |
 | -------- | -------- | ----- |----- | 
 |code|状态码|integer(int32)|integer(int32)|
-|data|承载数据|IPage«FwDeviceVO»|IPage«FwDeviceVO»|
-|&emsp;&emsp;current||integer(int64)||
-|&emsp;&emsp;pages||integer(int64)||
-|&emsp;&emsp;records||array|FwDeviceVO|
-|&emsp;&emsp;&emsp;&emsp;azimuth|方位角 0-360°|integer||
-|&emsp;&emsp;&emsp;&emsp;batteryPct|电量百分比 0-100|integer||
-|&emsp;&emsp;&emsp;&emsp;belongDept|所属部门id|integer||
-|&emsp;&emsp;&emsp;&emsp;belongDeptName|所属部门名称|string||
-|&emsp;&emsp;&emsp;&emsp;charger|负责人|string||
-|&emsp;&emsp;&emsp;&emsp;contactPhone|联系电话|string||
-|&emsp;&emsp;&emsp;&emsp;createTime|创建时间|string||
-|&emsp;&emsp;&emsp;&emsp;detectTargetCnt|侦测目标数量|integer||
-|&emsp;&emsp;&emsp;&emsp;deviceAtt|设备属性(无线电/光电/雷达)|string||
-|&emsp;&emsp;&emsp;&emsp;deviceModel|型号|string||
-|&emsp;&emsp;&emsp;&emsp;deviceName|设备名称|string||
-|&emsp;&emsp;&emsp;&emsp;deviceSpecification|规格|string||
-|&emsp;&emsp;&emsp;&emsp;deviceType|设备类型(察打一体/便捷侦测箱/反制枪)|string||
-|&emsp;&emsp;&emsp;&emsp;effectiveRangeKm|有效范围 km|number||
-|&emsp;&emsp;&emsp;&emsp;elevation|俯仰角 -90-+90°|integer||
-|&emsp;&emsp;&emsp;&emsp;id|主键|integer||
-|&emsp;&emsp;&emsp;&emsp;manufacturer|生产厂商|string||
-|&emsp;&emsp;&emsp;&emsp;purpose|用途|string||
-|&emsp;&emsp;&emsp;&emsp;remark|备注|string||
-|&emsp;&emsp;&emsp;&emsp;source|来源|string||
-|&emsp;&emsp;&emsp;&emsp;status|运行状态(0:在线/1:离线/2:故障/3:报废)|integer||
-|&emsp;&emsp;&emsp;&emsp;workMode|工作模式:1.侦测中/2.信号干扰中/3.诱导驱离中/4.待机|string||
-|&emsp;&emsp;size||integer(int64)||
-|&emsp;&emsp;total||integer(int64)||
-|msg|返回消息|string||
-|success|是否成功|boolean||
-
-
-**响应示例**:
-```javascript
-{
-	"code": 0,
-	"data": {
-		"current": 0,
-		"pages": 0,
-		"records": [
-			{
-				"azimuth": 0,
-				"batteryPct": 0,
-				"belongDept": 0,
-				"belongDeptName": "",
-				"charger": "",
-				"contactPhone": "",
-				"createTime": "",
-				"detectTargetCnt": 0,
-				"deviceAtt": "",
-				"deviceModel": "",
-				"deviceName": "",
-				"deviceSpecification": "",
-				"deviceType": "",
-				"effectiveRangeKm": 0,
-				"elevation": 0,
-				"id": 0,
-				"manufacturer": "",
-				"purpose": "",
-				"remark": "",
-				"source": "",
-				"status": 0,
-				"workMode": ""
-			}
-		],
-		"size": 0,
-		"total": 0
-	},
-	"msg": "",
-	"success": true
-}
-```
-
-
-
-
-## 详情
-
-
-**接口地址**:`/device/fwDevice/detail`
-
-
-**请求方式**:`GET`
-
-
-**请求数据类型**:`application/x-www-form-urlencoded`
-
-
-**响应数据类型**:`*/*`
-
-
-**接口描述**:<p>传入fwDevice</p>
-
-
-
-**请求参数**:
-
-
-**请求参数**:
-
-
-| 参数名称 | 参数说明 | 请求类型    | 是否必须 | 数据类型 | schema |
-| -------- | -------- | ----- | -------- | -------- | ------ |
-|id|主键|query|true|integer(int64)||
-
-
-**响应状态**:
-
-
-| 状态码 | 说明 | schema |
-| -------- | -------- | ----- | 
-|200|OK|R«FwDeviceVO»|
-|401|Unauthorized||
-|403|Forbidden||
-|404|Not Found||
-
-
-**响应参数**:
-
-
-| 参数名称 | 参数说明 | 类型 | schema |
-| -------- | -------- | ----- |----- | 
-|code|状态码|integer(int32)|integer(int32)|
-|data|承载数据|FwDeviceVO|FwDeviceVO|
-|&emsp;&emsp;azimuth|方位角 0-360°|integer(int32)||
-|&emsp;&emsp;batteryPct|电量百分比 0-100|integer(int32)||
-|&emsp;&emsp;belongDept|所属部门id|integer(int64)||
-|&emsp;&emsp;belongDeptName|所属部门名称|string||
-|&emsp;&emsp;charger|负责人|string||
-|&emsp;&emsp;contactPhone|联系电话|string||
+|data|承载数据|array|FwAreaDivide对象|
+|&emsp;&emsp;areaCode|区域编码|string||
+|&emsp;&emsp;areaName|区域名称|string||
+|&emsp;&emsp;areaSize|区域面积(km²)|number||
+|&emsp;&emsp;areaType|区域类型:报警区/重点管制区|string||
+|&emsp;&emsp;controlLevel|管控级别:日常/重点/严密|string||
+|&emsp;&emsp;createDept|创建部门|integer(int64)||
 |&emsp;&emsp;createTime|创建时间|string(date-time)||
-|&emsp;&emsp;detectTargetCnt|侦测目标数量|integer(int32)||
-|&emsp;&emsp;deviceAtt|设备属性(无线电/光电/雷达)|string||
-|&emsp;&emsp;deviceModel|型号|string||
-|&emsp;&emsp;deviceName|设备名称|string||
-|&emsp;&emsp;deviceSpecification|规格|string||
-|&emsp;&emsp;deviceType|设备类型(察打一体/便捷侦测箱/反制枪)|string||
-|&emsp;&emsp;effectiveRangeKm|有效范围 km|number||
-|&emsp;&emsp;elevation|俯仰角 -90-+90°|integer(int32)||
-|&emsp;&emsp;id|主键|integer(int64)||
-|&emsp;&emsp;manufacturer|生产厂商|string||
-|&emsp;&emsp;purpose|用途|string||
-|&emsp;&emsp;remark|备注|string||
-|&emsp;&emsp;source|来源|string||
-|&emsp;&emsp;status|运行状态(0:在线/1:离线/2:故障/3:报废)|integer(int32)||
-|&emsp;&emsp;workMode|工作模式:1.侦测中/2.信号干扰中/3.诱导驱离中/4.待机|string||
+|&emsp;&emsp;createUser|创建人|integer(int64)||
+|&emsp;&emsp;deviceIds|关联设备ID,逗号分隔|string||
+|&emsp;&emsp;flyDateEnd|可飞行日期时间-结束|string(date-time)||
+|&emsp;&emsp;flyDateStart|可飞行日期时间-开始|string(date-time)||
+|&emsp;&emsp;geom|经纬度面(存储地理面数据)|string||
+|&emsp;&emsp;id|主键id|integer(int64)||
+|&emsp;&emsp;isDeleted|是否已删除|integer(int32)||
+|&emsp;&emsp;latitude|区域中心纬度|number(double)||
+|&emsp;&emsp;longitude|区域中心经度|number(double)||
+|&emsp;&emsp;policeStationContactPerson|派出所联系人|string||
+|&emsp;&emsp;policeStationContactPhone|派出所联系电话|string||
+|&emsp;&emsp;policeStationId|关联派出所id|integer(int64)||
+|&emsp;&emsp;policeStationName|派出所名称|string||
+|&emsp;&emsp;responseMechanism|响应机制内容|string||
+|&emsp;&emsp;status|业务状态|integer(int32)||
+|&emsp;&emsp;triggerCondition|触发条件|string||
+|&emsp;&emsp;updateTime|更新时间|string(date-time)||
+|&emsp;&emsp;updateUser|更新人|integer(int64)||
 |msg|返回消息|string||
 |success|是否成功|boolean||
 
@@ -206,134 +82,35 @@
 ```javascript
 {
 	"code": 0,
-	"data": {
-		"azimuth": 0,
-		"batteryPct": 0,
-		"belongDept": 0,
-		"belongDeptName": "",
-		"charger": "",
-		"contactPhone": "",
-		"createTime": "",
-		"detectTargetCnt": 0,
-		"deviceAtt": "",
-		"deviceModel": "",
-		"deviceName": "",
-		"deviceSpecification": "",
-		"deviceType": "",
-		"effectiveRangeKm": 0,
-		"elevation": 0,
-		"id": 0,
-		"manufacturer": "",
-		"purpose": "",
-		"remark": "",
-		"source": "",
-		"status": 0,
-		"workMode": ""
-	},
-	"msg": "",
-	"success": true
-}
-```
-
-
-
-## 新增或修改
-
-
-**接口地址**:`/device/fwDevice/submit`
-
-
-**请求方式**:`POST`
-
-
-**请求数据类型**:`application/json`
-
-
-**响应数据类型**:`*/*`
-
-
-**接口描述**:<p>传入fwDevice</p>
-
-
-
-**请求示例**:
-
-
-```javascript
-{
-  "belongDept": 0,
-  "charger": "",
-  "contactPhone": "",
-  "deviceAtt": "",
-  "deviceModel": "",
-  "deviceName": "",
-  "deviceSpecification": "",
-  "deviceStatusList": [],
-  "deviceType": "",
-  "effectiveRangeKm": 0,
-  "effectiveRangeKmIsNotNull": 0,
-  "id": 0,
-  "manufacturer": "",
-  "purpose": "",
-  "source": ""
-}
-```
-
-
-**请求参数**:
-
-
-**请求参数**:
-
-
-| 参数名称 | 参数说明 | 请求类型    | 是否必须 | 数据类型 | schema |
-| -------- | -------- | ----- | -------- | -------- | ------ |
-|fwDevice|fwDevice|body|true|FwDeviceDTO|FwDeviceDTO|
-|&emsp;&emsp;belongDept|所属部门||false|integer(int64)||
-|&emsp;&emsp;charger|负责人||false|string||
-|&emsp;&emsp;contactPhone|联系电话||false|string||
-|&emsp;&emsp;deviceAtt|设备属性(无线电/光电/雷达)||false|string||
-|&emsp;&emsp;deviceModel|型号||false|string||
-|&emsp;&emsp;deviceName|设备名称||true|string||
-|&emsp;&emsp;deviceSpecification|规格||false|string||
-|&emsp;&emsp;deviceStatusList|设备状态,多个状态用逗号隔开||false|array|string|
-|&emsp;&emsp;deviceType|设备类型(察打一体/便捷侦测箱/反制枪)||false|string||
-|&emsp;&emsp;effectiveRangeKm|有效范围 km||false|number||
-|&emsp;&emsp;effectiveRangeKmIsNotNull|是否有范围 0不过滤 1有 2没有||false|integer(int32)||
-|&emsp;&emsp;id|主键||false|integer(int64)||
-|&emsp;&emsp;manufacturer|生产厂商||false|string||
-|&emsp;&emsp;purpose|用途||false|string||
-|&emsp;&emsp;source|来源||false|string||
-
-
-**响应状态**:
-
-
-| 状态码 | 说明 | schema |
-| -------- | -------- | ----- | 
-|200|OK|R|
-|201|Created||
-|401|Unauthorized||
-|403|Forbidden||
-|404|Not Found||
-
-
-**响应参数**:
-
-
-| 参数名称 | 参数说明 | 类型 | schema |
-| -------- | -------- | ----- |----- | 
-|code|状态码|integer(int32)|integer(int32)|
-|data|承载数据|object||
-|msg|返回消息|string||
-|success|是否成功|boolean||
-
-
-**响应示例**:
-```javascript
-{
-	"code": 0,
-	"data": {},
+	"data": [
+		{
+			"areaCode": "",
+			"areaName": "",
+			"areaSize": 0,
+			"areaType": "",
+			"controlLevel": "",
+			"createDept": 0,
+			"createTime": "",
+			"createUser": 0,
+			"deviceIds": "",
+			"flyDateEnd": "",
+			"flyDateStart": "",
+			"geom": "",
+			"id": 0,
+			"isDeleted": 0,
+			"latitude": 0,
+			"longitude": 0,
+			"policeStationContactPerson": "",
+			"policeStationContactPhone": "",
+			"policeStationId": 0,
+			"policeStationName": "",
+			"responseMechanism": "",
+			"status": 0,
+			"triggerCondition": "",
+			"updateTime": "",
+			"updateUser": 0
+		}
+	],
 	"msg": "",
 	"success": true
 }
diff --git a/applications/drone-command/src/views/dataCockpit/components/DeviceHistoryDialog.vue b/applications/drone-command/src/views/dataCockpit/components/DeviceHistoryDialog.vue
index a266041..9df9a8b 100644
--- a/applications/drone-command/src/views/dataCockpit/components/DeviceHistoryDialog.vue
+++ b/applications/drone-command/src/views/dataCockpit/components/DeviceHistoryDialog.vue
@@ -16,15 +16,14 @@
 
 			<el-form-item label="区域" prop="area">
 				<el-tree-select class="command-data-cockpit-select" popper-class="command-data-cockpit-tree-select-popper"
-					v-model="searchParams.area" :data="areaTree" :props="areaTreeProps" node-key="value" check-strictly
-					clearable placeholder="请选择" @change="handleSearch" />
+					v-model="searchParams.area" :data="areaTree" :props="areaTreeProps" node-key="value" check-strictly filterable :filter-node-method="filterAreaNode" clearable placeholder="请选择" @change="handleSearch" />
 			</el-form-item>
 
 			<el-form-item label="无人机类型" prop="droneType">
 				<el-select class="command-data-cockpit-select" popper-class="command-data-cockpit-select-popper"
 					v-model="searchParams.droneType" placeholder="请选择" clearable @change="handleSearch">
-					<el-option v-for="item in droneTypeOptions" :key="item.value" :label="item.label"
-						:value="item.value" />
+					<el-option v-for="item in dictObj.droneType" :key="item.dictKey" :label="item.dictValue"
+						:value="item.dictKey" />
 				</el-select>
 			</el-form-item>
 
@@ -74,7 +73,9 @@
 <script setup>
 import { Search, RefreshRight } from '@element-plus/icons-vue'
 import { computed, ref, watch } from 'vue'
-import { alarmLogApi } from '@/api/dataCockpit'
+import { getDictionaryByCode } from '@/api/system/dictbiz'
+import { alarmLogApi, areaDivideListApi } from '@/api/dataCockpit'
+import { getDictLabel } from '@ztzf/utils'
 
 const props = defineProps({
 	modelValue: {
@@ -111,29 +112,41 @@
 const loading = ref(true)
 const list = ref([])
 const total = ref(0)
-const areaTree = ref([
-	{
-		label: '古村区',
-		value: '古村区'
-	},
-	{
-		label: '新区',
-		value: '新区'
-	},
-	{
-		label: '产业园',
-		value: '产业园'
-	}
-])
+const dictObj = ref({
+	droneType: []
+})
+const areaTree = ref([])
 const areaTreeProps = {
 	label: 'label',
 	children: 'children'
 }
 
-const droneTypeOptions = [
-	{ label: '微型机', value: '1' },
-	{ label: '植保机', value: '2' }
-]
+
+const fetchDictList = async () => {
+	const res = await getDictionaryByCode('droneType')
+	dictObj.value = res?.data?.data ?? { droneType: [] }
+}
+
+
+const filterAreaNode = (value, data) => {
+	if (!value) return true
+	return (data?.label || '').includes(value)
+}
+
+const fetchAreaTree = async () => {
+	try {
+		const res = await areaDivideListApi()
+		const list = res?.data?.data ?? []
+		areaTree.value = list
+			.filter((item) => item?.areaName)
+			.map((item) => ({
+				label: item.areaName,
+				value: item.areaName
+			}))
+	} catch (error) {
+		areaTree.value = []
+	}
+}
 
 const getList = async () => {
 	if (!props.device?.id) {
@@ -188,9 +201,7 @@
 }
 
 const getDroneTypeText = (value) => {
-	if (value === 1 || value === '1') return '微型机'
-	if (value === 2 || value === '2') return '植保机'
-	return value || '-'
+	return getDictLabel(value, dictObj.value.droneType) || value || '-'
 }
 
 watch(
@@ -198,7 +209,11 @@
 	(visible) => {
 		if (visible) {
 			searchParams.value.current = 1
+			fetchDictList()
+			fetchAreaTree()
 			getList()
+		} else {
+			searchParams.value = initSearchParams()
 		}
 	}
 )

--
Gitblit v1.9.3