| | |
| | | |
| | | <div class="right-container"> |
| | | <div class="header"> |
| | | {{ titleEnum[dialogMode] }} |
| | | <span>{{ titleEnum[dialogMode] }}</span> |
| | | |
| | | <el-icon class="close-btn" @click.stop="visible = false"><Close /></el-icon> |
| | | </div> |
| | | |
| | | <div class="dialog-container" v-if="readonly"> |
| | | <div class="content" v-if="readonly"> |
| | | <div class="detail-title">防区详情</div> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | |
| | | <el-table-column prop="sceneName" label="场景名称" /> |
| | | <el-table-column prop="sceneType" label="场景类型"> |
| | | <template v-slot="{ row }"> |
| | | {{ getDictLabel(row.sceneType, dictObj.sceneType) }} |
| | | {{ getDictLabel(row.sceneType, dictObj.CommandSceneType) }} |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <el-table-column prop="sceneName" label="场景名称" /> |
| | | <el-table-column prop="sceneType" label="场景类型"> |
| | | <template v-slot="{ row }"> |
| | | {{ getDictLabel(row.sceneType, dictObj.sceneType) }} |
| | | {{ getDictLabel(row.sceneType, dictObj.CommandSceneType) }} |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </el-form> |
| | | |
| | | <div class="footer"> |
| | | <el-button color="#2B2B4C" @click="handleCancel">{{ readonly ? '关闭' : '取消' }}</el-button> |
| | | <el-button v-if="dialogMode != 'view'" color="#2B2B4C" @click="handleCancel">{{ readonly ? '关闭' : '取消' }}</el-button> |
| | | <el-button color="#284FE3" v-if="!readonly" type="primary" :loading="submitting" |
| | | :disabled="submitting" @click="handleSubmit"> |
| | | 确定 |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { Close } from '@element-plus/icons-vue' |
| | | |
| | | import { computed, inject, nextTick, ref } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { fwDefenseZoneDetailApi, fwDefenseZoneSubmitApi } from './defenseZoneApi' |
| | | import { fwDefenseSceneListApi } from '@/views/areaManage/sceneConfig/sceneConfigApi' |
| | | import { fieldRules, geomAnalysis, getDictLabel } from '@ztzf/utils' |
| | | import CommonCesiumMap from '@/components/map-container/common-cesium-map.vue' |
| | | import { DrawPolygon } from '@/utils/cesium/DrawPolygon' |
| | | import { DrawPolygon } from '@ztzf/utils' |
| | | import { cartesian3Convert } from '@/utils/cesium/mapUtil' |
| | | import * as turf from '@turf/turf' |
| | | import * as Cesium from 'cesium' |
| | | import { saveOperationLog } from '@ztzf/apis' |
| | | import { useRoute } from 'vue-router' |
| | | |
| | | // 初始化表单 |
| | | const initForm = () => ({ |
| | |
| | | const selectedSceneRows = ref([]) // 选中场景 |
| | | const dictObj = inject('dictObj') |
| | | const mapRef = ref(null) |
| | | const route = useRoute() |
| | | let viewer |
| | | let drawPolygonExample |
| | | let pointList = [] |
| | | |
| | | const rules = { |
| | | zoneName: fieldRules(true, 50), |
| | | defenseSceneIds: fieldRules(true), |
| | | defenseSceneIds: fieldRules(false), |
| | | zoneArea: fieldRules(true), |
| | | } |
| | | |
| | |
| | | const str = [...pointList, pointList[0]].map(item => `${item.longitude} ${item.latitude}`).join(',') |
| | | formData.value.geom = `POLYGON((${str}))` |
| | | await fwDefenseZoneSubmitApi(formData.value) |
| | | saveOperationLog({ |
| | | requestUri: route.path, |
| | | title: `${route.name || '防区管理'}-${dialogMode.value === 'add' ? '新增' : '编辑'}`, |
| | | type: 1, |
| | | }) |
| | | ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功') |
| | | visible.value = false |
| | | emit('success') |