lcw
This commit is contained in:
@ -2,19 +2,23 @@
|
||||
<div class="noScollLine">
|
||||
<!-- 预警信息弹框 -->
|
||||
<Home_YJ v-if="isShow.showYj" :show="isShow.showYj" :data="list.Info_YJ" />
|
||||
<PopupWarning v-if="isShow.showWarning" :show="isShow.showWarning" :data="list.Info_Warning" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import emitter from "@/utils/eventBus.js";
|
||||
import Home_YJ from "./components/home_yj.vue";
|
||||
import PopupWarning from './components/popupWarning'
|
||||
import { ref, onMounted, onUnmounted, reactive, getCurrentInstance } from "vue";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const isShow = ref({
|
||||
showYj: false, //预警弹窗
|
||||
showWarning: false
|
||||
});
|
||||
const list = reactive({
|
||||
Info_YJ: [], //预警数据
|
||||
Info_Warning: [],
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
@ -23,11 +27,16 @@ onMounted(() => {
|
||||
isShow.value.showYj = res ? true : false;
|
||||
if (res) list.Info_YJ = res;
|
||||
});
|
||||
// 展示预警
|
||||
emitter.on("showHomeWarning", (res) => {
|
||||
isShow.value.showWarning = res ? true : false;
|
||||
if (res) list.Info_Warning = res;
|
||||
});
|
||||
});
|
||||
onUnmounted(() => {
|
||||
emitter.off("showHomeYJ");
|
||||
emitter.off("showHomeWarning");
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
Reference in New Issue
Block a user