Files
sgxt_web/src/views/home/dialog/components/home_yj.vue

107 lines
2.8 KiB
Vue
Raw Normal View History

2025-07-14 17:31:24 +08:00
<template>
2025-08-06 14:25:36 +08:00
2025-08-27 17:26:29 +08:00
<DialogDragger title="预警详情" top="150px" v-model="props.show" @close="close">
2025-07-28 10:47:50 +08:00
2025-07-14 18:15:09 +08:00
<ul class="warningList" ref="gjyjList">
<li v-for="item in props.data" :key="item.id">
2025-08-27 17:26:29 +08:00
<YjItem :item="item" />
2025-07-14 17:31:24 +08:00
</li>
2025-07-14 18:15:09 +08:00
<MOSTY.Empty :show="props.data.length <= 0" :imgSize="150"></MOSTY.Empty>
2025-07-14 17:31:24 +08:00
</ul>
2025-08-06 14:25:36 +08:00
<!-- :style="{height: `calc(100vh - ${handleHs}px)`}" -->
2025-08-27 17:26:29 +08:00
<div style="position:relative;width: 100%;" :style="{ height: `calc(100vh - ${handleHs}px)` }">
2025-08-06 14:25:36 +08:00
<GdMap v-if="showMap"></GdMap>
</div>
2025-07-14 17:31:24 +08:00
</DialogDragger>
</template>
<script setup>
import * as MOSTY from "@/components/MyComponents/index";
2025-08-06 14:25:36 +08:00
import GdMap from "@/components/GdMap/index.vue";
2025-07-14 17:31:24 +08:00
import DialogDragger from "@/views/home/layout/dialogDragger.vue";
import YjItem from "@/views/home/components/yjItem.vue";
2025-08-06 14:25:36 +08:00
import { ref, defineProps, onMounted, watch } from "vue";
2025-07-14 17:31:24 +08:00
import emitter from "@/utils/eventBus.js";
const gjyjList = ref(null); //预警列表数据
//参数传递
const props = defineProps({
//某条预警详情
data: {
2025-08-27 17:26:29 +08:00
type: Array,
default: []
2025-07-14 17:31:24 +08:00
},
show: {
2025-08-27 17:26:29 +08:00
type: Boolean,
default: false
2025-07-14 17:31:24 +08:00
},
});
2025-08-06 14:25:36 +08:00
console.log(props.show);
2025-07-14 18:15:09 +08:00
2025-07-14 17:31:24 +08:00
//关闭
function close() {
2025-08-27 17:26:29 +08:00
emitter.emit('deletePointArea', 'home_yj_map');
emitter.emit("showHomeYJ", false);
2025-07-14 17:31:24 +08:00
}
2025-08-27 17:26:29 +08:00
const showMap = ref(false)
2025-08-06 14:25:36 +08:00
onMounted(() => {
setTimeout(() => {
showMap.value = true
setTimeout(() => {
for (let i = 0; i < props.data.length; i++) {
2025-08-27 17:26:29 +08:00
const item = props.data[i];
console.log(item);
2025-08-06 14:25:36 +08:00
2025-08-27 17:26:29 +08:00
emitter.emit('showHomeYJ', [item]);
emitter.emit('deletePointArea', 'home_yj_map');
if (!item.jd || !item.jd) return proxy.$message({ type: "warning", message: "该预警没有坐标!" });
let icon = require('@/assets/point/yj.png');
if (item.yjjb == '20') icon = require('@/assets/point/yj1.png');
if (item.yjjb == '30') icon = require('@/assets/point/yj2.png');
if (item.yjjb == '40') icon = require('@/assets/point/yj3.png');
emitter.emit('addPointArea', { flag: 'home_yj_map', icon, coords: [item] });
emitter.emit('setMapCenter', { location: [item.jd, item.wd], zoomLevel: 10 });
}
2025-08-06 14:25:36 +08:00
}, 500);
2025-07-14 17:31:24 +08:00
2025-08-06 14:25:36 +08:00
}, 200);
})
2025-08-27 17:26:29 +08:00
const handleHs = ref(0)
2025-08-06 14:25:36 +08:00
watch(() => gjyjList.value, (val) => {
console.log(val.clientHeight);
2025-08-27 17:26:29 +08:00
handleHs.value = val.clientHeight + 198 + 150 + 20
}, { deep: true })
2025-07-14 17:31:24 +08:00
</script>
<style lang="scss" scoped>
@import "@/assets/css/homeScreen.scss";
2025-08-27 17:26:29 +08:00
2025-07-14 17:31:24 +08:00
.dialogBox {
2025-07-14 18:15:09 +08:00
z-index: 999;
2025-08-27 17:26:29 +08:00
ul.warningList {
2025-07-14 17:31:24 +08:00
height: calc(100vh - 198px);
overflow: hidden;
overflow-y: auto;
padding: 7px 10px;
box-sizing: border-box;
2025-08-27 17:26:29 +08:00
2025-07-14 17:31:24 +08:00
.photo {
width: 60px;
height: 80px;
2025-08-27 17:26:29 +08:00
2025-07-14 17:31:24 +08:00
img {
width: 100%;
height: 100%;
}
}
}
}
2025-08-27 17:26:29 +08:00
2025-07-14 17:31:24 +08:00
//加载时 取消背景
::v-deep .el-loading-mask {
background-color: transparent !important;
}
</style>