|
@@ -2,8 +2,9 @@
|
|
|
<div class="container">
|
|
|
<div class="top-content">
|
|
|
<!-- <YztMap v-if="['satellite2', 'satellite3'].includes(activeMap)" ref="map2Ref" :active-map="activeMap" :point-type="pointType" />-->
|
|
|
- <Map ref="mapRef" :active-map="activeMap" :point-type="pointType" :class="showMenu && !!eventId && !temp && !fullscreen ? 'containerHeight1' : 'containerHeight2'"/>
|
|
|
+ <Map v-if="!loading" ref="mapRef" :active-map="activeMap" :point-type="pointType" :event-details="eventDetails" :class="showMenu && !!eventId && !temp && !fullscreen ? 'containerHeight1' : 'containerHeight2'"/>
|
|
|
<div v-show="!fullscreen" class="top-left-panel">
|
|
|
+ <div class="select" @click="showSwitch = true">{{ eventDetails.event_title }}</div>
|
|
|
</div>
|
|
|
<div class="top-right-panel">
|
|
|
<SearchBtn v-show="!fullscreen" @confirm="selectSearchMarker"/>
|
|
@@ -38,8 +39,18 @@
|
|
|
</div>
|
|
|
|
|
|
<div v-if="!!eventId && !temp" v-show="showMenu && !fullscreen">
|
|
|
- <EventBox :eventId="eventId" />
|
|
|
+ <EventBox :eventId="eventId" :event-details="eventDetails" />
|
|
|
</div>
|
|
|
+ <!--切换事件-->
|
|
|
+ <van-popup v-model:show="showSwitch" round position="bottom">
|
|
|
+ <van-picker
|
|
|
+ v-model="selectEventId"
|
|
|
+ :columns="endEventState.columns"
|
|
|
+ :columns-field-names="{ text: 'event_title', value: 'event_id' }"
|
|
|
+ @cancel="showSwitch = false"
|
|
|
+ @confirm="onPickerConfirm"
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
<!--地点选择-->
|
|
|
<PositionSelect v-model:visible="showPositionSelect" @confirm="handleEnterCommand" />
|
|
|
<!--临时结束指挥-->
|
|
@@ -48,17 +59,18 @@
|
|
|
<div class="form-item">
|
|
|
<i class="icon" />
|
|
|
<div class="form-label">灾害事件:</div>
|
|
|
- <div class="form-select" @click="endEventState.showPicker = true">{{ endEventState.name }}</div>
|
|
|
+ <div class="select" @click="endEventState.showPicker = true">{{ endEventState.name }}</div>
|
|
|
</div>
|
|
|
<div class="form-text">注意:本次指挥未关联事件,指挥记录将不会保留。若要保留记录,请关联事件。</div>
|
|
|
</div>
|
|
|
</van-dialog>
|
|
|
<van-popup v-model:show="endEventState.showPicker" round position="bottom">
|
|
|
<van-picker
|
|
|
+ v-model="endEventState.event_id"
|
|
|
:columns="endEventState.columns"
|
|
|
:columns-field-names="{ text: 'event_title', value: 'event_id' }"
|
|
|
@cancel="endEventState.showPicker = false"
|
|
|
- @confirm="onPickerConfirm"
|
|
|
+ @confirm="onPickerConfirm2"
|
|
|
/>
|
|
|
</van-popup>
|
|
|
</div>
|
|
@@ -74,11 +86,19 @@ import {iconList} from "@/components/Map/mapData";
|
|
|
import PositionSelect from "@/views/mobileControl/PositionSelect.vue";
|
|
|
import {editEvent, registeredEvent} from "@/api/duty/eventing";
|
|
|
import {showFailToast, showSuccessToast} from "vant";
|
|
|
-import {closeEvent} from "@/api/event";
|
|
|
+import {closeEvent, getEventDetail} from "@/api/event";
|
|
|
|
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
|
-const eventId = ref('');
|
|
|
+let loading = ref(true);
|
|
|
+let eventId = ref('');
|
|
|
+let selectEventId = ref([]);
|
|
|
+let eventDetails = ref({
|
|
|
+ event_title: '',
|
|
|
+ longitude: '',
|
|
|
+ latitude: ''
|
|
|
+});
|
|
|
+let showSwitch = ref(false);
|
|
|
const temp = ref(false);
|
|
|
let fullscreen = ref(false);
|
|
|
let showMenu = ref(true);
|
|
@@ -95,7 +115,7 @@ let endEventState = reactive({
|
|
|
address: '',
|
|
|
latitude: '',
|
|
|
longitude: '',
|
|
|
- event_id: ''
|
|
|
+ event_id: []
|
|
|
});
|
|
|
|
|
|
|
|
@@ -160,34 +180,43 @@ const handleShowPosition = () => {
|
|
|
const handleEnterCommand = (res) => {
|
|
|
temp.value = true;
|
|
|
eventId.value = res.event_id;
|
|
|
+ selectEventId.value = [res.event_id];
|
|
|
endEventState.address = res.address;
|
|
|
endEventState.latitude = res.latitude;
|
|
|
endEventState.longitude = res.longitude;
|
|
|
}
|
|
|
-const onPickerConfirm = (data, a, b) => {
|
|
|
- endEventState.event_id = data.selectedValues[0];
|
|
|
+const onPickerConfirm = (data) => {
|
|
|
+ eventId.value = data.selectedValues[0];
|
|
|
+ eventDetails.value = data.selectedOptions[0];
|
|
|
+ showSwitch.value = false;
|
|
|
+ getEventDetail({event_id: eventId.value}).then((res) => {
|
|
|
+ eventDetails.value = res.data;
|
|
|
+ })
|
|
|
+};
|
|
|
+const onPickerConfirm2 = (data) => {
|
|
|
+ endEventState.event_id = [data.selectedValues[0]];
|
|
|
endEventState.name = data.selectedOptions[0].event_title;
|
|
|
endEventState.showPicker = false;
|
|
|
};
|
|
|
const closeDialog = () => {
|
|
|
endEventState.show = false;
|
|
|
- endEventState.event_id = '';
|
|
|
+ endEventState.event_id = [];
|
|
|
endEventState.name = '';
|
|
|
}
|
|
|
const endProcess = () => {
|
|
|
- if (!endEventState.event_id) {
|
|
|
+ if (!endEventState.event_id[0]) {
|
|
|
showFailToast('请先选择一个事件')
|
|
|
return;
|
|
|
}
|
|
|
// 更新事件信息
|
|
|
const updateParams = {
|
|
|
- event_id: endEventState.event_id,
|
|
|
+ event_id: endEventState.event_id[0],
|
|
|
address: endEventState.address,
|
|
|
latitude: endEventState.latitude,
|
|
|
longitude: endEventState.longitude
|
|
|
};
|
|
|
const params = {
|
|
|
- eventId: endEventState.event_id,
|
|
|
+ eventId: endEventState.event_id[0],
|
|
|
address: endEventState.address,
|
|
|
latitude: endEventState.latitude,
|
|
|
longitude: endEventState.longitude
|
|
@@ -204,6 +233,16 @@ const endProcess = () => {
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
eventId.value = route.query.event_id as string;
|
|
|
+ selectEventId.value = [route.query.event_id as string];
|
|
|
+ if (!!eventId.value && !temp.value) {
|
|
|
+ getEventDetail({event_id: eventId.value}).then((res) => {
|
|
|
+ eventDetails.value = res.data;
|
|
|
+ }).finally(() => {
|
|
|
+ loading.value = false;
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ loading.value = false;
|
|
|
+ }
|
|
|
registeredEvent({}).then((res) => {
|
|
|
endEventState.columns = res.data;
|
|
|
});
|
|
@@ -236,6 +275,12 @@ onMounted(() => {
|
|
|
position: absolute;
|
|
|
top: 16px;
|
|
|
left: 16px;
|
|
|
+ .select {
|
|
|
+ flex: none;
|
|
|
+ width: 223px;
|
|
|
+ height: 30px;
|
|
|
+ margin-left: 0;
|
|
|
+ }
|
|
|
}
|
|
|
.top-right-panel {
|
|
|
display: flex;
|
|
@@ -352,19 +397,6 @@ onMounted(() => {
|
|
|
flex-shrink: 0;
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
- .form-select {
|
|
|
- flex: 1;
|
|
|
- height: 35px;
|
|
|
- background: #FFFFFF;
|
|
|
- border: 1px solid #DCE0EE;
|
|
|
- border-radius: 2px;
|
|
|
- margin-left: 6px;
|
|
|
- padding: 5px 40px 5px 8px;
|
|
|
- position: relative;;
|
|
|
- &::before {
|
|
|
- content: '';
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
.form-text {
|
|
|
font-size: 14px;
|
|
@@ -372,4 +404,18 @@ onMounted(() => {
|
|
|
margin: 10px 0;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.select {
|
|
|
+ flex: 1;
|
|
|
+ height: 35px;
|
|
|
+ background: #FFFFFF;
|
|
|
+ border: 1px solid #DCE0EE;
|
|
|
+ border-radius: 2px;
|
|
|
+ margin-left: 6px;
|
|
|
+ padding: 5px 40px 5px 8px;
|
|
|
+ position: relative;;
|
|
|
+ &::before {
|
|
|
+ content: '';
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|