Files
sgxt_web/src/views/home/dialog/leftDialog.vue

43 lines
1.1 KiB
Vue
Raw Normal View History

2025-07-14 17:31:24 +08:00
<template>
<div class="noScollLine">
<!-- 预警信息弹框 -->
2025-07-14 18:15:09 +08:00
<Home_YJ v-if="isShow.showYj" :show="isShow.showYj" :data="list.Info_YJ" />
2025-09-19 23:10:52 +08:00
<PopupWarning v-if="isShow.showWarning" :show="isShow.showWarning" :data="list.Info_Warning" />
2025-07-14 17:31:24 +08:00
</div>
</template>
<script setup>
import emitter from "@/utils/eventBus.js";
import Home_YJ from "./components/home_yj.vue";
2025-09-19 23:10:52 +08:00
import PopupWarning from './components/popupWarning'
2025-07-14 17:31:24 +08:00
import { ref, onMounted, onUnmounted, reactive, getCurrentInstance } from "vue";
const { proxy } = getCurrentInstance();
const isShow = ref({
showYj: false, //预警弹窗
2025-09-19 23:10:52 +08:00
showWarning: false
2025-07-14 17:31:24 +08:00
});
const list = reactive({
Info_YJ: [], //预警数据
2025-09-19 23:10:52 +08:00
Info_Warning: [],
2025-07-14 17:31:24 +08:00
});
onMounted(() => {
// 展示预警
emitter.on("showHomeYJ", (res) => {
isShow.value.showYj = res ? true : false;
2025-07-14 18:15:09 +08:00
if (res) list.Info_YJ = res;
2025-07-14 17:31:24 +08:00
});
2025-09-19 23:10:52 +08:00
// 展示预警
emitter.on("showHomeWarning", (res) => {
isShow.value.showWarning = res ? true : false;
if (res) list.Info_Warning = res;
});
2025-07-14 17:31:24 +08:00
});
onUnmounted(() => {
emitter.off("showHomeYJ");
2025-09-19 23:10:52 +08:00
emitter.off("showHomeWarning");
2025-07-14 17:31:24 +08:00
});
</script>
2025-09-19 23:10:52 +08:00
<style lang="scss" scoped></style>