|
@@ -37,11 +37,13 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="event-card">
|
|
|
- <div class="common-title gradient-text" style="display: flex; align-items: center">灾害信息<i class="icon-edit" /></div>
|
|
|
+ <div class="common-title gradient-text" style="display: flex; align-items: center">
|
|
|
+ 灾害信息<i class="icon-edit" @click="showPositionMap = true" />
|
|
|
+ </div>
|
|
|
<div class="card-content">
|
|
|
<div class="event-box">
|
|
|
<div class="event-item">
|
|
|
- <div class="event-icon1"></div>
|
|
|
+ <div class="event-icon1" />
|
|
|
<div class="text-box">
|
|
|
<div class="text1">灾害事件</div>
|
|
|
<div v-if="eventData.event_title" class="text2">{{ eventData.event_title }}</div>
|
|
@@ -109,21 +111,20 @@
|
|
|
@update:event-title="updateEventTitle"
|
|
|
/>
|
|
|
<Communication />
|
|
|
+ <PositionMap v-if="showPositionMap" v-model:visible="showPositionMap" :id="eventId" @confirm="fetchEventDetail" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts" setup name="LeftSection">
|
|
|
import { getEventDetail, getWeather } from '@/api/duty/eventing';
|
|
|
import VideoMonitor from '@/views/emergencyCommandMap/LeftSection/VideoMonitor.vue';
|
|
|
-import { ref, onMounted, onUnmounted, computed } from 'vue';
|
|
|
import Communication from './Communication.vue';
|
|
|
import CloseCommand from './CloseCommand.vue';
|
|
|
import AssociatedEvent from './AssociatedEvent.vue';
|
|
|
+import PositionMap from '@/views/routineCommandMap/PositionMap.vue';
|
|
|
+
|
|
|
const proxy = getCurrentInstance()?.proxy;
|
|
|
-const { mm_event_level } = toRefs<any>(
|
|
|
- proxy?.useDict( 'mm_event_level')
|
|
|
-);
|
|
|
+const { mm_event_level } = toRefs<any>(proxy?.useDict('mm_event_level'));
|
|
|
const route = useRoute();
|
|
|
-const router = useRouter();
|
|
|
|
|
|
const eventId = ref('');
|
|
|
|
|
@@ -149,6 +150,7 @@ const eventData = ref({
|
|
|
longitude: '',
|
|
|
latitude: ''
|
|
|
});
|
|
|
+let showPositionMap = ref(false);
|
|
|
|
|
|
// 灾害信息卡片中的持续时间
|
|
|
const duration = computed(() => {
|
|
@@ -227,15 +229,12 @@ function getWindDirection(angle) {
|
|
|
|
|
|
const fetchEventDetail = () => {
|
|
|
const id = eventId.value;
|
|
|
- console.log('fetchEventDetail');
|
|
|
- if (id && id !== eventData.value.event_id) {
|
|
|
+ if (id) {
|
|
|
// 如果有 id,则正常获取事件详情
|
|
|
getEventDetail({ event_id: id }).then((res) => {
|
|
|
eventData.value = res.data;
|
|
|
- console.log('Received del_flag:', eventData.value.del_flag);
|
|
|
// 根据 del_flag 设置 flag
|
|
|
closeCommandState.flag = eventData.value.del_flag === '0';
|
|
|
- console.log('closeCommandState.flag:', closeCommandState.flag);
|
|
|
// 初始化响应时间
|
|
|
updateTime();
|
|
|
});
|
|
@@ -278,7 +277,6 @@ const updateTime = () => {
|
|
|
};
|
|
|
// 更新事件标题
|
|
|
const updateEventTitle = (eventTitle) => {
|
|
|
- console.log('Update event title:', eventTitle);
|
|
|
eventData.value.event_title = eventTitle;
|
|
|
// 每次更新事件标题时,重新获取事件详情
|
|
|
fetchEventDetail();
|
|
@@ -287,7 +285,7 @@ onMounted(() => {
|
|
|
// 从 URL 参数中获取 event_id
|
|
|
eventId.value = route.query.event_id as string;
|
|
|
// 获取事件数据并检查 del_flag
|
|
|
- fetchEventDetail(eventId.value);
|
|
|
+ fetchEventDetail();
|
|
|
fetchWeatherData();
|
|
|
intervalId = setInterval(updateTime, 1000);
|
|
|
});
|
|
@@ -297,13 +295,6 @@ onUnmounted(() => {
|
|
|
clearInterval(intervalId);
|
|
|
}
|
|
|
});
|
|
|
-// 监听事件标题的变化
|
|
|
-watchEffect(() => {
|
|
|
- if (eventData.value.event_title) {
|
|
|
- // 每次事件标题变化时,重新获取事件详情
|
|
|
- fetchEventDetail();
|
|
|
- }
|
|
|
-});
|
|
|
|
|
|
// 发射自定义事件
|
|
|
defineExpose({
|
|
@@ -408,6 +399,7 @@ defineExpose({
|
|
|
animation-name: slideLeft;
|
|
|
animation-duration: 1s;
|
|
|
.icon-edit {
|
|
|
+ display: inline-block;
|
|
|
width: 50px;
|
|
|
height: 50px;
|
|
|
background: url('@/assets/images/edit.png') no-repeat;
|