Newer
Older
BJgas-metering-front / src / views / dashboard / map / deviceDetail.vue
<!--
  Description: 设备和人员信息窗体
  Author: 李亚光
  Date: 2023-05-17
 -->
<script lang="ts" setup name="infoWindow">
const overlay = ref()
const infoWindow = ref()
const info = ref()
// 初始化
const initDialog = (e) => {
  overlay.value = e.overlay
  infoWindow.value = e.infoWindow
  info.value = e.info
}
defineExpose({ initDialog })
// 关闭
const close = () => {
  infoWindow.value.close()
}
</script>

<template>
  <div class="container">
    <div class="title">
      <div class="text">
        安全树设备-{{ info?.deviceCode }}
      </div>
      <div class="close" @click="close">
        x
      </div>
    </div>
    <div class="item">
      位置: {{ info?.location }}
    </div>
    <div class="item">
      <span>时间: {{ info?.time }}</span>
    </div>
    <div class="item">
      <span :class="{ alarm: info?.alarmFlag ? true : false }">甲烷浓度: {{ info?.gasValue }}</span>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.container {
  width: 340px;
  height: 140px;
  padding: 0;
  background-color: #fff;
  border: 1px solid #6d9ece;

  .alarm {
    color: red;
  }

  .title {
    font-size: 16px;
    font-weight: 700;
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
    background-color: #ccc;

    .close {
      // color: #ccc;
      margin-left: 100px;

      &:hover {
        cursor: pointer;
      }
    }
  }

  .item {
    padding: 0 5px;
    color: #111213;
    font-size: 14px;
    margin: 10px;
    border-bottom: 1px solid #ccc;
    display: flex;
    justify-content: space-between;
  }
}
</style>