吉安感知网项目-前端
shuishen
2026-01-30 5fa75a76afc7c9d8031bf084a6a83d902af8b7c1
feat:场景配置中新增、编辑、查看,对于已选区域回显处理
4 files modified
13 files renamed
1 files added
478 ■■■■ changed files
applications/drone-command/env/.env.development 4 ●●●● patch | view | raw | blame | history
applications/drone-command/src/utils/cesium/shapeTools/DrawManager.js patch | view | raw | blame | history
applications/drone-command/src/utils/cesium/shapeTools/EditManager.js patch | view | raw | blame | history
applications/drone-command/src/utils/cesium/shapeTools/ToolBase.js patch | view | raw | blame | history
applications/drone-command/src/utils/cesium/shapeTools/Tooltip.js patch | view | raw | blame | history
applications/drone-command/src/utils/cesium/shapeTools/draw/DrawBufferCircleTool.js patch | view | raw | blame | history
applications/drone-command/src/utils/cesium/shapeTools/draw/DrawEllipseTool.js patch | view | raw | blame | history
applications/drone-command/src/utils/cesium/shapeTools/draw/DrawPolygonTool.js patch | view | raw | blame | history
applications/drone-command/src/utils/cesium/shapeTools/draw/DrawRectangleTool.js patch | view | raw | blame | history
applications/drone-command/src/utils/cesium/shapeTools/edit/EditBufferCircleTool.js patch | view | raw | blame | history
applications/drone-command/src/utils/cesium/shapeTools/edit/EditEllipseTool.js patch | view | raw | blame | history
applications/drone-command/src/utils/cesium/shapeTools/edit/EditPolygonTool.js patch | view | raw | blame | history
applications/drone-command/src/utils/cesium/shapeTools/edit/EditRectangleTool.js patch | view | raw | blame | history
applications/drone-command/src/utils/cesium/shapeTools/index.js 13 ●●●●● patch | view | raw | blame | history
applications/drone-command/src/utils/cesium/shapeTools/shapeUtils.js patch | view | raw | blame | history
applications/drone-command/src/views/api.txt 225 ●●●● patch | view | raw | blame | history
applications/drone-command/src/views/areaManage/partition/FormDiaLog.vue 4 ●●● patch | view | raw | blame | history
applications/drone-command/src/views/areaManage/sceneConfig/FormDiaLog.vue 232 ●●●● patch | view | raw | blame | history
applications/drone-command/env/.env.development
@@ -2,7 +2,7 @@
 # @Author       : yuan
 # @Date         : 2026-01-07 14:58:30
 # @LastEditors  : yuan
 # @LastEditTime : 2026-01-29 15:22:54
 # @LastEditTime : 2026-01-30 09:29:25
 # @FilePath     : \applications\drone-command\env\.env.development
 # @Description  : 
 # Copyright 2026 OBKoro1, All Rights Reserved. 
