| | |
| | | <div>区域位置: {{ formatLocation(formData) }}</div> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <div>区域面积: {{ formData.areaSize }}</div> |
| | | <div>区域面积: {{ formData.areaSize }}㎡</div> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <div>区域类型: {{ getOptionLabel(formData.areaType, areaTypeOptions) }}</div> |
| | | <div>区域类型: {{ getDictLabel(formData.areaType, dictObj.areaType) }}</div> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <div>触发条件: {{ formData.triggerCondition }}</div> |
| | |
| | | <div>响应机制: {{ formData.responseMechanism }}</div> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <div>管控级别: {{ getOptionLabel(formData.controlLevel, controlLevelOptions) }}</div> |
| | | <div>管控级别: {{ getDictLabel(formData.controlLevel, dictObj.controlLevel) }}</div> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <div>关联派出所: {{ formData.policeStationName }}</div> |
| | |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="区域面积" prop="areaSize"> |
| | | {{ formData.areaSize }} |
| | | {{ formData.areaSize }}㎡ |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="区域类型" prop="areaType"> |
| | | <el-select v-model="formData.areaType" placeholder="请选择" clearable> |
| | | <el-option |
| | | v-for="item in areaTypeOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | v-for="item in dictObj.areaType" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :value="item.dictKey" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="管控级别" prop="controlLevel"> |
| | | <el-select v-model="formData.controlLevel" placeholder="请选择" clearable> |
| | | <el-option |
| | | v-for="item in controlLevelOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | v-for="item in dictObj.controlLevel" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :value="item.dictKey" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, nextTick, onMounted, ref, watch } from 'vue' |
| | | import { computed, inject, nextTick, onMounted, ref, watch } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { fwAreaDivideDetailApi, fwAreaDivideSubmitApi, fwDevicePageApi, fwPoliceStationPageApi } from './partitionApi' |
| | | import { fieldRules } from '@ztzf/utils' |
| | | import { fieldRules, getDictLabel } from '@ztzf/utils' |
| | | import { PublicCesium } from '@/utils/cesium/publicCesium' |
| | | import { DrawPolygon } from '@/utils/cesium/DrawPolygon' |
| | | import { cartesian3Convert } from '@/utils/cesium/mapUtil' |
| | |
| | | triggerCondition: '', // 触发条件 |
| | | }) |
| | | |
| | | const areaTypeOptions = [ |
| | | { label: '报警区', value: '报警区' }, |
| | | { label: '重点管制区', value: '重点管制区' }, |
| | | ] |
| | | const controlLevelOptions = [ |
| | | { label: '日常', value: '日常' }, |
| | | { label: '重点', value: '重点' }, |
| | | { label: '严密', value: '严密' }, |
| | | ] |
| | | |
| | | const emit = defineEmits(['success']) |
| | | const formRef = ref(null) // 表单实例 |
| | | const formData = ref(initForm()) // 表单数据 |
| | |
| | | const deviceIdList = ref([]) // 关联设备ID |
| | | const policeStationOptions = ref([]) // 关联派出所 |
| | | const deviceOptions = ref([]) // 关联设备 |
| | | const dictObj = inject('dictObj') |
| | | let viewer |
| | | let drawPolygonExample |
| | | let pointList = [] |
| | |
| | | formData.value.flyDateEnd = end || '' |
| | | formData.value.deviceIds = deviceIdList.value.length ? deviceIdList.value.join(',') : '' |
| | | let str = [...pointList, pointList[0]].map(item => `${item.longitude} ${item.latitude}`).join(',') |
| | | formData.value.geom = `POLYGON((${str})) | 4326` |
| | | formData.value.geom = `POLYGON((${str}))` |
| | | await fwAreaDivideSubmitApi(formData.value) |
| | | ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功') |
| | | visible.value = false |
| | |
| | | // 格式化区域位置 |
| | | function formatLocation(row) { |
| | | if (row?.longitude == null || row?.latitude == null) return '' |
| | | return `${row.longitude}, ${row.latitude}` |
| | | return `${_.round(row.longitude,6)}, ${_.round(row.latitude,6)}` |
| | | } |
| | | |
| | | // 格式化可飞行时间段 |
| | | function formatFlyDate(row) { |
| | | if (!row?.flyDateStart && !row?.flyDateEnd) return '' |
| | | return `${row.flyDateStart || '-'} ~ ${row.flyDateEnd || '-'}` |
| | | } |
| | | |
| | | // 获取选项文本 |
| | | function getOptionLabel(value, options) { |
| | | const match = options.find(item => item.value === value) |
| | | return match?.label ?? value ?? '' |
| | | } |
| | | |
| | | // 初始化地图实例 |
| | |
| | | if (!str) return [] |
| | | return str |
| | | .replace('POLYGON((', '') |
| | | .replace(')) | 4326', '') |
| | | .replace('))', '') |
| | | .split(',') |
| | | .map(pair => { |
| | | const [lat, lon] = pair.trim().split(' ').map(Number) |
| | | const [lon, lat] = pair.trim().split(' ').map(Number) |
| | | return [lon, lat] |
| | | }) |
| | | } |