| | |
| | | <template> |
| | | <el-dialog class="ztzf-page-view-dialog" v-model="visible" :title="titleEnum[dialogMode]"> |
| | | <el-dialog class="command-page-view-dialog" v-model="visible" :title="titleEnum[dialogMode]"> |
| | | <div class="detail-container" v-if="readonly"> |
| | | <div class="detail-title">派出所详情</div> |
| | | <el-row> |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="派出所名称" prop="stationName"> |
| | | <el-input class="ztzf-data-cockpit-search-input" v-model="formData.stationName" maxlength="50" |
| | | <el-input class="command-data-cockpit-search-input" v-model="formData.stationName" maxlength="50" |
| | | placeholder="请输入" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="联系人" prop="contactPerson"> |
| | | <el-input class="ztzf-data-cockpit-search-input" v-model="formData.contactPerson" maxlength="50" |
| | | <el-input class="command-data-cockpit-search-input" v-model="formData.contactPerson" maxlength="50" |
| | | placeholder="请输入" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="联系方式" prop="contactPhone"> |
| | | <el-input class="ztzf-data-cockpit-search-input" v-model="formData.contactPhone" maxlength="50" |
| | | <el-input class="command-data-cockpit-search-input" v-model="formData.contactPhone" maxlength="50" |
| | | placeholder="请输入" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-button> |
| | | </template> |
| | | |
| | | <el-dialog class="ztzf-page-map-view-dialog" v-model="visible1" :show-close="false" |
| | | <el-dialog class="command-page-map-view-dialog" v-model="visible1" :show-close="false" |
| | | :close-on-click-modal="false" destroy-on-close @closed="positionClosed"> |
| | | <div class="dialog-container"> |
| | | <div class="left-container"> |
| | | <div class="leftMap ztzf-cesium" id="mapContainer"></div> |
| | | <CommonCesiumMap |
| | | ref="mapRef" |
| | | class="leftMap command-cesium" |
| | | :active="visible1" |
| | | :flat-mode="false" |
| | | :terrain="true" |
| | | :layer-mode="4" |
| | | :boundary="false" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | import { ElMessage } from 'element-plus' |
| | | import { fwPoliceStationDetailApi, fwPoliceStationSubmitApi } from './precinctInfoApi' |
| | | import { fieldRules } from '@ztzf/utils' |
| | | import { PublicCesium } from '@/utils/cesium/publicCesium' |
| | | import CommonCesiumMap from '@/components/map-container/common-cesium-map.vue' |
| | | import * as Cesium from 'cesium' |
| | | import axios from 'axios' |
| | | |
| | |
| | | const readonly = computed(() => dialogMode.value === 'view') |
| | | const titleEnum = ref({ edit: '编辑', view: '查看', add: '新增' }) |
| | | const tempLocation = ref({ longitude: null, latitude: null }) |
| | | const mapRef = ref(null) |
| | | |
| | | const rules = { |
| | | address: fieldRules(true, 50), |
| | |
| | | |
| | | let viewer |
| | | let redPointEntity |
| | | let leftClickBound = false |
| | | function setMapPoint (longitude, latitude) { |
| | | if (!viewer || longitude == null || latitude == null) return |
| | | if (!redPointEntity) { |
| | |
| | | async function selectLocation () { |
| | | visible1.value = true |
| | | await nextTick() |
| | | const publicCesiumInstance = new PublicCesium({ |
| | | dom: 'mapContainer', |
| | | flatMode: false, |
| | | terrain: true, |
| | | layerMode: 4, |
| | | boundary: false, |
| | | }) |
| | | publicCesiumInstance.addLeftClickEvent(null, LeftClickEvent) |
| | | viewer = publicCesiumInstance.getViewer() |
| | | const map = mapRef.value?.getMap() |
| | | viewer = map?.viewer || null |
| | | if (viewer && !leftClickBound) { |
| | | map.publicCesium?.addLeftClickEvent?.(null, LeftClickEvent) |
| | | leftClickBound = true |
| | | } |
| | | if (formData.value.longitude != null && formData.value.latitude != null) { |
| | | tempLocation.value = { longitude: formData.value.longitude, latitude: formData.value.latitude } |
| | | setMapPoint(formData.value.longitude, formData.value.latitude) |
| | |
| | | } |
| | | visible1.value = false |
| | | } |
| | | |
| | | // 打开弹框 |
| | | async function open ({ mode, row } = {}) { |
| | | dialogMode.value = mode || 'add' |