@@ -16,7 +16,7 @@
#开发环境代理地址(推荐本地新建文件 .env.development.local 来进行覆盖)
# VITE_APP_URL = https://wrj.shuixiongit.com/api
VITE_APP_URL= http://192.168.1.168
VITE_APP_URL= http://192.168.1.204
#新大屏地址
VITE_APP_DASHBOARD_URL = 'https://wrj.shuixiongit.com/command-center-dashboard/'
applications/drone-command/src/utils/cesium/shapeTools/DrawManager.js
applications/drone-command/src/utils/cesium/shapeTools/EditManager.js
applications/drone-command/src/utils/cesium/shapeTools/ToolBase.js
applications/drone-command/src/utils/cesium/shapeTools/Tooltip.js
applications/drone-command/src/utils/cesium/shapeTools/draw/DrawBufferCircleTool.js
applications/drone-command/src/utils/cesium/shapeTools/draw/DrawEllipseTool.js
applications/drone-command/src/utils/cesium/shapeTools/draw/DrawPolygonTool.js
applications/drone-command/src/utils/cesium/shapeTools/draw/DrawRectangleTool.js
applications/drone-command/src/utils/cesium/shapeTools/edit/EditBufferCircleTool.js
applications/drone-command/src/utils/cesium/shapeTools/edit/EditEllipseTool.js
applications/drone-command/src/utils/cesium/shapeTools/edit/EditPolygonTool.js
applications/drone-command/src/utils/cesium/shapeTools/edit/EditRectangleTool.js
applications/drone-command/src/utils/cesium/shapeTools/index.js
New file
@@ -0,0 +1,13 @@
export { DrawManager } from './DrawManager'
export { EditManager } from './EditManager'
export { buildEllipsePositions, getBoundsFromCartesians, getBoundsFromLngLats, rectanglePositionsFromBounds, getCenterFromBounds, getMetersBetween, cartesianToLocal } from './shapeUtils'
export { DrawPolygonTool } from './draw/DrawPolygonTool'
export { DrawRectangleTool } from './draw/DrawRectangleTool'
export { DrawEllipseTool } from './draw/DrawEllipseTool'
export { DrawBufferCircleTool } from './draw/DrawBufferCircleTool'
export { EditPolygonTool } from './edit/EditPolygonTool'
export { EditRectangleTool } from './edit/EditRectangleTool'
export { EditEllipseTool } from './edit/EditEllipseTool'
export { EditBufferCircleTool } from './edit/EditBufferCircleTool'
export { ToolBase } from './ToolBase'
export { MapTooltip as Tooltip } from './Tooltip'
applications/drone-command/src/utils/cesium/shapeTools/shapeUtils.js
applications/drone-command/src/views/api.txt
@@ -1,152 +1,9 @@
## 新增或修改
## 列表-不带分页
**接口地址**:`/area/fwAreaDivide/submit`
**请求方式**:`POST`
**请求数据类型**:`application/json`
**响应数据类型**:`*/*`
**接口描述**:<p>传入主表对象与扩展面列表</p>
**请求示例**:
```javascript
{
  "areaDivide": {
    "areaCode": "",
    "areaName": "",
    "controlLevel": "",
    "createDept": 0,
    "createTime": "",
    "createUser": 0,
    "deviceIds": "",
    "flyDateEnd": "",
    "flyDateStart": "",
    "id": 0,
    "isDeleted": 0,
    "policeStationId": 0,
    "responseMechanism": "",
    "status": 0,
    "triggerCondition": "",
    "updateTime": "",
    "updateUser": 0
  },
  "areaDivideExtList": [
    {
      "areaCode": "",
      "areaDivideId": 0,
      "areaTypeKey": "",
      "areaTypeValue": "",
      "createDept": 0,
      "createTime": "",
      "createUser": 0,
      "geomJson": "",
      "id": 0,
      "isDeleted": 0,
      "status": 0,
      "updateTime": "",
      "updateUser": 0
    }
  ]
}
```
**请求参数**:
**请求参数**:
| 参数名称 | 参数说明 | 请求类型    | 是否必须 | 数据类型 | schema |
| -------- | -------- | ----- | -------- | -------- | ------ |
|fwAreaDivideSubmit|fwAreaDivideSubmit|body|true|FwAreaDivideSubmitDTO|FwAreaDivideSubmitDTO|
|&emsp;&emsp;areaDivide|区域划分表||false|FwAreaDivide对象|FwAreaDivide对象|
|&emsp;&emsp;&emsp;&emsp;areaCode|区域编码||false|string||
|&emsp;&emsp;&emsp;&emsp;areaName|区域名称||false|string||
|&emsp;&emsp;&emsp;&emsp;controlLevel|管控级别:日常/重点/严密||false|string||
|&emsp;&emsp;&emsp;&emsp;createDept|创建部门||false|integer||
|&emsp;&emsp;&emsp;&emsp;createTime|创建时间||false|string||
|&emsp;&emsp;&emsp;&emsp;createUser|创建人||false|integer||
|&emsp;&emsp;&emsp;&emsp;deviceIds|关联设备ID,逗号分隔||false|string||
|&emsp;&emsp;&emsp;&emsp;flyDateEnd|可飞行日期时间-结束||false|string||
|&emsp;&emsp;&emsp;&emsp;flyDateStart|可飞行日期时间-开始||false|string||
|&emsp;&emsp;&emsp;&emsp;id|主键id||false|integer||
|&emsp;&emsp;&emsp;&emsp;isDeleted|是否已删除||false|integer||
|&emsp;&emsp;&emsp;&emsp;policeStationId|关联派出所id||false|integer||
|&emsp;&emsp;&emsp;&emsp;responseMechanism|响应机制内容||false|string||
|&emsp;&emsp;&emsp;&emsp;status|业务状态||false|integer||
|&emsp;&emsp;&emsp;&emsp;triggerCondition|触发条件||false|string||
|&emsp;&emsp;&emsp;&emsp;updateTime|更新时间||false|string||
|&emsp;&emsp;&emsp;&emsp;updateUser|更新人||false|integer||
|&emsp;&emsp;areaDivideExtList|区域划分扩展表(多面数据/多区域类型)||false|array|FwAreaDivideExt对象|
|&emsp;&emsp;&emsp;&emsp;areaCode|区域编码||false|string||
|&emsp;&emsp;&emsp;&emsp;areaDivideId|关联主表区域划分ID||false|integer||
|&emsp;&emsp;&emsp;&emsp;areaTypeKey|区域类型数字字典key||false|string||
|&emsp;&emsp;&emsp;&emsp;areaTypeValue|区域类型数字字典value||false|string||
|&emsp;&emsp;&emsp;&emsp;createDept|创建部门||false|integer||
|&emsp;&emsp;&emsp;&emsp;createTime|创建时间||false|string||
|&emsp;&emsp;&emsp;&emsp;createUser|创建人||false|integer||
|&emsp;&emsp;&emsp;&emsp;geomJson|几何JSON||false|string||
|&emsp;&emsp;&emsp;&emsp;id|主键id||false|integer||
|&emsp;&emsp;&emsp;&emsp;isDeleted|是否已删除||false|integer||
|&emsp;&emsp;&emsp;&emsp;status|业务状态||false|integer||
|&emsp;&emsp;&emsp;&emsp;updateTime|更新时间||false|string||
|&emsp;&emsp;&emsp;&emsp;updateUser|更新人||false|integer||
**响应状态**:
| 状态码 | 说明 | 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": {},
    "msg": "",
    "success": true
}
```
## 详情
**接口地址**:`/area/fwAreaDivide/detail`
**接口地址**:`/drone-fw/area/fwAreaDivide/list`
**请求方式**:`GET`
@@ -158,7 +15,7 @@
**响应数据类型**:`*/*`
**接口描述**:<p>传入id</p>
**接口描述**:<p>传入filterSelected或sceneId或areaTypeKeys</p>
@@ -170,7 +27,9 @@
| 参数名称 | 参数说明 | 请求类型    | 是否必须 | 数据类型 | schema |
| -------- | -------- | ----- | -------- | -------- | ------ |
|id|主键id|query|true|integer(int64)||
|areaTypeKeys|区域类型key集合(逗号分隔)|query|false|string||
|filterSelected|是否过滤已被选择的数据(1过滤 0不过滤)|query|false|integer(int32)||
|sceneId|场景id|query|false|integer(int64)||
**响应状态**:
@@ -178,7 +37,7 @@
| 状态码 | 说明 | schema |
| -------- | -------- | ----- | 
|200|OK|R«FwAreaDivideVO»|
|200|OK|R«List«FwAreaDivideVO»»|
|401|Unauthorized||
|403|Forbidden||
|404|Not Found||
@@ -190,9 +49,10 @@
| 参数名称 | 参数说明 | 类型 | schema |
| -------- | -------- | ----- |----- | 
|code|状态码|integer(int32)|integer(int32)|
|data|承载数据|FwAreaDivideVO|FwAreaDivideVO|
|data|承载数据|array|FwAreaDivideVO|
|&emsp;&emsp;areaCode|区域编码|string||
|&emsp;&emsp;areaName|区域名称|string||
|&emsp;&emsp;areaTypeKeys|区域面的类型集合逗号隔开|string||
|&emsp;&emsp;controlLevel|管控级别:日常/重点/严密|string||
|&emsp;&emsp;deviceIds|关联设备ID,逗号分隔|string||
|&emsp;&emsp;flyDateEnd|可飞行日期时间-结束|string(date-time)||
@@ -205,7 +65,10 @@
|&emsp;&emsp;&emsp;&emsp;geomJson|几何JSON|string||
|&emsp;&emsp;&emsp;&emsp;id|主键id|integer||
|&emsp;&emsp;id|主键id|integer(int64)||
|&emsp;&emsp;policeStationContactPerson|派出所联系人|string||
|&emsp;&emsp;policeStationContactPhone|派出所联系电话|string||
|&emsp;&emsp;policeStationId|关联派出所id|string||
|&emsp;&emsp;policeStationName|派出所名称|string||
|&emsp;&emsp;responseMechanism|响应机制内容|string||
|&emsp;&emsp;triggerCondition|触发条件|string||
|msg|返回消息|string||
@@ -215,38 +78,36 @@
**响应示例**:
```javascript
{
    "code": 200,
    "success": true,
    "data": {
        "id": "2016778024413888513",
        "areaName": "新版测试1",
        "triggerCondition": "1",
        "responseMechanism": "1",
        "controlLevel": "1",
        "policeStationId": "6000000000001",
        "deviceIds": "",
        "flyDateStart": "2026-01-29 00:00:00",
        "flyDateEnd": "2026-01-31 00:00:00",
        "areaCode": "",
        "fwAreaDivideExtList": [
            {
                "id": "21",
                "areaDivideId": "2016778024413888513",
                "areaTypeKey": "1",
                "areaTypeValue": "侦测区",
                "geomJson": "{\"id\": \"shape_1769672288759_0bdd\", \"meta\": null, \"points\": [{\"lat\": 27.131594958673237, \"lng\": 114.97629628660002, \"height\": 0, \"latitude\": 27.131594958673237, \"longitude\": 114.97629628660002}, {\"lat\": 27.08982649211561, \"lng\": 114.95070164271222, \"height\": 0, \"latitude\": 27.08982649211561, \"longitude\": 114.95070164271222}, {\"lat\": 27.078929811185212, \"lng\": 114.9933846220512, \"height\": 0, \"latitude\": 27.078929811185212, \"longitude\": 114.9933846220512}, {\"lat\": 27.107909998247127, \"lng\": 115.02860852426171, \"height\": 0, \"latitude\": 27.107909998247127, \"longitude\": 115.02860852426171}], \"areaType\": \"1\", \"drawType\": \"polygon\", \"displayPoints\": null}",
                "areaCode": ""
            },
            {
                "id": "22",
                "areaDivideId": "2016778024413888513",
                "areaTypeKey": "1",
                "areaTypeValue": "侦测区",
                "geomJson": "{\"id\": \"shape_1769672293742_947a\", \"meta\": {\"center\": {\"lat\": 27.117257447017685, \"lng\": 115.1020385237064, \"height\": 238.8343626960753}, \"semiMajor\": 6700.514105765581, \"semiMinor\": 1943.840234046766, \"majorPoint\": {\"lat\": 27.10775369958058, \"lng\": 115.168774284004, \"height\": 104.8557871185756}, \"minorPoint\": {\"lat\": 27.10046558321718, \"lng\": 115.1077128183224, \"height\": 184.11135376718033}, \"controlPoints\": [{\"lat\": 27.117257447017685, \"lng\": 115.1020385237064, \"height\": 238.8343626960753}, {\"lat\": 27.10775369958058, \"lng\": 115.168774284004, \"height\": 104.8557871185756}, {\"lat\": 27.10046558321718, \"lng\": 115.1077128183224, \"height\": 184.11135376718033}]}, \"points\": [{\"lat\": 27.117257447017685, \"lng\": 115.1020385237064, \"height\": 238.8343626960753}, {\"lat\": 27.10775369958058, \"lng\": 115.168774284004, \"height\": 104.8557871185756}, {\"lat\": 27.10046558321718, \"lng\": 115.1077128183224, \"height\": 184.11135376718033}], \"areaType\": \"1\", \"drawType\": \"ellipse\", \"displayPoints\": [{\"lat\": 27.1172411931675, \"lng\": 115.16961434879582, \"height\": 242.35137437266533, \"latitude\": 27.1172411931675, \"longitude\": 115.16961434879582}, {\"lat\": 27.11907502581333, \"lng\": 115.16924525730374, \"height\": 242.3161770455558, \"latitude\": 27.11907502581333, \"longitude\": 115.16924525730374}, {\"lat\": 27.120889115581708, \"lng\": 115.16813979957712, \"height\": 242.2121648606328, \"latitude\": 27.120889115581708, \"longitude\": 115.16813979957712}, {\"lat\": 27.12266356982587, \"lng\": 115.1663100528295, \"height\": 242.0438829806018, \"latitude\": 27.12266356982587, \"longitude\": 115.1663100528295}, {\"lat\": 27.124378919527693, \"lng\": 115.16377603274732, \"height\": 241.81868547594897, \"latitude\": 27.124378919527693, \"longitude\": 115.16377603274732}, {\"lat\": 27.12601633381306, \"lng\": 115.16056547557488, \"height\": 241.54641391722672, \"latitude\": 27.12601633381306, \"longitude\": 115.16056547557488}, {\"lat\": 27.127557827888296, \"lng\": 115.15671353542164, \"height\": 241.238967263203, \"latitude\": 27.127557827888296, \"longitude\": 115.15671353542164}, {\"lat\": 27.128986462048708, \"lng\": 115.1522624000547, \"height\": 240.9097818279928, \"latitude\": 27.128986462048708, \"longitude\": 115.1522624000547}, {\"lat\": 27.130286529493247, \"lng\": 115.14726082934388, \"height\": 240.57324405610856, \"latitude\": 27.130286529493247, \"longitude\": 115.14726082934388}, {\"lat\": 27.131443730790306, \"lng\": 115.14176362138588, \"height\": 240.24406177058316, \"latitude\": 27.131443730790306, \"longitude\": 115.14176362138588}, {\"lat\": 27.132445332979348, \"lng\": 115.13583101214034, \"height\": 239.93662137804984, \"latitude\": 27.132445332979348, \"longitude\": 115.13583101214034}, {\"lat\": 27.13328031145803, \"lng\": 115.12952801515418, \"height\": 239.66435911715624, \"latitude\": 27.13328031145803, \"longitude\": 115.12952801515418}, {\"lat\": 27.133939472996364, \"lng\": 115.12292370862173, \"height\": 239.43917383966289, \"latitude\": 27.133939472996364, \"longitude\": 115.12292370862173}, {\"lat\": 27.134415558431908, \"lng\": 115.1160904776194, \"height\": 239.27090697284905, \"latitude\": 27.134415558431908, \"longitude\": 115.1160904776194}, {\"lat\": 27.13470332383455, \"lng\": 115.10910321985791, \"height\": 239.16691240515263, \"latitude\": 27.13470332383455, \"longitude\": 115.10910321985791}, {\"lat\": 27.134799599179868, \"lng\": 115.1020385237064, \"height\": 239.131735087732, \"latitude\": 27.134799599179868, \"longitude\": 115.1020385237064}, {\"lat\": 27.13470332383455, \"lng\": 115.09497382755488, \"height\": 239.16691240471368, \"latitude\": 27.13470332383455, \"longitude\": 115.09497382755488}, {\"lat\": 27.134415558431908, \"lng\": 115.08798656979342, \"height\": 239.27090697166375, \"latitude\": 27.134415558431908, \"longitude\": 115.08798656979342}, {\"lat\": 27.133939472996364, \"lng\": 115.08115333879108, \"height\": 239.43917384027625, \"latitude\": 27.133939472996364, \"longitude\": 115.08115333879108}, {\"lat\": 27.13328031145803, \"lng\": 115.0745490322586, \"height\": 239.66435911740945, \"latitude\": 27.13328031145803, \"longitude\": 115.0745490322586}, {\"lat\": 27.132445332979348, \"lng\": 115.0682460352724, \"height\": 239.9366213773679, \"latitude\": 27.132445332979348, \"longitude\": 115.0682460352724}, {\"lat\": 27.1314437307903, \"lng\": 115.06231342602688, \"height\": 240.24406177080297, \"latitude\": 27.1314437307903, \"longitude\": 115.06231342602688}, {\"lat\": 27.130286529493247, \"lng\": 115.0568162180689, \"height\": 240.57324405754517, \"latitude\": 27.130286529493247, \"longitude\": 115.0568162180689}, {\"lat\": 27.128986462048708, \"lng\": 115.0518146473581, \"height\": 240.9097818281966, \"latitude\": 27.128986462048708, \"longitude\": 115.0518146473581}, {\"lat\": 27.127557827888293, \"lng\": 115.04736351199114, \"height\": 241.238967262521, \"latitude\": 27.127557827888293, \"longitude\": 115.04736351199114}, {\"lat\": 27.126016333813062, \"lng\": 115.04351157183788, \"height\": 241.54641391765136, \"latitude\": 27.126016333813062, \"longitude\": 115.04351157183788}, {\"lat\": 27.12437891952769, \"lng\": 115.04030101466547, \"height\": 241.81868547645408, \"latitude\": 27.12437891952769, \"longitude\": 115.04030101466547}, {\"lat\": 27.122663569825875, \"lng\": 115.03776699458332, \"height\": 242.04388298107517, \"latitude\": 27.122663569825875, \"longitude\": 115.03776699458332}, {\"lat\": 27.120889115581715, \"lng\": 115.03593724783563, \"height\": 242.2121648595728, \"latitude\": 27.120889115581715, \"longitude\": 115.03593724783563}, {\"lat\": 27.119075025813327, \"lng\": 115.03483179010902, \"height\": 242.3161770439311, \"latitude\": 27.119075025813327, \"longitude\": 115.03483179010902}, {\"lat\": 27.117241193167494, \"lng\": 115.03446269861692, \"height\": 242.35137437283345, \"latitude\": 27.117241193167494, \"longitude\": 115.03446269861692}, {\"lat\": 27.11540771522819, \"lng\": 115.03483398128904, \"height\": 242.31621922677547, \"latitude\": 27.11540771522819, \"longitude\": 115.03483398128904}, {\"lat\": 27.11359467407704, \"lng\": 115.03594153443072, \"height\": 242.2122487268214, \"latitude\": 27.11359467407704, \"longitude\": 115.03594153443072}, {\"lat\": 27.111821916531323, \"lng\": 115.03777318924902, \"height\": 242.04400754760337, \"latitude\": 27.111821916531323, \"longitude\": 115.03777318924902}, {\"lat\": 27.110108837455485, \"lng\": 115.04030884666572, \"height\": 241.81884927999585, \"latitude\": 27.110108837455485, \"longitude\": 115.04030884666572}, {\"lat\": 27.10847416848657, \"lng\": 115.04352069887712, \"height\": 241.5466150531188, \"latitude\": 27.10847416848657, \"longitude\": 115.04352069887712}, {\"lat\": 27.106935774434948, \"lng\": 115.0473735351744, \"height\": 241.23920341133748, \"latitude\": 27.106935774434948, \"longitude\": 115.0473735351744}, {\"lat\": 27.10551045951957, \"lng\": 115.05182512862444, \"height\": 240.91005029162608, \"latitude\": 27.10551045951957, \"longitude\": 115.05182512862444}, {\"lat\": 27.104213785474624, \"lng\": 115.05682669933678, \"height\": 240.57354179818523, \"latitude\": 27.104213785474624, \"longitude\": 115.05682669933678}, {\"lat\": 27.10305990342386, \"lng\": 115.06232344921456, \"height\": 240.24438546029003, \"latitude\": 27.10305990342386, \"longitude\": 115.06232344921456}, {\"lat\": 27.10206140126076, \"lng\": 115.06825516231812, \"height\": 239.93696743263703, \"latitude\": 27.10206140126076, \"longitude\": 115.06825516231812}, {\"lat\": 27.10122916810148, \"lng\": 115.07455686426626, \"height\": 239.66472374787935, \"latitude\": 27.10122916810148, \"longitude\": 115.07455686426626}, {\"lat\": 27.100572277192217, \"lng\": 115.0811595334639, \"height\": 239.43955308582795, \"latitude\": 27.100572277192217, \"longitude\": 115.0811595334639}, {\"lat\": 27.10009788845782, \"lng\": 115.087990856394, \"height\": 239.2712967482805, \"latitude\": 27.10009788845782, \"longitude\": 115.087990856394}, {\"lat\": 27.099811171674233, \"lng\": 115.0949760187379, \"height\": 239.16730853166112, \"latitude\": 27.099811171674233, \"longitude\": 115.0949760187379}, {\"lat\": 27.09971525103608, \"lng\": 115.1020385237064, \"height\": 239.13213333836975, \"latitude\": 27.09971525103608, \"longitude\": 115.1020385237064}, {\"lat\": 27.099811171674233, \"lng\": 115.10910102867491, \"height\": 239.167308531655, \"latitude\": 27.099811171674233, \"longitude\": 115.10910102867491}, {\"lat\": 27.10009788845782, \"lng\": 115.11608619101878, \"height\": 239.27129674685, \"latitude\": 27.10009788845782, \"longitude\": 115.11608619101878}, {\"lat\": 27.10057227719222, \"lng\": 115.1229175139489, \"height\": 239.43955308551512, \"latitude\": 27.10057227719222, \"longitude\": 115.1229175139489}, {\"lat\": 27.10122916810148, \"lng\": 115.12952018314652, \"height\": 239.66472374829976, \"latitude\": 27.10122916810148, \"longitude\": 115.12952018314652}, {\"lat\": 27.10206140126076, \"lng\": 115.13582188509464, \"height\": 239.93696743312785, \"latitude\": 27.10206140126076, \"longitude\": 115.13582188509464}, {\"lat\": 27.10305990342386, \"lng\": 115.14175359819826, \"height\": 240.2443854608264, \"latitude\": 27.10305990342386, \"longitude\": 115.14175359819826}, {\"lat\": 27.104213785474617, \"lng\": 115.14725034807596, \"height\": 240.5735417970414, \"latitude\": 27.104213785474617, \"longitude\": 115.14725034807596}, {\"lat\": 27.105510459519557, \"lng\": 115.15225191878834, \"height\": 240.91005029170333, \"latitude\": 27.105510459519557, \"longitude\": 115.15225191878834}, {\"lat\": 27.106935774434948, \"lng\": 115.15670351223838, \"height\": 241.23920341122712, \"latitude\": 27.106935774434948, \"longitude\": 115.15670351223838}, {\"lat\": 27.10847416848657, \"lng\": 115.16055634853564, \"height\": 241.5466150535108, \"latitude\": 27.10847416848657, \"longitude\": 115.16055634853564}, {\"lat\": 27.110108837455485, \"lng\": 115.16376820074704, \"height\": 241.81884927874424, \"latitude\": 27.110108837455485, \"longitude\": 115.16376820074704}, {\"lat\": 27.11182191653132, \"lng\": 115.16630385816376, \"height\": 242.04400754640932, \"latitude\": 27.11182191653132, \"longitude\": 115.16630385816376}, {\"lat\": 27.11359467407704, \"lng\": 115.16813551298206, \"height\": 242.2122487283748, \"latitude\": 27.11359467407704, \"longitude\": 115.16813551298206}, {\"lat\": 27.11540771522819, \"lng\": 115.16924306612378, \"height\": 242.31621922659275, \"latitude\": 27.11540771522819, \"longitude\": 115.16924306612378}]}",
                "areaCode": ""
            }
        ]
    },
    "msg": "操作成功"
    "code": 0,
    "data": [
        {
            "areaCode": "",
            "areaName": "",
            "areaTypeKeys": "",
            "controlLevel": "",
            "deviceIds": "",
            "flyDateEnd": "",
            "flyDateStart": "",
            "fwAreaDivideExtList": [
                {
                    "areaCode": "",
                    "areaDivideId": 0,
                    "areaTypeKey": "",
                    "areaTypeValue": "",
                    "geomJson": "",
                    "id": 0
                }
            ],
            "id": 0,
            "policeStationContactPerson": "",
            "policeStationContactPhone": "",
            "policeStationId": "",
            "policeStationName": "",
            "responseMechanism": "",
            "triggerCondition": ""
        }
    ],
    "msg": "",
    "success": true
}
```
applications/drone-command/src/views/areaManage/partition/FormDiaLog.vue
@@ -233,10 +233,8 @@
import { useRoute } from 'vue-router'
import { fieldRules, geomAnalysis, getDictLabel } from '@ztzf/utils'
import CommonCesiumMap from '@/components/map-container/common-cesium-map.vue'
import { DrawManager } from './shapeTools/DrawManager'
import { EditManager } from './shapeTools/EditManager'
import { DrawManager, EditManager, buildEllipsePositions } from '@/utils/cesium/shapeTools'
import { cartesian3Convert } from '@/utils/cesium/mapUtil'
import { buildEllipsePositions } from './shapeTools/shapeUtils'
import * as Cesium from 'cesium'
import { fwPoliceStationListApi } from '@/views/areaManage/precinctInfo/precinctInfoApi'
import { fwDeviceListApi } from '@/views/basicManage/deviceStock/fwDevice'
applications/drone-command/src/views/areaManage/sceneConfig/FormDiaLog.vue
@@ -152,15 +152,14 @@
<script setup>
import { Close } from '@element-plus/icons-vue'
import { computed, inject, nextTick, onMounted, ref, watch } from 'vue'
import { computed, inject, nextTick, ref, watch } from 'vue'
import { ElMessage } from 'element-plus'
import { fwDefenseSceneDetailApi, fwDefenseSceneSubmitApi } from './sceneConfigApi'
import { fieldRules, geomAnalysis, getDictLabel } from '@ztzf/utils'
import { fieldRules, getDictLabel } from '@ztzf/utils'
import CommonCesiumMap from '@/components/map-container/common-cesium-map.vue'
import * as Cesium from 'cesium'
import { fwAreaDivideDetailApi, fwAreaDivideListApi } from '../partition/partitionApi'
import { DrawPolygon } from '@/utils/cesium/DrawPolygon'
import commandPost from '@/assets/images/dataCockpit/legend/command-post.png'
import { buildEllipsePositions } from '@/utils/cesium/shapeTools'
import { saveOperationLog } from '@ztzf/apis'
import { useRoute } from 'vue-router'
@@ -188,8 +187,21 @@
const mapRef = ref(null)
const route = useRoute()
let viewer
let redPointEntity
let leftClickBound = false
let areaDisplaySource
const areaTypeStyleMap = {
    '1': {
        fill: Cesium.Color.fromBytes(25, 178, 230, 128),
        outline: Cesium.Color.fromBytes(0, 251, 255, 255),
    },
    '2': {
        fill: Cesium.Color.fromBytes(255, 235, 59, 128),
        outline: Cesium.Color.fromBytes(255, 235, 59, 255),
    },
    '3': {
        fill: Cesium.Color.fromBytes(247, 20, 20, 128),
        outline: Cesium.Color.fromBytes(255, 0, 0, 255),
    },
}
const rules = {
    sceneName: fieldRules(true, 50),
@@ -242,7 +254,7 @@
// 关联区域变更
async function handleAreaSelectionChange(rows) {
    const selectedRows = await ensureAreaGeom(rows)
    const selectedRows = await ensureAreaExtList(rows)
    selectedAreaRows.value = selectedRows
    const ids = selectedRows.map(item => item.id)
    formData.value.areaDivideIds = ids.join(',')
@@ -250,34 +262,184 @@
}
// 渲染面
function renderingSurface() {
    if (!geometricSource) {
        initMap()
function ensureAreaDisplaySource() {
    if (!viewer) return null
    if (!areaDisplaySource) {
        areaDisplaySource = new Cesium.CustomDataSource('scene-area-display')
        viewer.dataSources.add(areaDisplaySource)
    }
    if (!geometricSource) return
    geometricSource && geometricSource.entities.removeAll()
    selectedAreaRows.value.forEach(item => {
        if (item.geom) {
            const pointList = geomAnalysis(item.geom)
            const result = pointList.map(item => [item.longitude, item.latitude]).flat()
            geometricSource.entities?.add({
                customType: 'control_group',
                position: Cesium.Cartesian3.fromDegrees(result[0], result[1]),
    return areaDisplaySource
}
function clearAreaDisplay() {
    if (!areaDisplaySource) return
    areaDisplaySource.entities.removeAll()
}
function normalizeShapePoint(point) {
    if (!point) return null
    const lng = point?.lng ?? point?.longitude
    const lat = point?.lat ?? point?.latitude
    const height = Number.isFinite(Number(point?.height)) ? Number(point.height) : 0
    if (!Number.isFinite(Number(lng)) || !Number.isFinite(Number(lat))) return null
    return { lng: Number(lng), lat: Number(lat), height }
}
function buildShapePositions(points = []) {
    const normalized = points.map(normalizeShapePoint).filter(Boolean)
    return normalized.map(point => Cesium.Cartesian3.fromDegrees(point.lng, point.lat, point.height))
}
function getShapeDisplayPoints(shape) {
    if (Array.isArray(shape?.displayPoints) && shape.displayPoints.length) {
        return shape.displayPoints
    }
    return shape?.points || []
}
function getAreaTypeStyle(areaType) {
    return areaTypeStyleMap?.[String(areaType)] || {
        fill: Cesium.Color.fromBytes(45, 140, 240, 99),
        outline: Cesium.Color.fromBytes(45, 140, 240, 255),
    }
}
function parseGeomJson(geomJson) {
    if (!geomJson) return null
    if (typeof geomJson === 'object') return geomJson
    if (typeof geomJson !== 'string') return null
    const trimmed = geomJson.trim()
    if (!trimmed) return null
    try {
        return JSON.parse(trimmed)
    } catch (error) {
        return null
    }
}
function resolveAreaShapes(area) {
    const extList = Array.isArray(area?.fwAreaDivideExtList) ? area.fwAreaDivideExtList : []
    if (!extList.length) return []
    return extList
        .map((item, index) => {
            const isShapePayload = item?.drawType || item?.points
            if (isShapePayload) {
                return {
                    id: item?.id || `shape_${Date.now()}_${index}_${Math.random().toString(16).slice(2, 6)}`,
                    drawType: item?.drawType ?? 'polygon',
                    areaType: item?.areaType ?? item?.areaTypeKey ?? '',
                    points: Array.isArray(item?.points) ? item.points : [],
                    displayPoints: Array.isArray(item?.displayPoints) ? item.displayPoints : null,
                    meta: item?.meta ?? null,
                }
            }
            const parsed = parseGeomJson(item?.geomJson)
            if (!parsed) return null
            return {
                id: parsed?.id || `shape_${Date.now()}_${index}_${Math.random().toString(16).slice(2, 6)}`,
                drawType: parsed?.drawType ?? 'polygon',
                areaType: item?.areaTypeKey ?? parsed?.areaType ?? '',
                points: Array.isArray(parsed?.points) ? parsed.points : [],
                displayPoints: Array.isArray(parsed?.displayPoints) ? parsed.displayPoints : null,
                meta: parsed?.meta ?? null,
            }
        })
        .filter(Boolean)
}
function renderSelectedAreas() {
    if (!visible.value) {
        clearAreaDisplay()
        return
    }
    if (!viewer) initMap()
    const dataSource = ensureAreaDisplaySource()
    if (!dataSource) return
    dataSource.entities.removeAll()
    selectedAreaRows.value.forEach(area => {
        const shapes = resolveAreaShapes(area)
        shapes.forEach(shape => {
            if (shape.drawType === 'buffer' && shape.meta?.bufferRadii?.length && shape.meta?.center) {
                const center = shape.meta.center
                const centerCartesian = Cesium.Cartesian3.fromDegrees(center.lng, center.lat, center.height || 0)
                const radii = shape.meta.bufferRadii
                    .map(radius => Number(radius))
                    .filter(radius => Number.isFinite(radius) && radius > 0)
                const styles = [
                    {
                        fill: Cesium.Color.fromBytes(247, 20, 20, 128),
                        outline: Cesium.Color.fromBytes(255, 0, 0, 255),
                    },
                    {
                        fill: Cesium.Color.fromBytes(255, 235, 59, 128),
                        outline: Cesium.Color.fromBytes(255, 235, 59, 255),
                    },
                    {
                        fill: Cesium.Color.fromBytes(25, 178, 230, 128),
                        outline: Cesium.Color.fromBytes(0, 251, 255, 255),
                    },
                ]
                radii.forEach((radius, index) => {
                    const style = styles[index] || styles[styles.length - 1]
                    dataSource.entities.add({
                        name: 'scene-area-display',
                        customData: { drawType: shape.drawType, level: index + 1 },
                        position: centerCartesian,
                        ellipse: {
                            semiMajorAxis: radius,
                            semiMinorAxis: radius,
                            material: style.fill,
                            outline: false,
                            heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
                        },
                    })
                    const positions = buildEllipsePositions(centerCartesian, radius, radius)
                    dataSource.entities.add({
                        name: 'scene-area-display',
                        customData: { drawType: shape.drawType, level: index + 1, outline: true },
                        polyline: {
                            positions: positions.length ? [...positions, positions[0]] : positions,
                            clampToGround: true,
                            width: 2,
                            material: style.outline,
                        },
                    })
                })
                return
            }
            const positions = buildShapePositions(getShapeDisplayPoints(shape))
            if (positions.length < 3) return
            const style = getAreaTypeStyle(shape.areaType)
            dataSource.entities.add({
                name: 'scene-area-display',
                customData: { drawType: shape.drawType },
                polygon: {
                    hierarchy: new Cesium.PolygonHierarchy(positions),
                    material: style.fill,
                    outline: false,
                    heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
                },
                polyline: {
                    positions: Cesium.Cartesian3.fromDegreesArray(result),
                    positions: positions.length ? [...positions, positions[0]] : positions,
                    clampToGround: true,
                    width: 3,
                    material: Cesium.Color.RED,
                    width: 2,
                    material: style.outline,
                },
            })
        }
        })
    })
}
watch(() => selectedAreaRows.value, renderingSurface)
watch(() => selectedAreaRows.value, renderSelectedAreas)
watch(
    () => visible.value,
    val => {
        if (!val) clearAreaDisplay()
    }
)
async function ensureAreaGeom(rows) {
    const missingRows = rows.filter(row => row?.id && !row.geom)
async function ensureAreaExtList(rows) {
    const missingRows = rows.filter(row => row?.id && !Array.isArray(row?.fwAreaDivideExtList))
    if (!missingRows.length) return rows
    const detailList = await Promise.all(
        missingRows.map(row =>
@@ -299,7 +461,7 @@
}
// 同步关联区域
function syncAreaSelection() {
async function syncAreaSelection() {
    if (!areaTableRef.value) return
    areaTableRef.value.clearSelection()
    const rows = []
@@ -315,30 +477,24 @@
            rows.push(row)
        }
    })
    selectedAreaRows.value = rows
    if (!rows.length) return
    formData.value.areaCount = rows.length
    const ensuredRows = await ensureAreaExtList(rows)
    selectedAreaRows.value = ensuredRows
    if (!ensuredRows.length) return
    formData.value.areaCount = ensuredRows.length
}
let geometricSource
// 初始化地图实例
function initMap() {
    if (viewer) return
    const map = mapRef.value?.getMap()
    if (!map?.viewer) return
    viewer = map.viewer
    if (!geometricSource) {
        geometricSource = new Cesium.CustomDataSource('geometricSource')
        viewer.dataSources.add(geometricSource)
    }
}
// 打开弹框
async function open({ mode, row } = {}) {
    dialogMode.value = mode || 'add'
    formData.value = dialogMode.value === 'add' ? initForm() : row
    selectedAreaRows.value = []
    redPointEntity = null
    await nextTick()
    initMap()
    await getAreaList()
@@ -346,7 +502,7 @@
        await loadDetail()
    }
    await nextTick()
    syncAreaSelection()
    await syncAreaSelection()
}
defineExpose({
    open,