| | |
| | | <div>区域位置: {{ formatLocation(formData) }}</div> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <div>区域面积: {{ formData.areaSize }}㎡</div> |
| | | <div>区域面积: {{ formData.areaSize }}k㎡</div> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <div>区域类型: {{ getDictLabel(formData.areaType, dictObj.areaType) }}</div> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="区域面积" prop="areaSize"> |
| | | {{ formData.areaSize }}㎡ |
| | | </el-form-item> |
| | | <el-form-item label="区域面积" prop="areaSize">{{ formData.areaSize }}k㎡</el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="区域类型" prop="areaType"> |
| | |
| | | <script setup> |
| | | import { computed, inject, nextTick, onMounted, ref, watch } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { fwAreaDivideDetailApi, fwAreaDivideSubmitApi, fwDevicePageApi, fwPoliceStationPageApi } from './partitionApi' |
| | | import { |
| | | fwAreaDivideDetailApi, |
| | | fwAreaDivideSubmitApi, |
| | | } from './partitionApi' |
| | | import { fieldRules, getDictLabel } from '@ztzf/utils' |
| | | import { PublicCesium } from '@/utils/cesium/publicCesium' |
| | | import { DrawPolygon } from '@/utils/cesium/DrawPolygon' |
| | | import { cartesian3Convert } from '@/utils/cesium/mapUtil' |
| | | import * as turf from '@turf/turf' |
| | | import * as Cesium from 'cesium' |
| | | import { fwPoliceStationListApi } from '@/views/areaManage/precinctInfo/precinctInfoApi' |
| | | import { fwDeviceListApi } from '@/views/basicManage/deviceStock/fwDevice' |
| | | |
| | | const initForm = () => ({ |
| | | areaName: '', // 区域名称 |
| | |
| | | // 格式化区域位置 |
| | | function formatLocation(row) { |
| | | if (row?.longitude == null || row?.latitude == null) return '' |
| | | return `${_.round(row.longitude,6)}, ${_.round(row.latitude,6)}` |
| | | return `${_.round(row.longitude, 6)}, ${_.round(row.latitude, 6)}` |
| | | } |
| | | |
| | | // 格式化可飞行时间段 |
| | |
| | | [...pointList.map(item => [item.longitude, item.latitude]), [pointList[0].longitude, pointList[0].latitude]], |
| | | ]) |
| | | const center = turf.centerOfMass(polygon) |
| | | formData.value.areaSize = _.round(turf.area(polygon), 2) |
| | | const areaSqm = turf.area(polygon) // 平方米 |
| | | formData.value.areaSize = _.round(areaSqm / 1_000_000, 2) // 平方千米 |
| | | formData.value.longitude = center.geometry.coordinates[0] |
| | | formData.value.latitude = center.geometry.coordinates[1] |
| | | } |
| | |
| | | |
| | | // 获取派出所列表 |
| | | async function getPoliceStationList() { |
| | | const res = await fwPoliceStationPageApi({ current: 1, size: 9999 }) |
| | | policeStationOptions.value = res?.data?.data?.records ?? [] |
| | | const res = await fwPoliceStationListApi() |
| | | policeStationOptions.value = res?.data?.data ?? [] |
| | | } |
| | | |
| | | // 获取设备列表 |
| | | async function getDeviceList() { |
| | | const res = await fwDevicePageApi({ current: 1, size: 9999 }) |
| | | deviceOptions.value = res?.data?.data?.records ?? [] |
| | | const res = await fwDeviceListApi({ isAreaSelect: 1 }) |
| | | deviceOptions.value = res?.data?.data ?? [] |
| | | } |
| | | |
| | | // 打开弹框 |
| | |
| | | <style scoped lang="scss"> |
| | | .bodyBox { |
| | | display: flex; |
| | | height: 800px; |
| | | height: 600px; |
| | | .leftMap { |
| | | width: 70%; |
| | | height: 100%; |