Newer
Older
carbon-metering-front / src / components / map / infoWindowHot.vue
<!--
  Description: 高德地图信息窗体 - 用热
  Author: 李亚光
  Date: 2023-05-10
 -->
<script lang="ts" setup name="infoWindow">
const overlay = ref()
const infoWindow = ref()
const info = ref()
// 初始化
const initialize = (e) => {
  overlay.value = e.overlay
  infoWindow.value = e.infoWindow
  info.value = e.info
  console.log(e, '123')
}
defineExpose({ initialize })
// 关闭
const close = () => {
  infoWindow.value.close()
}
</script>

<template>
  <div class="container">
    <div class="title">
      <div class="text">
        {{ info?.deviceName }}
      </div>
      <div class="close" @click="close">
        x
      </div>
    </div>
    <div class="item">
      <span>设备编号 : {{ info?.deviceNo }}</span>  <span>设备类型 : {{ info?.deviceTypeName }}</span>
    </div>
    <div class="item">
      <span>所属分区 : {{ info?.ptnName }}</span>  <span>监测对象 : {{ info?.monitorObjName }}</span>
    </div>
    <div class="item">
      <span>安装位置 : {{ info?.installLocaltion }}</span>  <span>安装时间 : {{ info?.installTime }}</span>
    </div>
  </div>
</template>

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

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

    .close {
      color: #ccc;

      &: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>